summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 3f08713ba27001c161687390f608ae94ed25804f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Submitter: Zesen Qian <quartus at riaqn dot org>
# Maintainer: Sequencer <liujiuyang1994 at gmail dot com>
#
# 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
#       is around 13GB.
#
pkgname=quartus-standard
pkgver=17.1.1.593
_oldver=17.1.0.590
pkgrel=1
pkgdesc="Quartus Prime Standard Edition design software for Altera FPGA's. Modular package"
arch=('i686' 'x86_64')
url="http://dl.altera.com/?edition=standard"
license=('custom')

_alteradir="/opt/altera"

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' 'lsb-release')

source=("RealQuartusSetup-${pkgver}-linux.run::http://download.altera.com/akdlm/software/acdsinst/17.1std.1/593/update/QuartusSetup-${pkgver}-linux.run"
        "http://download.altera.com/akdlm/software/acdsinst/17.1std/590/ib_installers/QuartusSetup-${_oldver}-linux.run"
        "quartus.sh"
        "quartus.desktop"
        "51-usbblaster.rules"
        "quartus.install")
sha256sums=('5a6a98b61b054bb2116be36afd53aa67e67684a0017adfca0e1a9b96ef0069da'
            '2f05a82bc996a9fa160f4dc42ea9afd047d7b1535589e4687681a611319eb44d'
            '849dd042a6173bb4f97a9522b51935bd3069a3313fe963ae19dcf4c25331b291'
            'eade659fda0db843a5b287502415c698c4f251f3b721836e2a56911896fc2371'
            'dd9d33fa2698a0ec11ae86f4508f77e2e12bf4a21224f5b16640bc41d6c0999b'
            '0e815b138bcec2d1f9c6aa498d2f56cc131417119af19016a2019173da526d9b')

options=(!strip !upx) # Stripping and UPX will takes ages, I'd avoid it.
install='quartus.install'
PKGEXT=".pkg.tar" # Do not compress
prepare() {
    cd "${srcdir}"
    chmod a+x "QuartusSetup-${_oldver}-linux.run"
    chmod a+x "RealQuartusSetup-${pkgver}-linux.run"
}

package() {
    cd "${srcdir}"
    DISPLAY="" ./"QuartusSetup-${_oldver}-linux.run" --accept_eula 1 --mode unattended --unattendedmodeui none --installdir "${pkgdir}${_alteradir}" & 
    while [ ! -f "${pkgdir}${_alteradir}/logs/quartus-${_oldver}-linux-install.log" ]; do
        echo waiting for QuartusSetup-${_oldver}
	sync
        sleep 10
    done
    killall QuartusSetup-${_oldver}-linux.run
    echo "base package packaged"
    DISPLAY="" ./"RealQuartusSetup-${pkgver}-linux.run" --accept_eula 1 --mode unattended --unattendedmodeui none --installdir "${pkgdir}${_alteradir}" & 
    while [ ! -f "${pkgdir}${_alteradir}/logs/quartus-${pkgver}-linux-install.log" ]; do
        echo waiting for QuartusSetup-${pkgver}
	sync
        sleep 10
    done
    killall RealQuartusSetup-${pkgver}-linux.run
    sync
    echo "update package packaged"
    # Remove uninstaller and install logs since we have a working package management
    echo "remove useless package"
    rm -r "${pkgdir}${_alteradir}/uninstall"
    rm -r "${pkgdir}${_alteradir}/logs"

    # Replace altera directory in integration files
    sed -i.bak "s,_alteradir,$_alteradir,g" quartus.sh
    sed -i.bak "s,_alteradir,$_alteradir,g" quartus.desktop

    # Copy license file
    install -D -m644 "${pkgdir}${_alteradir}/licenses/license.txt" "${pkgdir}/usr/share/licenses/${pkgnam}/license.txt"

    # Install integration files
    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"
}