-
Notifications
You must be signed in to change notification settings - Fork 0
/
PKGBUILD
61 lines (53 loc) · 2.75 KB
/
PKGBUILD
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
# Maintainer: Evan Greenup <evan_greenup@protonmail.com>
_name=ghcup-hs
pkgname=hx-${_name}
pkgver=0.1.30.0
pkgrel=5
license=("LGPL-3.0-only")
arch=('x86_64')
url="https://github.com/haskell/ghcup-hs"
depends=(curl python gcc gmp make ncurses libyaml)
makedepends=(stack cabal-install git)
provides=("ghc" "stack" "cabal-install" "haskell-language-server")
conflicts=("ghc" "stack" "cabal-install" "haskell-language-server" "ghcup-hs-bin")
replaces=("ghcup-hs")
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/haskell/ghcup-hs/archive/refs/tags/v${pkgver}.tar.gz"
"ghcup_entry_proxy.py")
sha256sums=('89d158023f634f079ac6a306bb87d208445384a725d47b432f6858c8876cbef6'
'9e440ce518a46d9d1b42617dd45fd8fc557e66a64fd49929694fdf7336a78263')
_resolver="lts-21.25"
prepare() {
stack update --resolver=$_resolver
}
build() {
cd "${srcdir}/${_name}-${pkgver}"
stack build --resolver=$_resolver ghcup:exe:ghcup
}
package() {
cd "${srcdir}/${_name}-${pkgver}"
mkdir -m755 -p "${pkgdir}/usr/bin/"
install -m755 "$(stack path --resolver=${_resolver} --local-install-root)/bin/ghcup" "${pkgdir}/usr/bin/ghcup"
chmod 755 "${pkgdir}/usr/bin/ghcup"
mkdir -m755 -p "${pkgdir}/usr/share/ghcup/script"
install -m755 "${srcdir}/ghcup_entry_proxy.py" "${pkgdir}/usr/share/ghcup/script/ghcup_entry_proxy.py"
mkdir -m755 -p "${pkgdir}/usr/share/licenses/${pkgname}"
install -D -m644 "LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/cabal"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/ghc"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/ghci"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/ghc-pkg"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/haddock"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/haskell-language-server-wrapper"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/hp2ps"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/hpc"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/hsc2hs"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/runghc"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py""${pkgdir}/usr/bin/runhaskell"
ln -s "/usr/share/ghcup/script/ghcup_entry_proxy.py" "${pkgdir}/usr/bin/stack"
_install_completion_script bash bash-completion/completions/ghcup
_install_completion_script zsh zsh/site-functions/_ghcup
_install_completion_script fish fish/vendor_completions.d/ghcup.fish
}
_install_completion_script() {
install -Dm644 <("$pkgdir/usr/bin/ghcup" --$1-completion-script "/usr/bin/ghcup") "$pkgdir/usr/share/$2"
}