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