From 01cb128ca4d727692aab7f2dc9ccd53242ce7af6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Batuhan=20Ba=C5=9Ferdem?= Date: Mon, 21 Sep 2020 17:47:20 -0400 Subject: [PATCH] Version bump to 2020b --- .SRCINFO | 8 ++-- PKGBUILD | 84 +++++++++++++------------------------ README.md | 6 +-- matlab.tar.gz => matlab.tar | 0 4 files changed, 35 insertions(+), 63 deletions(-) rename matlab.tar.gz => matlab.tar (100%) diff --git a/.SRCINFO b/.SRCINFO index 17f89bc..0d8292b 100644 --- a/.SRCINFO +++ b/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = matlab pkgdesc = A high-level language for numerical computation and visualization - pkgver = 9.8.0.1323502 + pkgver = 9.9.0.1467703 pkgrel = 1 url = http://www.mathworks.com arch = x86_64 @@ -53,7 +53,9 @@ pkgbase = matlab depends = x11vnc depends = sudo depends = zlib - depends = gcc6 + depends = gcc9 + depends = gcc9-fortran + depends = gcc9-libs depends = gconf depends = glu depends = gstreamer0.10-base @@ -69,7 +71,7 @@ pkgbase = matlab provides = matlab-licenses provides = matlab-engine-for-python provides = matlab-bin - source = matlab.tar.gz + source = matlab.tar source = matlab.fik source = matlab.lic source = matlab.script diff --git a/PKGBUILD b/PKGBUILD index a9b78f4..f1a8ea0 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -2,10 +2,10 @@ # Matlab packaging for archlinux name=MATLAB -version='2020a' -instdir="/opt/tmw/${name}-${version}" +release='r2020b' +instdir="/opt/tmw/${name}-${release}" pkgname=matlab -pkgver=9.8.0.1323502 +pkgver=9.9.0.1467703 pkgrel=1 pkgdesc='A high-level language for numerical computation and visualization' arch=('x86_64') @@ -13,7 +13,7 @@ url='http://www.mathworks.com' license=(custom) makedepends=('gendesk' 'python' 'findutils' 'libselinux') # For 2020a; from https://hub.docker.com/r/mathworks/matlab-deps/dockerfile -# Some of the dependencies are probably not needed; if in case contact the maintainer +# Some of the dependencies are probably not needed; contact the maintainer please depends=( 'ca-certificates' 'lsb-release' @@ -59,9 +59,10 @@ depends=( 'x11vnc' 'sudo' 'zlib') -# These I got from arch before and afraid to play around +# These I got from arch before and afraid to play around. +# GCC: https://www.mathworks.com/support/requirements/supported-compilers.html depends+=( - 'gcc6' + 'gcc9' 'gcc9-fortran' 'gcc9-libs' 'gconf' 'glu' 'gstreamer0.10-base' @@ -75,7 +76,8 @@ depends+=( 'qt5-x11extras' 'xerces-c') provides=('matlab-licenses' 'matlab-engine-for-python' 'matlab-bin') -source=("matlab.tar.gz" +source=( + "matlab.tar" "matlab.fik" "matlab.lic" "matlab.script") @@ -89,7 +91,9 @@ products=( #---MATLAB Product Family---# "Curve_Fitting_Toolbox" # Math and Optimization "Database_Toolbox" # Database Access and Reporting + "Deep_Learning_HDL_Toolbox" "Deep_Learning_Toolbox" + "DSP_System_Toolbox" "Global_Optimization_Toolbox" "GPU_Coder" "MATLAB_Coder" # Code Generation @@ -138,7 +142,8 @@ prepare() { --pkgdesc "${pkgdesc}" \ --categories "Development;Education;Science;Mathematics;IDE" \ --mimetypes "application/x-matlab-data;text/x-matlab" \ - --exec 'sh -c '\''if [ "${MATLAB_INTEL_OVERRIDE}" = "yes" ] ; then exec env MESA_LOADER_DRIVER_OVERRIDE=i965 matlab -desktop ; else exec matlab -desktop ; fi'\' + --exec 'matlab -desktop' + #--exec 'sh -c '\''if [ "${MATLAB_INTEL_OVERRIDE}" = "yes" ] ; then exec env MESA_LOADER_DRIVER_OVERRIDE=i965 matlab -desktop ; else exec matlab -desktop ; fi'\' } build() { @@ -146,48 +151,22 @@ build() { # cause the installation to be non-interactive "${srcdir}/${pkgname}/install" -inputFile "${srcdir}/${pkgname}/installer_input.txt" - # Create spoofing for Python API - # https://aur.archlinux.org/packages/matlab-engine-for-python/ + # Build the python API cd "${srcdir}/build/extern/engines/python" - # Getting appropriate python version for spoofing - _matminor="$(find "${srcdir}/build/extern/engines/python" \ - -name 'matlabengineforpython3*.so' | - sort | - sed 's|.*matlabengineforpython3_\([0-9]\)\.so|\1|g' | - tail -1)" - echo 'import sys' > "${srcdir}/sitecustomize.py" - echo "sys.version_info = (3, ${_matminor}, 0)" >> "${srcdir}/sitecustomize.py" - + python setup.py build } package() { - # Install the python API - # https://www.mathworks.com/help/matlab/matlab_external/install-the-matlab-engine-for-python.html + # Package the python API cd "${srcdir}/build/extern/engines/python" - PYTHONPATH="${srcdir}" python setup.py \ - install --root="${pkgdir}" --optimize 1 - # Spoofing trick to fool matlab into believing 3.8 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)')" - # Correct file names - if [[ "${_pytminor}" != "${_matminor}" ]]; then - mv "${pkgdir}/${_prefix}/lib/python3".{"${_matminor}","${_pytminor}"} - _egginfo="$(ls "${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 + python setup.py install --root="${pkgdir}" --optimize 1 --skip-build # Fix erronous referances in the _arch.txt files + _prefix="$(python -c 'import sys; print(sys.prefix)')" errstr="${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" \ + "${pkgdir}/${_prefix}/lib/python3.8/site-packages/matlab/engine" \ ; do sed -i "s|${errstr}|${trustr}|" "${_dir}/_arch.txt" done @@ -214,46 +193,39 @@ package() { install -D -m644 "${srcdir}/${pkgname}.desktop" \ "${pkgdir}/usr/share/applications/${pkgname}.desktop" - # Create backup directories - mkdir -p "${pkgdir}/${instdir}/backup/bin/glnxa64/mexopts" - mkdir -p "${pkgdir}/${instdir}/backup/sys/os/glnxa64" - # Link mex options to ancient libraries sysdir="bin/glnxa64/mexopts" mkdir -p "${pkgdir}/${instdir}/backup/${sysdir}" cp "${pkgdir}/${instdir}/${sysdir}/gcc_glnxa64.xml" \ "${pkgdir}/${instdir}/backup/${sysdir}/" - sed -i "s/gcc/gcc-6/g" "${pkgdir}/${instdir}/${sysdir}/gcc_glnxa64.xml" + sed -i "s/gcc/gcc-9/g" "${pkgdir}/${instdir}/${sysdir}/gcc_glnxa64.xml" cp "${pkgdir}/${instdir}/${sysdir}/g++_glnxa64.xml" \ "${pkgdir}/${instdir}/backup/${sysdir}/" - sed -i "s/g++/g++-6/g" "${pkgdir}/${instdir}/${sysdir}/g++_glnxa64.xml" + sed -i "s/g++/g++-9/g" "${pkgdir}/${instdir}/${sysdir}/g++_glnxa64.xml" cp "${pkgdir}/${instdir}/${sysdir}/gfortran.xml" \ "${pkgdir}/${instdir}/backup/${sysdir}/" - sed -i "s/gfortran/gfortran-6/g" "${pkgdir}/${instdir}/${sysdir}/gfortran.xml" + sed -i "s/gfortran/gfortran-9/g" "${pkgdir}/${instdir}/${sysdir}/gfortran.xml" cp "${pkgdir}/${instdir}/${sysdir}/gfortran6.xml" \ "${pkgdir}/${instdir}/backup/${sysdir}/" - sed -i "s/gfortran/gfortran-6/g" "${pkgdir}/${instdir}/${sysdir}/gfortran6.xml" + sed -i "s/gfortran/gfortran-9/g" "${pkgdir}/${instdir}/${sysdir}/gfortran6.xml" # Remove unused library files # /sys/os/glnxa64/README.libstdc++ sysdir="sys/os/glnxa64" - mkdir -p "${pkgdir}/${instdir}/backup/${sysdir}" - mv "${pkgdir}/${instdir}/${sysdir}/"{libstdc++.so.6.0.22,libstdc++.so.6} \ + install -d -m755 "${pkgdir}/${instdir}/backup/${sysdir}" + mv "${pkgdir}/${instdir}/${sysdir}/"{libstdc++.so.6.0.25,libstdc++.so.6} \ "${pkgdir}/${instdir}/backup/${sysdir}/" mv "${pkgdir}/${instdir}/${sysdir}/libgcc_s.so.1" \ "${pkgdir}/${instdir}/backup/${sysdir}/" - mv "${pkgdir}/${instdir}/${sysdir}/"{libgfortran.so.3.0.0,libgfortran.so.3} \ + mv "${pkgdir}/${instdir}/${sysdir}/"{libgfortran.so.5.0.0,libgfortran.so.5} \ "${pkgdir}/${instdir}/backup/${sysdir}/" mv "${pkgdir}/${instdir}/${sysdir}/"{libquadmath.so.0.0.0,libquadmath.so.0} \ "${pkgdir}/${instdir}/backup/${sysdir}/" - # make sure MATLAB can find libgfortran.so.3 + # make sure MATLAB can find proper libraries libgfortran.so.3 mkdir -p "${pkgdir}/${instdir}/backup/bin" cp "${pkgdir}/${instdir}/bin/matlab" "${pkgdir}/${instdir}/backup/bin" - sed -i 's|LD_LIBRARY_PATH="`eval echo $LD_LIBRARY_PATH`"|LD_LIBRARY_PATH="`eval echo $LD_LIBRARY_PATH`:/usr/lib/gcc/x86_64-pc-linux-gnu/'$(pacman -Q gcc6 | awk '{print $2}' | cut -d- -f1)'"|g' "${pkgdir}/${instdir}/bin/matlab" - - # https://bbs.archlinux.org/viewtopic.php?id=236821 - # These steps were deleted cause matlab switched to new freetype + sed -i 's|LD_LIBRARY_PATH="`eval echo $LD_LIBRARY_PATH`"|LD_LIBRARY_PATH="`eval echo $LD_LIBRARY_PATH`:/usr/lib/gcc/x86_64-pc-linux-gnu/'$(pacman -Q gcc9 | awk '{print $2}' | cut -d- -f1)'"|g' "${pkgdir}/${instdir}/bin/matlab" # Install the script file to make scripting easier with matlab install -Dm 0755 "${srcdir}/matlab.script" "${pkgdir}/usr/bin/matscript" diff --git a/README.md b/README.md index bf7f66b..0dc36bc 100644 --- a/README.md +++ b/README.md @@ -49,15 +49,13 @@ Follow the steps; * After logging in and accepting license; select `Advanced Options > I want to download without installing` from the top dropdown menu. +* Set the download location to an empty directory called `matlab` * Select the toolboxes you want in the `PKGBUILD`. (Alternatively install them all) -* Download the files to an empty directory called `matlab` * After downloading; from the parent directory; do -`tar --create --verbose --file matlab.tar.gz .../matlab` +`tar --create --verbose --file matlab.tar matlab` to create the tarball. -# Tips - ## Large files To transport large files in fat32 media (most flash drives); use split and cat; diff --git a/matlab.tar.gz b/matlab.tar similarity index 100% rename from matlab.tar.gz rename to matlab.tar