diff options
Diffstat (limited to 'pkgs/development/python-modules/mujoco/default.nix')
-rw-r--r-- | pkgs/development/python-modules/mujoco/default.nix | 92 |
1 files changed, 52 insertions, 40 deletions
diff --git a/pkgs/development/python-modules/mujoco/default.nix b/pkgs/development/python-modules/mujoco/default.nix index 9237dbb6501ca..c7d8258e89797 100644 --- a/pkgs/development/python-modules/mujoco/default.nix +++ b/pkgs/development/python-modules/mujoco/default.nix @@ -1,23 +1,24 @@ -{ absl-py -, buildPythonPackage -, cmake -, etils -, fetchPypi -, glfw -, lib -, mujoco -, numpy -, perl -, pybind11 -, pyopengl -, python -, setuptools -, stdenv +{ + absl-py, + buildPythonPackage, + cmake, + etils, + fetchPypi, + glfw, + lib, + mujoco, + numpy, + perl, + pybind11, + pyopengl, + python, + setuptools, + stdenv, }: buildPythonPackage rec { pname = "mujoco"; - version = "3.1.4"; + inherit (mujoco) version; pyproject = true; @@ -27,12 +28,18 @@ buildPythonPackage rec { # in the project's CI. src = fetchPypi { inherit pname version; - hash = "sha256-GdeL1zMri/ArjXyjXTgan48WVPTHDA1/SZxtTYB8QFk="; + hash = "sha256-fPiIdSbwcedBHcAs4c1mXjm0tgg/3/Sf4TSKgtIxRlE="; }; - nativeBuildInputs = [ cmake setuptools ]; + nativeBuildInputs = [ + cmake + setuptools + ]; dontUseCmakeConfigure = true; - buildInputs = [ mujoco pybind11 ]; + buildInputs = [ + mujoco + pybind11 + ]; propagatedBuildInputs = [ absl-py etils @@ -53,31 +60,36 @@ buildPythonPackage rec { preConfigure = # Use non-system eigen3, lodepng, abseil: Remove mirror info and prefill # dependency directory. $build from setuptools. - (let - # E.g. 3.11.2 -> "311" - pythonVersionMajorMinor = with lib.versions; - "${major python.pythonVersion}${minor python.pythonVersion}"; + ( + let + # E.g. 3.11.2 -> "311" + pythonVersionMajorMinor = + with lib.versions; + "${major python.pythonVersion}${minor python.pythonVersion}"; - # E.g. "linux-aarch64" - platform = with stdenv.hostPlatform.parsed; - "${kernel.name}-${cpu.name}"; - in '' - ${perl}/bin/perl -0777 -i -pe "s/GIT_REPO\n.*\n.*GIT_TAG\n.*\n//gm" mujoco/CMakeLists.txt - ${perl}/bin/perl -0777 -i -pe "s/(FetchContent_Declare\(\n.*lodepng\n.*)(GIT_REPO.*\n.*GIT_TAG.*\n)(.*\))/\1\3/gm" mujoco/simulate/CMakeLists.txt + # E.g. "linux-aarch64" + platform = with stdenv.hostPlatform.parsed; "${kernel.name}-${cpu.name}"; + in + '' + ${perl}/bin/perl -0777 -i -pe "s/GIT_REPO\n.*\n.*GIT_TAG\n.*\n//gm" mujoco/CMakeLists.txt + ${perl}/bin/perl -0777 -i -pe "s/(FetchContent_Declare\(\n.*lodepng\n.*)(GIT_REPO.*\n.*GIT_TAG.*\n)(.*\))/\1\3/gm" mujoco/simulate/CMakeLists.txt - build="/build/${pname}-${version}/build/temp.${platform}-cpython-${pythonVersionMajorMinor}/" - mkdir -p $build/_deps - ln -s ${mujoco.pin.lodepng} $build/_deps/lodepng-src - ln -s ${mujoco.pin.eigen3} $build/_deps/eigen-src - ln -s ${mujoco.pin.abseil-cpp} $build/_deps/abseil-cpp-src - ''); + build="/build/${pname}-${version}/build/temp.${platform}-cpython-${pythonVersionMajorMinor}/" + mkdir -p $build/_deps + ln -s ${mujoco.pin.lodepng} $build/_deps/lodepng-src + ln -s ${mujoco.pin.eigen3} $build/_deps/eigen-src + ln -s ${mujoco.pin.abseil-cpp} $build/_deps/abseil-cpp-src + '' + ); - meta = with lib; { - description = - "Python bindings for MuJoCo: a general purpose physics simulator."; + meta = { + description = "Python bindings for MuJoCo: a general purpose physics simulator"; homepage = "https://mujoco.org/"; changelog = "https://github.com/google-deepmind/mujoco/releases/tag/${version}"; - license = licenses.asl20; - maintainers = with maintainers; [ tmplt ]; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ + GaetanLepage + tmplt + ]; }; } |