2022-12-08 01:11:44 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-05-19 15:59:20 +02:00
|
|
|
, fetchpatch
|
2022-12-08 01:11:44 +01:00
|
|
|
, cmake
|
|
|
|
, example-robot-data
|
|
|
|
, pinocchio
|
|
|
|
, pythonSupport ? false
|
|
|
|
, python3Packages
|
|
|
|
}:
|
|
|
|
|
2023-07-18 17:25:20 +02:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-12-08 01:11:44 +01:00
|
|
|
pname = "crocoddyl";
|
2023-07-18 17:25:20 +02:00
|
|
|
version = "2.0.1";
|
2022-12-08 01:11:44 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "loco-3d";
|
2023-07-18 17:25:20 +02:00
|
|
|
repo = finalAttrs.pname;
|
|
|
|
rev = "v${finalAttrs.version}";
|
2022-12-08 01:11:44 +01:00
|
|
|
fetchSubmodules = true;
|
2023-07-18 17:25:20 +02:00
|
|
|
hash = "sha256-h7rzLSvmWOZCP8rvmUEhFeMEiPhojfbvkt+fNKpgoXo=";
|
2022-12-08 01:11:44 +01: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-07-18 17:25:20 +02:00
|
|
|
prePatch = ''
|
|
|
|
substituteInPlace \
|
|
|
|
examples/CMakeLists.txt \
|
|
|
|
examples/log/check_logfiles.sh \
|
|
|
|
--replace /bin/bash ${stdenv.shell}
|
|
|
|
'';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"crocoddyl"
|
|
|
|
];
|
|
|
|
checkInputs = lib.optionals (pythonSupport) [
|
|
|
|
python3Packages.scipy
|
|
|
|
];
|
|
|
|
|
2022-12-08 01:11:44 +01:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Crocoddyl optimal control library";
|
|
|
|
homepage = "https://github.com/loco-3d/crocoddyl";
|
|
|
|
license = licenses.bsd3;
|
2023-07-18 17:25:20 +02:00
|
|
|
maintainers = with maintainers; [ nim65s wegank ];
|
2022-12-08 01:11:44 +01:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
2023-07-18 17:25:20 +02:00
|
|
|
})
|