boolector: 3.0.0 -> 3.2.1

enable tests
optionnally enable gmp
This commit is contained in:
Symphorien Gibol 2020-05-24 15:02:07 +02:00 committed by Austin Seipp
parent 90b75531a5
commit 0a488516be
2 changed files with 38 additions and 19 deletions

View File

@ -0,0 +1,16 @@
diff --git a/cmake/googletest-download.cmake b/cmake/googletest-download.cmake
index 0ec4d558..d0910313 100644
--- a/cmake/googletest-download.cmake
+++ b/cmake/googletest-download.cmake
@@ -9,10 +9,7 @@ ExternalProject_Add(
googletest
SOURCE_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-src"
BINARY_DIR "@GOOGLETEST_DOWNLOAD_ROOT@/googletest-build"
- GIT_REPOSITORY
- https://github.com/google/googletest.git
- GIT_TAG
- release-1.10.0
+ URL REPLACEME
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""

View File

@ -1,37 +1,31 @@
{ stdenv, fetchFromGitHub, fetchpatch
, cmake, lingeling, btor2tools
{ stdenv, fetchFromGitHub, lib, python3
, cmake, lingeling, btor2tools, gtest, gmp
}:
stdenv.mkDerivation rec {
pname = "boolector";
version = "3.0.0";
version = "3.2.1";
src = fetchFromGitHub {
owner = "boolector";
repo = "boolector";
rev = "refs/tags/${version}";
sha256 = "15i3ni5klss423m57wcy1gx0m5wfrjmglapwg85pm7fb3jj1y7sz";
sha256 = "0jkmaw678njqgkflzj9g374yk1mci8yqvsxkrqzlifn6bwhwb7ci";
};
patches = [
(fetchpatch {
name = "CVE-2019-7560.patch";
url = "https://github.com/Boolector/boolector/commit/8d979d02e0482c7137c9f3a34e6d430dbfd1f5c5.patch";
sha256 = "1a1g02mk8b0azzjcigdn5zpshn0dn05fciwi8sd5q38yxvnvpbbi";
})
];
postPatch = ''
sed s@REPLACEME@file://${gtest.src}@ ${./cmake-gtest.patch} | patch -p1
'';
nativeBuildInputs = [ cmake ];
buildInputs = [ lingeling btor2tools ];
buildInputs = [ lingeling btor2tools gmp ];
cmakeFlags =
[ "-DSHARED=ON"
[ "-DBUILD_SHARED_LIBS=ON"
"-DUSE_LINGELING=YES"
"-DBTOR2_INCLUDE_DIR=${btor2tools.dev}/include"
"-DBTOR2_LIBRARIES=${btor2tools.lib}/lib/libbtor2parser.so"
"-DLINGELING_INCLUDE_DIR=${lingeling.dev}/include"
"-DLINGELING_LIBRARIES=${lingeling.lib}/lib/liblgl.a"
];
"-DBtor2Tools_INCLUDE_DIR=${btor2tools.dev}/include"
"-DBtor2Tools_LIBRARIES=${btor2tools.lib}/lib/libbtor2parser.so"
] ++ (lib.optional (gmp != null) "-DUSE_GMP=YES");
installPhase = ''
mkdir -p $out/bin $lib/lib $dev/include
@ -39,13 +33,22 @@ stdenv.mkDerivation rec {
cp -vr bin/* $out/bin
cp -vr lib/* $lib/lib
rm -rf $out/bin/{examples,test}
rm -rf $out/bin/{examples,tests}
# we don't care about gtest related libs
rm -rf $lib/lib/libg*
cd ../src
find . -iname '*.h' -exec cp --parents '{}' $dev/include \;
rm -rf $dev/include/tests
'';
checkInputs = [ python3 ];
doCheck = true;
preCheck = ''
export LD_LIBRARY_PATH=$(readlink -f lib)
patchShebangs ..
'';
outputs = [ "out" "dev" "lib" ];
meta = with stdenv.lib; {