2020-04-24 23:36:52 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, makeWrapper, z3 }:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-05-29 06:06:01 +00:00
|
|
|
pname = "zz";
|
2021-02-05 17:12:51 +00:00
|
|
|
version = "unstable-2021-01-26";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
# commit chosen by using the latest build from http://bin.zetz.it/
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
2021-02-05 17:12:51 +00:00
|
|
|
owner = "zetzit";
|
2020-04-24 23:36:52 +00:00
|
|
|
repo = "zz";
|
2021-02-05 17:12:51 +00:00
|
|
|
rev = "0b5c52674e9adf795fbfb051d4dceef3126e669f";
|
|
|
|
sha256 = "0bb77ll1g5i6a04ybpgx6lqsb74xs4v4nyqm9j4j6x24407h8l89";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
cargoSha256 = "1lf4k3n89w2797c1yrj1dp97y8a8d5hnixr1nwa2qcq1sxmm5rcg";
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# remove search path entry which would reference /build
|
|
|
|
sed -i '/env!("CARGO_MANIFEST_DIR")/d' src/lib.rs
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
postInstall = ''
|
2021-02-05 17:12:51 +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-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "🍺🐙 ZetZ a zymbolic verifier and tranzpiler to bare metal C";
|
2021-02-05 17:12:51 +00:00
|
|
|
homepage = "https://github.com/zetzit/zz";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.marsam ];
|
|
|
|
};
|
|
|
|
}
|