archrelease: copy trunk to community-any
[ArchLinux/community.git] / lua-dkjson / trunk / PKGBUILD
blob78c78991ebab19e891a590bbfe564d89ffe849f5
1 # Maintainer: Daurnimator <daurnimator@archlinux.org>
3 pkgname=("lua-dkjson" "lua53-dkjson" "lua52-dkjson" "lua51-dkjson")
4 pkgver=2.6
5 pkgrel=1
6 pkgdesc='David Kolf’s Pure Lua JSON module with UTF-8 support and no external dependencies'
7 arch=('any')
8 url="http://dkolf.de/src/dkjson-lua.fsl/home"
9 license=('MIT')
10 makedepends=('luarocks'
11              'lua51' 'lua52' 'lua53' 'lua' # https://github.com/luarocks/luarocks/issues/1275
12             )
13 source=("http://dkolf.de/src/dkjson-lua.fsl/tarball/dkjson-$pkgver.tar.gz"
14         "LICENSE")
15 sha256sums=('bd07ee4eb398aed6cf36f92423845399a5b46c15090990cc90e56d07c46f9773'
16             '695b49734d1244ff236ec8785aa908883deb0f65b2356e36e8739ea06002b03c')
18 build() {
19   cd "dkjson-$pkgver"
20   for v in 5.1 5.2 5.3 5.4; do
21     mkdir -p "$v/"
22     luarocks make --lua-version="$v" \
23       --pack-binary-rock --deps-mode=none \
24       dkjson-"$pkgver"-1.rockspec
25     mv dkjson-"$pkgver"-1.*.rock "$v/"
26   done
29 package_lua-dkjson() {
30   pkgdesc="$pkgdesc for Lua 5.4"
31   optdepends=('lua-lpeg: speeds up decoding')
33   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
35   cd "dkjson-$pkgver"
36   luarocks install --lua-version=5.4 --tree="$pkgdir/usr/" --deps-mode=none --no-manifest 5.4/*.rock
39 package_lua53-dkjson() {
40   pkgdesc="$pkgdesc for Lua 5.3"
41   optdepends=('lua53-lpeg: speeds up decoding')
43   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
45   cd "dkjson-$pkgver"
46   luarocks install --lua-version=5.3 --tree="$pkgdir/usr/" --deps-mode=none --no-manifest 5.3/*.rock
49 package_lua52-dkjson() {
50   pkgdesc="$pkgdesc for Lua 5.2"
51   optdepends=('lua52-lpeg: speeds up decoding')
53   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
55   cd "dkjson-$pkgver"
56   luarocks install --lua-version=5.2 --tree="$pkgdir/usr/" --deps-mode=none --no-manifest 5.2/*.rock
59 package_lua51-dkjson() {
60   pkgdesc="$pkgdesc for Lua 5.1"
61   optdepends=('lua51-lpeg: speeds up decoding')
63   install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
65   cd "dkjson-$pkgver"
66   luarocks install --lua-version=5.1 --tree="$pkgdir/usr/" --deps-mode=none --no-manifest 5.1/*.rock