ed0c4a69f0
GitOrigin-RevId: e3652e0735fbec227f342712f180f4f21f0594f2
53 lines
1.3 KiB
Nix
53 lines
1.3 KiB
Nix
{ lib, buildGoModule, fetchFromGitHub, testers, wakatime }:
|
|
|
|
buildGoModule rec {
|
|
pname = "wakatime";
|
|
version = "1.70.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "wakatime";
|
|
repo = "wakatime-cli";
|
|
rev = "v${version}";
|
|
hash = "sha256-JURz3xPZIqrPreh+kT+o62cOhw55anUH4kqaT3t0tM0=";
|
|
};
|
|
|
|
vendorHash = "sha256-SlYYrlRDBvhNm2BxemK9HzzsqM/RGH/sDQXpoGEY8rw=";
|
|
|
|
ldflags = [
|
|
"-s"
|
|
"-w"
|
|
"-X github.com/wakatime/wakatime-cli/pkg/version.Version=${version}"
|
|
];
|
|
|
|
preCheck =
|
|
let
|
|
skippedTests = [
|
|
# Tests requiring network
|
|
"TestFileExperts"
|
|
"TestSendHeartbeats"
|
|
"TestSendHeartbeats_ExtraHeartbeats"
|
|
"TestSendHeartbeats_IsUnsavedEntity"
|
|
"TestSendHeartbeats_NonExistingExtraHeartbeatsEntity"
|
|
|
|
# Flaky tests
|
|
"TestLoadParams_ApiKey_FromVault_Err_Darwin"
|
|
];
|
|
in
|
|
''
|
|
# Disable tests
|
|
buildFlagsArray+=("-run" "[^(${builtins.concatStringsSep "|" skippedTests})]")
|
|
'';
|
|
|
|
passthru.tests.version = testers.testVersion {
|
|
package = wakatime;
|
|
command = "HOME=$(mktemp -d) wakatime-cli --version";
|
|
};
|
|
|
|
meta = with lib; {
|
|
homepage = "https://wakatime.com/";
|
|
description = "WakaTime command line interface";
|
|
license = licenses.bsd3;
|
|
maintainers = with maintainers; [ aaronjheng ];
|
|
mainProgram = "wakatime-cli";
|
|
};
|
|
}
|