mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-01-06 02:17:34 -08:00
sci-mathematics/mathematica: add 14.2.1
Closes: https://bugs.gentoo.org/960922 Signed-off-by: Huang Rui <vowstar@gmail.com> Part-of: https://github.com/gentoo/gentoo/pull/44406 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
parent
a9dd64e955
commit
1eb36b222a
@ -13,5 +13,7 @@ DIST Mathematica_14.0.0_LINUX.sh 2175783771 BLAKE2B ceb6e0d9ee8ef5c548c5dcf5d426
|
||||
DIST WLDocs_13.1.0_LINUX.sh 3546448755 BLAKE2B e5dbf6bf9cd60a313329df8591c281215039d7efa7c83a53f3b2d4e176765b62efae3ff04628ecf6905e76bbaf6867e87c96bd6188d13df2b981bea5a633335a SHA512 2107b37b30fc76974d040e746ca26ddb5df23bbacb9d8fabcd546a7cf789f1daaf70179c53890bed2385430665f601fbbc1f9829bf64f61068909ea8774f91d2
|
||||
DIST Wolfram_14.1.0_LIN.sh 2181436246 BLAKE2B fe51d8dc47e92c502d35847ccc27caec1321db693a0c77fbb8c6a7fea450cee256623b1427724d165cf85d2631dded5cf7ff43e24a1990a04b7e3c3b25d9ee2a SHA512 db6ca86308480dc623346bf0b4fb11008703768f67c83f5c2db5827497ecd856f564cd719a418bcd572e29e7ca9381d0b6fa4ba7de9a6d52b115106bd8517818
|
||||
DIST Wolfram_14.1.0_LIN_Bndl.sh 6452683618 BLAKE2B 51353b92af4bbe9b650513458171a9df5bb853ad2750a206bf9533cd9e797ea98b78bfc92dae9a4c98bd86a50a9acfa423439bb1d0d877c9128a9a530520869c SHA512 b8618468a9a443183c23197bab8384237225131b422bd2315ebbba2bc15ef501a1f1a5ca30d6a689fa89ebce8050cf86497fc08c2c80ae034a18aa8921a95791
|
||||
DIST Wolfram_14.2.1_LIN.sh 2351379285 BLAKE2B eec3c50c3fc177c1c69a95cc287ad1650bc901795ce1ff827fcdd8327379222c3248001d7be5a48abdf72fb13f0cc863ed871f579751ebe9dc4bbc12b98a7101 SHA512 03f1dee57db7eeecdce3b330f404d7ec2d8f22bb26179375e2f6b3025ce6fa654df3e083c63bfc9dff14d88485aa16b82fb300398f1b80f9d610a37bb05d5fbf
|
||||
DIST Wolfram_14.2.1_LIN_Bndl.sh 6718186338 BLAKE2B bf6aa60f1e3d7c5be2b397b3619bd9a656a06edd1a8467ebb0eaa8a797153ad02b0be9101ed2ef36b5251c60bb5ef05c26b132e0b8e181103d936527381f6823 SHA512 a9eb84a8328fc971472467c156f8671f6691ccda34d749bd1cbc3a1767a4d2a8279e6bb6f93be8d107ebff0e5c8a65842337570fd067fcb1e9bbaadb92f8242c
|
||||
DIST Wolfram_14.3.0_LIN.sh 2486025044 BLAKE2B e5f6fb60687b4f01da7e1b02173f25f4fcd2d2bbe670cdbe6e3bb1083360c3bb8dfab73cfc6a7c7767f08f60f928c2a6483beca206ca1d7a96dfb103f8ac5d3c SHA512 962c2f206970beb167acf0f7f9452c1ed8dc084eb6e988721ad26c97aad2763212428c5f1607837948072c971e96c368840e2fcbef23d996269dc0edbf3e3bbf
|
||||
DIST Wolfram_14.3.0_LIN_Bndl.sh 7389940578 BLAKE2B 6d1739ab8512841351c5a7a15c04e03a24e87171fe9ee5769a1f930cf62cad4ce17ad96185436870f7a441c92aa3a4a1bb35d8e6e52dba6de1128e5c0261aae0 SHA512 a1f55858cb12feaa33903599ea4eae65b08b8faf21548bade7ddd601465a523aa1c0fc5e1deacbe858dde35735a552761bb6b082cda9d7e0d45e8d14b7d1883f
|
||||
|
||||
250
sci-mathematics/mathematica/mathematica-14.2.1.ebuild
Normal file
250
sci-mathematics/mathematica/mathematica-14.2.1.ebuild
Normal file
@ -0,0 +1,250 @@
|
||||
# Copyright 1999-2025 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
CHECKREQS_DISK_BUILD=20G
|
||||
inherit check-reqs desktop unpacker xdg
|
||||
|
||||
DESCRIPTION="Wolfram Mathematica"
|
||||
|
||||
# Note: Please do not "remove old". Mathematica is licensed by version, and there
|
||||
# are certainly still active installations of old versions around.
|
||||
# That said, the compatibility of old versions with new Linux installs is not
|
||||
# really great...
|
||||
|
||||
HOMEPAGE="https://www.wolfram.com/mathematica/"
|
||||
SRC_URI="
|
||||
bundle? ( Wolfram_${PV}_LIN_Bndl.sh )
|
||||
!bundle? ( Wolfram_${PV}_LIN.sh )
|
||||
"
|
||||
S="${WORKDIR}"
|
||||
|
||||
LICENSE="all-rights-reserved"
|
||||
SLOT="0"
|
||||
KEYWORDS="-* ~amd64"
|
||||
IUSE="bundle cuda doc ffmpeg R mqtt"
|
||||
|
||||
RESTRICT="strip mirror bindist fetch"
|
||||
|
||||
# Mathematica comes with a lot of bundled stuff. We should place here only what we
|
||||
# explicitly override with LD_PRELOAD.
|
||||
# RLink (libjri.so) requires dev-lang/R
|
||||
# FFmpegTools (FFmpegToolsSystem-7.0.so) requires media-video/ffmpeg-7.0
|
||||
# FFmpegTools (FFmpegToolsSystem-6.0.so) requires media-video/ffmpeg-6.0
|
||||
# FFmpegTools (FFmpegToolsSystem-5.1.2.so) requires media-video/ffmpeg-5.1.2
|
||||
# FFmpegTools (FFmpegToolsSystem-4.4.so) requires media-video/ffmpeg-4.4
|
||||
# Bundled mosquitto depends upon outdated shared libraries.
|
||||
RDEPEND="
|
||||
dev-qt/qt5compat:6
|
||||
dev-qt/qtbase:6[eglfs,wayland]
|
||||
dev-qt/qtsvg:6
|
||||
dev-qt/qtwayland:6[compositor(+)]
|
||||
media-libs/freetype
|
||||
virtual/libcrypt
|
||||
cuda? (
|
||||
>=dev-util/nvidia-cuda-toolkit-11
|
||||
<dev-util/nvidia-cuda-toolkit-13
|
||||
)
|
||||
ffmpeg? ( || (
|
||||
media-video/ffmpeg:0/56.58.58
|
||||
media-video/ffmpeg:0/58.60.60
|
||||
media-video/ffmpeg:0/59.61.61
|
||||
) )
|
||||
R? ( dev-lang/R )
|
||||
mqtt? (
|
||||
app-misc/mosquitto[bridge,srv]
|
||||
)
|
||||
"
|
||||
|
||||
DEPEND="
|
||||
${RDEPEND}
|
||||
"
|
||||
|
||||
BDEPEND="
|
||||
dev-util/patchelf
|
||||
"
|
||||
|
||||
# we need this a few times
|
||||
MPN="Mathematica"
|
||||
MPV=$(ver_cut 1-2)
|
||||
M_BINARIES="math mathematica Mathematica MathKernel mcc wolfram WolframKernel wolframscript"
|
||||
M_TARGET="opt/Wolfram/${MPN}/${MPV}"
|
||||
|
||||
# we might as well list all files in all QA variables...
|
||||
QA_PREBUILT="opt/*"
|
||||
|
||||
src_unpack() {
|
||||
/bin/sh "${DISTDIR}/${A}" --nox11 --keep --target "${S}/unpack_app" -- "-help" || die
|
||||
}
|
||||
|
||||
src_install() {
|
||||
local ARCH='-x86-64'
|
||||
|
||||
pushd "${S}/unpack_app" > /dev/null || die
|
||||
# fix ACCESS DENIED issue when installer generate desktop files
|
||||
sed -e "s|xdg-desktop-icon|xdg-dummy-command|g" -i "Unix/Installer/WolframInstaller" || die
|
||||
sed -e "s|xdg-desktop-menu|xdg-dummy-command|g" -i "Unix/Installer/WolframInstaller" || die
|
||||
sed -e "s|xdg-icon-resource|xdg-dummy-command|g" -i "Unix/Installer/WolframInstaller" || die
|
||||
sed -e "s|xdg-mime|xdg-dummy-command|g" -i "Unix/Installer/WolframInstaller" || die
|
||||
|
||||
# fix ACCESS DENIED issue when installer check the avahi-daemon
|
||||
sed -e "s|avahi-daemon -c|true|g" -i "Unix/Installer/WolframInstaller" || die
|
||||
|
||||
# fix ACCESS DENIED issue when installing documentation
|
||||
sed -e "s|\(exec ./MathInstaller -noprompt\)|\1 -targetdir=${S}/${M_TARGET}/Documentation|" \
|
||||
-i "Unix/Installer/WolframInstaller" || die
|
||||
|
||||
# in the depths of the installer it tests whether it can write here
|
||||
# addpredict is by far the simplest solution
|
||||
# bug 960526, the installer may check the following two paths for write access
|
||||
addpredict /usr/share/Wolfram/thisisatest
|
||||
addpredict /usr/share/thisisatest
|
||||
|
||||
/bin/sh "Unix/Installer/WolframInstaller" -auto "-targetdir=${S}/${M_TARGET}" "-execdir=${S}/opt/bin" || die
|
||||
|
||||
popd > /dev/null || die
|
||||
|
||||
if ! use doc; then
|
||||
einfo "Removing documentation"
|
||||
rm -r "${S}/usr/share/Wolfram/Documentation/${MPV}/en-us" || die
|
||||
fi
|
||||
|
||||
# fix world writable file QA problem for files
|
||||
while IFS= read -r -d '' i; do
|
||||
chmod o-w "${i}" || die
|
||||
done < <(find "${S}/${M_TARGET}" -type f -print0)
|
||||
|
||||
einfo 'Removing MacOS- and Windows-specific files'
|
||||
find "${S}/${M_TARGET}" -type d -\( -name Windows -o -name Windows-x86-64 \
|
||||
-o -name MacOSX -o -name MacOSX-ARM64 -o -name MacOSX-x86-64 -o -name Macintosh -\) \
|
||||
-exec rm -rv {} + || die
|
||||
|
||||
if ! use cuda; then
|
||||
einfo 'Removing cuda support'
|
||||
rm -r \
|
||||
"${S}/${M_TARGET}/SystemFiles/Components/CUDACompileTools/LibraryResources/Linux-x86-64/CUDAExtensions"*.so \
|
||||
|| die
|
||||
rm "${S}/${M_TARGET}/SystemFiles/Links//WhisperLink/LibraryResources/Linux-x86-64/libwhisper_cuda.so.1.5.5" || die
|
||||
fi
|
||||
|
||||
# Linux-x86-64/AllVersions is the supported version, other versions remove
|
||||
einfo 'Removing unsupported RLink versions'
|
||||
rm -r "${S}/${M_TARGET}/SystemFiles/Links/RLink/SystemFiles/Libraries/Linux-x86-64/3.5.0" || die
|
||||
rm -r "${S}/${M_TARGET}/SystemFiles/Links/RLink/SystemFiles/Libraries/Linux-x86-64/3.6.0" || die
|
||||
# rm -r "${S}/${M_TARGET}/SystemFiles/Links/RLink/SystemFiles/Libraries/Linux-x86-64/AllVersions" || die
|
||||
# RLink can't use if R not used
|
||||
if ! use R; then
|
||||
einfo 'Removing RLink support'
|
||||
rm -r "${S}/${M_TARGET}/SystemFiles/Links/RLink/SystemFiles/Libraries/Linux-x86-64/AllVersions/libjri.so" || die
|
||||
fi
|
||||
|
||||
if ! use ffmpeg; then # FFmpegTools can't use if ffmpeg not used
|
||||
einfo 'Removing FFmpegTools support'
|
||||
rm -r "${S}/${M_TARGET}/SystemFiles/Links/FFmpegTools/LibraryResources/Linux-x86-64/FFmpegToolsSystem"*.so || die
|
||||
else # Support ffmpeg, but remove support for versions not installed
|
||||
if ! has_version 'media-video/ffmpeg:0/56.58.58'; then
|
||||
einfo 'Removing FFmpegTools version 4 support'
|
||||
rm -r "${S}/${M_TARGET}/SystemFiles/Links/FFmpegTools/LibraryResources/Linux-x86-64/FFmpegToolsSystem-4.4.so" || die
|
||||
fi
|
||||
if ! has_version 'media-video/ffmpeg:0/58.60.60'; then
|
||||
einfo 'Removing FFmpegTools version 6 support'
|
||||
rm -r "${S}/${M_TARGET}/SystemFiles/Links/FFmpegTools/LibraryResources/Linux-x86-64/FFmpegToolsSystem-6.0.so" || die
|
||||
fi
|
||||
if ! has_version 'media-video/ffmpeg:0/59.61.61'; then
|
||||
einfo 'Removing FFmpegTools version 7 support'
|
||||
rm -r "${S}/${M_TARGET}/SystemFiles/Links/FFmpegTools/LibraryResources/Linux-x86-64/FFmpegToolsSystem-7.0.so" || die
|
||||
fi
|
||||
fi
|
||||
|
||||
# MQTT Support -- Bundled version of mosquitto requires outdated shared libraries
|
||||
if use mqtt; then
|
||||
einfo 'Enabling MQTT support'
|
||||
ln -sf "$(equery files --filter=cmd app-misc/mosquitto | \
|
||||
sed -ne /mosquitto$/p)" "${S}/${M_TARGET}/SystemFiles/Links/MQTTLink/Resources/Binaries/Linux-x86-64" || die
|
||||
else
|
||||
einfo 'Removing MQTT support'
|
||||
rm -r "${S}/${M_TARGET}/SystemFiles/Links/MQTTLink" || die
|
||||
fi
|
||||
|
||||
# Remove cuda support for whisper. It requires an old version 11 of cuda.
|
||||
einfo 'Removing cuda support for Whisper'
|
||||
rm "${S}/${M_TARGET}/SystemFiles/Links//WhisperLink/LibraryResources/Linux-x86-64/libwhisper_cuda.so.1.5.5" || \
|
||||
! use cuda || die
|
||||
|
||||
# fix RPATH
|
||||
while IFS= read -r -d '' i; do
|
||||
# Use \x7fELF header to separate ELF executables and libraries
|
||||
# Skip .o files and static files to avoid surprises
|
||||
[[ $(od -t x1 -N 4 "${i}") == *"7f 45 4c 46"* ]] || continue
|
||||
[[ -f "${i}" && "${i: -2}" != ".o" ]] || continue
|
||||
[[ "$(file "${i}")" == *"dynamically"* ]] || continue
|
||||
einfo "Fixing RPATH of ${i}"
|
||||
patchelf --set-rpath \
|
||||
'/'"${M_TARGET}"'/SystemFiles/Libraries/Linux-x86-64:'\
|
||||
'/'"${M_TARGET}"'/SystemFiles/Libraries/Linux-x86-64/Qt/lib:'\
|
||||
'/'"${M_TARGET}"'/SystemFiles/Java/Linux-x86-64/lib:'\
|
||||
'/'"${M_TARGET}"'/SystemFiles/Java/Linux-x86-64/lib/jli:'\
|
||||
'$ORIGIN' "${i}" || \
|
||||
die "patchelf failed on ${i}"
|
||||
done < <(find "${S}/${M_TARGET}" -type f -print0)
|
||||
|
||||
# fix broken symbolic links
|
||||
ln -sf "/${M_TARGET}/Executables/WolframNB" "${S}/${M_TARGET}/Executables/mathematica" || die
|
||||
ln -sf "/${M_TARGET}/Executables/WolframNB" "${S}/${M_TARGET}/Executables/Mathematica" || die
|
||||
ln -sf "/${M_TARGET}/SystemFiles/Kernel/Binaries/Linux-x86-64/wolframscript" \
|
||||
"${S}/${M_TARGET}/Executables/wolframscript" || die
|
||||
|
||||
# move all over
|
||||
mv "${S}"/opt "${ED}"/opt || die
|
||||
|
||||
# the autogenerated symlinks point into sandbox, remove
|
||||
rm "${ED}"/opt/bin/* || die
|
||||
|
||||
# install wrappers instead
|
||||
for name in ${M_BINARIES} ; do
|
||||
einfo "Generating wrapper for ${name}"
|
||||
echo '#!/bin/sh' >> "${T}/${name}" || die
|
||||
echo 'QT_QPA_PLATFORM="wayland;xcb"' >> "${T}/${name}" || die
|
||||
echo "LD_PRELOAD=/usr/$(get_libdir)/libfreetype.so.6:/usr/$(get_libdir)/libz.so.1:/usr/$(get_libdir)/libcrypt.so.1 /${M_TARGET}/Executables/${name} \"\${@}\"" \
|
||||
>> "${T}/${name}" || die
|
||||
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 "${ED}/${M_TARGET}/SystemFiles/Installation" -name "*wolfram[-.][wW]olfram*.desktop") ; do
|
||||
einfo "Fixing ${filename}"
|
||||
sed -e 's/^Icon=.*$/Icon=wolfram-mathematica/' -i "${filename}" || die
|
||||
sed -e "s|${S}||g" -e 's|^\t\t||g' -i "${filename}" || die
|
||||
sed -e 's|Version=2.0|Version=1.0|' -e 's|\\+|+|g' -i "${filename}" || die
|
||||
echo "Categories=Physics;Science;Engineering;2DGraphics;Graphics;" >> "${filename}" || die
|
||||
domenu "${filename}"
|
||||
done
|
||||
|
||||
# install icons
|
||||
for iconsize in 16 32 64 128 256; do
|
||||
local iconfile="${ED}/${M_TARGET}/SystemFiles/FrontEnd/SystemResources/X/App-${iconsize}.png"
|
||||
if [ -e "${iconfile}" ]; then
|
||||
newicon -s "${iconsize}" "${iconfile}" wolfram-mathematica.png
|
||||
fi
|
||||
done
|
||||
|
||||
# install mime types
|
||||
insinto /usr/share/mime/application
|
||||
for filename in $(find "${ED}/${M_TARGET}/SystemFiles" -name "application-*.xml"); do
|
||||
basefilename=$(basename "${filename}")
|
||||
mv "${filename}" "${T}/${basefilename#application-}" || die
|
||||
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}"
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user