[arch-commits] Commit in penlight/trunk (PKGBUILD penlight-lua-5.4.patch)

Felix Yan felixonmars at archlinux.org
Fri Jul 31 13:47:48 UTC 2020


    Date: Friday, July 31, 2020 @ 13:47:47
  Author: felixonmars
Revision: 666189

upgpkg: penlight 1.6.0-2: rebuild for lua 5.4

Added:
  penlight/trunk/penlight-lua-5.4.patch
Modified:
  penlight/trunk/PKGBUILD

------------------------+
 PKGBUILD               |   33 +++++++++++++++++++++++++++------
 penlight-lua-5.4.patch |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 60 insertions(+), 6 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-07-31 13:29:58 UTC (rev 666188)
+++ PKGBUILD	2020-07-31 13:47:47 UTC (rev 666189)
@@ -5,26 +5,47 @@
 # Contributor: Donald Ephraim Curtis <dcurtis at gmail.com>
 
 pkgbase=penlight
-pkgname=('lua-penlight')
+pkgname=('lua-penlight' 'lua53-penlight')
 pkgver=1.6.0
-pkgrel=1
+pkgrel=2
 pkgdesc='Lua libraries focusing on input data handling'
 url='https://github.com/stevedonovan/penlight'
 arch=('any')
 license=('custom')
-depends=('lua' 'lua-filesystem')
-source=(https://github.com/stevedonovan/penlight/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz)
-sha256sums=('a552d0a314f7aa94c9579746996a7aad4ed59f3187f33b4735d3e323e27354b0')
-sha512sums=('4f9988e9e5d66aad1c7137a5b8a36e4eaa2dba5408c90ee0253ce3db69980b2e0be8c9ba38f1e88f269da96d09a908115e0e9c2bd0667393f950fdfc1e232ff0')
+makedepends=('lua' 'lua-filesystem' 'lua53' 'lua53-filesystem')
+source=(https://github.com/stevedonovan/penlight/archive/${pkgver}/${pkgname}-${pkgver}.tar.gz
+        penlight-lua-5.4.patch)
+sha256sums=('a552d0a314f7aa94c9579746996a7aad4ed59f3187f33b4735d3e323e27354b0'
+            'bdb1fb023240b717b3fd800ebd9cf9ee51e94a073769e5c4b6e19c9dc4713b6c')
+sha512sums=('4f9988e9e5d66aad1c7137a5b8a36e4eaa2dba5408c90ee0253ce3db69980b2e0be8c9ba38f1e88f269da96d09a908115e0e9c2bd0667393f950fdfc1e232ff0'
+            'eec7d1c61a4ca2cbea7760f18e15d4634ca9eca451bc4a101ace7efd672ffe061141f0d028c459b72a4834cf8dbe0ca29942b5c871885636dfec18dc10515c67')
 
+prepare() {
+  cd Penlight-${pkgver}
+  patch -p1 -i ../penlight-lua-5.4.patch
+}
+
 check() {
   cd Penlight-${pkgver}
   export LUA_PATH="${PWD}/lua/?/init.lua;${PWD}/lua/?.lua;$(lua -e 'print(package.path)')"
   lua run.lua
+  export LUA_PATH="${PWD}/lua/?/init.lua;${PWD}/lua/?.lua;$(lua5.3 -e 'print(package.path)')"
+  lua5.3 run.lua
 }
 
 package_lua-penlight() {
+  depends=('lua' 'lua-filesystem')
   cd Penlight-${pkgver}
+  install -Dm 644 lua/pl/* -t "${pkgdir}/usr/share/lua/5.4/pl"
+  install -Dm 644 CONTRIBUTING.md CHANGELOG.md README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
+  install -Dm 644 docs/manual/* -t "${pkgdir}/usr/share/doc/${pkgname}/manual"
+  install -Dm 644 examples/* -t "${pkgdir}/usr/share/doc/${pkgname}/examples"
+  install -Dm 644 LICENSE.md -t "${pkgdir}/usr/share/licenses/${pkgname}"
+}
+
+package_lua53-penlight() {
+  depends=('lua53' 'lua53-filesystem')
+  cd Penlight-${pkgver}
   install -Dm 644 lua/pl/* -t "${pkgdir}/usr/share/lua/5.3/pl"
   install -Dm 644 CONTRIBUTING.md CHANGELOG.md README.md -t "${pkgdir}/usr/share/doc/${pkgname}"
   install -Dm 644 docs/manual/* -t "${pkgdir}/usr/share/doc/${pkgname}/manual"

Added: penlight-lua-5.4.patch
===================================================================
--- penlight-lua-5.4.patch	                        (rev 0)
+++ penlight-lua-5.4.patch	2020-07-31 13:47:47 UTC (rev 666189)
@@ -0,0 +1,33 @@
+From f8c8628ab65542996de84a5a03ee912c7f7dd859 Mon Sep 17 00:00:00 2001
+From: Thijs <thijs at thijsschreijer.nl>
+Date: Tue, 28 Jul 2020 08:55:07 +0200
+Subject: [PATCH 2/3] fix(tests) fix tests failing on Lua 5.4
+
+---
+ tests/lua/mod52.lua | 10 +++++++++-
+ 1 file changed, 9 insertions(+), 1 deletion(-)
+
+diff --git a/tests/lua/mod52.lua b/tests/lua/mod52.lua
+index 7cc8c7e..06e505e 100644
+--- a/tests/lua/mod52.lua
++++ b/tests/lua/mod52.lua
+@@ -10,9 +10,17 @@ local _ENV,M = require 'pl.import_into' (rawget(_G,'STRICT'))
+ function answer ()
+     -- of course, you don't have the usual global environment available
+     -- so define it as a local up above, or use utils.import(_G).
++
++    local versioned_errors = {
++        ["1"] = "attempt to call global 'print'",
++        ["2"] = "attempt to call global 'print'",
++        ["3"] = "attempt to call a nil value",
++        ["4"] = "attempt to call a nil value",
++    }
++    local expected = versioned_errors[LUA_VERSION:match("Lua 5.(%d)")]
+     test.assertraise(function()
+         print 'hello'
+-    end,(LUA_VERSION~="Lua 5.3") and "attempt to call global 'print'" or "attempt to call a nil value")
++    end, expected)
+ 
+     -- but all the Penlight modules are available
+     return pretty.write(utils.split '10 20  30', '')
+



More information about the arch-commits mailing list