summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: ed3826f313847859cc8079a14c38ce4d60f6e15b (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
_rockname=fennel
_project=lua-$_rockname
pkgname=("lua-$_rockname" "lua51-$_rockname" "lua52-$_rockname" "lua53-$_rockname")
pkgver=1.3.1
_rockrel=1
pkgrel=2
pkgdesc='Lisp that compiles to Lua'
arch=(any)
url="https://github.com/bakpakin/Fennel"
license=(MIT)
makedepends=(lua
             lua51
             lua52
             lua53
             luarocks)
_archive="Fennel-$pkgver"
source=("$_rockname-$pkgver.tar.gz::$url/archive/refs/tags/$pkgver.tar.gz")
sha256sums=('12045cbd70088b966e73ac4c54ad63e096fb9b91b9874cb17533c8045595ee74')

_package() {
    cd "$_archive"
    depends=("${pkgname%-*}")
    rm -f fennel fennel.lua
    LUA="lua$1" DESTDIR="$pkgdir" make fennel fennel.lua
    luarocks --lua-version="$1" --tree="$pkgdir/usr/" \
             make --deps-mode=none --no-manifest "rockspecs/${_rockname}-${pkgver}-${_rockrel}.rockspec"
    rm ${pkgdir}/usr/bin/fennel
    install -Dm755 "fennel" "${pkgdir}/usr/bin/lua$1-fennel"
}

package_lua-fennel() {
    _package 5.4
}

package_lua51-fennel() {
    _package 5.1
}

package_lua52-fennel() {
    _package 5.2
}

package_lua53-fennel() {
    _package 5.3
}