summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 48824a41c16862f2557ff73da19ae89eb8f69b44 (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
# Maintainer: Philippe Hürlimann <p@hurlimann.org>
pkgname=haskell-ide-engine
pkgver=1.1
pkgrel=1
pkgdesc="The engine for haskell ide-integration. Not an IDE"
arch=('x86_64')
url="https://github.com/haskell/haskell-ide-engine"
license=('custom:BSD3')
makedepends=('git' 'stack' 'cabal-install' 'happy')
source=("${pkgname}-${pkgver}::git://github.com/haskell/${pkgname}.git#tag=${pkgver}")
noextract=()
md5sums=('SKIP')

# Supported are '8.4.2' '8.4.3' '8.4.4' '8.6.4' '8.6.5' '8.8.1' '8.8.2'
# activated by default are the ones also used in a stackage snapshot. Removing
# versions you do not use will greatly reduce the compilation time of this
# package
_enabled_ghc_versions=('8.4.3' '8.4.4' '8.6.4' '8.6.5')

prepare() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    git submodule update --init
}

build() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    for ver in "${_enabled_ghc_versions[@]}"; do
        stack --stack-yaml=stack-${ver}.yaml build
    done
}

package() {
    cd "${srcdir}/${pkgname}-${pkgver}"
    install -D -m 644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"

    for ver in "${_enabled_ghc_versions[@]}"; do
        stack --stack-yaml=stack-${ver}.yaml --local-bin-path "${pkgdir}/usr/bin/" install \
        && mv "${pkgdir}/usr/bin/hie" "${pkgdir}/usr/bin/hie-${ver}"
    done
}