From c3cc52fe6bd57b56ee5a871b8f2ecf7f5fc859c6 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 4 Sep 2024 14:24:05 +0200 Subject: [PATCH 1/2] eigenrand: init at 0.5.1 Co-authored-by: Aleksana --- pkgs/by-name/ei/eigenrand/package.nix | 48 +++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 pkgs/by-name/ei/eigenrand/package.nix diff --git a/pkgs/by-name/ei/eigenrand/package.nix b/pkgs/by-name/ei/eigenrand/package.nix new file mode 100644 index 000000000000..d3014ff9d75f --- /dev/null +++ b/pkgs/by-name/ei/eigenrand/package.nix @@ -0,0 +1,48 @@ +{ + cmake, + eigen, + fetchFromGitHub, + gtest, + lib, + stdenv, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "eigenrand"; + version = "0.5.1"; + + src = fetchFromGitHub { + owner = "bab2min"; + repo = "EigenRand"; + rev = "v${finalAttrs.version}"; + hash = "sha256-mrpkWIb6kfLvppmIfzhjF1/3m1zSd8XG1D07V6Zjlu0="; + }; + + # Avoid downloading googletest: we already have it. + postPatch = '' + substituteInPlace CMakeLists.txt --replace-fail \ + "FetchContent_MakeAvailable(googletest)" \ + "add_subdirectory(${gtest.src} googletest SYSTEM)" + ''; + + postInstall = '' + # Remove installed tests and googletest stuff + rm -rf $out/bin $out/include/gmock $out/include/gtest $out/lib + ''; + + nativeBuildInputs = [ cmake ]; + propagatedBuildInputs = [ eigen ]; + checkInputs = [ gtest ]; + + doCheck = true; + + cmakeFlags = [ "-DCMAKE_CTEST_ARGUMENTS=--exclude-regex;EigenRand-test" ]; + + meta = { + description = "Fastest Random Distribution Generator for Eigen"; + homepage = "https://github.com/bab2min/EigenRand"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ nim65s ]; + platforms = lib.platforms.unix; + }; +}) From 9b16fe5f70ba1cbc3e3e66db5522b99d86d358e1 Mon Sep 17 00:00:00 2001 From: Guilhem Saurel Date: Wed, 4 Sep 2024 13:59:26 +0200 Subject: [PATCH 2/2] proxsuite-nlp: init at 0.7.1 Co-authored-by: Aleksana --- pkgs/by-name/pr/proxsuite-nlp/package.nix | 95 +++++++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 97 insertions(+) create mode 100644 pkgs/by-name/pr/proxsuite-nlp/package.nix diff --git a/pkgs/by-name/pr/proxsuite-nlp/package.nix b/pkgs/by-name/pr/proxsuite-nlp/package.nix new file mode 100644 index 000000000000..234cc93febc7 --- /dev/null +++ b/pkgs/by-name/pr/proxsuite-nlp/package.nix @@ -0,0 +1,95 @@ +{ + cmake, + doxygen, + eigenrand, + example-robot-data, + fetchFromGitHub, + fetchpatch, + fmt, + fontconfig, + graphviz, + lib, + stdenv, + pinocchio, + pkg-config, + proxsuite, + python3Packages, + pythonSupport ? false, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "proxsuite-nlp"; + version = "0.7.1"; + + src = fetchFromGitHub { + owner = "Simple-Robotics"; + repo = "proxsuite-nlp"; + rev = "v${finalAttrs.version}"; + hash = "sha256-aMTEjAu1ltjorx5vhz7klB0cGgdm+7STAPhi+NA6mnI="; + }; + + outputs = [ + "doc" + "out" + ]; + + patches = [ + # Fix use of system jrl-cmakemodules + # This patch was merged upstream and can be removed on next release + (fetchpatch { + url = "https://github.com/Simple-Robotics/proxsuite-nlp/pull/106/commits/c653ab67860fdf7b53b1a919f0b8a7746eba016b.patch"; + hash = "sha256-Kw2obJGOWms/Lr4cVkLFpaLTickCq5WQyDVbwi8Bd58="; + }) + # Fix use of system EigenRand + # This patch was merged upstream and can be removed on next release + (fetchpatch { + url = "https://github.com/Simple-Robotics/proxsuite-nlp/pull/106/commits/25370417755f003708b5b2b81e253797e8d96928.patch"; + hash = "sha256-PKijVmttt5JakF3X/GiVWptncxHJUbs/aikgwgB5NME="; + }) + ]; + + nativeBuildInputs = [ + cmake + doxygen + graphviz + pkg-config + ] ++ lib.optional pythonSupport python3Packages.pythonImportsCheckHook; + checkInputs = [ eigenrand ] ++ lib.optional pythonSupport python3Packages.pytest; + propagatedBuildInputs = + [ + example-robot-data + fmt + ] + ++ lib.optionals pythonSupport [ + python3Packages.pinocchio + python3Packages.proxsuite + ] + ++ lib.optionals (!pythonSupport) [ + pinocchio + proxsuite + ]; + + cmakeFlags = [ + (lib.cmakeBool "BUILD_PYTHON_INTERFACE" pythonSupport) + (lib.cmakeBool "BUILD_WITH_PINOCCHIO_SUPPORT" true) + (lib.cmakeBool "BUILD_WITH_PROXSUITE_SUPPORT" true) + ]; + + # 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 = [ "proxsuite_nlp" ]; + + meta = { + description = "Primal-dual augmented Lagrangian solver for nonlinear programming on manifolds"; + homepage = "https://github.com/Simple-Robotics/proxsuite-nlp"; + changelog = "https://github.com/Simple-Robotics/proxsuite-nlp/blob/v${finalAttrs.version}/CHANGELOG.md"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ nim65s ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 1390548108c6..d77636d23440 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10017,6 +10017,8 @@ self: super: with self; { proxsuite = toPythonModule (pkgs.proxsuite.override { pythonSupport = true; python3Packages = self; }); + proxsuite-nlp = toPythonModule (pkgs.proxsuite-nlp.override { pythonSupport = true; python3Packages = self; }); + proxy-tools = callPackage ../development/python-modules/proxy-tools { }; proxy-db = callPackage ../development/python-modules/proxy-db { };