2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, example-robot-data
|
|
|
|
, pinocchio
|
|
|
|
, pythonSupport ? false
|
|
|
|
, python3Packages
|
|
|
|
}:
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-12-17 10:02:37 +00:00
|
|
|
pname = "crocoddyl";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "2.1.0";
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "loco-3d";
|
2023-08-10 07:59:29 +00:00
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = "v${finalAttrs.version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-SVV9sleDXLm2QJmNgL25XLHC3y5bfKab4GSlE8jbT8w=";
|
2022-12-17 10:02:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
strictDeps = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
cmake
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = lib.optionals (!pythonSupport) [
|
|
|
|
example-robot-data
|
|
|
|
pinocchio
|
|
|
|
] ++ lib.optionals pythonSupport [
|
|
|
|
python3Packages.example-robot-data
|
|
|
|
python3Packages.pinocchio
|
|
|
|
];
|
|
|
|
|
|
|
|
cmakeFlags = lib.optionals (!pythonSupport) [
|
|
|
|
"-DBUILD_EXAMPLES=OFF"
|
|
|
|
"-DBUILD_PYTHON_INTERFACE=OFF"
|
|
|
|
];
|
|
|
|
|
2023-08-10 07:59:29 +00:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace \
|
|
|
|
examples/CMakeLists.txt \
|
|
|
|
examples/log/check_logfiles.sh \
|
|
|
|
--replace /bin/bash ${stdenv.shell}
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"crocoddyl"
|
|
|
|
];
|
2024-06-05 15:53:02 +00:00
|
|
|
checkInputs = lib.optionals pythonSupport [
|
2023-08-10 07:59:29 +00:00
|
|
|
python3Packages.scipy
|
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Crocoddyl optimal control library";
|
|
|
|
homepage = "https://github.com/loco-3d/crocoddyl";
|
|
|
|
license = licenses.bsd3;
|
2023-08-10 07:59:29 +00:00
|
|
|
maintainers = with maintainers; [ nim65s wegank ];
|
2022-12-17 10:02:37 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2023-08-10 07:59:29 +00:00
|
|
|
})
|