2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, boost
|
|
|
|
, eigen
|
2023-08-22 20:05:09 +00:00
|
|
|
, collisionSupport ? !stdenv.isDarwin
|
|
|
|
, hpp-fcl
|
2022-12-17 10:02:37 +00:00
|
|
|
, urdfdom
|
|
|
|
, pythonSupport ? false
|
|
|
|
, python3Packages
|
|
|
|
}:
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-12-17 10:02:37 +00:00
|
|
|
pname = "pinocchio";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "2.7.0";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stack-of-tasks";
|
2023-08-22 20:05:09 +00:00
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = "v${finalAttrs.version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
fetchSubmodules = true;
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-yhrG+MilGJkvwLUNTAgNhDqUWGjPswjrbg38yOLsmHc=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
urdfdom
|
|
|
|
] ++ lib.optionals (!pythonSupport) [
|
|
|
|
boost
|
|
|
|
eigen
|
2023-08-22 20:05:09 +00:00
|
|
|
] ++ lib.optionals (!pythonSupport && collisionSupport) [
|
|
|
|
hpp-fcl
|
2022-12-17 10:02:37 +00:00
|
|
|
] ++ lib.optionals pythonSupport [
|
|
|
|
python3Packages.boost
|
|
|
|
python3Packages.eigenpy
|
2023-08-22 20:05:09 +00:00
|
|
|
] ++ lib.optionals (pythonSupport && collisionSupport) [
|
|
|
|
python3Packages.hpp-fcl
|
2022-12-17 10:02:37 +00:00
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
cmakeFlags = lib.optionals collisionSupport [
|
|
|
|
"-DBUILD_WITH_COLLISION_SUPPORT=ON"
|
|
|
|
] ++ lib.optionals pythonSupport [
|
|
|
|
"-DBUILD_WITH_LIBPYTHON=ON"
|
|
|
|
] ++ lib.optionals (pythonSupport && stdenv.isDarwin) [
|
2024-01-25 14:12:00 +00:00
|
|
|
# AssertionError: '.' != '/tmp/nix-build-pinocchio-2.7.0.drv/sou[84 chars].dae'
|
2023-08-22 20:05:09 +00:00
|
|
|
"-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;test-py-bindings_geometry_model_urdf'"
|
|
|
|
] ++ lib.optionals (!pythonSupport) [
|
2022-12-17 10:02:37 +00:00
|
|
|
"-DBUILD_PYTHON_INTERFACE=OFF"
|
|
|
|
];
|
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
pythonImportsCheck = lib.optionals (!pythonSupport) [
|
|
|
|
"pinocchio"
|
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
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;
|
2023-08-22 20:05:09 +00:00
|
|
|
maintainers = with maintainers; [ nim65s wegank ];
|
2022-12-17 10:02:37 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2023-08-22 20:05:09 +00:00
|
|
|
})
|