1 # Maintainer: Daurnimator <quae@archlinux.org>
2 # Maintainer: Caleb Maclennan <caleb@alerque.com>
3 # Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
4 # Contributor: Sébastien Luttringer
5 # Contributor: SpepS <dreamspepser at yahoo dot it>
6 # Contributor: Laszlo Papp <djszapi at archlinux us>
7 # Contributor: Donald Ephraim Curtis <dcurtis@gmail.com>
10 pkgname=('lua-penlight' 'lua53-penlight' 'lua52-penlight' 'lua51-penlight')
13 pkgdesc='Lua libraries focusing on input data handling'
14 url='https://github.com/lunarmodules/Penlight'
17 makedepends=('luarocks'
18 'lua51' 'lua52' 'lua53' 'lua') # https://github.com/luarocks/luarocks/issues/1275
19 checkdepends=('busted'
28 source=("https://github.com/lunarmodules/Penlight/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz")
29 sha256sums=('530380e1a377df519c2e589f47823f79701f8e0e67f6bbd994e18d09a470b680')
35 for _version in 5.1 5.2 5.3 5.4; do
37 luarocks make --pack-binary-rock --lua-version="$_version" --deps-mode=none \
38 rockspecs/penlight-"$pkgver"-1.rockspec
39 mv penlight-"$pkgver"-1.*.rock "$_version/"
47 for _version in 5.1 5.2 5.3 5.4; do
48 # Upstream is migrating to busted, run.lua is legacy format tests
49 env LUA_PATH="${PWD}/lua/?/init.lua;${PWD}/lua/?.lua;;" \
50 "lua${_version}" run.lua
51 # https://github.com/lunarmodules/Penlight/issues/411
52 env LUA_PATH="${PWD}/lua/?/init.lua;${PWD}/lua/?.lua;;" \
53 busted --lua "lua${_version}" --exclude-pattern app_spec
60 pkgdesc="$pkgdesc for Lua $lib_version"
63 luarocks install --lua-version="$lib_version" --tree="$pkgdir/usr/" --deps-mode=none --no-manifest "$lib_version"/*.rock
64 install -Dm 644 CONTRIBUTING.md CHANGELOG.md README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
65 ln -s "/usr/lib/luarocks/rocks-${lib_version}/penlight/${pkgver}-1/docs/manual" "${pkgdir}/usr/share/doc/${pkgname}/manual"
66 ln -s "/usr/lib/luarocks/rocks-${lib_version}/penlight/${pkgver}-1/docs/examples" "${pkgdir}/usr/share/doc/${pkgname}/examples"
67 install -Dm 644 LICENSE.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
70 package_lua53-penlight() {
71 depends=("lua53-filesystem")
76 package_lua52-penlight() {
77 depends=("lua52-filesystem")
82 package_lua51-penlight() {
83 depends=("lua51-filesystem")
88 package_lua-penlight() {
89 depends=("lua-filesystem")