2021-10-12 10:58:26 +00:00
|
|
|
{ lib, rustPlatform, fetchFromGitHub, makeWrapper, z3, pkgsHostTarget }:
|
|
|
|
|
|
|
|
let
|
|
|
|
runtimeDeps = [
|
|
|
|
z3
|
|
|
|
pkgsHostTarget.targetPackages.stdenv.cc
|
|
|
|
];
|
|
|
|
in
|
2020-03-04 09:20:00 +00:00
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
2020-05-28 09:20:00 +00:00
|
|
|
pname = "zz";
|
2021-10-12 10:58:26 +00:00
|
|
|
version = "unstable-2021-05-04";
|
2020-03-04 09:20:00 +00:00
|
|
|
|
2021-03-07 11:31:34 +00:00
|
|
|
# when updating, choose commit of the latest build on http://bin.zetz.it/
|
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";
|
2021-10-12 10:58:26 +00:00
|
|
|
rev = "18020b10b933cfe2fc7f2256b71e646889f9b1d2";
|
|
|
|
sha256 = "01nlyyk1qxk76dq2hw3wpbjwkh27zzp6mpczjnxdpv6rxs7mc825";
|
2020-03-04 09:20:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2021-10-12 10:58:26 +00:00
|
|
|
cargoSha256 = "080rd8x4jsssnx4il80xcb81iw8pjcm70zckpa1hcijkw9104dgs";
|
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 \
|
2021-10-12 10:58:26 +00:00
|
|
|
--prefix PATH ":" "${lib.makeBinPath runtimeDeps}" \
|
2021-01-25 13:25:42 +00:00
|
|
|
--suffix ZZ_MODULE_PATHS ":" "$out/share/zz/modules"
|
2020-03-04 09:20:00 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
2021-03-07 18:45:50 +00:00
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|