Commit 73f6b8ac authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

pinocchio: add casadiSupport

parent 7c9c23c5
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -2,10 +2,12 @@
, stdenv
, fetchFromGitHub
, fetchpatch
, casadi
, cmake
, boost
, eigen
, example-robot-data
, casadiSupport ? !stdenv.isDarwin
, collisionSupport ? true
, console-bridge
, jrl-cmakemodules
@@ -41,11 +43,14 @@ stdenv.mkDerivation (finalAttrs: {
    })
  ];

  postPatch = ''
    # example-robot-data models are used in checks.
    # Upstream provide them as git submodule, but we can use our own version instead.
  postPatch = ''
    rmdir models/example-robot-data
    ln -s ${example-robot-data.src} models/example-robot-data

    # allow package:// uri use in examples
    export ROS_PACKAGE_PATH=${example-robot-data}/share
  '';

  # CMAKE_BUILD_TYPE defaults to Release in this package,
@@ -75,11 +80,18 @@ stdenv.mkDerivation (finalAttrs: {
    python3Packages.eigenpy
  ] ++ lib.optionals (pythonSupport && collisionSupport) [
    python3Packages.hpp-fcl
  ] ++ lib.optionals (!pythonSupport && casadiSupport) [
    casadi
  ] ++ lib.optionals (pythonSupport && casadiSupport) [
    python3Packages.casadi
  ];

  checkInputs = lib.optionals (pythonSupport && casadiSupport) [ python3Packages.matplotlib ];

  cmakeFlags = [
    (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport)
    (lib.cmakeBool "BUILD_WITH_LIBPYTHON" pythonSupport)
    (lib.cmakeBool "BUILD_WITH_CASADI_SUPPORT" casadiSupport)
    (lib.cmakeBool "BUILD_WITH_COLLISION_SUPPORT" collisionSupport)
  ];