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-03-15 16:39:30 +00:00
|
|
|
version = "1.68.3";
|
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-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-LifMxov7j2yRDtwh74RjjwfcHfFc/zWrzX96vb2hI9o=";
|
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 = [
|
|
|
|
"TestFileExperts"
|
|
|
|
"TestSendHeartbeats"
|
|
|
|
"TestSendHeartbeats_ExtraHeartbeats"
|
|
|
|
"TestSendHeartbeats_IsUnsavedEntity"
|
|
|
|
"TestSendHeartbeats_NonExistingExtraHeartbeatsEntity"
|
|
|
|
];
|
|
|
|
in
|
|
|
|
''
|
|
|
|
# Disable tests requiring network
|
|
|
|
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-03-08 16:32:21 +00:00
|
|
|
maintainers = with maintainers; [ aaronjheng ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "wakatime-cli";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|