aboutsummaryrefslogtreecommitdiffstats
path: root/community/fennel/APKBUILD
blob: 7eabdb30c4c23265fb00de423c758b7202a1adf6 (plain) (blame)
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
# Contributor: Will Sinatra <wpsinatra@gmail.com>
# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=fennel
pkgver=0.8.1
pkgrel=0
pkgdesc="A Lua Lisp Language"
url="https://fennel-lang.org"
arch="all"
license="MIT"
source="fennel-$pkgver.tar.gz::https://git.sr.ht/~technomancy/fennel/archive/$pkgver.tar.gz"
_lua_version=5.3 #Upstream suggests building against 5.3 until 5.4 has better library support
makedepends="lua5.3 lua5.3-dev lua5.3-libs"
subpackages="$pkgname-doc"

check() {
	make test LUA=lua$_lua_version
}

build() {
	make fennel-bin LUA=lua$_lua_version STATIC_LUA_LIB=/usr/lib/liblua-$_lua_version.so.0.0.0
	./fennel-bin --compile src/fennel/binary.fnl > binary.lua
}

package() {
	install -Dm644 "fennelview.lua" \
			-t "$pkgdir/usr/share/lua/$_lua_version/"

	install -Dm644 "fennel.lua" \
			-t "$pkgdir/usr/share/lua/$_lua_version/"

	install -Dm644 "binary.lua" \
			-t "$pkgdir/usr/share/lua/$_lua_version/fennel/"

	install -Dm644 "fennel.1" \
			-t "$pkgdir/usr/share/man/man1/fennel.1"

	install -Dm755 "fennel-bin" \
			"$pkgdir/usr/bin/fennel"
}

sha512sums="6ccc8553eaf42d4cba56c1a3fb3f6ac75292fe2b13c4fe8f205fe7d457e02427616f7a31ff8145cf6a7fc5a6283934039f5ac80c2789d03ca497e7aac68f5f27  fennel-0.8.1.tar.gz"