summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 18313044671d8a78fc3ae04eac113253ebdf872c (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
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Christian Krause ("wookietreiber") <christian.krause@mailbox.org>

_rockname=posix
pkgbase=lua-$_rockname
_pkgbase="${pkgbase//-}"
pkgname=("lua-$_rockname" "lua53-$_rockname" "lua52-$_rockname" "lua51-$_rockname")
pkgver=35.0
_rockrel=1
pkgrel=1
pkgdesc="POSIX bindings for Lua"
arch=('x86_64' 'i686')
url="https://github.com/$_pkgbase/$_pkgbase"
license=('MIT')
makedepends=('lua' 'lua53' 'lua52' 'lua51' 'luarocks')
_lua_deps=('std-normalize')
source=("$_pkgbase-$pkgver.tar.gz::$url/archive/v$pkgver.tar.gz")
sha256sums=('a4edf2f715feff65acb009e8d1689e57ec665eb79bc36a6649fae55eafd56809')

_package_helper() {
    cd "$_pkgbase-$pkgver"
    luarocks --lua-version="$1" --tree="$pkgdir/usr/" \
        make --deps-mode=none --no-manifest "$_pkgbase-$pkgver-$_rockrel.rockspec"
    install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}

package_lua-posix() {
    depends+=('lua' "${_lua_deps[@]/#/lua-}")
    _package_helper 5.4
}

package_lua53-posix() {
    depends+=('lua53' "${_lua_deps[@]/#/lua53-}")
    _package_helper 5.3
}

package_lua52-posix() {
    depends+=('lua52' "${_lua_deps[@]/#/lua52-}")
    _package_helper 5.2
}

package_lua51-posix() {
    depends+=('lua51' "${_lua_deps[@]/#/lua51-}")
    _package_helper 5.1
}