2017-02-05 17:55:39 +00:00
|
|
|
{ stdenv, fetchFromGitHub, cmake, makeWrapper
|
2017-02-17 21:47:44 +00:00
|
|
|
, llvmPackages_4, hiredis, z3_opt, gtest
|
2017-02-05 17:55:39 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
klee = fetchFromGitHub {
|
2017-02-17 21:47:44 +00:00
|
|
|
owner = "rsas";
|
2017-02-05 17:55:39 +00:00
|
|
|
repo = "klee";
|
2017-02-17 21:47:44 +00:00
|
|
|
rev = "57cd3d43056b029d9da3c6b3c666c4153554c04f";
|
|
|
|
sha256 = "197wb7nbirlfpx2jr3afpjjhcj7slc4dxxi02j3kmazz9kcqaygz";
|
2017-02-05 17:55:39 +00:00
|
|
|
};
|
|
|
|
in stdenv.mkDerivation {
|
2017-02-17 21:47:44 +00:00
|
|
|
name = "souper-unstable-2017-03-07";
|
2017-02-05 17:55:39 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "google";
|
|
|
|
repo = "souper";
|
2017-02-17 21:47:44 +00:00
|
|
|
rev = "5faed54ddc4a0e0e12647a0eac1da455a1067a47";
|
|
|
|
sha256 = "1v8ml94ryw5wdls9syvicx4sc9l34yaq8r7cf7is6x7y1q677rps";
|
2017-02-05 17:55:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
2017-02-17 21:47:44 +00:00
|
|
|
llvmPackages_4.llvm
|
|
|
|
llvmPackages_4.clang-unwrapped
|
2017-02-05 17:55:39 +00:00
|
|
|
hiredis
|
|
|
|
gtest
|
|
|
|
];
|
|
|
|
|
2017-02-17 21:47:44 +00:00
|
|
|
patches = [ ./cmake-fix.patch ];
|
|
|
|
|
2017-02-05 17:55:39 +00: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" \
|
|
|
|
--add-flags "-z3-path=\"${z3_opt}/bin/z3\""
|
|
|
|
'';
|
|
|
|
|
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|