From cfb8d6f8aca395d28f226643d3cfafe562da13c7 Mon Sep 17 00:00:00 2001 From: Simo Tuomisto Date: Fri, 3 Dec 2021 21:40:09 +0200 Subject: New package: mujoco (#27656) --- var/spack/repos/builtin/packages/mujoco/package.py | 49 ++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 var/spack/repos/builtin/packages/mujoco/package.py diff --git a/var/spack/repos/builtin/packages/mujoco/package.py b/var/spack/repos/builtin/packages/mujoco/package.py new file mode 100644 index 0000000000..a29772b1f1 --- /dev/null +++ b/var/spack/repos/builtin/packages/mujoco/package.py @@ -0,0 +1,49 @@ +# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) + +import platform + +from spack import * + + +class Mujoco(Package): + """MuJoCo is a physics engine that aims to facilitate research and + development in robotics, biomechanics, graphics and animation, and + other areas where fast and accurate simulation is needed. """ + + homepage = "https://mujoco.org/" + + mujoco_releases = { + '2.1.0': { + 'Linux-x86_64': 'a436ca2f4144c38b837205635bbd60ffe1162d5b44c87df22232795978d7d012', + 'Darwin-x86_64': '50226f859d9d3742fa57e1a0a92d656197ec5786f75bfa50ae00eb80fae25e90', + } + } + + for ver, packages in mujoco_releases.items(): + key = "{0}-{1}".format(platform.system(), platform.machine()) + pkg_sha256 = packages.get(key) + if pkg_sha256: + version(ver, sha256=pkg_sha256) + + def url_for_version(self, version): + + url = "https://mujoco.org/download/mujoco{0}-{1}-x86_64.tar.gz" + + system_map = { + 'Linux': 'linux', + 'Darwin': 'macos', + } + + return url.format(version.joined, system_map[platform.system()]) + + def install(self, spec, prefix): + copy_tree('.', prefix) + + def setup_run_environment(self, env): + env.prepend_path('CPATH', prefix.include) + env.prepend_path('LD_LIBRARY_PATH', prefix.bin) + if platform.system() == 'Darwin': + env.prepend_path('DYLD_LIBRARY_PATH', prefix.bin) -- cgit v1.2.3-60-g2f50