Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.9 KiB
Nix
Raw Permalink Normal View History

{
cmake,
crocoddyl,
fetchFromGitHub,
lib,
llvmPackages,
pkg-config,
proxsuite,
python3Packages,
pythonSupport ? false,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mim-solvers";
2025-03-21 19:24:48 +00:00
version = "0.1.0";
src = fetchFromGitHub {
owner = "machines-in-motion";
repo = "mim_solvers";
rev = "v${finalAttrs.version}";
2025-03-21 19:24:48 +00:00
hash = "sha256-jUL/kyXKODpcCURG7e7/qNarvwm4+EnzZRL2Wix5Jbs=";
};
# eigenpy is not used without python support
postPatch = lib.optionalString (!pythonSupport) ''
substituteInPlace CMakeLists.txt --replace-fail \
"add_project_dependency(eigenpy 2.7.10 REQUIRED)" \
""
'';
nativeBuildInputs = [
cmake
pkg-config
]
++ lib.optional pythonSupport python3Packages.pythonImportsCheckHook;
buildInputs = lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
propagatedBuildInputs =
lib.optionals pythonSupport [
python3Packages.crocoddyl
python3Packages.osqp
python3Packages.proxsuite
python3Packages.scipy
]
++ lib.optionals (!pythonSupport) [
crocoddyl
proxsuite
];
cmakeFlags = [
(lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport)
(lib.cmakeBool "BUILD_WITH_PROXSUITE" true)
]
++ lib.optional (stdenv.hostPlatform.isDarwin) (
lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'py-test-clqr-osqp'"
)
++ lib.optional (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) (
lib.cmakeFeature "CMAKE_CTEST_ARGUMENTS" "--exclude-regex;'test_solvers'"
);
doCheck = true;
pythonImportsCheck = [ "mim_solvers" ];
meta = {
description = "Numerical solvers used in the Machines in Motion Laboratory";
homepage = "https://github.com/machines-in-motion/mim_solvers";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ nim65s ];
platforms = lib.platforms.all;
};
})