[arch-commits] Commit in (4 files)

Caleb Maclennan alerque at gemini.archlinux.org
Sat Sep 4 15:19:19 UTC 2021


    Date: Saturday, September 4, 2021 @ 15:19:19
  Author: alerque
Revision: 1011299

Migrate lua-cosmo from AUR

Added:
  lua-cosmo/
  lua-cosmo/repos/
  lua-cosmo/trunk/
  lua-cosmo/trunk/PKGBUILD

----------+
 PKGBUILD |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 54 insertions(+)

Added: lua-cosmo/trunk/PKGBUILD
===================================================================
--- lua-cosmo/trunk/PKGBUILD	                        (rev 0)
+++ lua-cosmo/trunk/PKGBUILD	2021-09-04 15:19:19 UTC (rev 1011299)
@@ -0,0 +1,54 @@
+# Maintainer: Caleb Maclennan <caleb at alerque.com>
+
+pkgbase=lua-cosmo
+_rockname=${pkgbase#lua-}
+pkgname=("$pkgbase" "lua51-$_rockname" "lua52-$_rockname" "lua53-$_rockname")
+pkgver=16.06.04
+pkgrel=5
+_rockrel=1
+pkgdesc='Safe templates for Lua'
+arch=(any)
+url="https://github.com/mascarenhas/$_rockname"
+license=(MIT)
+_luadeps=(lpeg)
+makedepends=(lua
+             lua51
+             lua52
+             lua53
+             luarocks)
+_archive="$_rockname-$pkgver"
+_rockspec="$_rockname-$pkgver-$_rockrel.rockspec"
+source=("$_archive.tar.gz::$url/archive/v$pkgver.tar.gz")
+sha256sums=('86d17aea5080a90671d965cffeb9b104c19e0e1ea55c08687c0924c4512b52b1')
+
+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 -i -e '/lpeg >=/d' "rockspec/$_rockspec"
+}
+
+_package() {
+	cd "$_archive"
+	depends=("${pkgname%-*}" "${_luadeps[@]/#/${pkgname%-*}-}")
+	luarocks --lua-version="$1" --tree="$pkgdir/usr/" \
+		make --deps-mode=none --no-manifest "rockspec/$_rockspec"
+	sed -ne '/license/p' rockspec/$_rockspec |
+		install -Dm0644 /dev/stdin "$pkgdir/usr/share/licenses/$pkgname/LICENSE.lua"
+}
+
+package_lua-cosmo() {
+	_package 5.4
+}
+
+package_lua51-cosmo() {
+	_package 5.1
+}
+
+package_lua52-cosmo() {
+	_package 5.2
+}
+
+package_lua53-cosmo() {
+	_package 5.3
+}



More information about the arch-commits mailing list