Created
October 3, 2021 08:08
-
-
Save buttercutter/ba7d790e8b030309aaf74b2bde1e32b2 to your computer and use it in GitHub Desktop.
PKGBUILD for Modelsim
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
pkgname=modelsim | |
# Keep dot in _patchver | |
_mainver=20.1; _patchver=.1; _buildver=720 | |
pkgver=${_mainver}${_patchver}.${_buildver} | |
pkgrel=1 | |
# According to the installer script, these dependencies are needed for the installer | |
depends=('ld-lsb' 'lib32-expat' 'lib32-fontconfig' 'lib32-freetype2' 'lib32-glibc' | |
'lib32-gtk2' 'lib32-libcanberra' 'lib32-libpng' 'lib32-libice' 'lib32-libsm' | |
'lib32-util-linux' 'lib32-ncurses' 'lib32-ncurses5-compat-libs' 'lib32-zlib' | |
'lib32-libx11' 'lib32-libxau' 'lib32-libxdmcp' 'lib32-libxext' 'lib32-libxft' | |
'lib32-libxrender' 'lib32-libxt' 'lib32-libxtst') | |
depends+=(lib32-alsa-lib lib32-libxi lib32-libxml2) | |
pkgdesc="ModelSim-Intel FPGA Starter Edition" | |
arch=('x86_64') | |
url="https://fpgasoftware.intel.com/20.1.1/?edition=standard&product=modelsim_ae&platform=linux#tabs-2" | |
license=('custom') | |
_alteradir="/opt/altera" | |
source=("./ModelSimSetup-${pkgver}-linux.run" | |
'modelsim-ase.sh' | |
'modelsim-ase.desktop') | |
md5sums=('adfdde0d455dadedd2cc094cbf771352' | |
'ea5eca3341da1628e57f3efb7e074796' | |
'a32f9e42db394016ce267c8d96f69cd5') | |
options=(!strip !debug) # Stripping will takes ages, I'd avoid it | |
PKGEXT=".pkg.tar.zst" # ZSTD is fast enough for compression | |
prepare(){ | |
chmod u+x ./ModelSimSetup-${pkgver}-linux.run | |
} | |
package() { | |
DISPLAY="" ./ModelSimSetup-${pkgver}-linux.run \ | |
--modelsim_edition modelsim_ase \ | |
--mode unattended \ | |
--unattendedmodeui none \ | |
--accept_eula 1 \ | |
--installdir "${pkgdir}${_alteradir}" | |
# Remove uninstaller and install logs since we have a working package management | |
rm -r "${pkgdir}${_alteradir}/uninstall" | |
rm -r "${pkgdir}${_alteradir}/logs" | |
# Fix missing permissions | |
find "${pkgdir}${_alteradir}" \! -perm /o+rwx -exec chmod o=g {} \; | |
# Replace altera directory in integration files | |
sed -i "s,_alteradir,${_alteradir},g" modelsim-ase.sh | |
sed -i "s,_alteradir,${_alteradir},g" modelsim-ase.desktop | |
# Fix modelsim startup code for Linux Kernel >=4.0 | |
# see https://wiki.archlinux.org/index.php/Altera_Design_Software | |
sed -i 's,linux_rh60,linux,g' "${pkgdir}${_alteradir}/modelsim_ase/vco" | |
# Suppress spurious warning about linux-gate.so.1 | |
sed -i '/msg_system/a suppress = 3116' "${pkgdir}${_alteradir}/modelsim_ase/modelsim.ini" | |
# Install integration files | |
install -D -m755 modelsim-ase.sh "${pkgdir}/etc/profile.d/modelsim-ase.sh" | |
install -D -m644 modelsim-ase.desktop "${pkgdir}/usr/share/applications/modelsim-ase.desktop" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment