Last active
May 13, 2019 04:49
-
-
Save specter119/8112ca0952394a4277f71984b808e8d7 to your computer and use it in GitHub Desktop.
patch for AUR Matlab to enable login installation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment