From 0c0b3af7936d868d5346f8e2fc46814ab0dfa4be Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 9 Aug 2023 11:06:28 +0200 Subject: [PATCH 1/3] pinocchio: 2.6.19 -> 2.6.20 While here: - add hpp-fcl dependency - enable libpython dependency when python support is activated - use finalAttrs instead of rec - add check & python import check - add myself in maintainers --- .../libraries/pinocchio/default.nix | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/pinocchio/default.nix b/pkgs/development/libraries/pinocchio/default.nix index ad3e3ba1299c..6faf612c1971 100644 --- a/pkgs/development/libraries/pinocchio/default.nix +++ b/pkgs/development/libraries/pinocchio/default.nix @@ -4,21 +4,22 @@ , cmake , boost , eigen +, hpp-fcl , urdfdom , pythonSupport ? false , python3Packages }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "pinocchio"; - version = "2.6.19"; + version = "2.6.20"; src = fetchFromGitHub { owner = "stack-of-tasks"; - repo = pname; - rev = "v${version}"; + repo = finalAttrs.pname; + rev = "v${finalAttrs.version}"; fetchSubmodules = true; - hash = "sha256-P7jSAQ6LYcboJHqtpneT4W8Pu5G3fd3/a8Gju9im1e8="; + hash = "sha256-Pu/trCpqdue7sQKDbLhyxTfgj/+xRiVcG7Luz6ZQXtM="; }; # error: use of undeclared identifier '__sincos' @@ -38,20 +39,31 @@ stdenv.mkDerivation rec { ] ++ lib.optionals (!pythonSupport) [ boost eigen + hpp-fcl ] ++ lib.optionals pythonSupport [ python3Packages.boost python3Packages.eigenpy + python3Packages.hpp-fcl ]; - cmakeFlags = lib.optionals (!pythonSupport) [ + cmakeFlags = [ + "-DBUILD_WITH_COLLISION_SUPPORT=ON" + ] ++ lib.optionals (pythonSupport) [ + "-DBUILD_WITH_LIBPYTHON=ON" + ] ++ lib.optionals (!pythonSupport) [ "-DBUILD_PYTHON_INTERFACE=OFF" ]; + doCheck = true; + pythonImportsCheck = lib.optionals (!pythonSupport) [ + "pinocchio" + ]; + meta = with lib; { description = "A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives"; homepage = "https://github.com/stack-of-tasks/pinocchio"; license = licenses.bsd2; - maintainers = with maintainers; [ wegank ]; + maintainers = with maintainers; [ nim65s wegank ]; platforms = platforms.unix; }; -} +}) From 94924be1418c08138abb09b8bd7ac9595920ed2c Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 9 Aug 2023 14:56:15 +0200 Subject: [PATCH 2/3] example-robot-data: add preCheck MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix 43 occurences of eg.: > ValueError: Mesh package://example-robot-data/robots/ur_description/meshes/ur5/collision/base.stl could not be found. Following 0c0b3af7936d868d5346f8e2fc46814ab0dfa4be, pinocchio has hpp-fcl support, so example-robot-data try to load meshes. But for `package://example-robot-data/robots/…/mesh.stl` paths to be resolved by the mesh loader, there must be a `example-robot-data/robots` folder. --- pkgs/development/libraries/example-robot-data/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/development/libraries/example-robot-data/default.nix b/pkgs/development/libraries/example-robot-data/default.nix index 201275fb02ef..d9a107bf6497 100644 --- a/pkgs/development/libraries/example-robot-data/default.nix +++ b/pkgs/development/libraries/example-robot-data/default.nix @@ -33,6 +33,10 @@ stdenv.mkDerivation (finalAttrs: { ]; doCheck = true; + # The package expect to find an `example-robot-data/robots` folder somewhere + # either in install prefix or in the sources + # where it can find the meshes for unit tests + preCheck = "ln -s source ../../${finalAttrs.pname}"; pythonImportsCheck = [ "example_robot_data" ]; From 35360ba7fb3842a1f1d885de6f940ad63a7f4fb9 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Thu, 10 Aug 2023 11:05:49 +0200 Subject: [PATCH 3/3] pinocchio: disable collision support on darwin --- pkgs/development/libraries/pinocchio/default.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/pinocchio/default.nix b/pkgs/development/libraries/pinocchio/default.nix index 6faf612c1971..af7fff14e8f3 100644 --- a/pkgs/development/libraries/pinocchio/default.nix +++ b/pkgs/development/libraries/pinocchio/default.nix @@ -4,6 +4,7 @@ , cmake , boost , eigen +, collisionSupport ? !stdenv.isDarwin , hpp-fcl , urdfdom , pythonSupport ? false @@ -39,22 +40,28 @@ stdenv.mkDerivation (finalAttrs: { ] ++ lib.optionals (!pythonSupport) [ boost eigen + ] ++ lib.optionals (!pythonSupport && collisionSupport) [ hpp-fcl ] ++ lib.optionals pythonSupport [ python3Packages.boost python3Packages.eigenpy + ] ++ lib.optionals (pythonSupport && collisionSupport) [ python3Packages.hpp-fcl ]; - cmakeFlags = [ + cmakeFlags = lib.optionals collisionSupport [ "-DBUILD_WITH_COLLISION_SUPPORT=ON" - ] ++ lib.optionals (pythonSupport) [ + ] ++ lib.optionals pythonSupport [ "-DBUILD_WITH_LIBPYTHON=ON" + ] ++ lib.optionals (pythonSupport && stdenv.isDarwin) [ + # AssertionError: '.' != '/tmp/nix-build-pinocchio-2.6.20.drv/sou[84 chars].dae' + "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;test-py-bindings_geometry_model_urdf'" ] ++ lib.optionals (!pythonSupport) [ "-DBUILD_PYTHON_INTERFACE=OFF" ]; doCheck = true; + pythonImportsCheck = lib.optionals (!pythonSupport) [ "pinocchio" ];