diff options
author | Huang Rui <vowstar@gmail.com> | 2021-05-11 12:17:02 +0800 |
---|---|---|
committer | Andreas K. Hüttel <dilfridge@gentoo.org> | 2022-01-28 00:36:06 +0100 |
commit | 07f8823ea56d6d185798ffda411b6dc3ee66b90f (patch) | |
tree | a46756cf20c62129e5dcc2230eebadceea729bb6 /sci-mathematics/mathematica/mathematica-12.2.0.ebuild | |
parent | dev-python/httpx: Remove old (diff) | |
download | gentoo-07f8823ea56d6d185798ffda411b6dc3ee66b90f.tar.gz gentoo-07f8823ea56d6d185798ffda411b6dc3ee66b90f.tar.bz2 gentoo-07f8823ea56d6d185798ffda411b6dc3ee66b90f.zip |
sci-mathematics/mathematica: bump to 12.2.0
Closes: https://bugs.gentoo.org/789387
Package-Manager: Portage-3.0.18, Repoman-3.0.3
Signed-off-by: Huang Rui <vowstar@gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/20766
Signed-off-by: Andreas K. Hüttel <dilfridge@gentoo.org>
Diffstat (limited to 'sci-mathematics/mathematica/mathematica-12.2.0.ebuild')
-rw-r--r-- | sci-mathematics/mathematica/mathematica-12.2.0.ebuild | 104 |
1 files changed, 104 insertions, 0 deletions
diff --git a/sci-mathematics/mathematica/mathematica-12.2.0.ebuild b/sci-mathematics/mathematica/mathematica-12.2.0.ebuild new file mode 100644 index 000000000000..85cab466a173 --- /dev/null +++ b/sci-mathematics/mathematica/mathematica-12.2.0.ebuild @@ -0,0 +1,104 @@ +# Copyright 1999-2021 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +inherit desktop multilib unpacker xdg + +DESCRIPTION="Wolfram Mathematica" +SRC_URI="Mathematica_${PV}_LINUX.sh" +HOMEPAGE="https://www.wolfram.com/mathematica/" + +LICENSE="all-rights-reserved" +KEYWORDS="-* ~amd64" +SLOT="0" +IUSE="+doc" + +RESTRICT="strip mirror bindist fetch" + +DEPEND="" + +# Mathematica comes with a lot of bundled stuff. We should place here only what we +# explicitly override with LD_PRELOAD. +RDEPEND=" + media-libs/freetype +" + +# we need this a few times +MPN="Mathematica" +MPV=$(ver_cut 1-2) +M_BINARIES="MathKernel Mathematica MathematicaScript WolframKernel WolframScript math mathematica mcc wolfram" +M_TARGET="opt/Wolfram/${MPN}/${MPV}" + +# we might as well list all files in all QA variables... +QA_PREBUILT="opt/*" + +S=${WORKDIR} + +src_unpack() { + /bin/sh "${DISTDIR}/${A}" --nox11 --keep --target "${S}/unpack" -- "-help" || die +} + +src_prepare() { + pushd "${S}/unpack" > /dev/null || die + # fix ACCESS DENIED issue when installer check the avahi-daemon + sed -e "s:avahi-daemon -c:true:g" -i "Unix/Installer/MathInstaller" || die + /bin/sh "Unix/Installer/MathInstaller" -auto "-targetdir=${S}/${M_TARGET}" "-execdir=${S}/opt/bin" || die + popd > /dev/null || die + eapply_user +} + +src_install() { + local ARCH='-x86-64' + + if ! use doc; then + einfo "Removing documentation" + rm -r "${S}/${M_TARGET}/Documentation" + fi + + einfo 'Removing MacOS- and Windows-specific files' + find AddOns SystemFiles -type d -\( -name Windows -o -name Windows-x86-64 \ + -o -name MacOSX -o -name MacOSX-x86-64 -\) -delete + + # move all over + mv "${S}"/opt "${D}"/opt || die + + # the autogenerated symlinks point into sandbox, remove + rm "${D}"/opt/bin/* || die + + # install wrappers instead + for name in ${M_BINARIES} ; do + einfo "Generating wrapper for ${name}" + echo '#!/bin/sh' >> "${T}/${name}" + echo "LD_PRELOAD=/usr/$(get_libdir)/libfreetype.so.6:/$(get_libdir)/libz.so.1 /${M_TARGET}/Executables/${name} \$*" \ + >> "${T}/${name}" + dobin "${T}/${name}" + done + for name in ${M_BINARIES} ; do + einfo "Symlinking ${name} to /opt/bin" + dosym ../../usr/bin/${name} /opt/bin/${name} + done + + # fix some embedded paths and install desktop files + for filename in $(find "${D}/${M_TARGET}/SystemFiles/Installation" -name "wolfram-mathematica*.desktop") ; do + echo Fixing "${filename}" + sed -e "s:${S}::g" -e 's:^\t\t::g' -i "${filename}" + echo "Categories=Physics;Science;Engineering;2DGraphics;Graphics;" >> "${filename}" + domenu "${filename}" + done + + # install mime types + insinto /usr/share/mime/application + for filename in $(find "${D}/${M_TARGET}/SystemFiles/Installation" -name "application-*.xml"); do + basefilename=$(basename "${filename}") + mv "${filename}" "${T}/${basefilename#application-}" + doins "${T}/${basefilename#application-}" + done +} + +pkg_nofetch() { + einfo "Please place the Wolfram Mathematica installation file ${SRC_URI}" + einfo "in your \$\{DISTDIR\}." + einfo "Note that to actually run and use Mathematica you need a valid license." + einfo "Wolfram provides time-limited evaluation licenses at ${HOMEPAGE}" +} |