[arch-commits] Commit in lua-luaepnf/trunk (PKGBUILD)

Caleb Maclennan alerque at gemini.archlinux.org
Thu Dec 30 22:47:42 UTC 2021


    Date: Thursday, December 30, 2021 @ 22:47:42
  Author: alerque
Revision: 1088999

upgpkg: lua-luaepnf 0.3-8; add check() function

Modified:
  lua-luaepnf/trunk/PKGBUILD

----------+
 PKGBUILD |   15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-12-30 22:47:05 UTC (rev 1088998)
+++ PKGBUILD	2021-12-30 22:47:42 UTC (rev 1088999)
@@ -4,7 +4,7 @@
 _rockname=${pkgbase#lua-}
 pkgname=("$pkgbase" "lua51-$_rockname" "lua52-$_rockname" "lua53-$_rockname")
 pkgver=0.3
-pkgrel=7
+pkgrel=8
 _rockrel=2
 pkgdesc='Extended PEG Notation Format (easy grammars for LPeg)'
 arch=(any)
@@ -16,18 +16,17 @@
              lua52
              lua53
              luarocks)
+checkdepends=("${_luadeps[@]/#/lua-}")
 _archive="$pkgbase-$pkgver"
 _rockspec="$_rockname-$pkgver-$_rockrel.rockspec"
-source=("$_archive.tar.gz::$url/archive/v$pkgver.tar.gz"
+source=("$url/archive/v$pkgver/$_archive.tar.gz"
         "https://luarocks.org/manifests/siffiejoe/$_rockspec")
 sha256sums=('57c0ad1917e45c5677bfed0f6122da2baff98117aba05a5e987a0238600f85f9'
             '4aa148cb1df45d83332fa2b0c7609ecb56b214c2ff13f06b62d7551e82b4154f')
 
-prepare() {
-	cd "$_archive"
-	# Lpeg is not needed at *build* time, but `luarocks make` checks for it
-	# and depends=() is set at package time too late for makepkg to install it
-	sed -e '/lpeg >=/d' "../$_rockspec" > "$_rockspec"
+check() {
+	cd "$_archive/tests"
+	for t in *.lua; do lua $t; done
 }
 
 _package() {
@@ -35,7 +34,7 @@
 	depends=("${pkgname%-*}" "${_luadeps[@]/#/${pkgname%-*}-}")
 	provides=("${pkgname/-lua/-}=$pkgver")
 	luarocks --lua-version="$1" --tree="$pkgdir/usr/" \
-		make --deps-mode=none --no-manifest "$_rockspec"
+		make --deps-mode=none --no-manifest "../$_rockspec"
 	sed -ne '/^License$/,$p' README.md |
 		install -Dm0644 /dev/stdin "$pkgdir/usr/share/licenses/$pkgname/LICENSE.md"
 }



More information about the arch-commits mailing list