nixpkgs/pkgs/tools/misc/wakatime/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

54 lines
1.3 KiB
Nix
Raw Normal View History

2023-02-27 05:20:31 +00:00
{ lib, buildGoModule, fetchFromGitHub, testers, wakatime }:
buildGoModule rec {
pname = "wakatime";
2023-04-26 05:51:06 +00:00
version = "1.73.0";
src = fetchFromGitHub {
owner = "wakatime";
repo = "wakatime-cli";
rev = "v${version}";
2023-04-26 05:51:06 +00:00
hash = "sha256-EUZgYRsQRqtp0yiqNYex+ILSZwGEdO4BhciEgUVdui4=";
};
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
meta = with lib; {
2023-02-27 05:20:31 +00:00
homepage = "https://wakatime.com/";
description = "WakaTime command line interface";
license = licenses.bsd3;
2023-02-27 05:20:31 +00:00
maintainers = with maintainers; [ aaronjheng ];
mainProgram = "wakatime-cli";
};
}