cue: use finalAttrs

This commit is contained in:
Aaron Jheng 2025-05-24 21:13:14 +08:00
parent f2256199df
commit 8d5b47e9b8
No known key found for this signature in database
GPG key ID: F6A547A869D050A3

View file

@ -5,18 +5,17 @@
stdenv,
installShellFiles,
testers,
cue,
callPackage,
}:
buildGoModule rec {
buildGoModule (finalAttrs: {
pname = "cue";
version = "0.13.0";
src = fetchFromGitHub {
owner = "cue-lang";
repo = "cue";
tag = "v${version}";
tag = "v${finalAttrs.version}";
hash = "sha256-RvdjZ3wSc3IhQvYJL989x33qOtVZ4paoQTLFzWF9xj0=";
};
@ -29,7 +28,7 @@ buildGoModule rec {
ldflags = [
"-s"
"-w"
"-X cuelang.org/go/cmd/cue/cmd.version=v${version}"
"-X cuelang.org/go/cmd/cue/cmd.version=v${finalAttrs.version}"
];
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
@ -44,9 +43,9 @@ buildGoModule rec {
tests = {
test-001-all-good = callPackage ./tests/001-all-good.nix { };
version = testers.testVersion {
package = cue;
package = finalAttrs.finalPackage;
command = "cue version";
version = "v${version}";
version = "v${finalAttrs.version}";
};
};
};
@ -58,4 +57,4 @@ buildGoModule rec {
maintainers = with lib.maintainers; [ aaronjheng ];
mainProgram = "cue";
};
}
})