{ lib, rustPlatform, fetchFromGitHub, versionCheckHook, }: rustPlatform.buildRustPackage rec { pname = "sus-compiler"; version = "0.0.2"; src = fetchFromGitHub { owner = "pc2"; repo = "sus-compiler"; rev = "v${version}"; hash = "sha256-f93uT6ELW3T2Xd539EfZCf2LSbxcYnEX+smmLzBAxqc="; fetchSubmodules = true; }; # no lockfile upstream cargoLock.lockFile = ./Cargo.lock; postPatch = '' ln -s ${./Cargo.lock} Cargo.lock ''; doInstallCheck = true; nativeInstallCheckInputs = [ versionCheckHook ]; versionCheckProgram = "${placeholder "out"}/bin/sus_compiler"; meta = { description = "A new Hardware Design Language that keeps you in the driver's seat"; homepage = "https://github.com/pc2/sus-compiler"; license = lib.licenses.gpl3Only; maintainers = with lib.maintainers; [ pbsds ]; mainProgram = "sus_compiler"; }; }