From ad8b4f4e4f604889cd9ba45f2d4640a7b7d3e26d Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 26 Jun 2024 19:34:53 +0200 Subject: [PATCH 1/7] hpp-fcl: add missing dependency fix: ```python >>> import hppfcl Traceback (most recent call last): File "", line 1, in File "/nix/store/dfnl1p604453r5rc29h3bnr4vjn811lj-hpp-fcl-3.0.0-pre/lib/python3.11/site-packages/hppfcl/__init__.py", line 35, in from .hppfcl import * ImportError: libz.so.1: cannot open shared object file: No such file or directory ``` --- pkgs/development/libraries/hpp-fcl/default.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/development/libraries/hpp-fcl/default.nix b/pkgs/development/libraries/hpp-fcl/default.nix index 0359abec9b08..d5e96966e4d5 100644 --- a/pkgs/development/libraries/hpp-fcl/default.nix +++ b/pkgs/development/libraries/hpp-fcl/default.nix @@ -10,6 +10,7 @@ , qhull , pythonSupport ? false , python3Packages +, zlib }: stdenv.mkDerivation (finalAttrs: { @@ -37,6 +38,7 @@ stdenv.mkDerivation (finalAttrs: { assimp qhull octomap + zlib ] ++ lib.optionals (!pythonSupport) [ boost eigen From d791bfec05086daae182b284fd61d0d0cd9a2185 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 26 Aug 2024 19:20:07 +0200 Subject: [PATCH 2/7] hpp-fcl: fix import check --- pkgs/development/libraries/hpp-fcl/default.nix | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pkgs/development/libraries/hpp-fcl/default.nix b/pkgs/development/libraries/hpp-fcl/default.nix index d5e96966e4d5..31e403207f65 100644 --- a/pkgs/development/libraries/hpp-fcl/default.nix +++ b/pkgs/development/libraries/hpp-fcl/default.nix @@ -55,9 +55,11 @@ stdenv.mkDerivation (finalAttrs: { ]; doCheck = true; - pythonImportsCheck = lib.optionals (!pythonSupport) [ - "hppfcl" - ]; + # pythonImportsCheck, but in stdenv.mkDerivation + postInstall = lib.optionalString pythonSupport '' + PYTHONPATH=$out/${python3Packages.python.sitePackages}:$PYTHONPATH + python -c "import hppfcl" + ''; outputs = [ "dev" "out" "doc" ]; postFixup = '' From 8fdec88dd165f19f3d46f3a04d94a4a6416ae938 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 26 Aug 2024 19:20:36 +0200 Subject: [PATCH 3/7] hpp-fcl: clean cmakeFlags --- pkgs/development/libraries/hpp-fcl/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/hpp-fcl/default.nix b/pkgs/development/libraries/hpp-fcl/default.nix index 31e403207f65..c3d5f1185bfe 100644 --- a/pkgs/development/libraries/hpp-fcl/default.nix +++ b/pkgs/development/libraries/hpp-fcl/default.nix @@ -48,10 +48,9 @@ stdenv.mkDerivation (finalAttrs: { ]; cmakeFlags = [ - "-DHPP_FCL_HAS_QHULL=ON" - "-DINSTALL_DOCUMENTATION=ON" - ] ++ lib.optionals (!pythonSupport) [ - "-DBUILD_PYTHON_INTERFACE=OFF" + (lib.cmakeBool "HPP_FCL_HAS_QHULL" true) + (lib.cmakeBool "INSTALL_DOCUMENTATION" true) + (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) ]; doCheck = true; From ec841f6b65496e3ed42fe907c8b9190a8ea6ae96 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 26 Aug 2024 19:21:58 +0200 Subject: [PATCH 4/7] hpp-fcl: nixfmt --- .../development/libraries/hpp-fcl/default.nix | 65 ++++++++++--------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/pkgs/development/libraries/hpp-fcl/default.nix b/pkgs/development/libraries/hpp-fcl/default.nix index c3d5f1185bfe..55e0b469b36e 100644 --- a/pkgs/development/libraries/hpp-fcl/default.nix +++ b/pkgs/development/libraries/hpp-fcl/default.nix @@ -1,16 +1,17 @@ -{ lib -, stdenv -, fetchFromGitHub -, cmake -, doxygen -, boost -, eigen -, assimp -, octomap -, qhull -, pythonSupport ? false -, python3Packages -, zlib +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + doxygen, + boost, + eigen, + assimp, + octomap, + qhull, + pythonSupport ? false, + python3Packages, + zlib, }: stdenv.mkDerivation (finalAttrs: { @@ -30,22 +31,23 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ cmake doxygen - ] ++ lib.optionals pythonSupport [ - python3Packages.numpy - ]; + ] ++ lib.optionals pythonSupport [ python3Packages.numpy ]; - propagatedBuildInputs = [ - assimp - qhull - octomap - zlib - ] ++ lib.optionals (!pythonSupport) [ - boost - eigen - ] ++ lib.optionals pythonSupport [ - python3Packages.boost - python3Packages.eigenpy - ]; + propagatedBuildInputs = + [ + assimp + qhull + octomap + zlib + ] + ++ lib.optionals (!pythonSupport) [ + boost + eigen + ] + ++ lib.optionals pythonSupport [ + python3Packages.boost + python3Packages.eigenpy + ]; cmakeFlags = [ (lib.cmakeBool "HPP_FCL_HAS_QHULL" true) @@ -60,13 +62,16 @@ stdenv.mkDerivation (finalAttrs: { python -c "import hppfcl" ''; - outputs = [ "dev" "out" "doc" ]; + outputs = [ + "dev" + "out" + "doc" + ]; postFixup = '' moveToOutput share/ament_index "$dev" moveToOutput share/${finalAttrs.pname} "$dev" ''; - meta = with lib; { description = "Extension of the Flexible Collision Library"; homepage = "https://github.com/humanoid-path-planner/hpp-fcl"; From 4caafb45e0626a1a759e141626d1b5b8d4dbfa5a Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 26 Aug 2024 19:23:15 +0200 Subject: [PATCH 5/7] hpp-fcl: move to by-name --- .../hpp-fcl/default.nix => by-name/hp/hpp-fcl/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{development/libraries/hpp-fcl/default.nix => by-name/hp/hpp-fcl/package.nix} (100%) diff --git a/pkgs/development/libraries/hpp-fcl/default.nix b/pkgs/by-name/hp/hpp-fcl/package.nix similarity index 100% rename from pkgs/development/libraries/hpp-fcl/default.nix rename to pkgs/by-name/hp/hpp-fcl/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 004007fb0b72..a6fd9085ea1f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20771,8 +20771,6 @@ with pkgs; hound = callPackage ../development/tools/misc/hound { }; - hpp-fcl = callPackage ../development/libraries/hpp-fcl { }; - hpx = callPackage ../development/libraries/hpx { boost = boost179; asio = asio.override { boost = boost179; }; From 36b4ff0515f93e15cff9a85bdd55fdefe7837b10 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 26 Aug 2024 22:31:29 +0200 Subject: [PATCH 6/7] hpp-fcl: also available on other platforms than unix --- pkgs/by-name/hp/hpp-fcl/package.nix | 1 - 1 file changed, 1 deletion(-) diff --git a/pkgs/by-name/hp/hpp-fcl/package.nix b/pkgs/by-name/hp/hpp-fcl/package.nix index 55e0b469b36e..3b260503260e 100644 --- a/pkgs/by-name/hp/hpp-fcl/package.nix +++ b/pkgs/by-name/hp/hpp-fcl/package.nix @@ -77,6 +77,5 @@ stdenv.mkDerivation (finalAttrs: { homepage = "https://github.com/humanoid-path-planner/hpp-fcl"; license = licenses.bsd3; maintainers = with maintainers; [ nim65s ]; - platforms = platforms.unix; }; }) From 90a6f86d47ed76ef4501bed8a9835c6ccbfb6f50 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Mon, 26 Aug 2024 22:32:22 +0200 Subject: [PATCH 7/7] hpp-fcl: avoid use of meta = with lib; --- pkgs/by-name/hp/hpp-fcl/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/hp/hpp-fcl/package.nix b/pkgs/by-name/hp/hpp-fcl/package.nix index 3b260503260e..78ce6456c301 100644 --- a/pkgs/by-name/hp/hpp-fcl/package.nix +++ b/pkgs/by-name/hp/hpp-fcl/package.nix @@ -72,10 +72,10 @@ stdenv.mkDerivation (finalAttrs: { moveToOutput share/${finalAttrs.pname} "$dev" ''; - meta = with lib; { + meta = { description = "Extension of the Flexible Collision Library"; homepage = "https://github.com/humanoid-path-planner/hpp-fcl"; - license = licenses.bsd3; - maintainers = with maintainers; [ nim65s ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ nim65s ]; }; })