mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-06 04:53:27 +00:00
571c71e6f7
We are migrating packages that meet below requirements: 1. using `callPackage` 2. called path is a directory 3. overriding set is empty (`{ }`) 4. not containing path expressions other than relative path (to makenixpkgs-vet happy) 5. not referenced by nix files outside of the directory, other than`pkgs/top-level/all-packages.nix` 6. not referencing nix files outside of the directory 7. not referencing `default.nix` (since it's changed to `package.nix`) 8. `outPath` doesn't change after migration The tool is here: https://github.com/Aleksanaa/by-name-migrate.
69 lines
1.9 KiB
Nix
69 lines
1.9 KiB
Nix
{ stdenv
|
|
, lib
|
|
, fetchFromGitHub
|
|
, cmake
|
|
, python3
|
|
, osi
|
|
, cplex
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
pname = "fast-downward";
|
|
version = "24.06.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "aibasel";
|
|
repo = "downward";
|
|
rev = "release-${version}";
|
|
sha256 = "sha256-iIBoJZCFd05bKUeftvl2YBTmSQuFvATIQAYMITDywWA=";
|
|
};
|
|
|
|
nativeBuildInputs = [ cmake python3.pkgs.wrapPython ];
|
|
buildInputs = [ python3 osi ];
|
|
|
|
cmakeFlags = lib.optionals osi.withCplex [ "-DDOWNWARD_CPLEX_ROOT=${cplex}/cplex" ];
|
|
|
|
configurePhase = ''
|
|
python build.py release
|
|
'';
|
|
|
|
postPatch = ''
|
|
# Needed because the package tries to be too smart.
|
|
export CC="$(which $CC)"
|
|
export CXX="$(which $CXX)"
|
|
'';
|
|
|
|
installPhase = ''
|
|
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
|
|
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
|
|
|
|
substituteInPlace $out/${python3.sitePackages}/driver/arguments.py \
|
|
--replace 'args.build = "release"' "args.build = \"$out/libexec/fast-downward\""
|
|
'';
|
|
|
|
meta = with lib; {
|
|
description = "Domain-independent planning system";
|
|
mainProgram = "fast-downward";
|
|
homepage = "https://www.fast-downward.org/";
|
|
license = licenses.gpl3Plus;
|
|
platforms = platforms.unix;
|
|
maintainers = with maintainers; [ abbradar ];
|
|
};
|
|
}
|