diff --git a/flake.nix b/flake.nix index 94fc2b3..9f5daaa 100644 --- a/flake.nix +++ b/flake.nix @@ -26,6 +26,7 @@ mayo = pkgs.libsForQt5.callPackage ./pkgs/misc/mayo { }; darknet = pkgs.callPackage ./pkgs/misc/darknet { }; fstl = pkgs.libsForQt5.callPackage ./pkgs/misc/fstl { }; + unified-planning = pkgs.python3Packages.callPackage ./pkgs/development/python-modules/unified-planning { }; in { inherit pkgs; diff --git a/pkgs/development/python-modules/unified-planning/default.nix b/pkgs/development/python-modules/unified-planning/default.nix new file mode 100644 index 0000000..aa7b822 --- /dev/null +++ b/pkgs/development/python-modules/unified-planning/default.nix @@ -0,0 +1,89 @@ +{ lib +, python3 +, fetchFromGitHub +, fetchPypi +, clingo +}: +let + buildPythonPackage = python3.pkgs.buildPythonPackage; + + antlr472-python3-runtime = buildPythonPackage rec { + pname = "antlr4-python3-runtime"; + version = "v4.7.2"; + src = fetchPypi { + inherit pname version; + hash = "sha256-Fozc7I+5FS6EqHym/SYbPVTI9jWPQqs7gTsUpxk7tQs="; + }; + meta = with lib; { + description = "Runtime for ANTLR"; + homepage = "https://www.antlr.org/"; + license = licenses.bsd3; + }; + }; + + tarski = buildPythonPackage rec { + pname = "tarski"; + version = "0.8.2"; + format = "pyproject"; + + src = fetchFromGitHub { + owner = "aig-upf"; + repo = "tarski"; + rev = "v${version}"; + hash = "sha256-9yXFPrfLXNUWSoTuMKgdDxtbCZCvrcRflZHJLnJUPAw="; + }; + + nativeBuildInputs = with python3.pkgs; [ + cython + setuptools + wheel + ]; + + propagatedBuildInputs = (with python3.pkgs; [ psutil multipledispatch ]) ++ [ antlr472-python3-runtime ]; + + pythonImportsCheck = [ "tarski" ]; + + meta = with lib; { + description = "Tarski - An AI Planning Modeling Framework"; + homepage = "https://github.com/aig-upf/tarski"; + changelog = "https://github.com/aig-upf/tarski/blob/${src.rev}/CHANGELOG.md"; + license = licenses.asl20; + maintainers = with maintainers; [ ]; + }; + }; +in +buildPythonPackage rec { + pname = "unified-planning"; + version = "unstable-2023-03-01"; + format = "setuptools"; + + src = fetchFromGitHub { + owner = "movefasta"; + repo = "unified-planning"; + rev = "e58a76e5a128731112155b52dfb03384272eafab"; + hash = "sha256-KN7br09YYfhdOsuTvnwArW6yOyZ0sZDCt7B0ymbMVqM="; + }; + + propagatedBuildInputs = (with python3.pkgs; [ + networkx + pyparsing + pytest + protobuf + tarski + grpcio + grpcio-tools + ]); + + checkPhase = '' + export PATH=${lib.makeBinPath [ clingo ]}:$PATH + ''; + + pythonImportsCheck = [ "unified_planning" ]; + + meta = with lib; { + description = "The AIPlan4EU Unified Planning Library"; + homepage = "https://github.com/movefasta/unified-planning"; + license = licenses.asl20; + maintainers = with maintainers; [ ]; + }; +} diff --git a/pkgs/misc/darknet/default.nix b/pkgs/misc/darknet/default.nix index e11a988..2b0dc5e 100644 --- a/pkgs/misc/darknet/default.nix +++ b/pkgs/misc/darknet/default.nix @@ -55,16 +55,6 @@ stdenv.mkDerivation rec { cudaEnv ]; - -# indefined reference to `std::condition_variable::wait(std::unique_lock&)@GLIBCXX_3.4.30 - - # LD_LIBRARY_PATH = lib.makeLibraryPath (nativeBuildInputs ++ [ cudaStub ]); - - # shellHook = '' - # export ARCH= -gencode arch=compute_61,code=sm_61 -gencode arch=compute_61,code=compute_61 - # export LDFLAGS+= `pkg-config --libs opencv4 2> /dev/null || pkg-config --libs opencv` -lstdc++ - # ''; - cmakeFlags = (lib.optionals enableCuda [ "CUDA_PATH=${cudatoolkit}" ]) ++ [ "GPU=1" @@ -94,10 +84,6 @@ stdenv.mkDerivation rec { autoPatchelfIgnoreMissingDeps = true; - shellHook = '' - export LD_LIBRARY_PATH=${cudaStub}''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH - ''; - meta = with lib; { description = "YOLOv4 / Scaled-YOLOv4 / YOLO - Neural Networks for Object Detection (Windows and Linux version of Darknet )"; homepage = "https://github.com/AlexeyAB/darknet";