| 1 | # Contributor: Jakub Jirutka <[email protected]> |
| 2 | # Maintainer: Jakub Jirutka <[email protected]> |
| 3 | pkgname=lua-cliargs |
| 4 | _rockname=lua_cliargs |
| 5 | pkgver=3.0.2 |
| 6 | pkgrel=1 |
| 7 | pkgdesc="A command-line argument parsing module for Lua" |
| 8 | url="https://github.com/amireh/lua_cliargs" |
| 9 | arch="noarch" |
| 10 | license="MIT" |
| 11 | checkdepends=" |
| 12 | lua-busted |
| 13 | lua-cjson |
| 14 | lua-yaml |
| 15 | " |
| 16 | source="https://github.com/amireh/lua_cliargs/archive/v$pkgver/$_rockname-$pkgver.tar.gz |
| 17 | support-cjson.patch |
| 18 | " |
| 19 | builddir="$srcdir/$_rockname-$pkgver" |
| 20 | options="!check" # avoid circular dependency with lua-busted |
| 21 | |
| 22 | _luaversions="5.1 5.2 5.3 5.4 5.5" |
| 23 | for _v in $_luaversions; do |
| 24 | checkdepends="$checkdepends lua$_v" |
| 25 | # for backward compatibility (Alpine <3.18) |
| 26 | provides="$provides lua$_v-cliargs=$pkgver-r$pkgrel" |
| 27 | done |
| 28 | |
| 29 | check() { |
| 30 | local lver; for lver in $_luaversions jit; do |
| 31 | msg "Testing on lua$lver" |
| 32 | # from_ini - missing aport lua-inifile |
| 33 | lua$lver /usr/bin/busted --no-coverage --exclude-tags="from_ini" |
| 34 | done |
| 35 | } |
| 36 | |
| 37 | package() { |
| 38 | local rockdir="$pkgdir/usr/lib/luarocks/rocks-common/$_rockname/$pkgver-1" |
| 39 | local luadir="$pkgdir/usr/share/lua/common" |
| 40 | |
| 41 | mkdir -p "$luadir" |
| 42 | cp -r src/* "$luadir"/ |
| 43 | |
| 44 | mkdir -p "$rockdir" |
| 45 | echo 'rock_manifest = {}' > "$rockdir"/rock_manifest |
| 46 | } |
| 47 | |
| 48 | sha512sums=" |
| 49 | 3d9dac4723e8a41284eb28a7d1b5c400add91de055eb59645406929f5091c52bd71640b5f4914597b222b5ce7b43bbc918e4a34a69ce7bae726638bd2447abf8 lua_cliargs-3.0.2.tar.gz |
| 50 | 69c1d1118a9a4f270eb458c91c4cb73621e25d9ddede8b9a2892cf551b756abb328f705e69ff1e76b3e59af26dbe2852267e0c765db7d8e8e38f014797edc347 support-cjson.patch |
| 51 | " |