diff options
Diffstat (limited to 'pkgs/by-name/sp/spade/package.nix')
-rw-r--r-- | pkgs/by-name/sp/spade/package.nix | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/pkgs/by-name/sp/spade/package.nix b/pkgs/by-name/sp/spade/package.nix index e154d7ccfd4e..b312ce8683a4 100644 --- a/pkgs/by-name/sp/spade/package.nix +++ b/pkgs/by-name/sp/spade/package.nix @@ -3,21 +3,24 @@ rustPlatform, fetchFromGitLab, stdenv, + _experimental-update-script-combinators, + nix-update-script, nix-update, writeScript, git, python312, + swim, }: rustPlatform.buildRustPackage rec { pname = "spade"; - version = "0.9.0"; + version = "0.10.0"; src = fetchFromGitLab { owner = "spade-lang"; repo = "spade"; rev = "v${version}"; - hash = "sha256-DVvdCt/t7aA2IAs+cL6wT129PX8s3P5gHawcLAvAAGw="; + hash = "sha256-IAb9Vj5KwyXpARD2SIgYRXhz1ihwcgCTwx3zbgoN6dE="; # only needed for vatch, which contains test data fetchSubmodules = true; }; @@ -29,20 +32,31 @@ rustPlatform.buildRustPackage rec { }; }; - # rust + gitlab is a rare combo - passthru.updateScript = [ + # TODO: somehow respect https://nixos.org/manual/nixpkgs/stable/#var-passthru-updateScript-commit + passthru.updateScript = _experimental-update-script-combinators.sequence [ + # rust + gitlab + fetchgit is a rare combo (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" "$@" + exec ${lib.getExe nix-update} spade --version "$VERSION" "$@" --commit '') + (nix-update-script { + extraArgs = [ + "swim" + "--commit" + ]; + }) ]; - buildInputs = lib.optionals stdenv.isDarwin [ python312 ]; - env.NIX_CFLAGS_LINK = lib.optionals stdenv.isDarwin "-L${python312}/lib/python3.12/config-3.12-darwin -lpython3.12"; + buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ python312 ]; + env.NIX_CFLAGS_LINK = lib.optionalString stdenv.hostPlatform.isDarwin "-L${python312}/lib/python3.12/config-3.12-darwin -lpython3.12"; + + passthru.tests = { + inherit swim; + }; meta = with lib; { description = "Better hardware description language"; |