2020-03-04 09:20:00 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, makeWrapper, z3 }:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-05-28 09:20:00 +00:00
|
|
|
pname = "zz";
|
|
|
|
version = "0.1";
|
2020-03-04 09:20:00 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-01-25 13:03:26 +00:00
|
|
|
owner = "zetzit";
|
2020-03-04 09:20:00 +00:00
|
|
|
repo = "zz";
|
2020-05-28 09:20:00 +00:00
|
|
|
rev = version;
|
|
|
|
sha256 = "0kqrfm2r9wn0p2c3lcprsy03p9qhrwjs990va8qi59jp704l84ad";
|
2020-03-04 09:20:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2020-05-28 09:20:00 +00:00
|
|
|
cargoSha256 = "0yllcqxyyhwr9h0z8q84l0ms8x6jrqhpg79ik4xng6h5yf4ab0pq";
|
2020-03-04 09:20:00 +00:00
|
|
|
|
2021-01-25 13:25:42 +00:00
|
|
|
postPatch = ''
|
|
|
|
# remove search path entry which would reference /build
|
|
|
|
sed -i '/env!("CARGO_MANIFEST_DIR")/d' src/lib.rs
|
|
|
|
'';
|
|
|
|
|
2020-03-04 09:20:00 +00:00
|
|
|
postInstall = ''
|
2021-01-25 13:25:42 +00:00
|
|
|
mkdir -p "$out/share/zz"
|
|
|
|
cp -r modules "$out/share/zz/"
|
|
|
|
|
|
|
|
wrapProgram $out/bin/zz \
|
|
|
|
--prefix PATH ":" "${lib.getBin z3}/bin" \
|
|
|
|
--suffix ZZ_MODULE_PATHS ":" "$out/share/zz/modules"
|
2020-03-04 09:20:00 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "🍺🐙 ZetZ a zymbolic verifier and tranzpiler to bare metal C";
|
2021-01-25 13:03:26 +00:00
|
|
|
homepage = "https://github.com/zetzit/zz";
|
2020-03-04 09:20:00 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
};
|
|
|
|
}
|