2022-12-08 00:00:46 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, boost
|
|
|
|
, eigen
|
2023-08-09 09:06:28 +00:00
|
|
|
, hpp-fcl
|
2022-12-08 00:00:46 +00:00
|
|
|
, urdfdom
|
|
|
|
, pythonSupport ? false
|
|
|
|
, python3Packages
|
|
|
|
}:
|
|
|
|
|
2023-08-09 09:06:28 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-12-08 00:00:46 +00:00
|
|
|
pname = "pinocchio";
|
2023-08-09 09:06:28 +00:00
|
|
|
version = "2.6.20";
|
2022-12-08 00:00:46 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stack-of-tasks";
|
2023-08-09 09:06:28 +00:00
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = "v${finalAttrs.version}";
|
2022-12-08 00:00:46 +00:00
|
|
|
fetchSubmodules = true;
|
2023-08-09 09:06:28 +00:00
|
|
|
hash = "sha256-Pu/trCpqdue7sQKDbLhyxTfgj/+xRiVcG7Luz6ZQXtM=";
|
2022-12-08 00:00:46 +00:00
|
|
|
};
|
|
|
|
|
2022-12-08 01:48:18 +00:00
|
|
|
# error: use of undeclared identifier '__sincos'
|
|
|
|
postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) ''
|
|
|
|
substituteInPlace src/math/sincos.hpp \
|
|
|
|
--replace "__APPLE__" "0"
|
|
|
|
'';
|
|
|
|
|
2022-12-08 00:00:46 +00:00
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
urdfdom
|
|
|
|
] ++ lib.optionals (!pythonSupport) [
|
|
|
|
boost
|
|
|
|
eigen
|
2023-08-09 09:06:28 +00:00
|
|
|
hpp-fcl
|
2022-12-08 00:00:46 +00:00
|
|
|
] ++ lib.optionals pythonSupport [
|
|
|
|
python3Packages.boost
|
|
|
|
python3Packages.eigenpy
|
2023-08-09 09:06:28 +00:00
|
|
|
python3Packages.hpp-fcl
|
2022-12-08 00:00:46 +00:00
|
|
|
];
|
|
|
|
|
2023-08-09 09:06:28 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBUILD_WITH_COLLISION_SUPPORT=ON"
|
|
|
|
] ++ lib.optionals (pythonSupport) [
|
|
|
|
"-DBUILD_WITH_LIBPYTHON=ON"
|
|
|
|
] ++ lib.optionals (!pythonSupport) [
|
2022-12-08 00:00:46 +00:00
|
|
|
"-DBUILD_PYTHON_INTERFACE=OFF"
|
|
|
|
];
|
|
|
|
|
2023-08-09 09:06:28 +00:00
|
|
|
doCheck = true;
|
|
|
|
pythonImportsCheck = lib.optionals (!pythonSupport) [
|
|
|
|
"pinocchio"
|
|
|
|
];
|
|
|
|
|
2022-12-08 00:00:46 +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-09 09:06:28 +00:00
|
|
|
maintainers = with maintainers; [ nim65s wegank ];
|
2022-12-08 00:00:46 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2023-08-09 09:06:28 +00:00
|
|
|
})
|