spade: add updateScript
This commit is contained in:
parent
d1414f543e
commit
db641c704f
@ -2,6 +2,9 @@
|
||||
, rustPlatform
|
||||
, fetchFromGitLab
|
||||
, stdenv
|
||||
, nix-update
|
||||
, writeScript
|
||||
, git
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
@ -25,6 +28,18 @@ rustPlatform.buildRustPackage rec {
|
||||
};
|
||||
};
|
||||
|
||||
# rust + gitlab is a rare combo
|
||||
passthru.updateScript = [
|
||||
(writeScript "update-spade" ''
|
||||
VERSION="$(
|
||||
${lib.getExe git} ls-remote --tags --sort -version:refname ${lib.escapeShellArg src.gitRepoUrl} \
|
||||
| cut -f2 | grep ^refs/tags/v | cut -d/ -f3- | cut -c2- \
|
||||
| sort --version-sort --reverse | head -n1
|
||||
)"
|
||||
exec ${lib.getExe nix-update} --version "$VERSION" "$@"
|
||||
'')
|
||||
];
|
||||
|
||||
meta = with lib; {
|
||||
description = "A better hardware description language";
|
||||
homepage = "https://gitlab.com/spade-lang/spade";
|
||||
|
Loading…
Reference in New Issue
Block a user