summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 9b739f65be20f977d8606541f3228185f8248589 (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
# Maintainer: MithicSpirit <rpc01234 at gmail dot com>

_pkgname=idris2-pack
pkgname="$_pkgname-git"
pkgver=latest
pkgrel=3
epoch=
pkgdesc='An Idris2 package manager with curated package collections'
arch=('x86_64')
url="https://github.com/stefan-hoeck/$_pkgname"
license=('custom:BSD')
depends=('chez-scheme' 'sh')
makedepends=(
	'git'
	'idris2'
	'idris2-filepath'
	'idris2-elab-util'
	'idris2-getopts'
	'idris2-parser-toml'
)
optdepends=('idris2: Bootstrapping')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("$_pkgname::git+$url.git")
sha256sums=('SKIP')

prepare() {
	cd "$srcdir/$_pkgname"
	sed -i -e 's/initToml "scheme"/initToml "chez"/g' \
		-e 's|pathExec "pack"|MkF "/usr/bin" "pack"|g' \
		src/Pack/Config/Environment.idr
}

pkgver() {
	cd "$srcdir/$_pkgname"
	echo "r$(git rev-list --count HEAD).$(git rev-parse --short HEAD)"
}

build() {
	cd "$srcdir/$_pkgname"
	idris2 --build pack.ipkg
}

package() {
	cd "$srcdir/$_pkgname"

	install -dm755 "$pkgdir/usr/lib/"
	cp -r ./build/exec/pack_app "$pkgdir/usr/lib/"

	install -Dm755 ./build/exec/pack "$pkgdir/usr/bin/pack"
	sed -i 's|$DIR|/usr/lib|g' "$pkgdir/usr/bin/pack"

	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}