1 # Maintainer: Daurnimator <daurnimator@archlinux.org>
3 pkgname=("lua-dkjson" "lua53-dkjson" "lua52-dkjson" "lua51-dkjson")
6 pkgdesc='David Kolf’s Pure Lua JSON module with UTF-8 support and no external dependencies'
8 url="http://dkolf.de/src/dkjson-lua.fsl/home"
10 makedepends=('luarocks'
11 'lua51' 'lua52' 'lua53' 'lua' # https://github.com/luarocks/luarocks/issues/1275
13 source=("http://dkolf.de/src/dkjson-lua.fsl/tarball/dkjson-$pkgver.tar.gz"
15 sha256sums=('bd07ee4eb398aed6cf36f92423845399a5b46c15090990cc90e56d07c46f9773'
16 '695b49734d1244ff236ec8785aa908883deb0f65b2356e36e8739ea06002b03c')
20 for v in 5.1 5.2 5.3 5.4; do
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/"
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"
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"
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"
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"
66 luarocks install --lua-version=5.1 --tree="$pkgdir/usr/" --deps-mode=none --no-manifest 5.1/*.rock