1 { stdenv, fetchFromGitHub, lib, python3, fetchpatch
2 , cmake, lingeling, btor2tools, gtest, gmp
5 stdenv.mkDerivation rec {
9 src = fetchFromGitHub {
13 hash = "sha256-CdfpXUbU1+yEmrNyl+hvHlJfpzzzx356naim6vRafDg=";
17 # present in master - remove after 3.2.3
19 name = "update-unit-tests-to-cpp-14.patch";
20 url = "https://github.com/Boolector/boolector/commit/cc13f371c0c5093d98638ddd213dc835ef3aadf3.patch";
21 hash = "sha256-h8DBhAvUu+wXBwmvwRhHnJv3XrbEpBpvX9D1FI/+avc=";
25 nativeBuildInputs = [ cmake gtest ];
26 buildInputs = [ lingeling btor2tools gmp ];
29 [ "-DBUILD_SHARED_LIBS=ON"
31 "-DBtor2Tools_INCLUDE_DIR=${btor2tools.dev}/include/btor2parser"
32 ] ++ (lib.optional (gmp != null) "-DUSE_GMP=YES");
34 nativeCheckInputs = [ python3 ];
37 let var = if stdenv.hostPlatform.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
39 # tests modelgen and modelgensmt2 spawn boolector in another processes and
40 # macOS strips DYLD_LIBRARY_PATH, hardcode it for testing
41 lib.optionalString stdenv.hostPlatform.isDarwin ''
43 install_name_tool -change libboolector.dylib $(pwd)/lib/libboolector.dylib bin/boolector
45 export ${var}=$(readlink -f lib)
49 postCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
54 # this is what haskellPackages.boolector expects
56 cp $out/include/boolector/boolector.h $out/include/boolector.h
57 cp $out/include/boolector/btortypes.h $out/include/btortypes.h
61 description = "Extremely fast SMT solver for bit-vectors and arrays";
62 homepage = "https://boolector.github.io";
63 license = licenses.mit;
64 platforms = with platforms; linux ++ darwin;
65 maintainers = with maintainers; [ thoughtpolice ];