2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, boost
|
|
|
|
, eigen
|
|
|
|
, urdfdom
|
|
|
|
, pythonSupport ? false
|
|
|
|
, python3Packages
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pinocchio";
|
2023-01-20 10:41:00 +00:00
|
|
|
version = "2.6.14";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "stack-of-tasks";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
|
|
|
fetchSubmodules = true;
|
2023-01-20 10:41:00 +00:00
|
|
|
sha256 = "sha256-3dPGeWnIVIErLnd+mxwudTj4qHyN2k7H94EsHYmKV1I=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# error: use of undeclared identifier '__sincos'
|
|
|
|
postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) ''
|
|
|
|
substituteInPlace src/math/sincos.hpp \
|
|
|
|
--replace "__APPLE__" "0"
|
|
|
|
'';
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
urdfdom
|
|
|
|
] ++ lib.optionals (!pythonSupport) [
|
|
|
|
boost
|
|
|
|
eigen
|
|
|
|
] ++ lib.optionals pythonSupport [
|
|
|
|
python3Packages.boost
|
|
|
|
python3Packages.eigenpy
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = lib.optionals (!pythonSupport) [
|
|
|
|
"-DBUILD_PYTHON_INTERFACE=OFF"
|
|
|
|
];
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|