aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorDaniel E. Shub2015-10-22 18:22:26 -0400
committerDaniel E. Shub2015-10-22 18:22:26 -0400
commit0b4bf1238eb2d413a164cd9b184c0182beec2f40 (patch)
treeb5a612293ea442fdcc2f37a51c7fb8bacbf3e41e /PKGBUILD
parent54a6fe5c2e92bcb3b781aa58d50ccaa473de0e90 (diff)
downloadaur-0b4bf1238eb2d413a164cd9b184c0182beec2f40.tar.gz
08.06.00-1
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD406
1 files changed, 159 insertions, 247 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 9b28856c8917..d6cd8e150625 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,273 +1,185 @@
-# Maintainer: Daniel E. Shub <Daniel.Shub@nottingham.ac.uk>
+# Maintainer: Daniel E. Shub <daniel.e.shub@gmail.com>
-## This PKGBUILD creates an Arch Linux package for the proprietary MATLAB application. A license from The MathWorks is needed in order to both build the package and to run MATLAB once the package is installed. In order to build the package the user must supply a licensed copy of the software and a file installation key. The file installation key must be saved in a plain text file with a name in the format of matlab-[RELEASE].lic (e.g., to install r2014a the file would be called matlab-r2014a.lic). The PKGBUILD requires that the MATLAB software be saved as an iso file with a name in the format of matlab-[RELEASE].iso (e.g., to install r2014a the file would be called matlab-r2014a.iso). If The MathWorks provided an iso file, this should be directly usable after it is appropriately renamed. For DVDs, the DVD must be first ripped to an appropriately named iso file. For versions of MATLAB up to r2013b, individual zip files of all toolboxes could be directly downloaded from a web interface at www.mathworks.com. Starting with r2014a only the main MATLAB installer can be downloaded. The remaining toolboxes must then be downloaded with the interactive installer (installation can be made to a temporary directory and canceled once the toolboxes are downloaded). Once all the toolboxes are downloaded they can be added to an iso file. The contents of the iso file depends on the release.
+## This PKGBUILD creates an Arch Linux package for the proprietary MATLAB application. A license from The MathWorks is needed in order to both build the package and to run MATLAB once the package is installed. In order to build the package the user must supply a plain text file installation key and the software. For network installations, in addition to the file installation key, a license file needs to be used for the installation. The ISO file can be downloaded from The MathWorks, generated from the official DVD, or created by using the interactive installer to download the toolboxes (installation can be made to a temporary directory and canceled once the toolboxes are downloaded). The contents of the ISO file must include: ./archives/ ./bin/ ./etc/ ./help/ ./java/ /sys ./activate.ini ./install ./installer_input.txt
-## For MATLAB releases including and after r2011b the contents of the iso file must include: ./archives/ ./bin/ ./etc/ ./help/ ./java/ ./sys/ ./activate.ini ./install ./installer_input.txt
+## The default installation behavior is to install all licensed products whether or not they are available in the iso file. To install only a subset of licensed products either provide a $_products array or set $_partialinstall and remove unwanted entries from the provided $_products array. To perform a network install set $_networkinstall.
-## For MATLAB releases between r2010b and r2011a and the contents of the iso file must include: ./archives/ ./bin/ ./etc/ ./help/ ./java/ ./activate.ini ./install ./installer_input.txt
-
-## The PKGBUILD does not support MATLAB releases including and prior to r2010a since the installer does not support unattended installation. In order for the PKGBUILD to create a package, all the toolboxes must be downloaded similar to releases r2010b-r2013b and then the installer must be run in interactive mode to create a local temporary installation of MATLAB. The installer can install MATLAB into an arbitrary directory (e.g., /tmp). This local temporary directory must then be added to an iso file and this could then be used in the PKGBUILD, but this is a lot of work to back port really old versions.
-
-## It is not possible to separately package the toolboxes due to the DRM policies imposed by The MathWorks on MATLAB which requires that the installer be used to properly add and remove toolboxes. The toolboxes that can be added to the package are limited by the file installation key. In cases in which the file installation key allows for toolboxes to be included in the package that the license does not include, those packages will be installed, but unavailable to the user.
-
-
-
-
-
-## ## Begin PKGBUILD ## ##
-
-## While the most current MATLAB release is r2014b, it is possible to build the package with earlier releases.
-_release=r2014b
-#_release=r2014a
-#_release=r2013b
-#_release=r2013a
-#_release=r2012b
-#_release=r2012a
-#_release=r2011b
-#_release=r2011a
-#_release=r2010b-sp2
-#_release=r2010b-sp1
-#_release=r2010b
-
-## The default behavior is to build a single package matlab. By setting _multirelease to be true different packages can be created for each MATLAB release (e.g., matlab-r2010b, matlab-r2010b-sp1, ... , matlab-r2014a).
-#_multirelease=true
-
-## The default installation behavior is to install all licensed products whether or not they have been downloaded. To install only a subset of licensed products set _partialinstall to be true and remove unwanted entries from the _products array.
-#_partialinstall=true
-_products=("Aerospace_Blockset"
- "Aerospace_Toolbox"
- "Bioinformatics_Toolbox"
- "Control_System_Toolbox"
- "Communications_Blockset" # Removed in r2011a
- "Communications_System_Toolbox" # Added in r2011a
- "Communications_Toolbox" # Removed in r2011a
- "Computer_Vision_System_Toolbox" # Added in r2011a
- "Curve_Fitting_Toolbox"
- "DO_Qualification_Kit"
- "Data_Acquisition_Toolbox"
- "Database_Toolbox"
- "Datafeed_Toolbox"
- "DSP_System_Toolbox" # Added in r2011a
- "Econometrics_Toolbox"
- "EDA_Simulator_Link" # Removed in r2012a
- "Embedded_Coder" # Added in r2011a
- "Embedded_IDE_Link" # Removed in r2011a
- "Filter_Design_HDL_Coder"
- "Filter_Design_Toolbox" # Removed in r2011a
- "Financial_Derivatives_Toolbox" # Removed in r2012b
- "Financial_Instruments_Toolbox" # Added in r2012b
- "Financial_Toolbox"
- "Fixed_Income_Toolbox" # Removed in r2012b
- "Fixed_Point_Designer" # Added in r2013a
- "Fixed_Point_Toolbox" # Removed in r2013a
- "Fuzzy_Logic_Toolbox"
- "Gauges_Blockset"
- "Global_Optimization_Toolbox"
- "HDL_Coder" # Added in r2012a
- "HDL_Verifier" # Added in r2012a
- "IEC_Certification_Kit"
- "Image_Acquisition_Toolbox"
- "Image_Processing_Toolbox"
- "Instrument_Control_Toolbox"
- "LTE_System_Toolbox" # Added in r2014a
- "MATLAB"
- "MATLAB_Builder_EX"
- "MATLAB_Builder_JA"
- "MATLAB_Builder_NE"
- "MATLAB_Coder" # Added in r2011a
- "MATLAB_Compiler"
- "MATLAB_Distributed_Computing_Server"
- "MATLAB_Production_Server" # Added in r2012b
- "MATLAB_Report_Generator"
- "Mapping_Toolbox"
- "Model_Predictive_Control_Toolbox"
- "Model_Based_Calibration_Toolbox"
- "Neural_Network_Toolbox"
- "OPC_Toolbox"
- "Optimization_Toolbox"
- "Parallel_Computing_Toolbox"
- "Partial_Differential_Equation_Toolbox"
- "Phased_Array_System_Toolbox" # Added in r2011a
- "Polyspace_Bug_Finder" # Added in r2013b
- "Polyspace_Code_Prover" # Added in r2013b
- "RF_Toolbox"
- "Real_Time_Windows_Target"
- "Real_Time_Workshop" # Removed in r2011a
- "Real_Time_Workshop_Embedded_Coder" # Removed in r2011a
- "Robust_Control_Toolbox"
- "Signal_Processing_Blockset" # Removed in r2011a
- "Signal_Processing_Toolbox"
- "SimBiology"
- "SimDriveline"
- "SimElectronics"
- "SimEvents"
- "SimHydraulics"
- "SimMechanics"
- "SimPowerSystems"
- "SimRF"
- "Simscape"
- "Simulink"
- "Simulink_3D_Animation"
- "Simulink_Code_Inspector" # Added in r2011b
- "Simulink_Coder" # Added in r2011a
- "Simulink_Control_Design"
- "Simulink_Design_Optimization"
- "Simulink_Design_Verifier"
- "Simulink_Fixed_Point" # Removed in r2013a
- "Simulink_HDL_Coder" # Removed in r2012a
- "Simulink_PLC_Coder"
- "Simulink_Real_Time" # Added in r2014a
- "Simulink_Report_Generator"
- "Simulink_Verification_and_Validation"
- "Spreadsheet_Link_EX"
- "Stateflow"
- "Stateflow_Coder" # Removed in r2011a
- "Statistics_Toolbox"
- "Symbolic_Math_Toolbox"
- "System_Identification_Toolbox"
- "SystemTest"
- "Target_Support_Package" # Removed in r2011a
- "Trading_Toolbox" # Added in r2013a
- "Vehicle_Network_Toolbox"
- "Video_and_Image_Processing_Blockset" # Removed in r2011a
- "Wavelet_Toolbox"
- "xPC_Target" # Removed in r2014a
- "xPC_Target_Embedded_Option" # Removed in r2014a
-)
-
-_basename=matlab
-pkgname="${_basename}"
+pkgname=matlab
+pkgver=08.06.00
pkgrel=1
-pkgdesc="A high-level language for numerical computation and visualization"
-arch=("x86_64")
-url="http://www.mathworks.com"
+pkgdesc='A high-level language for numerical computation and visualization'
+arch=('x86_64')
+url='http://www.mathworks.com'
license=(custom)
-makedepends=("gendesk")
-depends=("libxt"
- "libxpm"
- "libxmu"
- "libxp"
- "libxtst")
-optdepends=("alsa-lib: For sound"
- "glu: For hardware accelerated OpenGL"
- "xorg-fonts-100dpi: For adjustable font sizes in figures on a local xserver"
- "gcc-libs: For MEX support")
-source=("http://127.0.0.1/${_basename}-${_release}.iso"
- "http://127.0.0.1/${_basename}-${_release}.fik")
-md5sums=('SKIP' 'SKIP')
-
-## Add release dependent dependencies
-case "${_release}" in
- r2014a) depends+=("libxrender");;
- r2014b) depends+=("libxrender" "libxxf86vm" "libxrandr");;
-esac
-
-## Convert release to version number
-case "${_release}" in
- r2010b) pkgver=07.11.00;;
- r2010b-sp1) pkgver=07.11.01;;
- r2010b-sp2) pkgver=07.11.02;;
- r2011a) pkgver=07.12.00;;
- r2011b) pkgver=07.13.00;;
- r2012a) pkgver=07.14.00;;
- r2012b) pkgver=08.00.00;;
- r2013a) pkgver=08.01.00;;
- r2013b) pkgver=08.02.00;;
- r2014a) pkgver=08.03.00;;
- r2014b) pkgver=08.04.00;;
- *)
- echo "Unknown MATLAB release: ${_release}"
- exit 1
- ;;
-esac
-
-## Handle differences in the installation directories and package names associated with building a multi-release based package
-if [ "${_multirelease}" = true ]; then
- pkgname+="-${_release}"
- _matlabdir="opt/${_basename}/${_release}"
- _licensedir="usr/local/${_basename}/${_release}/licenses"
- echo "Building a multi-release package (${pkgname})."
-else
- _matlabdir="opt/${_basename}"
- _licensedir="usr/local/${_basename}/licenses"
- echo "Building a single release package (${pkgname})."
-fi
-
-## Determine the gcc version for the release
-case "${_release}" in
- r2010b|r2010b-sp1|r2010b-sp2|r2011a|r2011b) _gccver=4.3;;
- r2012a|r2012b|r2013a) _gccver=4.4;;
- r2013b|r2014a|r2014b) _gccver=4.7;;
- *)
- echo "Unknown MATLAB release: ${_release}"
- exit 1
- ;;
-esac
-optdepends+=("gcc${_gccver//./}: For MEX support")
-
-## Determine the gfortran version for the release
-case "${_release}" in
- r2010b|r2010b-sp1|r2010b-sp2) _gfortranver='';;
- r2011a|r2011b|r2012a|r2012b|r2013a) _gfortranver=4.3;;
- r2013b|r2014a|r2014b) _gfortranver=4.7;;
- *)
- echo "Unknown MATLAB release: ${_release}"
- exit 1
- ;;
-esac
-optdepends+=("gcc-fortran${_gfortranver//./}: For MEX support")
-
-## The icon file for the desktop launcher
-case "${_release}" in
- r2010b|r2010b-sp1|r2010b-sp2|r2011a|r2011b|r2012a|r2012b|r2013a|r2013b) _icon=X11/icons/matlab64c_icon.xpm;;
- r2014a|r2014b) _icon=help/matlab/matlab_env/matlab_desktop_icon.png;;
- *)
- echo "Unknown MATLAB release: ${_release}"
- exit 1
- ;;
-esac
-_iconfilename=$(basename "${_icon}")
-_iconextension="${_iconfilename##*.}"
+makedepends=('gendesk')
+depends=('gconf'
+ 'glu'
+ 'gstreamer0.10-base'
+ 'gtk2'
+ 'libunwind'
+ 'libxp'
+ 'libxpm'
+ 'libxtst'
+ 'ncurses5-compat-libs'
+ 'nss'
+ 'portaudio'
+ 'python2'
+ 'qt5-svg'
+ 'qt5-webkit'
+ 'qt5-websockets'
+ 'qt5-x11extras'
+ 'xerces-c')
+optdepends=('gcc47: For MEX support'
+ 'gcc47-fortran: For MEX support')
+source=("file://${pkgname}.iso"
+ "file://${pkgname}.fik")
+md5sums=('SKIP'
+ 'SKIP')
prepare() {
- gendesk -n --pkgname "${pkgname}" --pkgdesc "${pkgdesc}"
+ msg2 'Creating desktop file'
+ gendesk -f -n --pkgname "${pkgname}" --pkgdesc "${pkgdesc}" --categories "Development;Education;Science;Mathematics;IDE" > /dev/null
sed -i "/^Exec=/ s,$, -desktop," "${srcdir}/${pkgname}.desktop"
- sed -i "s,^# destinationFolder=,destinationFolder=${pkgdir}/${_matlabdir}," "${srcdir}/installer_input.txt"
- sed -i "s,^# fileInstallationKey=,fileInstallationKey=$(more ${_basename}-${_release}.fik)," "${srcdir}/installer_input.txt"
+ msg2 'Extracting file installation key'
+ _fik=$(grep -o [0-9-]* ${pkgname}.fik)
+
+ msg2 'Modifying the installer settings'
+ sed -i "s,^# destinationFolder=,destinationFolder=${pkgdir}/opt/tmw/${pkgname}/," "${srcdir}/installer_input.txt"
sed -i "s,^# agreeToLicense=,agreeToLicense=yes," "${srcdir}/installer_input.txt"
sed -i "s,^# mode=,mode=silent," "${srcdir}/installer_input.txt"
-
- if [ "${_partialinstall}" = true ]; then
- echo "Building a package with a subset of the licensed products."
+ sed -i "s,^# fileInstallationKey=,fileInstallationKey=${_fik}," "${srcdir}/installer_input.txt"
+ if [ ! -z ${_networkinstall+isSet} ]; then
+ sed -i "s,^# licensePath=,licensePath=${srcdir}/${pkgname}.lic," "${srcdir}/installer_input.txt"
+ fi
+ if [ ! -z ${_products+isSet} ]; then
+ msg2 'Building a package with a subset of the licensed products.'
for _product in "${_products[@]}"; do
sed -i "/^#product.${_product}$/ s/^#//" "${srcdir}/installer_input.txt"
- echo "The ${_product} product will be included in the package."
done
fi
}
package() {
- ## The MATLAB installer can get confused if it cannot connect to an X display, even if it is running in silent mode
- unset DISPLAY
+ msg2 'Starting MATLAB installer'
+ "${srcdir}/install" -t -inputFile "${srcdir}/installer_input.txt" -mode silent &> /dev/null
- "${srcdir}/install" -t -inputFile "${srcdir}/installer_input.txt" -mode silent
+ msg2 'Installing license'
+ install -D -m644 "${pkgdir}/opt/tmw/${pkgname}/license_agreement.txt" "${pkgdir}/usr/share/licenses/tmw/${pkgname}/LICENSE"
- install -D -m644 "${pkgdir}/${_matlabdir}/license.txt" "${pkgdir}/usr/share/licenses/${_basename}/${_release}/LICENSE"
+ msg2 'Creating links for license.lic'
+ ln -s "/etc/tmw/${pkgname}/licenses/" "${pkgdir}/opt/tmw/${pkgname}/licenses"
- ln -s "/${_licensedir}" "${pkgdir}/${_matlabdir}/licenses"
+ msg2 'Creating links for executables'
+ install -d -m755 "${pkgdir}/usr/bin/"
+ for _executable in deploytool matlab mbuild mcc mex; do
+ ln -s "/opt/tmw/${pkgname}/bin/${_executable}" "${pkgdir}/usr/bin/${_executable}"
+ done
- install -d 755 "${pkgdir}/usr/bin/"
- ln -s "/${_matlabdir}/bin/matlab" "${pkgdir}/usr/bin/${pkgname}"
+ msg2 'Installing desktop files'
+ install -D -m644 "${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
+ install -D -m644 "${pkgdir}/opt/tmw/${pkgname}/help/matlab/matlab_env/matlab_desktop_icon.png" "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
-
- install -Dm644 "${pkgname}.desktop" "${pkgdir}/usr/share/applications/${pkgname}.desktop"
- install -Dm644 "${pkgdir}/${_matlabdir}/${_icon}" "${pkgdir}/usr/share/pixmaps/${pkgname}.${_iconextension}"
-
- sed -i "s#CC='gcc'#CC='gcc-${_gccver}'#g" "${pkgdir}/${_matlabdir}/bin/mexopts.sh"
- sed -i "s#CXX='g++'#CXX='g++-${_gccver}'#g" "${pkgdir}/${_matlabdir}/bin/mexopts.sh"
- sed -i "s#FC='gfortran'#FC='gfortran-${_gfortranver}'#g" "${pkgdir}/${_matlabdir}/bin/mexopts.sh"
+ msg2 'Configuring mex options'
+ sed -i "s#CC='gcc'#CC='gcc-4.7'#g" "${pkgdir}/opt/tmw/${pkgname}/bin/mexopts.sh"
+ sed -i "s#CXX='g++'#CXX='g++-4.7'#g" "${pkgdir}/opt/tmw/${pkgname}/bin/mexopts.sh"
+ sed -i "s#FC='gfortran'#FC='gfortran-4.7'#g" "${pkgdir}/opt/tmw/${pkgname}/bin/mexopts.sh"
## See $MATLABROOT/sys/os/glnxa64/README.libstdc++
- rm ${pkgdir}/${_matlabdir}/sys/os/glnxa64/{libstdc++.so.6,libgcc_s.so.1,libgfortran.so.3.0.0}
+ msg2 'Removing unused library files'
+ rm ${pkgdir}/opt/tmw/${pkgname}/sys/os/glnxa64/{libstdc++.so.6.0.17,libstdc++.so.6,libgcc_s.so.1,libgfortran.so.3.0.0,libgfortran.so.3,libquadmath.so.0.0.0,libquadmath.so.0}
}
+
+## For network installations, apparently, a license file needs to be used for the installation.
+if [ ! -z ${_networkinstall+isSet} ]; then
+ source+="file://${pkgname}.lic"
+ md5sums+='SKIP'
+fi
+
+if [ ! -z ${_partialinstall+isSet} ] && [ -z ${_products+isSet} ]; then
+ _products=(
+ "Aerospace_Blockset"
+ "Aerospace_Toolbox"
+ "Antenna_Toolbox"
+ "Bioinformatics_Toolbox"
+ "Communications_System_Toolbox"
+ "Computer_Vision_System_Toolbox"
+ "Control_System_Toolbox"
+ "Curve_Fitting_Toolbox"
+ "DO_Qualification_Kit"
+ "DSP_System_Toolbox"
+ "Data_Acquisition_Toolbox"
+ "Database_Toolbox"
+ "Datafeed_Toolbox"
+ "Econometrics_Toolbox"
+ "Embedded_Coder"
+ "Filter_Design_HDL_Coder"
+ "Financial_Instruments_Toolbox"
+ "Financial_Toolbox"
+ "Fixed_Point_Designer"
+ "Fuzzy_Logic_Toolbox"
+ "Gauges_Blockset"
+ "Global_Optimization_Toolbox"
+ "HDL_Coder"
+ "HDL_Verifier"
+ "IEC_Certification_Kit"
+ "Image_Acquisition_Toolbox"
+ "Image_Processing_Toolbox"
+ "Instrument_Control_Toolbox"
+ "LTE_System_Toolbox"
+ "MATLAB"
+ "MATLAB_Coder"
+ "MATLAB_Compiler"
+ "MATLAB_Compiler_SDK"
+ "MATLAB_Distributed_Computing_Server"
+ "MATLAB_Production_Server"
+ "MATLAB_Report_Generator"
+ "Mapping_Toolbox"
+ "Model_Predictive_Control_Toolbox"
+ "Model_Based_Calibration_Toolbox"
+ "Neural_Network_Toolbox"
+ "OPC_Toolbox"
+ "Optimization_Toolbox"
+ "Parallel_Computing_Toolbox"
+ "Partial_Differential_Equation_Toolbox"
+ "Phased_Array_System_Toolbox"
+ "Polyspace_Bug_Finder"
+ "Polyspace_Code_Prover"
+ "RF_Toolbox"
+ "Robotics_System_Toolbox"
+ "Robust_Control_Toolbox"
+ "Signal_Processing_Toolbox"
+ "SimBiology"
+ "SimDriveline"
+ "SimElectronics"
+ "SimEvents"
+ "SimHydraulics"
+ "SimMechanics"
+ "SimPowerSystems"
+ "SimRF"
+ "Simscape"
+ "Simulink"
+ "Simulink_3D_Animation"
+ "Simulink_Code_Inspector"
+ "Simulink_Coder"
+ "Simulink_Control_Design"
+ "Simulink_Design_Optimization"
+ "Simulink_Design_Verifier"
+ "Simulink_Desktop_Real_Time"
+ "Simulink_PLC_Coder"
+ "Simulink_Real_Time"
+ "Simulink_Report_Generator"
+ "Simulink_Test"
+ "Simulink_Verification_and_Validation"
+ "Spreadsheet_Link_EX"
+ "Stateflow"
+ "Statistics_and_Machine_Learning_Toolbox"
+ "Symbolic_Math_Toolbox"
+ "System_Identification_Toolbox"
+ "SystemTest"
+ "Trading_Toolbox"
+ "Vehicle_Network_Toolbox"
+ "Vision_HDL_Toolbox"
+ "Wavelet_Toolbox"
+ )
+fi