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

_pkgname=idris2-lsp
pkgname="$_pkgname-git"
pkgver=latest
pkgrel=3
epoch=
pkgdesc='Language Server for Idris2'
arch=('x86_64')
url="https://github.com/idris-community/$_pkgname"
license=('custom:BSD')
depends=('idris2' 'sh')
makedepends=('git' 'idris2-lsp-lib-git')
provides=("$_pkgname")
conflicts=("$_pkgname")
source=("$_pkgname::git+$url.git"
        'idris2::git+https://github.com/idris-lang/Idris2.git')
sha256sums=('SKIP' 'SKIP')

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

prepare() {
	cd "$srcdir/$_pkgname"
	git submodule init
	git config submodule.Idris2.url "$srcdir/idris2"
	git -c protocol.file.allow=always submodule update
}

build() {
	cd "$srcdir/$_pkgname"
	make build
}

check() {
	cd "$srcdir/$_pkgname"
	make testbin
	INTERACTIVE='' make test-only
}

package() {
	cd "$srcdir/$_pkgname"
	PREFIX="$pkgdir/usr/lib" make install-only

	mkdir -p "$pkgdir/usr/bin"
	mv "$pkgdir/usr/lib/bin/$_pkgname" "$pkgdir/usr/bin/$_pkgname"
	sed -i 's|$DIR|/usr/lib|g' "$pkgdir/usr/bin/$_pkgname"

	mv "$pkgdir/usr/lib/bin/${_pkgname}_app" \
		"$pkgdir/usr/lib/${_pkgname}_app"
	rmdir "$pkgdir/usr/lib/bin"

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