Skip to content

Commit 893757b

Browse files
authored
pinact: 1.0.0 -> 1.1.2 and set CGO_ENABLED=0 (NixOS#368078)
2 parents d91bc73 + b3ecbff commit 893757b

File tree

1 file changed

+25
-16
lines changed

1 file changed

+25
-16
lines changed

pkgs/by-name/pi/pinact/package.nix

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,57 @@
22
lib,
33
fetchFromGitHub,
44
buildGoModule,
5-
testers,
5+
versionCheckHook,
66
nix-update-script,
7-
pinact,
87
}:
98

109
let
1110
pname = "pinact";
12-
version = "1.0.0";
11+
version = "1.1.2";
1312
src = fetchFromGitHub {
1413
owner = "suzuki-shunsuke";
1514
repo = "pinact";
16-
rev = "v${version}";
17-
hash = "sha256-fOmQDfqG1aWzpL80Nc8JA6HWQR+z9mhqtwU4rC2g2Gg=";
15+
tag = "v${version}";
16+
hash = "sha256-QBWxs0YRTWItJ1aTG33Z6vK8/vaZBTuZAVPYqD6dIvE=";
1817
};
18+
mainProgram = "pinact";
1919
in
2020
buildGoModule {
2121
inherit pname version src;
2222

23-
vendorHash = "sha256-AFlkzs5mL/x9CwfF2apLcQbiu60GD33oFH6lQDHAL1M=";
23+
vendorHash = "sha256-Y44nJv0eWM0xO+lB56OBcEe/CCipPj8Ptg7WuJ2Vszo=";
24+
25+
env.CGO_ENABLED = 0;
2426

2527
doCheck = true;
2628

27-
passthru = {
28-
tests.version = testers.testVersion {
29-
package = pinact;
30-
};
29+
nativeInstallCheckInputs = [
30+
versionCheckHook
31+
];
32+
doInstallCheck = true;
33+
versionCheckProgram = "${placeholder "out"}/bin/${mainProgram}";
34+
versionCheckProgramArg = [ "version" ];
3135

36+
passthru = {
3237
updateScript = nix-update-script { };
3338
};
3439

3540
ldflags = [
3641
"-s"
3742
"-w"
38-
"-X main.version=${version} -X main.commit=${src.rev}"
43+
"-X main.version=${version} -X main.commit=v${version}"
44+
];
45+
46+
subPackages = [
47+
"cmd/pinact"
3948
];
4049

41-
meta = with lib; {
50+
meta = {
51+
inherit mainProgram;
4252
description = "Pin GitHub Actions versions";
4353
homepage = "https://github.com/suzuki-shunsuke/pinact";
44-
changelog = "https://github.com/suzuki-shunsuke/pinact/releases/tag/${src.rev}";
45-
license = licenses.mit;
46-
maintainers = [ maintainers.kachick ];
47-
mainProgram = "pinact";
54+
changelog = "https://github.com/suzuki-shunsuke/pinact/releases/tag/v${version}";
55+
license = lib.licenses.mit;
56+
maintainers = with lib.maintainers; [ kachick ];
4857
};
4958
}

0 commit comments

Comments
 (0)