nixpkgs/pkgs/development/compilers/zz/default.nix

40 lines
1.1 KiB
Nix
Raw Normal View History

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