2023-03-08 16:32:21 +00:00
|
|
|
{ lib, buildGoModule, fetchFromGitHub, testers, wakatime }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildGoModule rec {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "wakatime";
|
2023-04-29 16:46:19 +00:00
|
|
|
version = "1.73.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "wakatime";
|
2021-12-06 16:07:01 +00:00
|
|
|
repo = "wakatime-cli";
|
|
|
|
rev = "v${version}";
|
2023-04-29 16:46:19 +00:00
|
|
|
hash = "sha256-EUZgYRsQRqtp0yiqNYex+ILSZwGEdO4BhciEgUVdui4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-15 16:39:30 +00:00
|
|
|
vendorHash = "sha256-SlYYrlRDBvhNm2BxemK9HzzsqM/RGH/sDQXpoGEY8rw=";
|
2023-03-08 16:32:21 +00:00
|
|
|
|
|
|
|
ldflags = [
|
|
|
|
"-s"
|
|
|
|
"-w"
|
|
|
|
"-X github.com/wakatime/wakatime-cli/pkg/version.Version=${version}"
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck =
|
|
|
|
let
|
|
|
|
skippedTests = [
|
2023-03-30 22:05:00 +00:00
|
|
|
# Tests requiring network
|
2023-03-08 16:32:21 +00:00
|
|
|
"TestFileExperts"
|
|
|
|
"TestSendHeartbeats"
|
|
|
|
"TestSendHeartbeats_ExtraHeartbeats"
|
|
|
|
"TestSendHeartbeats_IsUnsavedEntity"
|
|
|
|
"TestSendHeartbeats_NonExistingExtraHeartbeatsEntity"
|
2023-03-30 22:05:00 +00:00
|
|
|
|
|
|
|
# Flaky tests
|
|
|
|
"TestLoadParams_ApiKey_FromVault_Err_Darwin"
|
2023-03-08 16:32:21 +00:00
|
|
|
];
|
|
|
|
in
|
|
|
|
''
|
2023-03-30 22:05:00 +00:00
|
|
|
# Disable tests
|
2023-03-08 16:32:21 +00:00
|
|
|
buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]")
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
|
|
package = wakatime;
|
|
|
|
command = "HOME=$(mktemp -d) wakatime-cli --version";
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2023-03-08 16:32:21 +00:00
|
|
|
homepage = "https://wakatime.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "WakaTime command line interface";
|
|
|
|
license = licenses.bsd3;
|
2023-10-09 19:29:22 +00:00
|
|
|
maintainers = with maintainers; [ ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "wakatime-cli";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|