6 _experimental-update-script-combinators,
15 rustPlatform.buildRustPackage rec {
19 src = fetchFromGitLab {
23 hash = "sha256-IAb9Vj5KwyXpARD2SIgYRXhz1ihwcgCTwx3zbgoN6dE=";
24 # only needed for vatch, which contains test data
25 fetchSubmodules = true;
29 lockFile = ./Cargo.lock;
31 "codespan-0.12.0" = "sha256-3F2006BR3hyhxcUTaQiOjzTEuRECKJKjIDyXonS/lrE=";
35 # TODO: somehow respect https://nixos.org/manual/nixpkgs/stable/#var-passthru-updateScript-commit
36 passthru.updateScript = _experimental-update-script-combinators.sequence [
37 # rust + gitlab + fetchgit is a rare combo
38 (writeScript "update-spade" ''
40 ${lib.getExe git} ls-remote --tags --sort -version:refname ${lib.escapeShellArg src.gitRepoUrl} \
41 | cut -f2 | grep ^refs/tags/v | cut -d/ -f3- | cut -c2- \
42 | sort --version-sort --reverse | head -n1
44 exec ${lib.getExe nix-update} spade --version "$VERSION" "$@" --commit
54 buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ python312 ];
55 env.NIX_CFLAGS_LINK = lib.optionalString stdenv.hostPlatform.isDarwin "-L${python312}/lib/python3.12/config-3.12-darwin -lpython3.12";
62 description = "Better hardware description language";
63 homepage = "https://gitlab.com/spade-lang/spade";
64 changelog = "https://gitlab.com/spade-lang/spade/-/blob/${src.rev}/CHANGELOG.md";
65 # compiler is eupl12, spade-lang stdlib is both asl20 and mit
66 license = with licenses; [
71 maintainers = with maintainers; [ pbsds ];
72 mainProgram = "spade";