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

@ -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 ""

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