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

Daurnimator daurnimator at archlinux.org
Fri Feb 5 14:32:48 UTC 2021


    Date: Friday, February 5, 2021 @ 14:32:47
  Author: daurnimator
Revision: 846094

Use luarocks build system

Also add optdepends for luaossl

Modified:
  lua-cqueues/trunk/PKGBUILD

----------+
 PKGBUILD |   47 ++++++++++++++++++++++++++++++++++-------------
 1 file changed, 34 insertions(+), 13 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2021-02-05 14:32:26 UTC (rev 846093)
+++ PKGBUILD	2021-02-05 14:32:47 UTC (rev 846094)
@@ -2,48 +2,69 @@
 
 pkgname=('lua-cqueues' 'lua51-cqueues' 'lua52-cqueues' 'lua53-cqueues')
 pkgver=20200726
-pkgrel=2
+pkgrel=3
 arch=('x86_64')
+pkgdesc='Continuation Queues: Embeddable asynchronous networking, threading, and notification framework'
 url='http://25thandclement.com/~william/projects/cqueues.html'
 license=('MIT')
-makedepends=('lua' 'lua51' 'lua52' 'lua53')
+makedepends=('luarocks' 'lua' 'lua51' 'lua52' 'lua53')
 depends=('openssl')
-source=("$pkgname-$pkgver.tar.gz::https://github.com/wahern/cqueues/archive/rel-$pkgver.tar.gz")
-md5sums=('fb21e8404cea86191e9658669eb44118')
+source=("$pkgname-$pkgver.tar.gz::https://github.com/wahern/cqueues/archive/rel-$pkgver.tar.gz"
+	    "https://luarocks.org/manifests/daurnimator/cqueues-$pkgver.5"{1,2,3,4}"-0.rockspec")
+sha256sums=('9e112edd246da5cfca264314b70325a0b63665cb87a00e45ee3ae4f194000d52'
+            'bbebe2285799895060c5acb565f5a4443d653f4a0d7a76ac8b49b272f8c6edf8'
+            '1742fa4b2c083625af3d3b69706c1d6c99cfd8afbbca2cc03445350e78c25370'
+            'f5bae8418551341d8c17ec302af27269098752e8fbda5f7bd1e610f2cb39fe2e'
+            'd78cba24427812a711d10a05b410b2afb6a9d4002d51dd2a4f4c55ba1a50d48c')
 
 build() {
 	cd "cqueues-rel-$pkgver"
-	make prefix=/usr
+	for v in 5.1 5.2 5.3 5.4; do
+		mkdir -p "$v/"
+		# Use `-ffile-prefix-map` to avoid embedding srcdir into binary
+		# Packed rocks with make backend don't work?
+		# Workaround: don't use --pack-binary-rock; instead make into a temporary tree and then pack
+		luarocks make --lua-version="$v" --tree="../luarocks-temp-$v" --deps-mode=none \
+			CFLAGS="$CPPFLAGS $CFLAGS -fPIC -ffile-prefix-map=$(pwd)=" \
+			LIBFLAG="$LDFLAGS -shared" \
+			../cqueues-"$pkgver".5${v#5.}-0.rockspec
+		luarocks pack --lua-version="$v" --tree="../luarocks-temp-$v" cqueues
+		mv cqueues-"$pkgver".*.rock "$v/"
+	done
 }
 
 package_lua-cqueues() {
-	pkgdesc='Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua 5.4'
+	pkgdesc="$pkgdesc for Lua 5.4"
+	optdepends=('lua-luaossl: TLS support')
 
 	cd "cqueues-rel-$pkgver"
-	make DESTDIR="$pkgdir" prefix=/usr install5.4
+	luarocks install --lua-version=5.4 --tree="$pkgdir/usr/" --deps-mode=none 5.4/*.rock --no-manifest
 	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }
 
 package_lua51-cqueues() {
-	pkgdesc='Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua 5.1'
+	pkgdesc="$pkgdesc for Lua 5.1"
+	optdepends=('lua51-luaossl: TLS support')
 
 	cd "cqueues-rel-$pkgver"
-	make DESTDIR="$pkgdir" prefix=/usr install5.1
+	luarocks install --lua-version=5.1 --tree="$pkgdir/usr/" --deps-mode=none 5.1/*.rock --no-manifest
 	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }
 
 package_lua52-cqueues() {
-	pkgdesc='Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua 5.2'
+	pkgdesc="$pkgdesc for Lua 5.2"
+	optdepends=('lua52-luaossl: TLS support')
 
 	cd "cqueues-rel-$pkgver"
-	make DESTDIR="$pkgdir" prefix=/usr install5.2
+	luarocks install --lua-version=5.2 --tree="$pkgdir/usr/" --deps-mode=none 5.2/*.rock --no-manifest
 	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }
 
 package_lua53-cqueues() {
-	pkgdesc='Continuation Queues: Embeddable asynchronous networking, threading, and notification framework for Lua 5.3'
+	pkgdesc="$pkgdesc for Lua 5.3"
+	optdepends=('lua53-luaossl: TLS support')
 
 	cd "cqueues-rel-$pkgver"
-	make DESTDIR="$pkgdir" prefix=/usr install5.3
+	luarocks install --lua-version=5.3 --tree="$pkgdir/usr/" --deps-mode=none 5.3/*.rock --no-manifest
 	install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }



More information about the arch-commits mailing list