summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0c7cd7db6381e507d1292e8e36f24f7527909e4a (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
# Maintainer: Shohei Maruyama <cheat.sc.linux@outlook.com>

pkgname='elm-git'
pkgver=0.18.0.r1814.g047d5026
pkgrel=2
pkgdesc='Compiler for Elm, a functional language for reliable webapps'
arch=('x86_64' 'aarch64')
url='https://github.com/elm/compiler'
license=('BSD')
source=("git+https://github.com/elm/compiler.git")
depends=(
	'ghc-libs'
	'haskell-file-embed'
	'haskell-filelock'
	'haskell-sha'
	'haskell-snap-server'
	'haskell-zip-archive'
	'haskell-raw-strings-qq'
	'haskell-language-glsl'
	'haskell-http'
	'haskell-ansi-wl-pprint'
	'haskell-http-client-tls'
	'haskell-edit-distance'
	'haskell-utf8-string'
)
makedepends=(
	'ghc'
	'uusi'
)
sha256sums=('SKIP')

pkgver() {
	cd compiler

	git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

prepare() {
	cd compiler

	gen-setup
	uusi -u HTTP -u ansi-terminal -u containers -u http-client -u network elm.cabal
}

build() {
	cd compiler

	runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
			--prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --disable-tests \
			--dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
			--ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
			--ghc-option='-pie'

	runhaskell Setup build ${MAKEFLAGS}
}

package() {
	cd compiler

	runhaskell Setup copy --destdir="${pkgdir}"
	install -D -m644 LICENSE -t "${pkgdir}/usr/share/licenses/${pkgname}/"
	rm -f "${pkgdir}/usr/share/doc/${pkgname}/LICENSE"
	rm -rf "${pkgdir}/usr/share/doc"
}