nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchurl,
5 autoPatchelfHook,
6 makeWrapper,
7 gmp,
8 ncurses,
9 zlib,
10 readline,
11 testers,
12}:
13
14stdenv.mkDerivation (finalAttrs: {
15 pname = "saw-tools";
16 version = "1.3";
17
18 src = fetchurl {
19 url = "https://github.com/GaloisInc/saw-script/releases/download/v${finalAttrs.version}/saw-${finalAttrs.version}-ubuntu-22.04-X64-with-solvers.tar.gz";
20 hash = "sha256-1t1uGAQXCBC//RNBxQfZIfg00At600An9HaEIcVBEy0=";
21 };
22
23 buildInputs = [
24 gmp
25 ncurses
26 readline
27 stdenv.cc.libc
28 zlib
29 ];
30
31 nativeBuildInputs = [
32 autoPatchelfHook
33 makeWrapper
34 ];
35
36 installPhase = ''
37 mkdir -p $out/lib $out/share
38
39 mv bin $out/bin
40 mv doc $out/share
41
42 wrapProgram "$out/bin/saw" --prefix PATH : "$out/bin/"
43 '';
44
45 passthru.tests.version = testers.testVersion {
46 package = finalAttrs.finalPackage;
47 command = "saw --version";
48 };
49
50 meta = {
51 description = "Tools for software verification and analysis";
52 homepage = "https://saw.galois.com";
53 sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
54 license = lib.licenses.bsd3;
55 platforms = [ "x86_64-linux" ];
56 maintainers = [ lib.maintainers.thoughtpolice ];
57 };
58})