summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorGuillaume Girol <symphorien+git@xlumurb.eu>2021-07-19 12:00:00 +0000
committerGuillaume Girol <symphorien+git@xlumurb.eu>2021-07-25 15:52:25 +0200
commit1894e8d9452640610c531a31186261b97d5d8f1c (patch)
treedc21bf5bc2f9ed53a66e27ca631c6cdf0e6ada65 /pkgs/applications
parent0708fe494be218d06141a1269c89077de61cbea7 (diff)
downloadnixpkgs-1894e8d9452640610c531a31186261b97d5d8f1c.tar
nixpkgs-1894e8d9452640610c531a31186261b97d5d8f1c.tar.gz
nixpkgs-1894e8d9452640610c531a31186261b97d5d8f1c.tar.bz2
nixpkgs-1894e8d9452640610c531a31186261b97d5d8f1c.tar.lz
nixpkgs-1894e8d9452640610c531a31186261b97d5d8f1c.tar.xz
nixpkgs-1894e8d9452640610c531a31186261b97d5d8f1c.tar.zst
nixpkgs-1894e8d9452640610c531a31186261b97d5d8f1c.zip
bitwuzla: init at unstable-2021-07-01
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/science/logic/bitwuzla/default.nix67
1 files changed, 67 insertions, 0 deletions
diff --git a/pkgs/applications/science/logic/bitwuzla/default.nix b/pkgs/applications/science/logic/bitwuzla/default.nix
new file mode 100644
index 00000000000..a8820b55b74
--- /dev/null
+++ b/pkgs/applications/science/logic/bitwuzla/default.nix
@@ -0,0 +1,67 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+, python3
+, cmake
+, lingeling
+, btor2tools
+, gtest
+, gmp
+, cadical
+, minisat
+, picosat
+, cryptominisat
+, zlib
+, pkg-config
+  # "*** internal error in 'lglib.c': watcher stack overflow" on aarch64-linux
+, withLingeling ? !stdenv.hostPlatform.isAarch64
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bitwuzla";
+  version = "unstable-2021-07-01";
+
+  src = fetchFromGitHub {
+    owner = "bitwuzla";
+    repo = "bitwuzla";
+    rev = "58d720598e359b1fdfec4a469c76f1d1f24db51a";
+    sha256 = "06ymqsdppyixb918161rmbgqvbnarj4nm4az88lkn3ri4gyimw04";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [
+    cadical
+    cryptominisat
+    picosat
+    minisat
+    btor2tools
+    gmp
+    zlib
+  ] ++ lib.optional withLingeling lingeling;
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DPicoSAT_INCLUDE_DIR=${lib.getDev picosat}/include/picosat"
+    "-DBtor2Tools_INCLUDE_DIR=${lib.getDev btor2tools}/include/btor2parser"
+    "-DBtor2Tools_LIBRARIES=${lib.getLib btor2tools}/lib/libbtor2parser${stdenv.hostPlatform.extensions.sharedLibrary}"
+  ] ++ lib.optional doCheck "-DTESTING=YES";
+
+  checkInputs = [ python3 gtest ];
+  # two tests fail on darwin and 3 on aarch64-linux
+  doCheck = stdenv.hostPlatform.isLinux && (!stdenv.hostPlatform.isAarch64);
+  preCheck = let
+    var = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
+  in
+    ''
+      export ${var}=$(readlink -f lib)
+      patchShebangs ..
+    '';
+
+  meta = with lib; {
+    description = "A SMT solver for fixed-size bit-vectors, floating-point arithmetic, arrays, and uninterpreted functions";
+    homepage = "https://bitwuzla.github.io";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ symphorien ];
+  };
+}