Unverified Commit bcee2432 authored by Weijia Wang's avatar Weijia Wang Committed by GitHub
Browse files

aligator: init at 0.8.0 (#342751)

parents c3c413a5 5108a107
Loading
Loading
Loading
Loading
+97 −0
Original line number Diff line number Diff line
{
  cmake,
  crocoddyl,
  doxygen,
  fetchFromGitHub,
  fmt,
  fontconfig,
  gbenchmark,
  graphviz,
  lib,
  llvmPackages, # llvm/Support/Host.h required by casadi 3.6.5 and not available in llvm 18
  pinocchio,
  pkg-config,
  proxsuite-nlp,
  python3Packages,
  pythonSupport ? false,
  stdenv,
  suitesparse,
}:

stdenv.mkDerivation (finalAttrs: {
  pname = "aligator";
  version = "0.8.0";

  src = fetchFromGitHub {
    owner = "Simple-Robotics";
    repo = "aligator";
    rev = "v${finalAttrs.version}";
    hash = "sha256-o4QjxTaZUa17hZsCv4hCI2cedaHoojBtLe8SVUkl0bo=";
  };

  outputs = [
    "doc"
    "out"
  ];

  strictDeps = true;

  nativeBuildInputs = [
    doxygen
    cmake
    graphviz
    pkg-config
  ] ++ lib.optional pythonSupport python3Packages.pythonImportsCheckHook;
  buildInputs = [ fmt ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
  propagatedBuildInputs =
    [ suitesparse ]
    ++ lib.optionals pythonSupport [
      python3Packages.crocoddyl
      python3Packages.matplotlib
      python3Packages.pinocchio
      python3Packages.proxsuite-nlp
    ]
    ++ lib.optionals (!pythonSupport) [
      crocoddyl
      pinocchio
      proxsuite-nlp
    ];
  checkInputs =
    [ gbenchmark ]
    ++ lib.optionals pythonSupport [
      python3Packages.matplotlib
      python3Packages.pytest
    ];

  cmakeFlags =
    [
      (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport)
      (lib.cmakeBool "BUILD_WITH_PINOCCHIO_SUPPORT" true)
      (lib.cmakeBool "BUILD_CROCODDYL_COMPAT" true)
      (lib.cmakeBool "BUILD_WITH_OPENMP_SUPPORT" true)
      (lib.cmakeBool "BUILD_WITH_CHOLMOD_SUPPORT" true)
      (lib.cmakeBool "GENERATE_PYTHON_STUBS" false) # this need git at configure time
    ]
    ++ lib.optionals (stdenv.hostPlatform.isDarwin && pythonSupport) [
      # ignore one failing test for now
      (lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;aligator-test-py-integrators")
    ];

  # Fontconfig error: Cannot load default config file: No such file: (null)
  env.FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";

  # Fontconfig error: No writable cache directories
  preBuild = "export XDG_CACHE_HOME=$(mktemp -d)";

  doCheck = true;
  pythonImportsCheck = [ "aligator" ];

  meta = {
    description = "Versatile and efficient framework for constrained trajectory optimization";
    homepage = "https://github.com/Simple-Robotics/aligator";
    changelog = "https://github.com/Simple-Robotics/aligator/blob/v${finalAttrs.version}/CHANGELOG.md";
    license = lib.licenses.bsd2;
    maintainers = with lib.maintainers; [ nim65s ];
    platforms = lib.platforms.unix;
  };
})
+89 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, cmake
, example-robot-data
, pinocchio
, pythonSupport ? false
, python3Packages
{
  blas,
  cmake,
  doxygen,
  example-robot-data,
  fetchFromGitHub,
  ipopt,
  lapack,
  lib,
  pinocchio,
  pkg-config,
  pythonSupport ? false,
  python3Packages,
  stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -19,47 +25,65 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-SVV9sleDXLm2QJmNgL25XLHC3y5bfKab4GSlE8jbT8w=";
  };

  outputs = [
    "out"
    "doc"
  ];

  strictDeps = true;

  nativeBuildInputs = [
  nativeBuildInputs =
    [
      cmake
  ] ++ lib.optionals pythonSupport [
      doxygen
      pkg-config
    ]
    ++ lib.optionals pythonSupport [
      python3Packages.python
      python3Packages.pythonImportsCheckHook
    ];

  propagatedBuildInputs = lib.optionals (!pythonSupport) [
  propagatedBuildInputs =
    [
      blas
      ipopt
      lapack
    ]
    ++ lib.optionals (!pythonSupport) [
      example-robot-data
      pinocchio
  ] ++ lib.optionals pythonSupport [
    ]
    ++ lib.optionals pythonSupport [
      python3Packages.example-robot-data
      python3Packages.pinocchio
      python3Packages.scipy
    ];

  cmakeFlags = lib.optionals (!pythonSupport) [
    "-DBUILD_EXAMPLES=OFF"
    "-DBUILD_PYTHON_INTERFACE=OFF"
  cmakeFlags = [
    (lib.cmakeBool "INSTALL_DOCUMENTATION" true)
    (lib.cmakeBool "BUILD_EXAMPLES" pythonSupport)
    (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport)
  ];

  prePatch = ''
    substituteInPlace \
      examples/CMakeLists.txt \
      examples/log/check_logfiles.sh \
      --replace /bin/bash ${stdenv.shell}
      --replace-fail /bin/bash ${stdenv.shell}
  '';

  doCheck = true;
  pythonImportsCheck = [
    "crocoddyl"
  ];
  checkInputs = lib.optionals pythonSupport [
    python3Packages.scipy
  ];
  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 ];
    maintainers = with maintainers; [
      nim65s
      wegank
    ];
    platforms = platforms.unix;
  };
})
+10 −0
Original line number Diff line number Diff line
{
  boost,
  cmake,
  doxygen,
  eigen,
  fetchFromGitHub,
  jrl-cmakemodules,
  lib,
  pkg-config,
  stdenv,
}:

@@ -19,8 +21,15 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-VqRx06sCCZrnB+NWm6Z9OMKzjKQIydGgKQU6fMY7phk=";
  };

  outputs = [
    "out"
    "doc"
  ];

  nativeBuildInputs = [
    cmake
    doxygen
    pkg-config
    jrl-cmakemodules
  ];
  propagatedBuildInputs = [ eigen ];
@@ -34,5 +43,6 @@ stdenv.mkDerivation (finalAttrs: {
    changelog = "https://github.com/stack-of-tasks/eiquadprog/blob/v${finalAttrs.version}/CHANGELOG.md";
    license = lib.licenses.gpl3Only;
    maintainers = with lib.maintainers; [ nim65s ];
    platforms = lib.platforms.unix;
  };
})
+32 −22
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, pythonSupport ? false
, python3Packages
{
  cmake,
  doxygen,
  fetchFromGitHub,
  fetchpatch,
  lib,
  pkg-config,
  pythonSupport ? false,
  python3Packages,
  stdenv,
}:

stdenv.mkDerivation (finalAttrs: {
@@ -19,6 +22,11 @@ stdenv.mkDerivation (finalAttrs: {
    hash = "sha256-Heq+c8SSYNO8ksTv5FphRBRStlTakm9T66jlPXon5tI=";
  };

  outputs = [
    "out"
    "doc"
  ];

  strictDeps = true;

  patches = [
@@ -31,34 +39,36 @@ stdenv.mkDerivation (finalAttrs: {
    })
  ];

  nativeBuildInputs = [
  nativeBuildInputs =
    [
      cmake
  ] ++ lib.optionals pythonSupport [
      doxygen
      pkg-config
    ]
    ++ lib.optionals pythonSupport [
      python3Packages.python
      python3Packages.pythonImportsCheckHook
    ];

  buildInputs = lib.optionals pythonSupport [
    python3Packages.pinocchio
  ];
  propagatedBuildInputs = lib.optionals pythonSupport [ python3Packages.pinocchio ];

  cmakeFlags = lib.optionals (!pythonSupport) [
    "-DBUILD_PYTHON_INTERFACE=OFF"
  ];
  cmakeFlags = [ (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) ];

  doCheck = true;
  # The package expect to find an `example-robot-data/robots` folder somewhere
  # either in install prefix or in the sources
  # where it can find the meshes for unit tests
  preCheck = "ln -s source ../../${finalAttrs.pname}";
  pythonImportsCheck = [
    "example_robot_data"
  ];
  pythonImportsCheck = [ "example_robot_data" ];

  meta = with lib; {
    description = "Set of robot URDFs for benchmarking and developed examples";
    homepage = "https://github.com/Gepetto/example-robot-data";
    license = licenses.bsd3;
    maintainers = with maintainers; [ nim65s wegank ];
    maintainers = with maintainers; [
      nim65s
      wegank
    ];
    platforms = platforms.unix;
  };
})
+11 −9
Original line number Diff line number Diff line
@@ -28,10 +28,15 @@ stdenv.mkDerivation (finalAttrs: {

  strictDeps = true;

  nativeBuildInputs = [
  nativeBuildInputs =
    [
      cmake
      doxygen
  ] ++ lib.optionals pythonSupport [ python3Packages.numpy ];
    ]
    ++ lib.optionals pythonSupport [
      python3Packages.numpy
      python3Packages.pythonImportsCheckHook
    ];

  propagatedBuildInputs =
    [
@@ -56,11 +61,7 @@ stdenv.mkDerivation (finalAttrs: {
  ];

  doCheck = true;
  # pythonImportsCheck, but in stdenv.mkDerivation
  postInstall = lib.optionalString pythonSupport ''
    PYTHONPATH=$out/${python3Packages.python.sitePackages}:$PYTHONPATH
    python -c "import hppfcl"
  '';
  pythonImportsCheck = [ "hppfcl" ];

  outputs = [
    "dev"
@@ -77,5 +78,6 @@ stdenv.mkDerivation (finalAttrs: {
    homepage = "https://github.com/humanoid-path-planner/hpp-fcl";
    license = lib.licenses.bsd3;
    maintainers = with lib.maintainers; [ nim65s ];
    platforms = lib.platforms.unix;
  };
})
Loading