summary refs log tree commit diff
path: root/pkgs/applications/science/logic/z3/tptp.nix
blob: 23136ddf7a70eac29aac6b667a16758bbba36185 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{lib, 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 (z3.meta) license homepage platforms;
    description = "TPTP wrapper for Z3 prover";
    maintainers = [lib.maintainers.raskin];
  };
}