Gentoo Archives: gentoo-commits

From: "Andreas K. Hüttel" <dilfridge@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sci-mathematics/mathematica/
Date: Wed, 28 Oct 2020 13:02:28
Message-Id: 1603889890.a5c9881856984f59c97200542d54ba3355168572.dilfridge@gentoo
1 commit: a5c9881856984f59c97200542d54ba3355168572
2 Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
3 AuthorDate: Wed Oct 28 12:57:40 2020 +0000
4 Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
5 CommitDate: Wed Oct 28 12:58:10 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a5c98818
7
8 sci-mathematics/mathematica: Add 12.1.0 for whoever cant get 12.1.1
9
10 (like me right now...)
11
12 Package-Manager: Portage-3.0.8, Repoman-3.0.2
13 Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>
14
15 sci-mathematics/mathematica/Manifest | 1 +
16 .../mathematica/mathematica-12.1.0.ebuild | 108 +++++++++++++++++++++
17 2 files changed, 109 insertions(+)
18
19 diff --git a/sci-mathematics/mathematica/Manifest b/sci-mathematics/mathematica/Manifest
20 index 3b54100ad20..4abc79ccc18 100644
21 --- a/sci-mathematics/mathematica/Manifest
22 +++ b/sci-mathematics/mathematica/Manifest
23 @@ -1,2 +1,3 @@
24 DIST Mathematica_10.3.1_LINUX.sh 3200459545 BLAKE2B 5a057b4e714eabb0afebe5a3ef536dbdc2d49a775130442e21493d6a0756527362fddfa7fabf927f996464456309c37b10b70a37f05718cb9f79d8ffc5912098 SHA512 08658a01a18c14a9b3f422816007980bf6576162e4cca6779ed1bdaf6b9748fb36a195006529ed6725f462042a264e7ee7753e802af8072ba6bebfee0cad8543
25 +DIST Mathematica_12.1.0_LINUX.sh 5889770327 BLAKE2B b0e637714f376d4066d5e484ef9facdcac36db691f7fd93e4a8228960acc9ec4b74b12ca19556c01247bd7927497f01f0c339a099b7f5abc7547051cc99c1fce SHA512 a661aa644944ee1058d7429f352ba6508514314086676a6eb918aac32773cc949feb531951b614be53198fa863575d8db456c66aa1306fd858c23423ef590fbb
26 DIST Mathematica_12.1.1_LINUX.sh 4438946649 BLAKE2B 473f814a3e0686bb3a6ac1f49c887842bc17db11439b65c1dad1dae8cd5797e6762d94bccdf156f6f9ba1edb9a16ed5172936a6884d2f0f98c29808214b1eabe SHA512 5cfdd91bae9bad53afe405b40759732589119256c3f785058808b20faf21f593d90bf7bb2dbaccf3e983aa84ff380a1fa6d40fd63f5ba17109c1cd6818c63490
27
28 diff --git a/sci-mathematics/mathematica/mathematica-12.1.0.ebuild b/sci-mathematics/mathematica/mathematica-12.1.0.ebuild
29 new file mode 100644
30 index 00000000000..20aaab87c6f
31 --- /dev/null
32 +++ b/sci-mathematics/mathematica/mathematica-12.1.0.ebuild
33 @@ -0,0 +1,108 @@
34 +# Copyright 1999-2020 Gentoo Authors
35 +# Distributed under the terms of the GNU General Public License v2
36 +
37 +EAPI=7
38 +
39 +inherit desktop multilib xdg
40 +
41 +DESCRIPTION="Wolfram Mathematica"
42 +SRC_URI="Mathematica_${PV}_LINUX.sh"
43 +HOMEPAGE="https://www.wolfram.com/mathematica/"
44 +
45 +LICENSE="all-rights-reserved"
46 +KEYWORDS="-* ~amd64"
47 +SLOT="0"
48 +IUSE="+doc"
49 +
50 +RESTRICT="strip mirror bindist fetch"
51 +
52 +DEPEND=""
53 +
54 +# Mathematica comes with a lot of bundled stuff. We should place here only what we
55 +# explicitly override with LD_PRELOAD.
56 +RDEPEND="
57 + media-libs/freetype
58 +"
59 +
60 +# we need this a few times
61 +MPN="Mathematica"
62 +MPV=$(ver_cut 1-2)
63 +M_BINARIES="MathKernel Mathematica MathematicaScript WolframKernel WolframScript math mathematica mcc wolfram"
64 +M_TARGET="opt/Wolfram/${MPN}/${MPV}"
65 +
66 +# we might as well list all files in all QA variables...
67 +QA_PREBUILT="opt/*"
68 +
69 +S=${WORKDIR}
70 +
71 +src_unpack() {
72 + /bin/sh "${DISTDIR}/${A}" --nox11 --keep --target "${S}/unpack" -- "-help" || die
73 +}
74 +
75 +src_prepare() {
76 + default
77 +
78 + pushd "${S}/unpack" > /dev/null || die
79 +
80 + # fix ACCESS DENIED issue when installer check the avahi-daemon
81 + sed -e "s:avahi-daemon -c:true:g" -i "Unix/Installer/MathInstaller" || die
82 +
83 + /bin/sh "Unix/Installer/MathInstaller" -auto "-targetdir=${S}/${M_TARGET}" "-execdir=${S}/opt/bin" || die
84 +
85 + popd > /dev/null || die
86 +}
87 +
88 +src_install() {
89 + local ARCH='-x86-64'
90 +
91 + if ! use doc; then
92 + einfo "Removing documentation"
93 + rm -r "${S}/${M_TARGET}/Documentation"
94 + fi
95 +
96 + einfo 'Removing MacOS- and Windows-specific files'
97 + find AddOns SystemFiles -type d -\( -name Windows -o -name Windows-x86-64 \
98 + -o -name MacOSX -o -name MacOSX-x86-64 -\) -delete
99 +
100 + # move all over
101 + mv "${S}"/opt "${D}"/opt || die
102 +
103 + # the autogenerated symlinks point into sandbox, remove
104 + rm "${D}"/opt/bin/* || die
105 +
106 + # install wrappers instead
107 + for name in ${M_BINARIES} ; do
108 + einfo "Generating wrapper for ${name}"
109 + echo '#!/bin/sh' >> "${T}/${name}"
110 + echo "LD_PRELOAD=/usr/$(get_libdir)/libfreetype.so.6:/$(get_libdir)/libz.so.1 /${M_TARGET}/Executables/${name} \$*" \
111 + >> "${T}/${name}"
112 + dobin "${T}/${name}"
113 + done
114 + for name in ${M_BINARIES} ; do
115 + einfo "Symlinking ${name} to /opt/bin"
116 + dosym ../../usr/bin/${name} /opt/bin/${name}
117 + done
118 +
119 + # fix some embedded paths and install desktop files
120 + for filename in $(find "${D}/${M_TARGET}/SystemFiles/Installation" -name "wolfram-mathematica.desktop") ; do
121 + echo Fixing "${filename}"
122 + sed -e "s:${S}::g" -e 's:^\t\t::g' -i "${filename}"
123 + echo "Categories=Physics;Science;Engineering;2DGraphics;Graphics;" >> "${filename}"
124 + domenu "${filename}"
125 + done
126 +
127 + # install mime types
128 + insinto /usr/share/mime/application
129 + for filename in $(find "${D}/${M_TARGET}/SystemFiles/Installation" -name "application-*.xml"); do
130 + basefilename=$(basename "${filename}")
131 + mv "${filename}" "${T}/${basefilename#application-}"
132 + doins "${T}/${basefilename#application-}"
133 + done
134 +}
135 +
136 +pkg_nofetch() {
137 + einfo "Please place the Wolfram Mathematica installation file ${SRC_URI}"
138 + einfo "in your \$\{DISTDIR\}."
139 + einfo "Note that to actually run and use Mathematica you need a valid license."
140 + einfo "Wolfram provides time-limited evaluation licenses at ${HOMEPAGE}"
141 +}