Skip to content

Commit e19a2b9

Browse files
committed
saw-tools: 0.1.1-20150731 -> 1.2
Changes: https://github.com/GaloisInc/saw-script/blob/v1.2/CHANGES.md
1 parent 13342ca commit e19a2b9

File tree

1 file changed

+30
-42
lines changed

1 file changed

+30
-42
lines changed

pkgs/by-name/sa/saw-tools/package.nix

Lines changed: 30 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -2,69 +2,57 @@
22
lib,
33
stdenv,
44
fetchurl,
5-
gmp4,
5+
autoPatchelfHook,
6+
makeWrapper,
7+
gmp,
68
ncurses,
79
zlib,
8-
clang,
10+
readline,
11+
testers,
912
}:
1013

11-
let
12-
libPath =
13-
lib.makeLibraryPath [
14-
stdenv.cc.libc
15-
stdenv.cc.cc
16-
gmp4
17-
ncurses
18-
zlib
19-
]
20-
+ ":${lib.getLib stdenv.cc.cc}/lib64";
14+
stdenv.mkDerivation (finalAttrs: {
15+
pname = "saw-tools";
16+
version = "1.2";
2117

22-
url = "https://github.com/GaloisInc/saw-script/releases/download";
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-A99BCiVV5Ep/PL7VSDNYcvr177Q+FKdDrxhFJLW/iU4=";
21+
};
2322

24-
saw-bin =
25-
if stdenv.hostPlatform.system == "i686-linux" then
26-
fetchurl {
27-
url = url + "/v0.1.1-dev/saw-0.1.1-dev-2015-07-31-CentOS6-32.tar.gz";
28-
sha256 = "126iag5nnvndi78c921z7vjrjfwcspn1hlxwwhzmqm4rvbhhr9v9";
29-
}
30-
else
31-
fetchurl {
32-
url = url + "/v0.1.1-dev/saw-0.1.1-dev-2015-07-31-CentOS6-64.tar.gz";
33-
sha256 = "07gyf319v6ama6n1aj96403as04bixi8mbisfy7f7va689zklflr";
34-
};
35-
in
36-
stdenv.mkDerivation {
37-
pname = "saw-tools";
38-
version = "0.1.1-20150731";
23+
buildInputs = [
24+
gmp
25+
ncurses
26+
readline
27+
stdenv.cc.libc
28+
zlib
29+
];
3930

40-
src = saw-bin;
31+
nativeBuildInputs = [
32+
autoPatchelfHook
33+
makeWrapper
34+
];
4135

4236
installPhase = ''
4337
mkdir -p $out/lib $out/share
4438
4539
mv bin $out/bin
4640
mv doc $out/share
4741
48-
ln -s ${ncurses.out}/lib/libtinfo.so.5 $out/lib/libtinfo.so.5
49-
ln -s ${stdenv.cc.libc}/lib/libpthread.so.0 $out/lib/libpthread.so.0
50-
51-
# Add a clang symlink for easy building with a suitable compiler.
52-
ln -s ${clang}/bin/clang $out/bin/saw-clang
42+
wrapProgram "$out/bin/saw" --prefix PATH : "$out/bin/"
5343
'';
5444

55-
fixupPhase = ''
56-
for x in bin/bcdump bin/extcore-info bin/jss bin/llvm-disasm bin/lss bin/saw; do
57-
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
58-
--set-rpath "$out/lib:${libPath}" $out/$x;
59-
done
60-
'';
45+
passthru.tests.version = testers.testVersion {
46+
package = finalAttrs.finalPackage;
47+
command = "saw --version";
48+
};
6149

6250
meta = {
6351
description = "Tools for software verification and analysis";
6452
homepage = "https://saw.galois.com";
6553
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
6654
license = lib.licenses.bsd3;
67-
platforms = lib.platforms.linux;
55+
platforms = [ "x86_64-linux" ];
6856
maintainers = [ lib.maintainers.thoughtpolice ];
6957
};
70-
}
58+
})

0 commit comments

Comments
 (0)