mujoco: init at 2.3.0 (#198145)

* mujoco: init at 2.3.0

* mujoco: refactor `meta`

Co-authored-by: Florian <florian.brandes@posteo.de>

Co-authored-by: Florian <florian.brandes@posteo.de>

authored by Samuel Ainsworth Florian and committed by GitHub b647155e e5900ddf

+238
+122
pkgs/applications/science/robotics/mujoco/default.nix
··· 1 + { cmake 2 + , fetchFromGitHub 3 + , fetchFromGitLab 4 + , git 5 + , lib 6 + , libGL 7 + , stdenv 8 + , xorg 9 + }: 10 + 11 + let 12 + # See https://github.com/deepmind/mujoco/blob/573d331b69845c5d651b70f5d1b0f3a0d2a3a233/cmake/MujocoDependencies.cmake#L21-L59 13 + abseil-cpp = fetchFromGitHub { 14 + owner = "abseil"; 15 + repo = "abseil-cpp"; 16 + rev = "8c0b94e793a66495e0b1f34a5eb26bd7dc672db0"; 17 + hash = "sha256-Od1FZOOWEXVQsnZBwGjDIExi6LdYtomyL0STR44SsG8="; 18 + }; 19 + benchmark = fetchFromGitHub { 20 + owner = "google"; 21 + repo = "benchmark"; 22 + rev = "d845b7b3a27d54ad96280a29d61fa8988d4fddcf"; 23 + hash = "sha256-XTnTM1k6xMGXUws/fKdJUbpCPcc4U0IelL6BPEEnpEQ="; 24 + }; 25 + ccd = fetchFromGitHub { 26 + owner = "danfis"; 27 + repo = "libccd"; 28 + rev = "7931e764a19ef6b21b443376c699bbc9c6d4fba8"; 29 + hash = "sha256-TIZkmqQXa0+bSWpqffIgaBela0/INNsX9LPM026x1Wk="; 30 + }; 31 + eigen3 = fetchFromGitLab { 32 + owner = "libeigen"; 33 + repo = "eigen"; 34 + rev = "3bb6a48d8c171cf20b5f8e48bfb4e424fbd4f79e"; 35 + hash = "sha256-k71DoEsx8JpC9AlQ0cCRI0fWMIWFBFL/Yscx+2iBtNM="; 36 + }; 37 + googletest = fetchFromGitHub { 38 + owner = "google"; 39 + repo = "googletest"; 40 + rev = "58d77fa8070e8cec2dc1ed015d66b454c8d78850"; 41 + hash = "sha256-W+OxRTVtemt2esw4P7IyGWXOonUN5ZuscjvzqkYvZbM="; 42 + }; 43 + lodepng = fetchFromGitHub { 44 + owner = "lvandeve"; 45 + repo = "lodepng"; 46 + rev = "b4ed2cd7ecf61d29076169b49199371456d4f90b"; 47 + hash = "sha256-5cCkdj/izP4e99BKfs/Mnwu9aatYXjlyxzzYiMD/y1M="; 48 + }; 49 + qhull = fetchFromGitHub { 50 + owner = "qhull"; 51 + repo = "qhull"; 52 + rev = "3df027b91202cf179f3fba3c46eebe65bbac3790"; 53 + hash = "sha256-aHO5n9Y35C7/zb3surfMyjyMjo109DoZnkozhiAKpYQ="; 54 + }; 55 + tinyobjloader = fetchFromGitHub { 56 + owner = "tinyobjloader"; 57 + repo = "tinyobjloader"; 58 + rev = "1421a10d6ed9742f5b2c1766d22faa6cfbc56248"; 59 + hash = "sha256-9z2Ne/WPCiXkQpT8Cun/pSGUwgClYH+kQ6Dx1JvW6w0="; 60 + }; 61 + tinyxml2 = fetchFromGitHub { 62 + owner = "leethomason"; 63 + repo = "tinyxml2"; 64 + rev = "1dee28e51f9175a31955b9791c74c430fe13dc82"; 65 + hash = "sha256-AQQOctXi7sWIH/VOeSUClX6hlm1raEQUOp+VoPjLM14="; 66 + }; 67 + 68 + # See https://github.com/deepmind/mujoco/blob/573d331b69845c5d651b70f5d1b0f3a0d2a3a233/simulate/cmake/SimulateDependencies.cmake#L32-L35 69 + glfw = fetchFromGitHub { 70 + owner = "glfw"; 71 + repo = "glfw"; 72 + rev = "7482de6071d21db77a7236155da44c172a7f6c9e"; 73 + hash = "sha256-4+H0IXjAwbL5mAWfsIVhW0BSJhcWjkQx4j2TrzZ3aIo="; 74 + }; 75 + in 76 + stdenv.mkDerivation rec { 77 + pname = "mujoco"; 78 + version = "2.3.0"; 79 + 80 + src = fetchFromGitHub { 81 + owner = "deepmind"; 82 + repo = pname; 83 + rev = version; 84 + hash = "sha256-FxMaXl7yfUAyY6LE1sxaw226dBtp1DOCWNnROp0WX2I="; 85 + }; 86 + 87 + patches = [ ./dependencies.patch ]; 88 + 89 + nativeBuildInputs = [ cmake git ]; 90 + 91 + buildInputs = [ 92 + libGL 93 + xorg.libX11 94 + xorg.libXcursor 95 + xorg.libXext 96 + xorg.libXi 97 + xorg.libXinerama 98 + xorg.libXrandr 99 + ]; 100 + 101 + # Move things into place so that cmake doesn't try downloading dependencies. 102 + preConfigure = '' 103 + mkdir -p build/_deps 104 + ln -s ${abseil-cpp} build/_deps/abseil-cpp-src 105 + ln -s ${benchmark} build/_deps/benchmark-src 106 + ln -s ${ccd} build/_deps/ccd-src 107 + ln -s ${eigen3} build/_deps/eigen3-src 108 + ln -s ${glfw} build/_deps/glfw-src 109 + ln -s ${googletest} build/_deps/googletest-src 110 + ln -s ${lodepng} build/_deps/lodepng-src 111 + ln -s ${qhull} build/_deps/qhull-src 112 + ln -s ${tinyobjloader} build/_deps/tinyobjloader-src 113 + ln -s ${tinyxml2} build/_deps/tinyxml2-src 114 + ''; 115 + 116 + meta = with lib; { 117 + description = "Multi-Joint dynamics with Contact. A general purpose physics simulator."; 118 + homepage = "https://mujoco.org/"; 119 + license = licenses.asl20; 120 + maintainers = with maintainers; [ samuela ]; 121 + }; 122 + }
+114
pkgs/applications/science/robotics/mujoco/dependencies.patch
··· 1 + diff --git a/cmake/MujocoDependencies.cmake b/cmake/MujocoDependencies.cmake 2 + index 99e4a7a..cf9a901 100644 3 + --- a/cmake/MujocoDependencies.cmake 4 + +++ b/cmake/MujocoDependencies.cmake 5 + @@ -82,8 +82,6 @@ set(BUILD_SHARED_LIBS 6 + if(NOT TARGET lodepng) 7 + FetchContent_Declare( 8 + lodepng 9 + - GIT_REPOSITORY https://github.com/lvandeve/lodepng.git 10 + - GIT_TAG ${MUJOCO_DEP_VERSION_lodepng} 11 + ) 12 + 13 + FetchContent_GetProperties(lodepng) 14 + @@ -111,10 +109,6 @@ findorfetch( 15 + qhull 16 + LIBRARY_NAME 17 + qhull 18 + - GIT_REPO 19 + - https://github.com/qhull/qhull.git 20 + - GIT_TAG 21 + - ${MUJOCO_DEP_VERSION_qhull} 22 + TARGETS 23 + qhull 24 + # TODO(fraromano) Remove when https://github.com/qhull/qhull/pull/112 is merged. 25 + @@ -146,10 +140,6 @@ findorfetch( 26 + tinyxml2 27 + LIBRARY_NAME 28 + tinyxml2 29 + - GIT_REPO 30 + - https://github.com/leethomason/tinyxml2.git 31 + - GIT_TAG 32 + - ${MUJOCO_DEP_VERSION_tinyxml2} 33 + TARGETS 34 + tinyxml2 35 + EXCLUDE_FROM_ALL 36 + @@ -164,10 +154,6 @@ findorfetch( 37 + tinyobjloader 38 + LIBRARY_NAME 39 + tinyobjloader 40 + - GIT_REPO 41 + - https://github.com/tinyobjloader/tinyobjloader.git 42 + - GIT_TAG 43 + - ${MUJOCO_DEP_VERSION_tinyobjloader} 44 + TARGETS 45 + tinyobjloader 46 + EXCLUDE_FROM_ALL 47 + @@ -182,10 +168,6 @@ findorfetch( 48 + ccd 49 + LIBRARY_NAME 50 + ccd 51 + - GIT_REPO 52 + - https://github.com/danfis/libccd.git 53 + - GIT_TAG 54 + - ${MUJOCO_DEP_VERSION_ccd} 55 + TARGETS 56 + ccd 57 + EXCLUDE_FROM_ALL 58 + @@ -222,10 +204,6 @@ if(MUJOCO_BUILD_TESTS) 59 + absl 60 + LIBRARY_NAME 61 + abseil-cpp 62 + - GIT_REPO 63 + - https://github.com/abseil/abseil-cpp.git 64 + - GIT_TAG 65 + - ${MUJOCO_DEP_VERSION_abseil} 66 + TARGETS 67 + absl::core_headers 68 + EXCLUDE_FROM_ALL 69 + @@ -249,10 +227,6 @@ if(MUJOCO_BUILD_TESTS) 70 + GTest 71 + LIBRARY_NAME 72 + googletest 73 + - GIT_REPO 74 + - https://github.com/google/googletest.git 75 + - GIT_TAG 76 + - ${MUJOCO_DEP_VERSION_gtest} 77 + TARGETS 78 + gtest 79 + gmock 80 + @@ -283,10 +257,6 @@ if(MUJOCO_BUILD_TESTS) 81 + benchmark 82 + LIBRARY_NAME 83 + benchmark 84 + - GIT_REPO 85 + - https://github.com/google/benchmark.git 86 + - GIT_TAG 87 + - ${MUJOCO_DEP_VERSION_benchmark} 88 + TARGETS 89 + benchmark::benchmark 90 + benchmark::benchmark_main 91 + @@ -303,8 +273,6 @@ if(MUJOCO_TEST_PYTHON_UTIL) 92 + 93 + FetchContent_Declare( 94 + Eigen3 95 + - GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git 96 + - GIT_TAG ${MUJOCO_DEP_VERSION_Eigen3} 97 + ) 98 + 99 + FetchContent_GetProperties(Eigen3) 100 + diff --git a/simulate/cmake/SimulateDependencies.cmake b/simulate/cmake/SimulateDependencies.cmake 101 + index 6616d6f..5d5a889 100644 102 + --- a/simulate/cmake/SimulateDependencies.cmake 103 + +++ b/simulate/cmake/SimulateDependencies.cmake 104 + @@ -81,10 +81,6 @@ findorfetch( 105 + glfw 106 + LIBRARY_NAME 107 + glfw 108 + - GIT_REPO 109 + - https://github.com/glfw/glfw.git 110 + - GIT_TAG 111 + - ${MUJOCO_DEP_VERSION_glfw} 112 + TARGETS 113 + glfw 114 + EXCLUDE_FROM_ALL
+2
pkgs/top-level/all-packages.nix
··· 21229 21229 21230 21230 mueval = callPackage ../development/tools/haskell/mueval { }; 21231 21231 21232 + mujoco = callPackage ../applications/science/robotics/mujoco { }; 21233 + 21232 21234 muparser = callPackage ../development/libraries/muparser { 21233 21235 inherit (darwin.stubs) setfile; 21234 21236 };