2022-12-17 10:02:37 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2023-05-24 13:37:59 +00:00
|
|
|
, fetchpatch
|
2022-12-17 10:02:37 +00:00
|
|
|
, 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-01-02 11:29:13 +00:00
|
|
|
version = "2.0.2";
|
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}";
|
2022-12-17 10:02:37 +00:00
|
|
|
fetchSubmodules = true;
|
2024-01-02 11:29:13 +00:00
|
|
|
hash = "sha256-MsAXHfxLNlIK/PbtVTjvBN1Jk3dyGEkfpj3/98nExj4=";
|
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"
|
|
|
|
];
|
|
|
|
checkInputs = lib.optionals (pythonSupport) [
|
|
|
|
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
|
|
|
})
|