Skip to content
Snippets Groups Projects
Commit 56d595bc authored by Caleb Maclennan's avatar Caleb Maclennan
Browse files

add check() function and optdepends

parent 26212ee9
No related branches found
No related tags found
No related merge requests found
......@@ -4,7 +4,7 @@ pkgbase=lua-cliargs
_rockname=${pkgbase#lua-}
pkgname=("$pkgbase" "lua51-$_rockname" "lua52-$_rockname" "lua53-$_rockname")
pkgver=3.0
pkgrel=6
pkgrel=7
_rockrel=2
pkgdesc='A command-line argument parser'
arch=(any)
......@@ -15,16 +15,27 @@ makedepends=(lua
lua52
lua53
luarocks)
checkdepends=(busted
lua-inifile
lua-yaml)
_optdepends=('inifile: load config file from INI'
'yaml: load config file from YAML')
_archive="${pkgbase/-/_}-$pkgver-$_rockrel"
source=("$_archive.tar.gz::$url/archive/v$pkgver-$_rockrel.tar.gz")
source=("$url/archive/v$pkgver/$_archive.tar.gz")
sha256sums=('971d6f1440a55bdf9db581d4b2bcbf472a301d76f696a0d0ed9423957c7d176e')
check() {
cd "$_archive"
busted
}
_package() {
cd "$_archive"
depends=("${pkgname%-*}")
optdepends=("${_optdepends[@]/#/${pkgname%-*}-}")
luarocks --lua-version="$1" --tree="$pkgdir/usr/" \
make --deps-mode=none --no-manifest "${pkgbase/-/_}-$pkgver-$_rockrel.rockspec"
install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
}
package_lua-cliargs() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment