summaryrefslogtreecommitdiff
path: root/skip/cabal/cabal.xibuild
blob: 501b0e30197f865b4a20935c89be9acc38814635 (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
#!/bin/sh

NAME="cabal"
DESC="The Haskell Cabal"

MAKEDEPS="cabal-stage0"
DEPS="gmp libffi musl zlib "

PKG_VER=3.6.2.0
SOURCE="https://hackage.haskell.org/package/cabal-install-$PKG_VER/cabal-install-$PKG_VER.tar.gz"
ADDITIONAL="cabal.project.freeze "


prepare () {
    export cabal_home="$BUILD_ROOT/dist"

	ln -sf cabal.project.freeze \
		"cabal.project.freeze"
}

build () {
    HOME="$cabal_home" cabal v2-update
	HOME="$cabal_home" cabal v2-build all \
		--allow-newer \
		--jobs=${JOBS:-1} \
		--prefix=/usr \
		--docdir=/usr/share/doc/cabal \
		--sysconfdir=/etc
}

package () {
    HOME="$cabal_home" cabal list-bin --allow-newer all:exes | \
    xargs install -Dm755 -t "$PKG_DEST"/usr/bin

	mkdir -p "$PKG_DEST"/usr/share/man/man1
	HOME="$cabal_home" cabal man --raw \
		> "$PKG_DEST"/usr/share/man/man1/cabal.1

	install -Dm644 LICENSE "$PKG_DEST/usr/share/licenses/cabal/LICENSE"
}