aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMarco Rubin2022-09-16 15:34:05 +0200
committerMarco Rubin2022-09-16 15:34:05 +0200
commitfac96479460e98e93c9db0e238f8be9681e22eed (patch)
tree5a3ea62f58b1658958eabddd7f630094c9c47f7b /PKGBUILD
parent88210eb823425713b93ac61ef7f8a408f910f229 (diff)
downloadaur-fac96479460e98e93c9db0e238f8be9681e22eed.tar.gz
R2022b
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD252
1 files changed, 29 insertions, 223 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 2d7e9f24961e..5a3997df4a20 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,281 +3,87 @@
# Contributor: Batuhan Baserdem <lastname dot firstname at gmail>
pkgbase=matlab
-# python-matlabengine must be packaged before matlab, because package_matlab
-# moves files needed by package_python-matlabengine, they're expensive to copy.
-pkgname=('python-matlabengine' 'matlab')
-pkgrel=6
-# No need to modify the pkgver here, it will be determined by the script
-# in the offline installer.
-pkgver=9.12.0.1903524
+pkgname=(matlab)
+pkgrel=1
+pkgver=9.13.0.2049777
pkgdesc='A high-level language for numerical computation and visualization'
-arch=('x86_64')
-url='http://www.mathworks.com'
+arch=(x86_64)
+url='https://www.mathworks.com'
license=(custom)
+depends=(matlab-meta)
makedepends=('findutils' 'gendesk' 'icoutils' 'python')
-# Some of the dependencies probably are not needed.
-# If you play around with them and find which one can be removed,
-# please contact the maintainers.
-# For a list of possible dependencies, see the package `namcap` and here:
-# https://hub.docker.com/r/mathworks/matlab-deps/dockerfile.
-depends=(
- 'alsa-lib'
- 'atk'
- 'ca-certificates'
- 'cairo'
- 'fontconfig'
- 'gdk-pixbuf2'
- 'glib2'
- 'gst-plugins-base'
- 'gstreamer'
- 'gtk3'
- 'krb5'
- 'libcap'
- 'libcups'
- 'libdbus'
- 'libdrm'
- 'libgcrypt'
- 'libselinux'
- 'libsm'
- 'libsndfile'
- 'libx11'
- 'libxcb'
- 'libxcomposite'
- 'libxcrypt-compat'
- 'libxcursor'
- 'libxdamage'
- 'libxext'
- 'libxfixes'
- 'libxft'
- 'libxi'
- 'libxmu'
- 'libxrandr'
- 'libxrender'
- 'libxslt'
- 'libxss'
- 'libxt'
- 'libxtst'
- 'libxxf86vm'
- 'lsb-release'
- 'make'
- 'mesa'
- 'net-tools'
- 'nspr'
- 'nss'
- 'pam'
- 'pango'
- 'procps-ng'
- 'sudo'
- 'unzip'
- 'util-linux-libs'
- 'wget'
- 'x11vnc'
- 'xorg-server-xvfb'
- 'zlib')
-# We should check even these ones.
-# GCC: https://www.mathworks.com/support/requirements/supported-compilers.html
-depends+=(
- 'gconf'
- 'glu'
- 'libunwind'
- 'libxp'
- 'libxpm'
- 'portaudio'
- 'qt5-svg'
- 'qt5-webkit'
- 'qt5-websockets'
- 'qt5-x11extras'
- 'xerces-c')
-provides=('matlab-bin' 'matlab' 'python-matlabengine')
+provides=('matlab-bin' 'matlab')
source=(
'local://matlab.tar'
'local://matlab.fik'
'local://matlab.lic'
)
-md5sums=(SKIP SKIP SKIP)
+b2sums=(SKIP SKIP SKIP)
-# Set this to `true` to do a partial install, otherwise install all products.
-_partialinstall=false
# Example list of products for a partial install. Check the README for details.
+# Leave empty for a full installation.
_products=(
"MATLAB"
"Simulink"
)
-
-_instdir="usr/lib/${pkgbase}"
+_release=''
+_instdir="usr/lib/matlab"
pkgver() {
- cat "${srcdir}/${pkgbase}/VersionInfo.xml" | grep "<version>" | sed "s|\s*<version>\(.*\)</version>\s*|\1|g"
+ _release=$(cat "${srcdir}/${pkgbase}/VersionInfo.xml" | grep "<release>" | sed "s|\s*<release>\(.*\)</release>\s*|\1|g")
+ cat "${srcdir}/${pkgbase}/VersionInfo.xml" | sed --quiet 's|\s*<version>\(.*\)</version>\s*|\1|p'
}
prepare() {
- # Extract file installation key.
- release=$(cat "${srcdir}/${pkgbase}/VersionInfo.xml" | grep "<release>" | sed "s|\s*<release>\(.*\)</release>\s*|\1|g")
-
- msg2 "Release from tarball: ${release}"
-
- _fik=$(grep -o '[0-9-]*' "${srcdir}/${pkgbase}.fik")
+ msg2 "Release from tarball: ${_release}"
msg2 "Modifying installer settings..."
-
+ _fik=$(grep -o '[0-9-]*' "${srcdir}/matlab.fik")
_set="${srcdir}/${pkgbase}/installer_input.txt"
sed -i "s|^# destinationFolder=|destinationFolder=${srcdir}/build|" "${_set}"
sed -i "s|^# fileInstallationKey=|fileInstallationKey=${_fik}|" "${_set}"
sed -i "s|^# agreeToLicense=|agreeToLicense=yes|" "${_set}"
- sed -i "s|^# improveMATLAB=yes|improveMATLAB=no|" "${_set}"
+ sed -i "s|^# outputFile=|outputFile=${srcdir}/../install.log|" "${_set}"
+ sed -i "s|improveMATLAB=yes|improveMATLAB=no|" "${_set}"
sed -i "s|^# licensePath=|licensePath=${srcdir}/matlab.lic|" "${_set}"
- # Install specified products if _partialinstall is set to 'true'.
- if [ "${_partialinstall}" = 'true' ]; then
+ # Install specified products if _products is non-empty.
+ if [ "${#_products[@]}" -gt '0' ]; then
for _prod in "${_products[@]}"; do
sed -i 's|^#\(product.'"${_prod}"'\)$|\1|' "${_set}"
done
fi
msg2 "Generating desktop file..."
- # Add a fix for Intel GPUs with mesa 20, see:
- # https://wiki.archlinux.org/index.php/MATLAB#OpenGL_acceleration
- # https://wiki.archlinux.org/index.php/Intel_graphics#Old_OpenGL_Driver_(i965)
gendesk -f -n \
--pkgname "${pkgbase}" \
--pkgdesc "${pkgdesc}" \
- --name "MATLAB" \
+ --name "MATLAB ${_release}" \
+ --genericname "MATLAB" \
+ --comment 'Programming and numeric computing platform' \
--categories "Development;Education;Science;Mathematics;IDE" \
--mimetypes "application/x-matlab-data;text/x-matlab" \
--icon "${pkgbase}" \
- --exec 'sh -c '\''if [ "${MATLAB_INTEL_OVERRIDE}" = "yes" ] ; then exec env MESA_LOADER_DRIVER_OVERRIDE=i965 GTK_PATH=/usr/lib/gtk-2.0 matlab -desktop ; else exec env GTK_PATH=/usr/lib/gtk-2.0 matlab -desktop ; fi'\'
+ --exec 'matlab'
}
build() {
msg2 "Running original installer..."
- # Using the installer with the -inputFile parameter will automatically
- # cause the installation to be non-interactive.
+ # -inputFile makes the installation non-interactive.
"${srcdir}/${pkgbase}/install" -inputFile "${srcdir}/${pkgbase}/installer_input.txt"
-
- msg2 "Building Python API..."
-
- cd "${srcdir}/build/extern/engines/python"
-
- msg2 "Checking supported vs existing MATLAB versions..."
- _matminor="$(find "${srcdir}/build/extern/engines/python" \
- -name 'matlabengineforpython3*.so' |
- sort |
- sed 's|.*matlabengineforpython3_\([0-9]\+\)\.so|\1|g' |
- tail -1)"
- _pytminor="$(python -c 'import sys; print(sys.version_info.minor)')"
-
- if [[ "${_pytminor}" != "${_matminor}" ]]; then
- msg2 "Spoofing Python version compatibility..."
- _matcustom="${srcdir}/sitecustomize.py"
- touch "${_matcustom}"
- echo 'import sys' >> "${_matcustom}"
- echo "sys.version_info = (3, ${_matminor}, 0)" >> "${_matcustom}"
- fi
-
- PYTHONPATH="${srcdir}" python setup.py build
-
- msg2 "Removing build licenses..."
- rm -rf "${srcdir}/build/licenses/*"
-}
-
-package_python-matlabengine() {
- depends=('matlab' 'python')
-
- msg2 "Installing license..."
- install -D -m644 "${srcdir}/${pkgbase}/license_agreement.txt" \
- "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
-
- msg2 "Packaging Python API..."
- cd "${srcdir}/build/extern/engines/python"
- PYTHONPATH="${srcdir}" python setup.py install --root="${pkgdir}" --optimize 1 --skip-build
-
- msg2 "Spoofing trick to fool MATLAB into believing current Python version is supported..."
- _matminor="$(find "${srcdir}/build/extern/engines/python" \
- -name 'matlabengineforpython3*.so' |
- sort |
- sed 's|.*matlabengineforpython3_\([0-9]\+\)\.so|\1|g' |
- tail -1)"
- _prefix="$(python -c 'import sys; print(sys.prefix)')"
- _pytminor="$(python -c 'import sys; print(sys.version_info.minor)')"
-
- if [[ "${_pytminor}" != "${_matminor}" ]]; then
- msg2 "Changing around locations as spoofing is needed..."
- mv "${pkgdir}${_prefix}/lib/python3".{"${_matminor}","${_pytminor}"}
- _egginfo="$(ls -d "${pkgdir}${_prefix}/lib/python3.${_pytminor}/site-packages/"*"-py3.${_matminor}.egg-info")"
- mv "${_egginfo}" "${_egginfo%py3."${_matminor}".egg-info}py3.${_pytminor}.egg-info"
- sed -i "s|sys.version_info|(3, $_matminor, 0)|" \
- "${pkgdir}${_prefix}/lib/python3.${_pytminor}/site-packages/matlab/engine/__init__.py"
- fi
-
- msg2 "Fixing erroneous references in the _arch.txt files..."
- errstr=$(realpath "${srcdir}/build/extern/engines/python/")
- trustr="/${_instdir}/extern/engines/python/"
- for _dir in \
- "${srcdir}/build/extern/engines/python/build/lib/matlab/engine" \
- "${pkgdir}${_prefix}/lib/python3.${_pytminor}/site-packages/matlab/engine" \
- ; do
- sed -i "s|${errstr}|${trustr}|" "${_dir}/_arch.txt"
- done
}
package_matlab() {
- # Compilers should be optional dependencies.
- msg2 "Determining compiler versions..."
- if [ "$(vercmp ${pkgver} "9.10" )" -ge "0" ]; then
- optdepends+=('gcc9: For MEX support'
- 'gcc8-fortran: For MEX support')
- gccexc="gcc-9"
- gppexc="g++-9"
- gfortranlib="gcc8-fortran"
- gfortranexc="gfortran-8"
- elif [ "$(vercmp ${pkgver} "9.9" )" -ge "0" ]; then
- optdepends+=('gcc8: For MEX support'
- 'gcc8-fortran: For MEX support')
- gccexc="gcc-8"
- gppexc="g++-8"
- gfortranlib="gcc8-fortran"
- gfortranexc="gfortran-8"
- elif [ "$(vercmp ${pkgver} "9.4" )" -ge "0" ]; then
- optdepends+=('gcc6: For MEX support'
- 'gcc6-fortran: For MEX support')
- gccexc="gcc-6"
- gppexc="g++-6"
- gfortranlib="gcc6-fortran"
- gfortranexc="gfortran-6"
- elif [ "$(vercmp ${pkgver} "9.1" )" -ge "0" ]; then
- optdepends+=('gcc49: For MEX support')
- gccexc="gcc-49"
- gppexc="g++-49"
- gfortranlib="gcc49"
- gfortranexc="gfortran-49"
- elif [ "$(vercmp ${pkgver} "8.2" )" -ge "0" ]; then
- optdepends+=('gcc47: For MEX support')
- gccexc="gcc-47"
- gppexc="g++-47"
- gfortranlib="gcc47"
- gfortranexc="gfortran-47"
- else
- msg2 "You need to install the GCC for MEX support yourself."
- msg2 "Visit here to determine your needed GCC version."
- msg2 "https://www.mathworks.com/support/requirements/previous-releases.html"
- msg2 "Create your own GCC package with name \"gcc-matlab\", and link these excutables to /usr/bin:"
- msg2 "gcc-matlab g++-matlab gfortran-matlab"
- gccexc="gcc-matlab"
- gppexc="g++-matlab"
- gfortranlib="gcc-matlab"
- gfortranexc="gfortran-matlab"
- fi
-
- msg2 "Moving files from building area to packaging area..."
+ msg2 "Moving files from build area to package area to save space..."
install -dm755 "${pkgdir}/usr/lib/"
mv "${srcdir}/build" "${pkgdir}/${_instdir}"
msg2 "Installing license..."
- install -D -m644 "${srcdir}/${pkgbase}/license_agreement.txt" \
+ install -Dm644 "${srcdir}/${pkgbase}/license_agreement.txt" \
"${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
msg2 "Symlinking executables..."
- install -d -m755 "${pkgdir}/usr/bin/"
+ install -dm755 "${pkgdir}/usr/bin/"
for _executable in deploytool matlab mbuild activate_matlab.sh; do
ln -s "/${_instdir}/bin/${_executable}" "${pkgdir}/usr/bin/${_executable}"
done
@@ -289,7 +95,7 @@ package_matlab() {
ln -s "/${_instdir}/bin/glnxa64/mlint" "${pkgdir}/usr/bin/mlint"
msg2 "Installing desktop files..."
- install -D -m644 "${srcdir}/${pkgbase}.desktop" \
+ install -Dm644 "${srcdir}/${pkgbase}.desktop" \
"${pkgdir}/usr/share/applications/${pkgbase}.desktop"
install -Dm644 "${srcdir}/${pkgbase}/bin/glnxa64/cef_resources/matlab_icon.png" \
"$pkgdir/usr/share/pixmaps/$pkgbase.png"
@@ -313,7 +119,7 @@ package_matlab() {
msg2 "Removing unused library files..."
# <MATLABROOT>/sys/os/glnxa64/README.libstdc++
sysdir="sys/os/glnxa64"
- install -d -m755 "${pkgdir}/${_instdir}/backup/${sysdir}"
+ install -dm755 "${pkgdir}/${_instdir}/backup/${sysdir}"
mv "${pkgdir}/${_instdir}/${sysdir}/"{libstdc++.so.*,libgcc_s.so.*,libgfortran.so.*,libquadmath.so.*} \
"${pkgdir}/${_instdir}/backup/${sysdir}/"
mv "${pkgdir}/${_instdir}"/bin/glnxa64/libfreetype.so.* \