summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name2022-05-23 23:08:39 +0800
committerYour Name2022-05-23 23:08:39 +0800
commitb59879feda53f62230b21c3040f6fb0cc05cf538 (patch)
tree77040ff5a750baa0449f607f027ffd8331f2b33c
downloadaur-b59879feda53f62230b21c3040f6fb0cc05cf538.tar.gz
Pack mujoco
-rw-r--r--.SRCINFO23
-rw-r--r--PKGBUILD39
-rw-r--r--mujoco.patch98
3 files changed, 160 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..1f89881683e0
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,23 @@
+pkgbase = mujoco
+ pkgdesc = Multi-Joint dynamics with Contact. A general purpose physics simulator.
+ pkgver = 2.2.0
+ pkgrel = 1
+ url = https://www.mujoco.org
+ arch = x86_64
+ license = Apache
+ makedepends = libccd
+ makedepends = abseil-cpp
+ makedepends = gtest
+ makedepends = benchmark
+ makedepends = cmake
+ makedepends = git
+ depends = libgl
+ depends = glfw
+ depends = tinyxml2
+ depends = tinyobjloader
+ source = https://github.com/deepmind/mujoco/archive/refs/tags/2.2.0.tar.gz
+ source = mujoco.patch
+ sha256sums = 5bd3847aca1f53e2467b680f797fe74ce6a1c20870e0fee534cfda38a25ea1d5
+ sha256sums = fa5799290dd68bd2bdd520515484112c3a72079af6425ee6d01b6865e81bdab1
+
+pkgname = mujoco
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..9043721c73ef
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,39 @@
+pkgname=mujoco
+pkgver=2.2.0
+pkgrel=1
+pkgdesc="Multi-Joint dynamics with Contact. A general purpose physics simulator."
+arch=('x86_64')
+url="https://www.mujoco.org"
+license=('Apache')
+depends=('libgl' 'glfw' 'tinyxml2' 'tinyobjloader')
+makedepends=('libccd' 'abseil-cpp' 'gtest' 'benchmark' 'cmake' 'git')
+source=("https://github.com/deepmind/mujoco/archive/refs/tags/$pkgver.tar.gz"
+ "${pkgname}.patch")
+sha256sums=('5bd3847aca1f53e2467b680f797fe74ce6a1c20870e0fee534cfda38a25ea1d5'
+ 'fa5799290dd68bd2bdd520515484112c3a72079af6425ee6d01b6865e81bdab1')
+
+prepare() {
+ cd "${pkgname}-${pkgver}"
+
+ # Use as many system libs as possible
+ patch -Np1 -i "${srcdir}/${pkgname}.patch"
+}
+
+build() {
+ cd "${pkgname}-${pkgver}"
+ mkdir build
+ cd build
+ cmake .. -DCMAKE_BUILD_TYPE=Release
+
+ make
+}
+
+package() {
+ cd "${pkgname}-${pkgver}/build"
+ make DESTDIR="${pkgdir}" install
+ mv $pkgdir/usr/local/* $pkgdir/usr/
+ rmdir $pkgdir/usr/local
+ mkdir $pkgdir/usr/lib/mujoco
+ mv $pkgdir/usr/bin/* $pkgdir/usr/lib/mujoco/
+ rmdir $pkgdir/usr/bin
+}
diff --git a/mujoco.patch b/mujoco.patch
new file mode 100644
index 000000000000..739f11da6fd6
--- /dev/null
+++ b/mujoco.patch
@@ -0,0 +1,98 @@
+diff --git a/cmake/MujocoDependencies.cmake b/cmake/MujocoDependencies.cmake
+index 56a1e64..7b95bfe 100644
+--- a/cmake/MujocoDependencies.cmake
++++ b/cmake/MujocoDependencies.cmake
+@@ -141,7 +141,7 @@ target_link_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
+ set(tinyxml2_BUILD_TESTING OFF)
+ findorfetch(
+ USE_SYSTEM_PACKAGE
+- OFF
++ ON
+ PACKAGE_NAME
+ tinyxml2
+ LIBRARY_NAME
+@@ -154,12 +154,12 @@ findorfetch(
+ tinyxml2
+ EXCLUDE_FROM_ALL
+ )
+-target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
+-target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
++#target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
++#target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
+
+ findorfetch(
+ USE_SYSTEM_PACKAGE
+- OFF
++ ON
+ PACKAGE_NAME
+ tinyobjloader
+ LIBRARY_NAME
+@@ -177,7 +177,7 @@ set(ENABLE_DOUBLE_PRECISION ON)
+ set(CCD_HIDE_ALL_SYMBOLS ON)
+ findorfetch(
+ USE_SYSTEM_PACKAGE
+- OFF
++ ON
+ PACKAGE_NAME
+ ccd
+ LIBRARY_NAME
+@@ -217,7 +217,7 @@ if(MUJOCO_BUILD_TESTS)
+ set(ABSL_BUILD_TESTING OFF)
+ findorfetch(
+ USE_SYSTEM_PACKAGE
+- OFF
++ ON
+ PACKAGE_NAME
+ absl
+ LIBRARY_NAME
+@@ -244,7 +244,7 @@ if(MUJOCO_BUILD_TESTS)
+
+ findorfetch(
+ USE_SYSTEM_PACKAGE
+- OFF
++ ON
+ PACKAGE_NAME
+ GTest
+ LIBRARY_NAME
+@@ -278,7 +278,7 @@ if(MUJOCO_BUILD_TESTS)
+
+ findorfetch(
+ USE_SYSTEM_PACKAGE
+- OFF
++ ON
+ PACKAGE_NAME
+ benchmark
+ LIBRARY_NAME
+diff --git a/sample/cmake/SampleDependencies.cmake b/sample/cmake/SampleDependencies.cmake
+index 14cc943..588e788 100644
+--- a/sample/cmake/SampleDependencies.cmake
++++ b/sample/cmake/SampleDependencies.cmake
+@@ -26,8 +26,8 @@ option(MUJOCO_SAMPLES_USE_SYSTEM_MUJOCO "Use installed MuJoCo version."
+ )
+ unset(DEFAULT_USE_SYSTEM_MUJOCO)
+
+-option(MUJOCO_SAMPLES_USE_SYSTEM_MUJOCO "Use installed MuJoCo version." OFF)
+-option(MUJOCO_SAMPLES_USE_SYSTEM_GLFW "Use installed GLFW version." OFF)
++option(MUJOCO_SAMPLES_USE_SYSTEM_MUJOCO "Use installed MuJoCo version." ON)
++option(MUJOCO_SAMPLES_USE_SYSTEM_GLFW "Use installed GLFW version." ON)
+
+ set(MUJOCO_DEP_VERSION_glfw
+ 7d5a16ce714f0b5f4efa3262de22e4d948851525 # 3.3.6
+@@ -58,7 +58,7 @@ findorfetch(
+ EXCLUDE_FROM_ALL
+ )
+
+-option(MUJOCO_SAMPLES_STATIC_GLFW "Link MuJoCo sample apps against GLFW statically." ON)
++option(MUJOCO_SAMPLES_STATIC_GLFW "Link MuJoCo sample apps against GLFW statically." OFF)
+ if(MUJOCO_SAMPLES_STATIC_GLFW)
+ set(BUILD_SHARED_LIBS_OLD ${BUILD_SHARED_LIBS})
+ set(BUILD_SHARED_LIBS
+@@ -76,7 +76,7 @@ findorfetch(
+ USE_SYSTEM_PACKAGE
+ MUJOCO_SAMPLES_USE_SYSTEM_GLFW
+ PACKAGE_NAME
+- glfw
++ glfw3
+ LIBRARY_NAME
+ glfw
+ GIT_REPO