2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv, lib, fetchhg, cmake, which, python3, osi, cplex }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
2020-08-20 17:08:02 +00:00
|
|
|
version = "19.12";
|
|
|
|
pname = "fast-downward";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchhg {
|
|
|
|
url = "http://hg.fast-downward.org/";
|
2020-08-20 17:08:02 +00:00
|
|
|
rev = "41688a4f16b3";
|
|
|
|
sha256 = "08m4k1mkx4sz7c2ab7xh7ip6b67zxv7kl68xrvwa83xw1yigqkna";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake which ];
|
|
|
|
buildInputs = [ python3 python3.pkgs.wrapPython osi ];
|
|
|
|
|
|
|
|
cmakeFlags =
|
|
|
|
lib.optional osi.withCplex [ "-DDOWNWARD_CPLEX_ROOT=${cplex}/cplex" ];
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-08-20 17:08:02 +00:00
|
|
|
configurePhase = ''
|
|
|
|
python build.py release
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
# Needed because the package tries to be too smart.
|
|
|
|
export CC="$(which $CC)"
|
|
|
|
export CXX="$(which $CXX)"
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
2020-08-20 17:08:02 +00:00
|
|
|
install -Dm755 builds/release/bin/downward $out/libexec/fast-downward/downward
|
|
|
|
cp -r builds/release/bin/translate $out/libexec/fast-downward/
|
|
|
|
install -Dm755 fast-downward.py $out/bin/fast-downward
|
2020-04-24 23:36:52 +00:00
|
|
|
mkdir -p $out/${python3.sitePackages}
|
2020-08-20 17:08:02 +00:00
|
|
|
cp -r driver $out/${python3.sitePackages}
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
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
|
2020-08-20 17:08:02 +00:00
|
|
|
|
|
|
|
substituteInPlace $out/${python3.sitePackages}/driver/arguments.py \
|
|
|
|
--replace 'args.build = "release"' "args.build = \"$out/libexec/fast-downward\""
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A domain-independent planning system";
|
|
|
|
homepage = "http://www.fast-downward.org/";
|
|
|
|
license = licenses.gpl3Plus;
|
2020-08-20 17:08:02 +00:00
|
|
|
platforms = with platforms; (linux ++ darwin);
|
2020-04-24 23:36:52 +00:00
|
|
|
maintainers = with maintainers; [ abbradar ];
|
|
|
|
};
|
|
|
|
}
|