Skip to content

Commit c2d6cd0

Browse files
authored
saw-tools: 0.1.1-20150731 -> 1.2 (NixOS#352477)
2 parents 28a8727 + e19a2b9 commit c2d6cd0

File tree

1 file changed

+41
-42
lines changed

1 file changed

+41
-42
lines changed
Lines changed: 41 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,58 @@
1-
{ lib, stdenv, fetchurl, gmp4, ncurses, zlib, clang }:
2-
3-
let
4-
libPath = lib.makeLibraryPath
5-
[ stdenv.cc.libc
6-
stdenv.cc.cc
7-
gmp4
8-
ncurses
9-
zlib
10-
] + ":${lib.getLib stdenv.cc.cc}/lib64";
11-
12-
url = "https://github.com/GaloisInc/saw-script/releases/download";
13-
14-
saw-bin =
15-
if stdenv.hostPlatform.system == "i686-linux"
16-
then fetchurl {
17-
url = url + "/v0.1.1-dev/saw-0.1.1-dev-2015-07-31-CentOS6-32.tar.gz";
18-
sha256 = "126iag5nnvndi78c921z7vjrjfwcspn1hlxwwhzmqm4rvbhhr9v9";
19-
}
20-
else fetchurl {
21-
url = url + "/v0.1.1-dev/saw-0.1.1-dev-2015-07-31-CentOS6-64.tar.gz";
22-
sha256 = "07gyf319v6ama6n1aj96403as04bixi8mbisfy7f7va689zklflr";
23-
};
24-
in
25-
stdenv.mkDerivation {
1+
{
2+
lib,
3+
stdenv,
4+
fetchurl,
5+
autoPatchelfHook,
6+
makeWrapper,
7+
gmp,
8+
ncurses,
9+
zlib,
10+
readline,
11+
testers,
12+
}:
13+
14+
stdenv.mkDerivation (finalAttrs: {
2615
pname = "saw-tools";
27-
version = "0.1.1-20150731";
16+
version = "1.2";
2817

29-
src = saw-bin;
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+
};
22+
23+
buildInputs = [
24+
gmp
25+
ncurses
26+
readline
27+
stdenv.cc.libc
28+
zlib
29+
];
30+
31+
nativeBuildInputs = [
32+
autoPatchelfHook
33+
makeWrapper
34+
];
3035

3136
installPhase = ''
3237
mkdir -p $out/lib $out/share
3338
3439
mv bin $out/bin
3540
mv doc $out/share
3641
37-
ln -s ${ncurses.out}/lib/libtinfo.so.5 $out/lib/libtinfo.so.5
38-
ln -s ${stdenv.cc.libc}/lib/libpthread.so.0 $out/lib/libpthread.so.0
39-
40-
# Add a clang symlink for easy building with a suitable compiler.
41-
ln -s ${clang}/bin/clang $out/bin/saw-clang
42+
wrapProgram "$out/bin/saw" --prefix PATH : "$out/bin/"
4243
'';
4344

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

5150
meta = {
5251
description = "Tools for software verification and analysis";
53-
homepage = "https://saw.galois.com";
52+
homepage = "https://saw.galois.com";
5453
sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
55-
license = lib.licenses.bsd3;
56-
platforms = lib.platforms.linux;
54+
license = lib.licenses.bsd3;
55+
platforms = [ "x86_64-linux" ];
5756
maintainers = [ lib.maintainers.thoughtpolice ];
5857
};
59-
}
58+
})

0 commit comments

Comments
 (0)