patch for AUR Matlab to enable login installation

Kyle
2019-05-13T03:55:58Z

aur-matlab.patch

| diff --git a/PKGBUILD b/PKGBUILD
| index a97c0b9..7b37fba 100644
| --- a/PKGBUILD
| +++ b/PKGBUILD
| @@ -40,6 +40,7 @@
|
| # partial install
| _partialinstall=false
| +_logininstall=true
|
| pkgname=matlab
| # install dir
| @@ -70,10 +71,10 @@ depends=('gconf'
| optdepends=('gcc6: For MEX support')
|
| source=("local:///matlab.tar"
| - "local:///matlab.fik"
| "matlab.png::https://upload.wikimedia.org/wikipedia/commons/2/21/Matlab_Logo.png")
| -md5sums=("SKIP" "SKIP" 'cf28632239db6e02bc09bcca6bf5360f')
| -PKGEXT='.pkg.tar'
| +md5sums=("SKIP" 'cf28632239db6e02bc09bcca6bf5360f')
| +
| +[ -z ${_logininstall} ] && source+=("local:///matlab.fik") && md5sums+=("SKIP")
|
| prepare() {
| msg2 'Creating desktop file'
| @@ -82,14 +83,18 @@ prepare() {
| --categories "Development;Education;Science;Mathematics;IDE" \
| --exec '/opt/matlab/bin/matlab -desktop'
|
| - msg2 'Extracting file installation key'
| - _fik=$(grep -o [0-9-]* ${pkgname}.fik)
| + if [ -z ${_logininstall} ]; then
| + msg2 'Extracting file installation key'
| + _fik=$(grep -o [0-9-]* ${pkgname}.fik)
| + fi
|
| msg2 'Modifying the installer settings'
| sed -i "s,^# destinationFolder=,destinationFolder=${pkgdir}/${_instdir}," "${srcdir}/${pkgname}/installer_input.txt"
| sed -i "s,^# agreeToLicense=,agreeToLicense=yes," "${srcdir}/${pkgname}/installer_input.txt"
| - sed -i "s,^# mode=,mode=silent," "${srcdir}/${pkgname}/installer_input.txt"
| - sed -i "s,^# fileInstallationKey=,fileInstallationKey=${_fik}," "${srcdir}/${pkgname}/installer_input.txt"
| + if [ -z ${_logininstall} ]; then
| + sed -i "s,^# mode=,mode=silent," "${srcdir}/${pkgname}/installer_input.txt"
| + sed -i "s,^# fileInstallationKey=,fileInstallationKey=${_fik}," "${srcdir}/${pkgname}/installer_input.txt"
| + fi
|
| if [ ! -z ${_products+isSet} ]; then
| msg2 'Building a package with a subset of the licensed products.'
| @@ -110,6 +115,8 @@ package() {
| install -D -m644 "${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
| install -D -m644 "${srcdir}/${pkgname}.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
|
| + msg2 'Clean the srcdir to forbind lacking space warning.'
| + /usr/bin/rm -rf ${srcdir}
| }
|
| if ${_partialinstall} && [ -z ${_products+isSet} ]; then