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

Caleb Maclennan alerque at gemini.archlinux.org
Fri Apr 22 14:47:36 UTC 2022


    Date: Friday, April 22, 2022 @ 14:47:35
  Author: alerque
Revision: 1187345

upgpkg: lua-luautf8 0.1.3-4; drop CFLAGS workarounds obsoleted by luarocks 3.9.0; split build() and package() steps

Modified:
  lua-luautf8/trunk/PKGBUILD

----------+
 PKGBUILD |   30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-04-22 14:41:32 UTC (rev 1187344)
+++ PKGBUILD	2022-04-22 14:47:35 UTC (rev 1187345)
@@ -5,7 +5,7 @@
 pkgname=("$pkgbase" "lua51-$_rockname" "lua52-$_rockname" "lua53-$_rockname")
 pkgver=0.1.3
 _rockrel=1
-pkgrel=3
+pkgrel=4
 pkgdesc='Add UTF-8 support to Lua, compatible with Lua string module'
 arch=(x86_64)
 url="https://github.com/starwing/$_rockname"
@@ -15,19 +15,29 @@
              lua52
              lua53
              luarocks)
+options=(debug)
 _archive="$_rockname-$pkgver"
-source=("$_archive.tgz::$url/archive/$pkgver.tar.gz")
+_rock="$_archive-$_rockrel.linux-$CARCH.rock"
+_rockspec="$_archive-$_rockrel.rockspec"
+source=("$url/archive/$pkgver/$_archive.tar.gz")
 sha256sums=('208b3423a03a6c2822a2fa6b7cc8092ed7d3c0d792ec12c7cd28d6afaa442e0b')
 
+build() {
+	cd "$_archive"
+	for LUAVER in 5.{1,2,3,4}; do
+		luarocks --lua-version "$LUAVER" \
+			make --pack-binary-rock --deps-mode none -- "rockspecs/$_rockspec"
+		install -Dm0644 -t "lua-$LUAVER/" "$_rock"
+	done
+}
+
 _package() {
 	cd "$_archive"
 	depends=("${pkgname%-*}")
 	provides=("${pkgname/-lua/-}=$pkgver")
 	replaces=("${pkgname/-lua/-}")
-	luarocks --lua-version="$1" --tree="$pkgdir/usr/" \
-		CFLAGS="$CPPFLAGS $CFLAGS -fPIC" \
-		LIBFLAG="$LDFLAGS -shared" \
-		make --deps-mode=none --no-manifest "rockspecs/$_rockname-$pkgver-$_rockrel.rockspec"
+	luarocks --lua-version "$1" --tree "$pkgdir/usr/" \
+		install --deps-mode none --no-manifest -- "lua-$1/$_rock"
 	install -Dm0644 -t "$pkgdir/usr/share/licenses/$pkgname/" LICENSE
 }
 
@@ -35,8 +45,8 @@
 	_package 5.4
 }
 
-package_lua51-luautf8() {
-	_package 5.1
+package_lua53-luautf8() {
+	_package 5.3
 }
 
 package_lua52-luautf8() {
@@ -43,6 +53,6 @@
 	_package 5.2
 }
 
-package_lua53-luautf8() {
-	_package 5.3
+package_lua51-luautf8() {
+	_package 5.1
 }



More information about the arch-commits mailing list