about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/crocoddyl
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/crocoddyl')
-rw-r--r--nixpkgs/pkgs/development/libraries/crocoddyl/default.nix65
1 files changed, 65 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/crocoddyl/default.nix b/nixpkgs/pkgs/development/libraries/crocoddyl/default.nix
new file mode 100644
index 000000000000..efba13612298
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/crocoddyl/default.nix
@@ -0,0 +1,65 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, example-robot-data
+, pinocchio
+, pythonSupport ? false
+, python3Packages
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "crocoddyl";
+  version = "2.0.2";
+
+  src = fetchFromGitHub {
+    owner = "loco-3d";
+    repo = finalAttrs.pname;
+    rev = "v${finalAttrs.version}";
+    fetchSubmodules = true;
+    hash = "sha256-MsAXHfxLNlIK/PbtVTjvBN1Jk3dyGEkfpj3/98nExj4=";
+  };
+
+  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"
+  ];
+
+  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
+  ];
+
+  meta = with lib; {
+    description = "Crocoddyl optimal control library";
+    homepage = "https://github.com/loco-3d/crocoddyl";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ nim65s wegank ];
+    platforms = platforms.unix;
+  };
+})