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

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

_setenv() {
	unset IDRIS2_PACKAGE_PATH IDRIS2_PREFIX
	IDRIS2_PACKAGE_PATH="$(idris2 --libdir)"
	IDRIS2_PREFIX="$pkgdir/usr/lib"
	export IDRIS2_PACKAGE_PATH IDRIS2_PREFIX
}

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

build() {
	_setenv
	cd "$srcdir/$_pkgname"
	idris2 --build lsp-lib.ipkg
}

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

	idris2 --install-with-src lsp-lib.ipkg
	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}