diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 79 |
1 files changed, 55 insertions, 24 deletions
@@ -5,17 +5,20 @@ # Contributor: Raphael Scholer <rscholer@gmx.de> # Contributor: kjslag <kjslag at gmail dot com> # Contributor: teratomata <teratomat@gmail.com> +# Contributor: Maxim Mikityanskiy <maxtram95@gmail.com> pkgname=mathematica -pkgver=12.2.0 +pkgver=14.0.0 +_pkgver=${pkgver%.[0-9]} pkgrel=1 -pkgdesc="A computational software program used in scientific, engineering, and mathematical fields and other areas of technical computing." +pkgdesc="A computational software program used in scientific, engineering, and mathematical fields and other areas of technical computing with offline documentation." arch=('x86_64') url="http://www.wolfram.com/mathematica/" license=('proprietary') depends=( 'openmp' ) +makedepends=('rsync') optdepends=( ## The following list of dependencies was inferred from namcap's output. If ## you believe there is an error, please let me know. Also feel free to @@ -70,8 +73,20 @@ optdepends=( 'tesseract' 'zlib' ) -source=("local://Mathematica_${pkgver}_LINUX.sh") -md5sums=('259a0b9688fa1829924497ef355816de') +_source_url=$( + curl -q "https://www.wolfram.com/download-center/mathematica/" \ + | grep "account.wolfram.com/dl/Mathematica" \ + | grep "version=${_pkgver}" \ + | grep "platform=Linux" \ + | grep -v "includesDocumentation" \ + | sed -E 's/.*href="([^"]+)".*/\1/' +) +source=( + "Mathematica_${pkgver}_BNDL_LINUX.sh::${_source_url}" + "remove-xdg-scripts.patch" +) +md5sums=('2e9479b7622ea8d09d465ffc53a753c4' + '14df424ec93fad057604378c2b5c24c2') options=("!strip") ## To build this package you need to place the mathematica-installer into your @@ -87,7 +102,7 @@ options=("!strip") # PKGEXT='.pkg.tar' prepare() { - warning "Building Mathematica takes more than 20GiB of space for 'makepkg', and another 10GiB for the pkg tarball." + warning "Building Mathematica takes more than 24GiB of space for 'makepkg'." warning "Building in a tmpfs (e.g. /tmp when mounted into RAM) may not work." if [ $(echo "${srcdir}" | wc -w) -ne 1 ]; then @@ -96,17 +111,36 @@ prepare() { exit 1 fi - chmod +x ${srcdir}/Mathematica_${pkgver}_LINUX.sh + msg2 "Extracting Mathematica installer..." + sh "${srcdir}/Mathematica_${pkgver}_BNDL_LINUX.sh" \ + --keep \ + --target "${srcdir}/bundle" \ + -- \ + -help >/dev/null + + patch -p1 -d "${srcdir}/bundle" < "${srcdir}/remove-xdg-scripts.patch" } package() { msg2 "Running Mathematica installer" # https://reference.wolfram.com/language/tutorial/InstallingMathematica.html#650929293 - sh ${srcdir}/Mathematica_${pkgver}_LINUX.sh -- \ - -execdir=${pkgdir}/usr/bin \ - -targetdir=${pkgdir}/opt/Mathematica \ - -auto - msg2 "Errors related to 'xdg-icon-resource' and 'xdg-desktop-menu' are to be expected during Mathematica's installation." + sh "${srcdir}/bundle/Unix/Installer/MathInstaller" \ + -execdir="${pkgdir}/usr/bin" \ + -targetdir="${pkgdir}/opt/Mathematica" \ + -auto + + # Install documentation + sh "${srcdir}/bundle/Unix/.bundle/Unix/Installer/MathInstaller" \ + -targetdir="${pkgdir}/tmp" \ + -auto + rsync -a --remove-source-files "${pkgdir}/tmp/Documentation/English" "${pkgdir}/opt/Mathematica/Documentation" + rm -rf "${pkgdir}/tmp" + + if [ -s "${pkgdir}/opt/Mathematica/InstallErrors" ]; then + msg2 "Review installation errors:" + cat "${pkgdir}/opt/Mathematica/InstallErrors" + fi + rm -f "${pkgdir}/opt/Mathematica/InstallErrors" msg2 "Fixing symbolic links" cd ${pkgdir}/opt/Mathematica/Executables @@ -128,7 +162,7 @@ package() { mkdir -p ${srcdir}/WolframScript mkdir -p ${pkgdir}/usr/share/ cd ${srcdir}/WolframScript - bsdtar -xf ${pkgdir}/opt/Mathematica/SystemFiles/Installation/wolframscript_1.5.0+2020121053_amd64.deb data.tar.xz + bsdtar -xf ${pkgdir}/opt/Mathematica/SystemFiles/Installation/wolframscript_*_amd64.deb data.tar.xz tar -xf data.tar.xz -C ${pkgdir}/usr/share/ --strip=3 ./usr/share/ @@ -138,13 +172,12 @@ package() { ${pkgdir}/usr/share/desktop-directories \ ${pkgdir}/usr/share/mime/packages cd ${pkgdir}/opt/Mathematica/SystemFiles/Installation - desktopFile='wolfram-mathematica12.desktop' - sed -Ei 's|^(\s*TryExec=).*|\1/usr/bin/Mathematica|g' $desktopFile - sed -Ei 's|^(\s*Exec=).*|\1/usr/bin/Mathematica %F|g' $desktopFile - printf 'Categories=Science;Math;NumericalAnalysis;DataVisualization;' >> $desktopFile - printf 'StartupWMClass=Mathematica;' >> $desktopFile + desktopFile="com.wolfram.Mathematica.${_pkgver}.desktop" + sed -Ei "s|^(\s*TryExec=).*|\1/usr/bin/Mathematica|g" $desktopFile + sed -Ei "s|^(\s*Exec=).*|\1/usr/bin/Mathematica --name com.wolfram.mathematica.${_pkgver} %F|g" $desktopFile + printf 'Categories=Science;Education;Languages;ArtificialIntelligence;Astronomy;Biology;Chemistry;ComputerScience;DataVisualization;Geography;ImageProcessing;Math;NumericalAnalysis;MedicalSoftware;Physics;ParallelComputer;\n' >> $desktopFile cp $desktopFile ${pkgdir}/usr/share/applications/ - cp wolfram-all.directory ${pkgdir}/usr/share/desktop-directories/ + cp *.directory ${pkgdir}/usr/share/desktop-directories/ cp *.xml ${pkgdir}/usr/share/mime/packages/ msg2 "Copying icons" @@ -162,12 +195,10 @@ package() { cd ${pkgdir}/opt/Mathematica/SystemFiles/SystemDocumentation/Unix cp *.1 ${pkgdir}/usr/share/man/man1 + msg2 "Copying license" + mkdir -p ${pkgdir}/usr/share/licenses/Mathematica/ + cp ${pkgdir}/opt/Mathematica/LICENSE.txt ${pkgdir}/usr/share/licenses/Mathematica/license.txt + msg2 "Fixing file permissions" chmod go-w -R ${pkgdir}/* - - ## The documentation takes up the majority of the disk space (6.8G+). If you - ## do not wish to have the documentation installed, uncomment the following - ## lines. - # msg2 "Removing documentation" - # rm -rf "${pkgdir}/opt/Mathematica/Documentation" } |