From 548edc2b41f7e8300a9fc959097454f4ae658115 Mon Sep 17 00:00:00 2001 From: dkwo Date: Mon, 14 Feb 2022 13:42:05 +0100 Subject: [PATCH] new package: mathematica --- srcpkgs/mathematica/template | 61 ++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 srcpkgs/mathematica/template diff --git a/srcpkgs/mathematica/template b/srcpkgs/mathematica/template new file mode 100644 index 000000000000..20b79c34eb0b --- /dev/null +++ b/srcpkgs/mathematica/template @@ -0,0 +1,61 @@ +# Template file for 'mathematica' +pkgname=mathematica +version=13.0.0 +revision=1 +archs="x86_64" +hostmakedepends="tar xz" +depends="$(vopt_if notebook 'alsa-lib xdg-user-dirs xorg')" +# probably less than full xorg is actualy enough +short_desc="Computational software" +maintainer="dkwo " +license="custom:Proprietary" +homepage="https://wolfram.com/mathematica" +noshlibprovides=yes +noverifyrdeps=yes +nopie=yes +nostrip=yes +repository=nonfree +restricted=yes +python_version=3 + +build_options="nodocs notebook" +build_options_default="nodocs" +desc_option_nodocs="Remove documentation (saves 6GB+)" +desc_option_notebook="Add dependecies to run notebook" + +_M_BINARIES="MathKernel Mathematica WolframKernel math mathematica mcc wolfram" + +do_build() { + if [ ! -f ${FILESDIR}/Mathematica_${version}_BNDL_LINUX.sh ]; then + echo 'please provide the installer script' + return 1 + fi + cp ${FILESDIR}/Mathematica_${version}_BNDL_LINUX.sh Mathematica.sh + chmod +x Mathematica.sh + sh Mathematica.sh -- \ + -execdir=${DESTDIR}/usr/bin \ + -targetdir=${DESTDIR}/opt/Mathematica \ + -auto +} + +do_install() { + # fix permissions + chmod -R go-w ${DESTDIR}/* + vlicense ${DESTDIR}/opt/Mathematica/LICENSE.txt + $(vopt_if nodocs "rm -rf ${DESTDIR}/opt/Mathematica/Documentation") + # remove MacOS- and Windows-specific files + cd ${DESTDIR}/opt/Mathematica + find AddOns SystemFiles -type d -\( -name Windows -o -name Windows-x86-64 \ + -o -name MacOSX -o -name MacOSX-x86-64 -\) -exec rm -rv {} + + # fix symlinks + cd ${DESTDIR}/opt/Mathematica/Executables + rm wolframscript + ln -s /opt/Mathematica/SystemFiles/Kernel/Binaries/Linux-x86-64/wolframscript + cd ${DESTDIR}/usr/bin + rm * + for _i in ${_M_BINARIES}; do + ln -s /opt/Mathematica/Executables/$_i + done + ln -s /opt/Mathematica/SystemFiles/Kernel/Binaries/Linux-x86-64/ELProver + ln -s /opt/Mathematica/SystemFiles/Kernel/Binaries/Linux-x86-64/wolframscript +}