diff options
author | Gabriel Souza Franco | 2018-06-16 12:50:46 +0200 |
---|---|---|
committer | Gabriel Souza Franco | 2018-06-16 12:50:46 +0200 |
commit | d770b44af03f8cbb037508c24902a6dfdc404f75 (patch) | |
tree | 0eb319d95117ff89b50bf81dd40a96aa8f15d720 | |
parent | 3a94222c1cbb8b2422ab854c9ccd5168e53dc031 (diff) | |
download | aur-d770b44af03f8cbb037508c24902a6dfdc404f75.tar.gz |
Update to 18.0.0.614
This works around an installer bug by extracting the files ourselves
We can remove this hack after the installer is updated
-rw-r--r-- | .SRCINFO | 59 | ||||
-rw-r--r-- | .gitignore | 2 | ||||
-rw-r--r-- | PKGBUILD | 189 | ||||
-rwxr-xr-x | installFiles.tcl | 143 | ||||
-rw-r--r-- | modelsim-ae.desktop | 9 | ||||
-rw-r--r-- | quartus.desktop | 4 | ||||
-rw-r--r-- | quartus.install | 12 | ||||
-rw-r--r-- | quartus.sh | 4 |
8 files changed, 292 insertions, 130 deletions
@@ -1,33 +1,50 @@ -# Generated by mksrcinfo v8 -# Sun Jun 5 15:25:50 UTC 2016 pkgbase = quartus-free pkgdesc = Quartus Prime Lite Edition design software for Altera FPGA's - pkgver = 16.0.0.211 - pkgrel = 2 + pkgver = 18.0.0.614 + pkgrel = 1 url = https://dl.altera.com/?edition=lite - install = quartus.install - arch = i686 arch = x86_64 license = custom - makedepends = bash + makedepends = unzip + makedepends = metakit + makedepends = tcl-cookfs + makedepends = tdom + makedepends = patchelf + depends = lib32-expat + depends = lib32-fontconfig + depends = lib32-freetype2 + depends = lib32-glibc + depends = lib32-gtk2 + depends = lib32-libcanberra + depends = lib32-libpng + depends = lib32-libice + depends = lib32-libsm + depends = lib32-util-linux + depends = lib32-ncurses + depends = lib32-ncurses5-compat-libs + depends = lib32-zlib + depends = lib32-libx11 + depends = lib32-libxau + depends = lib32-libxdmcp + depends = lib32-libxext + depends = lib32-libxft + depends = lib32-libxrender + depends = lib32-libxt + depends = lib32-libxtst options = !strip - options = !upx - source = https://download.altera.com/akdlm/software/acdsinst/16.0/211/ib_tar/Quartus-lite-16.0.0.211-linux.tar - source = https://gaming.jhu.edu/mirror/archlinux/multilib/os/x86_64/lib32-freetype2-2.5.0.1-1-x86_64.pkg.tar.xz + options = !debug + source = http://download.altera.com/akdlm/software/acdsinst/18.0std//614/ib_tar/Quartus-lite-18.0.0.614-linux.tar source = quartus.sh source = quartus.desktop - source = 51-usbblaster.rules - source = quartus.install source = modelsim-ase.desktop - source = modelsim-ae.desktop - md5sums = A3AD9370D0773F4E6AC41D1EAC4C85EE - md5sums = d3b3b7cdf874b6dd0b60c40d84dd9128 - md5sums = 067c444cae7fe31d3608245712b43ce8 - md5sums = 32b17cb8b992fc2dccd33d87f0dcd8ce - md5sums = f5744dc4820725b93917e3a24df13da9 - md5sums = a331a81c44aed062a7af6d28542c3d82 - md5sums = bb11a542139ea8ded899ea42588ec0f7 - md5sums = eb4fbf2b7b3a2ffa59ccac57fff968e5 + source = 51-usbblaster.rules + source = installFiles.tcl + sha256sums = 25d40a57c1c2e66a36f18fd7545b5ba39e75e7db6201bb0c86da8e909d5a8915 + sha256sums = 2a3d61e6f01aa16c9d3ddd40e9741b9fd080496db5437530b4e38faf6771c1ed + sha256sums = f8ba2a84c6f7551bb4ab62d17f77e2814c70871ddb15f0276f1bf89cc6c674b8 + sha256sums = 1092f7fe1e6471f2f6fe12177ecb8781c26ec1fededd10f9e65de921debb8696 + sha256sums = dd9d33fa2698a0ec11ae86f4508f77e2e12bf4a21224f5b16640bc41d6c0999b + sha256sums = e91f5fceffe9220f15edd6fc403c578ad260ba81debf27a4978d0c07fcd8649e pkgname = quartus-free diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000000..9749d4c02ac0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +Quartus-* +*.pkg.* @@ -1,106 +1,127 @@ -# Maintainer: Matthias Blaicher <matthias at blaicher dot com> -# Co-Maintainer: Danny Dutton <duttondj@vt.edu> +# Maintainer: Gabriel Souza Franco <Z2FicmllbGZyYW5jb3NvdXphQGdtYWlsLmNvbQ==> +# Contributor: Matthias Blaicher <matthias at blaicher dot com> +# Contributor: Danny Dutton <duttondj@vt.edu> # # NOTE: If you plan on using the usbblaster make sure you are member of the plugdev group. -# NOTE: Altera has dramatically changed their packing in regards to version 12. This -# PKGBUILD will install the full Altera suite now. Be aware that the space requirement -# for installation is around 14GB but packaging may require up to 54GB of space. # pkgname=quartus-free -pkgver=16.0.0.211 -pkgrel=2 +_mainver=18.0 +# Keep dot in _patchver +_patchver=.0 +_buildver=614 +_basever=.0.614 +pkgver=${_mainver}${_patchver}.${_buildver} +pkgrel=1 pkgdesc="Quartus Prime Lite Edition design software for Altera FPGA's" -arch=('i686' 'x86_64') +arch=('x86_64') url="https://dl.altera.com/?edition=lite" license=('custom') -_build_nr=$(echo ${pkgver} | cut -d '.' -f4) -_alteradir="/opt/altera/${pkgver%.*.*}" - -# Change this to "ae" if using ModelSim Subscription Edition -_modelsimver="ase" +_alteradir="/opt/altera/${_mainver}" # According to the installer script, these dependencies are needed for the installer -if [[ $CARCH = i686 ]] -then - depends=('desktop-file-utils' 'expat' 'fontconfig' 'freetype2' - 'glibc' 'gtk2' 'libcanberra' 'libpng' 'libpng12' 'libice' 'libsm' - 'util-linux' 'ncurses' 'ncurses5-compat-libs' 'tcl' 'tcllib' - 'zlib' 'libx11' 'libxau' 'libxdmcp' 'libxext' 'libxft' - 'libxrender' 'libxt' 'libxtst') -fi - -if [[ $CARCH = x86_64 ]] -then - depends=('desktop-file-utils' 'expat' 'fontconfig' 'freetype2' - 'glibc' 'gtk2' 'libcanberra' 'libpng' 'libpng12' 'libice' 'libsm' - 'util-linux' 'ncurses' 'tcl' 'tcllib' 'zlib' 'libx11' 'libxau' - 'libxdmcp' 'libxext' 'libxft' 'libxrender' 'libxt' 'libxtst' - - 'lib32-expat' 'lib32-fontconfig' 'lib32-freetype2' 'lib32-glibc' - 'lib32-gtk2' 'lib32-libcanberra' 'lib32-libpng' 'lib32-libpng12' - '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') -fi - -makedepends=('bash') - -# A more permanent source for lib32-freetype2-2.5.0.1-1-x86-64 should be found -source=("https://download.altera.com/akdlm/software/acdsinst/${pkgver%.*.*}/${_build_nr}/ib_tar/Quartus-lite-${pkgver}-linux.tar" - "https://gaming.jhu.edu/mirror/archlinux/multilib/os/x86_64/lib32-freetype2-2.5.0.1-1-x86_64.pkg.tar.xz" # Used for a freetype bugfix HACK - "quartus.sh" "quartus.desktop" "51-usbblaster.rules" "quartus.install" "modelsim-ase.desktop" "modelsim-ae.desktop") -md5sums=('A3AD9370D0773F4E6AC41D1EAC4C85EE' - 'd3b3b7cdf874b6dd0b60c40d84dd9128' - '067c444cae7fe31d3608245712b43ce8' - '32b17cb8b992fc2dccd33d87f0dcd8ce' - 'f5744dc4820725b93917e3a24df13da9' - 'a331a81c44aed062a7af6d28542c3d82' - 'bb11a542139ea8ded899ea42588ec0f7' - 'eb4fbf2b7b3a2ffa59ccac57fff968e5') - -options=('!strip' '!upx') # Stripping and UPX will takes ages, I'd avoid it. -install='quartus.install' -PKGEXT=".pkg.tar" - -# Need to patch some Quartus/ModelSim files -prepare() { - cd "${srcdir}" - - echo "Notice: May require up to 54GB of free space during package building!" +depends=('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') + +makedepends=('unzip' 'metakit' 'tcl-cookfs' 'tdom' 'patchelf') + +source=("http://download.altera.com/akdlm/software/acdsinst/${_mainver}std${_patchver/.0//}/${_buildver}/ib_tar/Quartus-lite-${pkgver}-linux.tar" + 'quartus.sh' 'quartus.desktop' 'modelsim-ase.desktop' '51-usbblaster.rules' 'installFiles.tcl') +sha256sums=('25d40a57c1c2e66a36f18fd7545b5ba39e75e7db6201bb0c86da8e909d5a8915' + '2a3d61e6f01aa16c9d3ddd40e9741b9fd080496db5437530b4e38faf6771c1ed' + 'f8ba2a84c6f7551bb4ab62d17f77e2814c70871ddb15f0276f1bf89cc6c674b8' + '1092f7fe1e6471f2f6fe12177ecb8781c26ec1fededd10f9e65de921debb8696' + 'dd9d33fa2698a0ec11ae86f4508f77e2e12bf4a21224f5b16640bc41d6c0999b' + 'e91f5fceffe9220f15edd6fc403c578ad260ba81debf27a4978d0c07fcd8649e') + +options=(!strip !debug) # Stripping will takes ages, I'd avoid it +PKGEXT=".pkg.tar" # Same for compression + +package() { + echo "Notice: Requires around 34GB of free space during package building!" echo "Extracting install binaries and scripts from downloaded tar..." - # Run setup.sh to extract Quartus, ModelSim, and device/help files - DISPLAY="" bash ./setup.sh --mode unattended --unattendedmodeui none --installdir "${srcdir}${_alteradir}" + + # Quartus installer deadlocks when using recent glibc + # Work around it by doing the install ourselves + + echo "==> Installing QuartusLiteSetup" + ./installFiles.tcl components/QuartusLiteSetup-${_mainver}${_basever}-linux.run "${pkgdir}${_alteradir}" + + echo "==> Installing QuartusHelpSetup" + ./installFiles.tcl components/QuartusHelpSetup-${_mainver}${_basever}-linux.run "${pkgdir}${_alteradir}" + unzip -qq -o "${pkgdir}${_alteradir}/quartus/common/help/webhelp.zip" -d "${pkgdir}${_alteradir}/quartus/common/help/" + rm -f "${pkgdir}${_alteradir}/quartus/common/help/webhelp.zip" + + echo "==> Installing ModelSimSetup" + ./installFiles.tcl components/ModelSimSetup-${_mainver}${_basever}-linux.run "${pkgdir}${_alteradir}" "product_key modelsim_ase" + unzip -qq -o "${pkgdir}${_alteradir}/modelsim_ase/altera/modelsim_altera_verilog.zip" -d "${pkgdir}${_alteradir}/modelsim_ase/altera" + rm -f "${pkgdir}${_alteradir}/modelsim_ase/altera/modelsim_altera_verilog.zip" + unzip -qq -o "${pkgdir}${_alteradir}/modelsim_ase/altera/modelsim_altera_vhdl.zip" -d "${pkgdir}${_alteradir}/modelsim_ase/altera" + rm -f "${pkgdir}${_alteradir}/modelsim_ase/altera/modelsim_altera_vhdl.zip" + + for dev in arria_lite cyclone10lp cyclone cyclonev max10 max; do + echo "=> Installing component files for ${dev} devices" + unzip -qq -o components/${dev}-${_mainver}${_basever}.qdz -d "${pkgdir}${_alteradir}" + done + + #echo "=> Installing update file QuartusSetup-${pkgver}" + #./installFiles.tcl components/QuartusSetup-${pkgver}-linux.run "${pkgdir}${_alteradir}" echo "Finished extracting binaries and scripts." - # Remove uninstaller and install logs since we have a working package management - rm -r "${srcdir}${_alteradir}/uninstall" - rm -r "${srcdir}${_alteradir}/logs" - + # Remove useless unzip binaries + find "${pkgdir}${_alteradir}" -name "unzip" -or -name "unzip32" -delete + # Remove not installed folder + rmdir "${pkgdir}${_alteradir}/modelsim_ae" + + # vlib needs this folder for some reason + ln -s ${_alteradir}/modelsim_ase/linuxaloem "${pkgdir}${_alteradir}/modelsim_ase/linuxpe" + + # Fix interpreter for the license manager + for prog in quartus/linux64/{lmutil,lmgrd}; do + patchelf --set-interpreter /lib64/ld-linux-x86-64.so.2 "${pkgdir}${_alteradir}/${prog}" + done + for prog in ip/altera/mentor_vip_ae/common/linux{,_x86_64}/mgls/bin/lmgrd modelsim_ase/linuxaloem/{mgls/bin/,}{lmutil,lmgrd}; do + patchelf --set-interpreter /lib/ld-linux.so.2 "${pkgdir}${_alteradir}/${prog}" + done + + # Create Lite "license" files + touch "${pkgdir}${_alteradir}/quartus/linux64/qvweid.fil" + touch "${pkgdir}${_alteradir}/modelsim_ase/lib/.awe" + + # This file is removed for some reason + rm -f "${pkgdir}${_alteradir}/quartus/linux64/libsys_tb2_base.so" + + # The installer creates this file + mkdir -p "${pkgdir}${_alteradir}/quartus/sopc_builder" + cat > "${pkgdir}${_alteradir}/quartus/sopc_builder/.sopc_builder" <<EOF +# .sopc_builder configuration file: +sopc_builder = "${_alteradir}/quartus/sopc_builder"; +sopc_legacy_dir = ""; +sopc_quartus_dir = "${_alteradir}/quartus/"; +sopc_modelsim_dir = ""; +sopc_ui_debug = "0"; +EOF + # Replace altera directory in integration files - sed -i.bak "s,_alteradir,$_alteradir,g" quartus.sh - sed -i.bak "s,_alteradir,$_alteradir,g" quartus.desktop - sed -i.bak "s,_alteradir,$_alteradir,g" "modelsim-${_modelsimver}.desktop" + sed -i "s,_alteradir,${_alteradir},g" quartus.sh + sed -i "s,_alteradir,${_alteradir},g" quartus.desktop + 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.bak "s,linux_rh60,linux,g" "${srcdir}${_alteradir}/modelsim_${_modelsimver}/vco" + sed -i 's,linux_rh60,linux,g' "${pkgdir}${_alteradir}/modelsim_ase/vco" - # Tell ModelSim where to find the specific lib32-freetype2 libraries it requires - # see https://wiki.archlinux.org/index.php/Altera_Design_Software#With_freetype2_2.5.0.1-1 - sed -i.bak2 "10s,^,export LD_LIBRARY_PATH=${_alteradir}/modelsim_${_modelsimver}/lib \n,g" "${srcdir}${_alteradir}/modelsim_${_modelsimver}/vco" -} + # Modelsim bundles a copy of tkImg linked to old versions of libs + # Replace by system version + rm -rf "${pkgdir}${_alteradir}/modelsim_ase/linuxaloem/Img1.3" + ln -s /usr/lib32/Img[0-9]* "${pkgdir}${_alteradir}/modelsim_ase/linuxaloem/Img" -package() { - # Copy Quartus over to pkgdir for installation - mkdir -p "${pkgdir}${_alteradir}" - cp -r "${srcdir}${_alteradir}"/* "${pkgdir}${_alteradir}" + # Suppress spurious warning about linux-gate.so.1 + sed -i '/msg_system/a suppress = 3116' "${pkgdir}${_alteradir}/modelsim_ase/modelsim.ini" - # Place the lib32-freetype2 libraries where ModelSim is now expecting them to be - # see https://wiki.archlinux.org/index.php/Altera_Design_Software#With_freetype2_2.5.0.1-1 - install -D -m755 usr/lib32/libfreetype.so* "${pkgdir}${_alteradir}/modelsim_${_modelsimver}/lib" - # Copy license file install -D -m644 "${pkgdir}${_alteradir}/licenses/license.txt" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE" @@ -108,5 +129,5 @@ package() { install -D -m755 quartus.sh "${pkgdir}/etc/profile.d/quartus.sh" install -D -m644 51-usbblaster.rules "${pkgdir}/etc/udev/rules.d/51-usbblaster.rules" install -D -m644 quartus.desktop "${pkgdir}/usr/share/applications/quartus.desktop" - install -D -m644 modelsim-${_modelsimver}.desktop "${pkgdir}/usr/share/applications/modelsim-${_modelsimver}.desktop" + install -D -m644 modelsim-ase.desktop "${pkgdir}/usr/share/applications/modelsim-ase.desktop" } diff --git a/installFiles.tcl b/installFiles.tcl new file mode 100755 index 000000000000..7e503b0b52c2 --- /dev/null +++ b/installFiles.tcl @@ -0,0 +1,143 @@ +#!/bin/env tclsh +package require Mk4tcl +package require zlib +package require vfs::mk4 +package require vfs::cookfs +package require tdom + +if {$argc < 2} { + puts "Usage: installFiles.tcl <installer> <install dir>" + exit 1 +} + +set installer [lindex $argv 0] + +set fd [open $installer rb] +seek $fd -16 end +binary scan [read $fd 16] IIII guard1 offset guard2 guard3 +seek $fd [expr {-16-$offset}] end + +mk::file open db +mk::file load db $fd +close $fd + +vfs::filesystem mount installerFiles [list vfs::mk4::handler db] + +set fd [open installerFiles/cookfsinfo.txt r] +set cookfsinfo [read $fd] +close $fd + +lappend auto_path [file normalize installerFiles/libraries] +package require Tcllzmadec + +set fd [open installerFiles/project.xml r] +set proj [dom parse -channel $fd] +close $fd + +set fd [open installerFiles/manifest.txt r] +set manifest [read $fd] +close $fd + +set components [$proj selectNodes /project//componentList/component] +set variables [$proj selectNodes /project/initializationActionList//setInstallerVariable] +set mappings [dict create] +foreach component $components { + foreach folder [$component selectNodes folderList/folder] { + dict set mappings [string cat [[$component selectNodes name] text] "/" [[$folder selectNodes name] text]] [[$folder selectNodes destination] text] + } +} + +vfs::cookfs::Mount {*}$cookfsinfo $installer files + +set installdir [lindex $argv 1] + +proc setVariables {} { + uplevel { + global variables + global argc + global argv + foreach var $variables { + set varname [$var selectNodes name] + set varvalue [$var selectNodes value] + if {$varname ne "" && $varvalue ne ""} { + set [$varname text] [$varvalue text] + } + } + if {$argc >= 3} { + dict for {var value} [lindex $argv 2] { + set $var $value + } + } + } +} + +proc extractFiles {dic type} { + global mappings + global installdir + + setVariables + + dict for {path fstat} $dic { + set filt [dict filter $mappings script {k v} { + set a [string first $k $path 0] + expr !$a + }] + + if {[dict size $filt] == 1} { + set mapping [dict get $filt] + set dest [subst -nobackslashes -nocommands [lindex $mapping 1]]/ + set final_path [string replace $path 0 [string length [lindex $mapping 0]] $dest] + + switch $type { + "directory" { + file mkdir $final_path + set fatt [lindex $fstat 1] + file attributes $final_path -permissions [string range $fatt [expr {[string length $fatt]-4}] [string length $fatt]] + } + "file" { + if {[file exists $final_path]} { + file delete -force -- $final_path + } + set fatt [lindex $fstat 1] + set fout [open $final_path wb [string range $fatt [expr {[string length $fatt]-4}] [string length $fatt]]] + set fin [open files/$path rb] + fcopy $fin $fout + close $fin + set counter 1 + while {[file exists files/${path}___bitrockBigFile$counter]} { + set fin [open files/${path}___bitrockBigFile$counter rb] + fcopy $fin $fout + close $fin + incr counter + } + close $fout + } + "link" { + exec ln -s [lindex $fstat 1] $final_path + } + } + } + } +} + +setVariables + +foreach mapping [dict values $mappings] { + file mkdir [subst -nobackslashes -nocommands $mapping] +} + +set directories [dict filter $manifest script {k v} { + expr {[lindex $v 0] eq "directory"} +}] + +set files [dict filter $manifest script {k v} { + expr {[lindex $v 0] eq "file"} +}] + +set links [dict filter $manifest script {k v} { + expr {[lindex $v 0] eq "link"} +}] + +extractFiles $directories "directory" +extractFiles $files "file" +extractFiles $links "link" diff --git a/modelsim-ae.desktop b/modelsim-ae.desktop deleted file mode 100644 index 3775ace4c44e..000000000000 --- a/modelsim-ae.desktop +++ /dev/null @@ -1,9 +0,0 @@ -[Desktop Entry] -Version=1.0 -Name=ModelSim-Altera Standard Edition -Comment=ModelSim simulation software for Altera FPGA's -Exec=_alteradir/modelsim_ae/bin/vsim -Icon=_alteradir/modelsim_ae/modesim.gif -Terminal=false -Type=Application -Categories=Development diff --git a/quartus.desktop b/quartus.desktop index dfb88ec78ea3..49e86babb8e7 100644 --- a/quartus.desktop +++ b/quartus.desktop @@ -2,8 +2,8 @@ Version=1.0 Name=Quartus II Comment=Quartus II design software for Altera FPGA's -Exec=_alteradir/quartus/bin/quartus +Exec=_alteradir/quartus/bin/quartus --64bit Icon=_alteradir/quartus/adm/quartusii.png Terminal=false Type=Application -Categories=Development
\ No newline at end of file +Categories=Development diff --git a/quartus.install b/quartus.install deleted file mode 100644 index 714b377744ac..000000000000 --- a/quartus.install +++ /dev/null @@ -1,12 +0,0 @@ -post_install() { - update-desktop-database -q -} - -post_upgrade() { - update-desktop-database -q -} - - -post_remove() { - update-desktop-database -q -} diff --git a/quartus.sh b/quartus.sh index 792e78e980ca..cf627ae751f1 100644 --- a/quartus.sh +++ b/quartus.sh @@ -1,4 +1,4 @@ -export PATH=$PATH:_alteradir/quartus/bin +export PATH=$PATH:_alteradir/quartus/bin:_alteradir/modelsim_ase/bin # Detect if a 64bit machine and activate quartus # depending on it. @@ -7,4 +7,4 @@ if [ `uname -m` = "x86_64" ] ; then else QUARTUS_64BIT='0' fi -export QUARTUS_64BIT
\ No newline at end of file +export QUARTUS_64BIT |