2017-02-05 18:55:39 +01:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, makeWrapper
|
2017-09-02 11:15:20 +02:00
|
|
|
, llvmPackages_4, hiredis, z3, gtest
|
2017-02-05 18:55:39 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
klee = fetchFromGitHub {
|
2017-02-17 22:47:44 +01:00
|
|
|
owner = "rsas";
|
2017-02-05 18:55:39 +01:00
|
|
|
repo = "klee";
|
2017-02-17 22:47:44 +01:00
|
|
|
rev = "57cd3d43056b029d9da3c6b3c666c4153554c04f";
|
|
|
|
sha256 = "197wb7nbirlfpx2jr3afpjjhcj7slc4dxxi02j3kmazz9kcqaygz";
|
2017-02-05 18:55:39 +01:00
|
|
|
};
|
2017-05-10 21:18:44 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
name = "souper-unstable-${version}";
|
|
|
|
version = "2017-03-23";
|
2017-02-05 18:55:39 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "souper";
|
2017-05-10 21:18:44 +02:00
|
|
|
rev = "cf2911d2eb1e7c8ab465df5a722fa5cdac06e6fc";
|
|
|
|
sha256 = "1kg08a1af4di729pn1pip2lzqzlvjign6av95214f5rr3cq2q0cl";
|
2017-02-05 18:55:39 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2017-02-17 22:47:44 +01:00
|
|
|
llvmPackages_4.llvm
|
|
|
|
llvmPackages_4.clang-unwrapped
|
2017-02-05 18:55:39 +01:00
|
|
|
hiredis
|
|
|
|
gtest
|
|
|
|
];
|
|
|
|
|
2017-02-17 22:47:44 +01:00
|
|
|
patches = [ ./cmake-fix.patch ];
|
|
|
|
|
2017-02-05 18:55:39 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
mkdir -pv third_party
|
|
|
|
cp -R "${klee}" third_party/klee
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -pv $out/bin
|
|
|
|
cp -v ./souper $out/bin/
|
|
|
|
cp -v ./clang-souper $out/bin/
|
|
|
|
wrapProgram "$out/bin/souper" \
|
2017-09-02 11:15:20 +02:00
|
|
|
--add-flags "-z3-path=\"${z3}/bin/z3\""
|
2017-02-05 18:55:39 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A superoptimizer for LLVM IR";
|
|
|
|
homepage = "https://github.com/google/souper";
|
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ taktoa ];
|
|
|
|
platforms = with platforms; linux;
|
|
|
|
};
|
|
|
|
}
|