about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/logic/z3/tptp.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science/logic/z3/tptp.nix')
-rw-r--r--nixpkgs/pkgs/applications/science/logic/z3/tptp.nix31
1 files changed, 31 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/applications/science/logic/z3/tptp.nix b/nixpkgs/pkgs/applications/science/logic/z3/tptp.nix
new file mode 100644
index 000000000000..34449542abb2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/z3/tptp.nix
@@ -0,0 +1,31 @@
+{stdenv, z3, cmake}:
+stdenv.mkDerivation rec {
+  pname = "z3-tptp";
+  version = z3.version;
+
+  src = z3.src;
+
+  sourceRoot = "source/examples/tptp";
+
+  nativeBuildInputs = [cmake];
+  buildInputs = [z3];
+
+  preConfigure = ''
+    echo 'set(Z3_LIBRARIES "-lz3")' >> CMakeLists.new
+    cat CMakeLists.txt | grep -E 'add_executable|project|link_libraries' >> CMakeLists.new
+    mv CMakeLists.new CMakeLists.txt
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/bin"
+    cp "z3_tptp5" "$out/bin/"
+    ln -s "z3_tptp5" "$out/bin/z3-tptp"
+  '';
+
+  meta = {
+    inherit version;
+    inherit (z3.meta) license homepage platforms;
+    description = ''TPTP wrapper for Z3 prover'';
+    maintainers = [stdenv.lib.maintainers.raskin];
+  };
+}