summary refs log tree commit diff
path: root/pkgs/applications/science/logic
diff options
context:
space:
mode:
authorNikolay Amiantov <ab@fmap.me>2019-05-24 19:45:06 +0300
committerNikolay Amiantov <ab@fmap.me>2019-06-24 15:59:57 +0300
commit3dd7d72e43027ddf316bf0e6fc27fbb33f888e58 (patch)
tree146df0ebf97b6cbf0f84e4bbc15e5f3f9d196d58 /pkgs/applications/science/logic
parent08b1d8108921f0228f30ede36e68bcf7242aa11f (diff)
downloadnixpkgs-3dd7d72e43027ddf316bf0e6fc27fbb33f888e58.tar
nixpkgs-3dd7d72e43027ddf316bf0e6fc27fbb33f888e58.tar.gz
nixpkgs-3dd7d72e43027ddf316bf0e6fc27fbb33f888e58.tar.bz2
nixpkgs-3dd7d72e43027ddf316bf0e6fc27fbb33f888e58.tar.lz
nixpkgs-3dd7d72e43027ddf316bf0e6fc27fbb33f888e58.tar.xz
nixpkgs-3dd7d72e43027ddf316bf0e6fc27fbb33f888e58.tar.zst
nixpkgs-3dd7d72e43027ddf316bf0e6fc27fbb33f888e58.zip
fast-downward: init at 2019-05-13
Diffstat (limited to 'pkgs/applications/science/logic')
-rw-r--r--pkgs/applications/science/logic/fast-downward/default.nix55
1 files changed, 55 insertions, 0 deletions
diff --git a/pkgs/applications/science/logic/fast-downward/default.nix b/pkgs/applications/science/logic/fast-downward/default.nix
new file mode 100644
index 00000000000..21ce6be3e6c
--- /dev/null
+++ b/pkgs/applications/science/logic/fast-downward/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, lib, fetchhg, cmake, which, python3, osi, cplex }:
+
+stdenv.mkDerivation rec {
+  name = "fast-downward-2019-05-13";
+
+  src = fetchhg {
+    url = "http://hg.fast-downward.org/";
+    rev = "090f5df5d84a";
+    sha256 = "14pcjz0jfzx5269axg66iq8js7lm2w3cnqrrhhwmz833prjp945g";
+  };
+
+  nativeBuildInputs = [ cmake which ];
+  buildInputs = [ python3 python3.pkgs.wrapPython osi ];
+
+  cmakeFlags =
+    lib.optional osi.withCplex [ "-DDOWNWARD_CPLEX_ROOT=${cplex}/cplex" ];
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    cd src
+    # Needed because the package tries to be too smart.
+    export CC="$(which $CC)"
+    export CXX="$(which $CXX)"
+  '';
+
+  installPhase = ''
+    install -Dm755 bin/downward $out/libexec/fast-downward/downward
+    cp -r ../translate $out/libexec/fast-downward/
+    install -Dm755 ../../fast-downward.py $out/bin/fast-downward
+    mkdir -p $out/${python3.sitePackages}
+    cp -r ../../driver $out/${python3.sitePackages}
+
+    wrapPythonProgramsIn $out/bin "$out $pythonPath"
+    wrapPythonProgramsIn $out/libexec/fast-downward/translate "$out $pythonPath"
+    # Because fast-downward calls `python translate.py` we need to return wrapped scripts back.
+    for i in $out/libexec/fast-downward/translate/.*-wrapped; do
+      name="$(basename "$i")"
+      name1="''${name#.}"
+      name2="''${name1%-wrapped}"
+      dir="$(dirname "$i")"
+      dest="$dir/$name2"
+      echo "Moving $i to $dest"
+      mv "$i" "$dest"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "A domain-independent planning system";
+    homepage = "http://www.fast-downward.org/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}