mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-19 16:45:49 +01:00
Merge pull request #173914 from Atemu/colima-embed-version
colima: embed version and git revision
This commit is contained in:
commit
d484bb7bb1
1 changed files with 13 additions and 1 deletions
|
@ -14,13 +14,25 @@ buildGoModule rec {
|
||||||
owner = "abiosoft";
|
owner = "abiosoft";
|
||||||
repo = pname;
|
repo = pname;
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-g7q2DmtyArtW7Ii2XF5umXQ0+BlCSa1Q7VNNuIuX65k=";
|
sha256 = "sha256-KYW3gxf21aWnuRHkysOjArzMSNH3m3XDoi6Sic3N+Po=";
|
||||||
|
|
||||||
|
# We need the git revision
|
||||||
|
leaveDotGit = true;
|
||||||
|
postFetch = ''
|
||||||
|
git -C $out rev-parse HEAD > $out/.git-revision
|
||||||
|
rm -rf $out/.git
|
||||||
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
nativeBuildInputs = [ installShellFiles makeWrapper ];
|
||||||
|
|
||||||
vendorSha256 = "sha256-Z4+qwoX04VnLsUIYRfOowFLgcaA9w8oGRl77jzFigIc=";
|
vendorSha256 = "sha256-Z4+qwoX04VnLsUIYRfOowFLgcaA9w8oGRl77jzFigIc=";
|
||||||
|
|
||||||
|
preConfigure = ''
|
||||||
|
ldflags="-X github.com/abiosoft/colima/config.appVersion=${version}
|
||||||
|
-X github.com/abiosoft/colima/config.revision=$(cat .git-revision)"
|
||||||
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = ''
|
||||||
wrapProgram $out/bin/colima \
|
wrapProgram $out/bin/colima \
|
||||||
--prefix PATH : ${lib.makeBinPath [ lima ]}
|
--prefix PATH : ${lib.makeBinPath [ lima ]}
|
||||||
|
|
Loading…
Reference in a new issue