1 |
commit: 4ff1e59ed4d38db1f906f022a80ae130f5fa1d08 |
2 |
Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Mar 3 14:24:21 2023 +0000 |
4 |
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Mar 3 14:25:58 2023 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4ff1e59e |
7 |
|
8 |
sci-mathematics/mathematica: add 13.2.1 |
9 |
|
10 |
Closes: https://bugs.gentoo.org/894242 |
11 |
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org> |
12 |
|
13 |
sci-mathematics/mathematica/Manifest | 1 + |
14 |
.../mathematica/mathematica-13.2.1.ebuild | 174 +++++++++++++++++++++ |
15 |
2 files changed, 175 insertions(+) |
16 |
|
17 |
diff --git a/sci-mathematics/mathematica/Manifest b/sci-mathematics/mathematica/Manifest |
18 |
index 7a6a8e62ab4a..35f7e055fb48 100644 |
19 |
--- a/sci-mathematics/mathematica/Manifest |
20 |
+++ b/sci-mathematics/mathematica/Manifest |
21 |
@@ -5,4 +5,5 @@ DIST Mathematica_12.2.0_LINUX.sh 4454613844 BLAKE2B 03b0567afe001fd0781ea6daf0f2 |
22 |
DIST Mathematica_13.0.0_BNDL_LINUX.sh 5118155611 BLAKE2B ff15a9def53f7fb808b117ecf2573f415b928c13a86d15634e6282c8f8542b32fa42ff76baeac95faa1242dc4350b0db28231c5cb7f36bc5b57425c2804bf996 SHA512 05008559c531a6920745d0047be0f2c42cb6994309db3f2ee2ad44151655f43d88de063a4952c5ac5544818e2da8973305ee46f44e74d7301da21cdf710cbd5b |
23 |
DIST Mathematica_13.0.1_BNDL_LINUX.sh 5094982487 BLAKE2B 55375b6038422fd5f11db36b33bc1162064c8d6a88575c982ce53b15678bf7b19dc62d66336b2105cbaa18a7fe86ba64f09db40e494c15d558f3ebd92ea025fe SHA512 cf4106202dfcf290f0dbe9e8062457eb705c2802f608e60f2810fc31e166ab60b5726c0c9bf675fadb02f5628af1dc2d25db8d02119dc63381eef8a88cdb6ec6 |
24 |
DIST Mathematica_13.1.0_LINUX.sh 2032362325 BLAKE2B d044fe1ed3c71e6ebc2357c440af6feaeb360962aea32843abbdfe40f124a29bd07bf0c3a5a35f8bac29c97a7d23dbcd79967b6d0028d01e09c9b662fc1f2b95 SHA512 3d84313be4da86d72cc652b0ec7dbbbf6d815debbde4c9ab855f447dda36aeccb416e90d298f0be975ae86fdf55f20aa7597b0d96d291ebdf6e4eb0dc2ca5433 |
25 |
+DIST Mathematica_13.2.1_BNDL_LINUX.sh 5512713048 BLAKE2B 266a6979faab891c6fc10a1bc690ee21ad3af01413a2af29d81c27dffc92d8a10a2947aefe978dfcf16378e8f8f0d33145f99930840eeb2843d73270d2ad0de9 SHA512 2062b2ce7f6e7f33b8623607ef71475091b877112f03ffbc32671f513b71925aad8489f25e1b01ec75b5d4d7bee03bb2dc8b2627f767633de578ecae1d86b7f6 |
26 |
DIST WLDocs_13.1.0_LINUX.sh 3546448755 BLAKE2B e5dbf6bf9cd60a313329df8591c281215039d7efa7c83a53f3b2d4e176765b62efae3ff04628ecf6905e76bbaf6867e87c96bd6188d13df2b981bea5a633335a SHA512 2107b37b30fc76974d040e746ca26ddb5df23bbacb9d8fabcd546a7cf789f1daaf70179c53890bed2385430665f601fbbc1f9829bf64f61068909ea8774f91d2 |
27 |
|
28 |
diff --git a/sci-mathematics/mathematica/mathematica-13.2.1.ebuild b/sci-mathematics/mathematica/mathematica-13.2.1.ebuild |
29 |
new file mode 100644 |
30 |
index 000000000000..d5bae7e2927e |
31 |
--- /dev/null |
32 |
+++ b/sci-mathematics/mathematica/mathematica-13.2.1.ebuild |
33 |
@@ -0,0 +1,174 @@ |
34 |
+# Copyright 1999-2023 Gentoo Authors |
35 |
+# Distributed under the terms of the GNU General Public License v2 |
36 |
+ |
37 |
+EAPI=8 |
38 |
+ |
39 |
+CHECKREQS_DISK_BUILD=20G |
40 |
+inherit check-reqs desktop unpacker xdg |
41 |
+ |
42 |
+DESCRIPTION="Wolfram Mathematica" |
43 |
+HOMEPAGE="https://www.wolfram.com/mathematica/" |
44 |
+SRC_URI="Mathematica_${PV}_BNDL_LINUX.sh" |
45 |
+S="${WORKDIR}" |
46 |
+ |
47 |
+LICENSE="all-rights-reserved" |
48 |
+KEYWORDS="-* ~amd64" |
49 |
+SLOT="0" |
50 |
+IUSE="cuda doc ffmpeg R" |
51 |
+ |
52 |
+RESTRICT="strip mirror bindist fetch" |
53 |
+ |
54 |
+# Mathematica comes with a lot of bundled stuff. We should place here only what we |
55 |
+# explicitly override with LD_PRELOAD. |
56 |
+# RLink (libjri.so) requires dev-lang/R |
57 |
+# FFmpegTools (FFmpegToolsSystem-5.0.so) requires media-video/ffmpeg |
58 |
+RDEPEND=" |
59 |
+ cuda? ( dev-util/nvidia-cuda-toolkit ) |
60 |
+ media-libs/freetype |
61 |
+ ffmpeg? ( <media-video/ffmpeg-5 ) |
62 |
+ R? ( dev-lang/R ) |
63 |
+ virtual/libcrypt |
64 |
+" |
65 |
+ |
66 |
+DEPEND=" |
67 |
+ ${RDEPEND} |
68 |
+" |
69 |
+ |
70 |
+BDEPEND=" |
71 |
+ dev-util/patchelf |
72 |
+" |
73 |
+ |
74 |
+# we need this a few times |
75 |
+MPN="Mathematica" |
76 |
+MPV=$(ver_cut 1-2) |
77 |
+M_BINARIES="MathKernel Mathematica WolframKernel wolframscript math mathematica mcc wolfram" |
78 |
+M_TARGET="opt/Wolfram/${MPN}/${MPV}" |
79 |
+ |
80 |
+# we might as well list all files in all QA variables... |
81 |
+QA_PREBUILT="opt/*" |
82 |
+ |
83 |
+src_unpack() { |
84 |
+ /bin/sh "${DISTDIR}/${A}" --nox11 --keep --target "${S}/unpack_app" -- "-help" || die |
85 |
+} |
86 |
+ |
87 |
+src_install() { |
88 |
+ local ARCH='-x86-64' |
89 |
+ |
90 |
+ pushd "${S}/unpack_app" > /dev/null || die |
91 |
+ # fix ACCESS DENIED issue when installer generate desktop files |
92 |
+ sed -e "s|xdg-desktop-icon|xdg-dummy-command|g" -i "Unix/Installer/MathInstaller" || die |
93 |
+ sed -e "s|xdg-desktop-menu|xdg-dummy-command|g" -i "Unix/Installer/MathInstaller" || die |
94 |
+ sed -e "s|xdg-icon-resource|xdg-dummy-command|g" -i "Unix/Installer/MathInstaller" || die |
95 |
+ sed -e "s|xdg-mime|xdg-dummy-command|g" -i "Unix/Installer/MathInstaller" || die |
96 |
+ # fix ACCESS DENIED issue when installer check the avahi-daemon |
97 |
+ sed -e "s|avahi-daemon -c|true|g" -i "Unix/Installer/MathInstaller" || die |
98 |
+ /bin/sh "Unix/Installer/MathInstaller" -auto "-targetdir=${S}/${M_TARGET}" "-execdir=${S}/opt/bin" || die |
99 |
+ popd > /dev/null || die |
100 |
+ |
101 |
+ if ! use doc; then |
102 |
+ einfo "Removing documentation" |
103 |
+ rm -r "${S}/${M_TARGET}/Documentation" || die |
104 |
+ fi |
105 |
+ |
106 |
+ # fix world writable file QA problem for files |
107 |
+ while IFS= read -r -d '' i; do |
108 |
+ chmod o-w "${i}" || die |
109 |
+ done < <(find "${S}/${M_TARGET}" -type f -print0) |
110 |
+ |
111 |
+ einfo 'Removing MacOS- and Windows-specific files' |
112 |
+ find "${S}/${M_TARGET}" -type d -\( -name Windows -o -name Windows-x86-64 \ |
113 |
+ -o -name MacOSX -o -name MacOSX-x86-64 -o -name Macintosh -\) \ |
114 |
+ -exec rm -rv {} + || die |
115 |
+ |
116 |
+ if ! use cuda; then |
117 |
+ einfo 'Removing cuda support' |
118 |
+ rm -r "${S}/${M_TARGET}/SystemFiles/Components/CUDACompileTools/LibraryResources/Linux-x86-64/CUDAExtensions.so" || die |
119 |
+ fi |
120 |
+ |
121 |
+ # Linux-x86-64/AllVersions is the supported version, other versions remove |
122 |
+ einfo 'Removing unsupported RLink versions' |
123 |
+ rm -r "${S}/${M_TARGET}/SystemFiles/Links/RLink/SystemFiles/Libraries/Linux-x86-64/3.5.0" || die |
124 |
+ rm -r "${S}/${M_TARGET}/SystemFiles/Links/RLink/SystemFiles/Libraries/Linux-x86-64/3.6.0" || die |
125 |
+ rm -r "${S}/${M_TARGET}/SystemFiles/Links/RLink/SystemFiles/Libraries/Linux/AllVersions" || die |
126 |
+ # RLink can't use if R not used |
127 |
+ if ! use R; then |
128 |
+ einfo 'Removing RLink support' |
129 |
+ rm -r "${S}/${M_TARGET}/SystemFiles/Links/RLink/SystemFiles/Libraries/Linux-x86-64/AllVersions/libjri.so" || die |
130 |
+ fi |
131 |
+ # FFmpegTools can't use if ffmpeg not used |
132 |
+ if ! use ffmpeg; then |
133 |
+ einfo 'Removing FFmpegTools support' |
134 |
+ rm -r "${S}/${M_TARGET}/SystemFiles/Links/FFmpegTools/LibraryResources/Linux-x86-64/FFmpegToolsSystem"*.so || die |
135 |
+ fi |
136 |
+ |
137 |
+ # fix RPATH |
138 |
+ while IFS= read -r -d '' i; do |
139 |
+ # Use \x7fELF header to separate ELF executables and libraries |
140 |
+ # Skip .o files and static files to avoid surprises |
141 |
+ [[ $(od -t x1 -N 4 "${i}") == *"7f 45 4c 46"* ]] || continue |
142 |
+ [[ -f "${i}" && "${i: -2}" != ".o" ]] || continue |
143 |
+ [[ "$(file "${i}")" == *"dynamically"* ]] || continue |
144 |
+ einfo "Fixing RPATH of ${i}" |
145 |
+ patchelf --set-rpath \ |
146 |
+'/'"${M_TARGET}"'/SystemFiles/Libraries/Linux-x86-64:'\ |
147 |
+'/'"${M_TARGET}"'/SystemFiles/Libraries/Linux-x86-64/Qt/lib:'\ |
148 |
+'/'"${M_TARGET}"'/SystemFiles/Java/Linux-x86-64/lib:'\ |
149 |
+'/'"${M_TARGET}"'/SystemFiles/Java/Linux-x86-64/lib/jli:'\ |
150 |
+'$ORIGIN' "${i}" || \ |
151 |
+ die "patchelf failed on ${i}" |
152 |
+ done < <(find "${S}/${M_TARGET}" -type f -print0) |
153 |
+ |
154 |
+ # fix broken symbolic link |
155 |
+ ln -sf "/${M_TARGET}/SystemFiles/Kernel/Binaries/Linux-x86-64/wolframscript" "${S}/${M_TARGET}/Executables/wolframscript" || die |
156 |
+ |
157 |
+ # move all over |
158 |
+ mv "${S}"/opt "${ED}"/opt || die |
159 |
+ |
160 |
+ # the autogenerated symlinks point into sandbox, remove |
161 |
+ rm "${ED}"/opt/bin/* || die |
162 |
+ |
163 |
+ # install wrappers instead |
164 |
+ for name in ${M_BINARIES} ; do |
165 |
+ einfo "Generating wrapper for ${name}" |
166 |
+ echo '#!/bin/sh' >> "${T}/${name}" || die |
167 |
+ echo 'QT_QPA_PLATFORM="wayland;xcb"' >> "${T}/${name}" || die |
168 |
+ echo "LD_PRELOAD=/usr/$(get_libdir)/libfreetype.so.6:/$(get_libdir)/libz.so.1:/$(get_libdir)/libcrypt.so.1 /${M_TARGET}/Executables/${name} \$*" \ |
169 |
+ >> "${T}/${name}" || die |
170 |
+ dobin "${T}/${name}" |
171 |
+ done |
172 |
+ for name in ${M_BINARIES} ; do |
173 |
+ einfo "Symlinking ${name} to /opt/bin" |
174 |
+ dosym ../../usr/bin/${name} /opt/bin/${name} |
175 |
+ done |
176 |
+ |
177 |
+ # fix some embedded paths and install desktop files |
178 |
+ for filename in $(find "${ED}/${M_TARGET}/SystemFiles/Installation" -name "wolfram-mathematica*.desktop") ; do |
179 |
+ einfo "Fixing ${filename}" |
180 |
+ sed -e "s|${S}||g" -e 's|^\t\t||g' -i "${filename}" || die |
181 |
+ echo "Categories=Physics;Science;Engineering;2DGraphics;Graphics;" >> "${filename}" || die |
182 |
+ domenu "${filename}" |
183 |
+ done |
184 |
+ |
185 |
+ # install icons |
186 |
+ for iconsize in 16 32 64 128 256; do |
187 |
+ local iconfile="${ED}/${M_TARGET}/SystemFiles/FrontEnd/SystemResources/X/App-${iconsize}.png" |
188 |
+ if [ -e "${iconfile}" ]; then |
189 |
+ newicon -s "${iconsize}" "${iconfile}" wolfram-mathematica.png |
190 |
+ fi |
191 |
+ done |
192 |
+ |
193 |
+ # install mime types |
194 |
+ insinto /usr/share/mime/application |
195 |
+ for filename in $(find "${ED}/${M_TARGET}/SystemFiles/Installation" -name "application-*.xml"); do |
196 |
+ basefilename=$(basename "${filename}") |
197 |
+ mv "${filename}" "${T}/${basefilename#application-}" || die |
198 |
+ doins "${T}/${basefilename#application-}" |
199 |
+ done |
200 |
+} |
201 |
+ |
202 |
+pkg_nofetch() { |
203 |
+ einfo "Please place the Wolfram Mathematica installation file ${SRC_URI}" |
204 |
+ einfo "in your \$\{DISTDIR\}." |
205 |
+ einfo "Note that to actually run and use Mathematica you need a valid license." |
206 |
+ einfo "Wolfram provides time-limited evaluation licenses at ${HOMEPAGE}" |
207 |
+} |