Skip to content

Commit eb9bee8

Browse files
authored
containerlab: fix version definition in LDFLAGS (#404091)
2 parents f7c79ff + 870855a commit eb9bee8

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

pkgs/by-name/co/containerlab/package.nix

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
buildGoModule,
44
fetchFromGitHub,
55
installShellFiles,
6+
versionCheckHook,
67
}:
78

89
buildGoModule rec {
@@ -23,9 +24,9 @@ buildGoModule rec {
2324
ldflags = [
2425
"-s"
2526
"-w"
26-
"-X github.com/srl-labs/containerlab/cmd.version=${version}"
27-
"-X github.com/srl-labs/containerlab/cmd.commit=${src.rev}"
28-
"-X github.com/srl-labs/containerlab/cmd.date=1970-01-01T00:00:00Z"
27+
"-X github.com/srl-labs/containerlab/cmd/version.Version=${version}"
28+
"-X github.com/srl-labs/containerlab/cmd/version.commit=${src.rev}"
29+
"-X github.com/srl-labs/containerlab/cmd/version.date=1970-01-01T00:00:00Z"
2930
];
3031

3132
preCheck = ''
@@ -41,6 +42,12 @@ buildGoModule rec {
4142
--zsh <($out/bin/containerlab completion zsh)
4243
'';
4344

45+
nativeInstallCheckInputs = [
46+
versionCheckHook
47+
];
48+
doInstallCheck = true;
49+
versionCheckProgramArg = "version";
50+
4451
meta = {
4552
description = "Container-based networking lab";
4653
homepage = "https://containerlab.dev/";

0 commit comments

Comments
 (0)