diff options
author | Symphorien Gibol <symphorien+git@xlumurb.eu> | 2020-05-24 15:02:07 +0200 |
---|---|---|
committer | Austin Seipp <aseipp@pobox.com> | 2020-06-08 17:32:07 -0500 |
commit | 0a488516be2caf29d2518a07363a2956646286bb (patch) | |
tree | 92bc4e26ac413b66a68389898ff993464c7a6d6f /pkgs/applications/science | |
parent | 90b75531a5a4354a1da2dd02feacfcce6e5d8b87 (diff) |
boolector: 3.0.0 -> 3.2.1
enable tests optionnally enable gmp
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r-- | pkgs/applications/science/logic/boolector/cmake-gtest.patch | 16 | ||||
-rw-r--r-- | pkgs/applications/science/logic/boolector/default.nix | 41 |
2 files changed, 38 insertions, 19 deletions
diff --git a/pkgs/applications/science/logic/boolector/cmake-gtest.patch b/pkgs/applications/science/logic/boolector/cmake-gtest.patch new file mode 100644 index 0000000000000..61a64d3abbbfe --- /dev/null +++ b/pkgs/applications/science/logic/boolector/cmake-gtest.patch @@ -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 "" diff --git a/pkgs/applications/science/logic/boolector/default.nix b/pkgs/applications/science/logic/boolector/default.nix index 105e911ed4fd1..aedc8e3484a95 100644 --- a/pkgs/applications/science/logic/boolector/default.nix +++ b/pkgs/applications/science/logic/boolector/default.nix @@ -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; { |