SHA256
10
0
forked from pool/lua-penlight

Accepting request 918515 from devel:languages:lua

OBS-URL: https://build.opensuse.org/request/show/918515
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lua-penlight?expand=0&rev=4
This commit is contained in:
2021-09-12 18:09:45 +00:00
committed by Git OBS Bridge
6 changed files with 61 additions and 42 deletions

BIN
Penlight-1.10.0.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
Penlight-1.6.0.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Wed Apr 21 12:57:58 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>
- Update to version 1.10.0:
* Fix Lua 5.4 issues
* Fix Lua 5.1 compat issues
* Fixed a lot of bugs
- Removed lua54.patch: upstream
- Added lua5_4_3.patch: fix tests fail on Lua 5.4.3
-------------------------------------------------------------------
Thu Feb 18 16:02:23 UTC 2021 - Callum Farmer <gmbr3@opensuse.org>

View File

@@ -16,22 +16,26 @@
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
%define flavor @BUILD_FLAVOR@
%define flavor @BUILD_FLAVOR@%{nil}
%define mod_name penlight
%define lua_value %(echo "%{flavor}" |sed -e 's:lua::')
%define with_docs 1
Version: 1.6.0
%define rname Penlight
%ifluadefault
%define with_main 1
%endif
%if "%{flavor}" == ""
Name: lua-%{mod_name}
ExclusiveArch: do_not_build
%else
Name: %{flavor}-%{mod_name}
%endif
Version: 1.10.0
Release: 0
Summary: Generally useful modules inspired by the Python standard libraries
License: MIT
Group: Development/Languages/Other
URL: http://stevedonovan.github.com/Penlight
Source: https://github.com/stevedonovan/Penlight/archive/%{version}.tar.gz#/Penlight-%{version}.tar.gz
# PATCH-FIX-UPSTREAM lua54.patch gh#Tieske/Penlight#320 mcepl@suse.com
# workaround hardcoded version of Lua 5.3.
Patch0: lua54.patch
URL: https://lunarmodules.github.io/Penlight/
Source0: https://github.com/lunarmodules/Penlight/archive/%{version}/%{rname}-%{version}.tar.gz
Patch0: lua5_4_3.patch
BuildRequires: %{flavor}-devel
BuildRequires: %{flavor}-ldoc
BuildRequires: %{flavor}-luafilesystem
@@ -39,15 +43,8 @@ BuildRequires: %{flavor}-markdown
Requires: %{flavor}
Requires: %{flavor}-luafilesystem
BuildArch: noarch
Recommends: lua-%{mod_name}-doc
%lua_provides
%if "%{flavor}" == ""
Name: lua-%{mod_name}
ExclusiveArch: do_not_build
%else
Name: %{flavor}-%{mod_name}
%endif
Requires(post): update-alternatives
Requires(postun): update-alternatives
%description
A set of pure Lua libraries focusing on input data handling (such as
@@ -55,19 +52,17 @@ reading configuration files), functional programming (such as map,
reduce, placeholder expressions,etc), and OS path management. Much of
the functionality is inspired by the Python standard libraries.
%if 0%{?with_docs}
%package doc
Summary: Documentation for %{name}
%if 0%{?with_main}
%package -n lua-%{mod_name}-doc
Summary: Documentation for lua-%{mod_name}
Group: Development/Languages/Other
Requires: %{name} = %{version}
%description doc
Documentation for the package %{name}
%description -n lua-%{mod_name}-doc
Documentation for the package lua-%{mod_name}
%endif
%prep
%setup -q -n Penlight-%{version}
%autopatch -p1
%autosetup -n %{rname}-%{version} -p1
%build
@@ -92,7 +87,9 @@ lua%{lua_version} run.lua tests
# Add bash/zsh-completion files
# from completions/bash/penlight.bash penlight
%files doc
%if 0%{?with_main}
%files -n lua-%{mod_name}-doc
%doc docs
%endif
%changelog

View File

@@ -1,11 +0,0 @@
--- a/tests/lua/mod52.lua
+++ b/tests/lua/mod52.lua
@@ -12,7 +12,7 @@ function answer ()
-- so define it as a local up above, or use utils.import(_G).
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,(LUA_VERSION~="Lua 5.3" and LUA_VERSION~="Lua 5.4") and "attempt to call global 'print'" or "attempt to call a nil value")
-- but all the Penlight modules are available
return pretty.write(utils.split '10 20 30', '')

23
lua5_4_3.patch Normal file
View File

@@ -0,0 +1,23 @@
From 10dfaea6adfddab4f138faad67b563b7c33c90a3 Mon Sep 17 00:00:00 2001
From: Pierre Chapuis <git@catwell.info>
Date: Thu, 29 Apr 2021 11:31:12 +0200
Subject: [PATCH] fix tests on Lua 5.4.3
see http://lua-users.org/lists/lua-l/2021-04/msg00024.html
---
tests/lua/mod52.lua | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/lua/mod52.lua b/tests/lua/mod52.lua
index 06e505e0..4b3ec7ce 100644
--- a/tests/lua/mod52.lua
+++ b/tests/lua/mod52.lua
@@ -15,7 +15,7 @@ function answer ()
["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",
+ ["4"] = "a nil value",
}
local expected = versioned_errors[LUA_VERSION:match("Lua 5.(%d)")]
test.assertraise(function()