aba2sat/nix/packages/aspforaba.nix

44 lines
954 B
Nix
Raw Normal View History

2024-03-25 17:16:34 +01:00
{
fetchFromBitbucket,
python3,
clingo,
}: let
2023-11-12 19:43:44 +01:00
name = "ASPforABA";
version = "ICCMA23";
src = fetchFromBitbucket {
owner = "coreo-group";
repo = name;
rev = "591d488";
hash = "sha256-QdcisBOsGPOq9/KCQAUpKzQS7E2Olg4Zv+0jmf3/GkU=";
};
clingoWithPython = clingo.overrideAttrs (old: {
2024-03-25 17:16:34 +01:00
cmakeFlags = ["-DCLINGO_BUILD_WITH_PYTHON=ON"];
nativeBuildInputs = old.nativeBuildInputs ++ [python3];
2023-11-12 19:43:44 +01:00
});
in
2024-03-25 17:16:34 +01:00
python3.pkgs.buildPythonPackage {
inherit src version;
pname = name;
2023-11-12 19:43:44 +01:00
2024-03-25 17:16:34 +01:00
format = "other";
2023-11-12 19:43:44 +01:00
2024-03-25 17:16:34 +01:00
pythonPath = [clingoWithPython python3.pkgs.cffi];
2023-11-12 19:43:44 +01:00
2024-03-25 17:16:34 +01:00
makeWrapperArgs = ["--run 'mkdir -p /tmp/clingo'"];
2023-11-12 19:43:44 +01:00
2024-03-25 17:16:34 +01:00
patchPhase = ''
rm ./configure
'';
2023-11-12 19:43:44 +01:00
2024-03-25 17:16:34 +01:00
installPhase = ''
mkdir -p $out/bin
cp aspforaba.py $out/bin/ASPforABA
cp -r encodings $out/bin/
2023-11-12 19:43:44 +01:00
2024-03-25 17:16:34 +01:00
cat << EOF > $out/bin/.config
TEMP_PATH=/tmp/clingo
CLINGO_PATH=${clingoWithPython}/bin/clingo
EOF
'';
}