7
0
forked from pool/lua-luacheck

8 Commits

Author SHA256 Message Date
280c732979 Make package buildable with Lua 5.5
Changing cycle counters (gh#mpeterv/luacheck!238)
2026-01-22 16:40:57 +01:00
0356366085 Enable lua55 build 2026-01-21 21:43:25 +01:00
b975013bba Switch off building lua51 build of the package. 2025-10-24 16:48:56 +02:00
fbe91033fe Fix shebang in the provide start script 2025-10-12 23:59:11 +02:00
c47c965157 fix: use __requires_exclude for eliminating unwanted file dependency
Looks more sane.
2025-10-12 21:44:21 +02:00
d84d860526 fix: dealing with *PATH variables and make %check pass 2025-10-12 01:41:15 +02:00
3c2cb1d1bb Allow building with LuaJIT. 2025-10-10 15:54:17 +02:00
3b8eafbc53 Add luajit version to _multibuild 2025-10-06 10:47:59 +02:00
6 changed files with 109 additions and 14 deletions

1
.gitattributes vendored
View File

@@ -21,3 +21,4 @@
*.xz filter=lfs diff=lfs merge=lfs -text *.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text *.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text *.zst filter=lfs diff=lfs merge=lfs -text
*.changes merge=merge-changes

5
.gitignore vendored
View File

@@ -1 +1,6 @@
.osc .osc
*.obscpio
*.osc
_build.*
.pbuild
lua*-luacheck-*-build/

View File

@@ -1,5 +1,6 @@
<multibuild> <multibuild>
<package>lua51</package> <package>luajit</package>
<package>lua53</package> <package>lua53</package>
<package>lua54</package> <package>lua54</package>
<package>lua55</package>
</multibuild> </multibuild>

View File

@@ -1,3 +1,25 @@
-------------------------------------------------------------------
Thu Jan 22 15:20:04 UTC 2026 - Matej Cepl <mcepl@cepl.eu>
- Add luacheck-lua55.patch to make package buildable with Lua
5.5, because of changing cycle counters.
(gh#mpeterv/luacheck!238)
-------------------------------------------------------------------
Fri Oct 24 14:48:56 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Switch off building lua51 build of the package.
-------------------------------------------------------------------
Sun Oct 12 21:59:08 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Fix shebang in the provide start script
-------------------------------------------------------------------
Sat Oct 11 23:30:50 UTC 2025 - Matej Cepl <mcepl@cepl.eu>
- Allow building with LuaJIT.
------------------------------------------------------------------- -------------------------------------------------------------------
Wed May 3 11:07:50 UTC 2023 - Michal Suchanek <msuchanek@suse.com> Wed May 3 11:07:50 UTC 2023 - Michal Suchanek <msuchanek@suse.com>

View File

@@ -17,9 +17,15 @@
# #
%define flavor @BUILD_FLAVOR@%{nil} %define flavor @BUILD_FLAVOR@
%define mod_name luacheck %define mod_name luacheck
# Remove file dependency on the interpreter
%global __requires_exclude ^%{_bindir}/lua(5\\.[1-9]|jit)?$
%if "%{flavor}" == "luajit"
%define lua_value 52
%else
%define lua_value %(echo "%{flavor}" |sed -e 's:lua::') %define lua_value %(echo "%{flavor}" |sed -e 's:lua::')
%endif
Version: 1.1.0 Version: 1.1.0
Release: 0 Release: 0
Summary: Command-line tool for linting and static analysis of Lua code Summary: Command-line tool for linting and static analysis of Lua code
@@ -29,6 +35,9 @@ URL: https://github.com/lunarmodules/luacheck
Source: https://github.com/lunarmodules/luacheck/archive/v%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz Source: https://github.com/lunarmodules/luacheck/archive/v%{version}.tar.gz#/%{mod_name}-%{version}.tar.gz
# PATCH-FIX-OPENSUSE - silence rpmlint # PATCH-FIX-OPENSUSE - silence rpmlint
Patch0: env.patch Patch0: env.patch
# PATCH-FIX-UPSTREAM luacheck-lua55.patch gh#mpeterv/luacheck!238 mcepl@suse.com
# Fix incompatibility with Lua 5.5 (changing of for cycle counters)
Patch1: luacheck-lua55.patch
BuildRequires: %{flavor} BuildRequires: %{flavor}
BuildRequires: %{flavor}-argparse BuildRequires: %{flavor}-argparse
BuildRequires: %{flavor}-luafilesystem BuildRequires: %{flavor}-luafilesystem
@@ -39,7 +48,7 @@ Requires: %{flavor}-luafilesystem
Requires(post): update-alternatives Requires(post): update-alternatives
Requires(postun): update-alternatives Requires(postun): update-alternatives
Provides: luacheck Provides: luacheck
Obsoletes: luacheck < 1.0.0 Obsoletes: luacheck < %{version}
BuildArch: noarch BuildArch: noarch
%lua_provides %lua_provides
%if "%{flavor}" == "" %if "%{flavor}" == ""
@@ -68,10 +77,10 @@ checked files as Lua comments.
%install %install
mkdir -p %{buildroot}%{lua_noarchdir} mkdir -p %{buildroot}%{lua_noarchdir}
mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_bindir}
cp bin/luacheck.lua %{buildroot}%{_bindir}/luacheck-%{lua_version} cp -v bin/luacheck.lua %{buildroot}%{_bindir}/luacheck-%{flavor}
cp -r src/luacheck %{buildroot}%{lua_noarchdir} cp -rv src/luacheck %{buildroot}%{lua_noarchdir}
chmod +x %{buildroot}%{_bindir}/luacheck-%{lua_version} chmod +x %{buildroot}%{_bindir}/luacheck-%{flavor}
sed -i -e 's,%{_bindir}/lua,%{_bindir}/lua%{lua_version},' %{buildroot}%{_bindir}/luacheck-%{lua_version} sed -i -e 's,# *\!%{_bindir}/.*lua,#!%{_bindir}/lua,' %{buildroot}%{_bindir}/luacheck-%{flavor}
# update-alternatives # update-alternatives
mkdir -p %{buildroot}%{_sysconfdir}/alternatives/ mkdir -p %{buildroot}%{_sysconfdir}/alternatives/
@@ -79,17 +88,16 @@ touch %{buildroot}%{_sysconfdir}/alternatives/luacheck
ln -sf %{_sysconfdir}/alternatives/luacheck %{buildroot}%{_bindir}/luacheck ln -sf %{_sysconfdir}/alternatives/luacheck %{buildroot}%{_bindir}/luacheck
%check %check
LUA_PATH='%{_datadir}/lua/%{lua_version}/?.lua' LUA_PATH='%{lua_noarchdir}/?.lua;%{lua_noarchdir}/?/init.lua'
LUA_PATH="%{buildroot}%{lua_noarchdir}/?/init.lua;${LUA_PATH}" export LUA_PATH="%{buildroot}%{lua_noarchdir}/?.lua;%{buildroot}%{lua_noarchdir}/?/init.lua;${LUA_PATH}"
export LUA_PATH="%{buildroot}%{lua_noarchdir}/?.lua;${LUA_PATH}" lua %{buildroot}%{_bindir}/luacheck-%{flavor} src/
%{_bindir}/lua%{lua_version} %{buildroot}%{_bindir}/luacheck-%{lua_version} src/
%post %post
%{_sbindir}/update-alternatives --install %{_bindir}/luacheck luacheck %{_bindir}/luacheck-%{lua_version} %{lua_value} %{_sbindir}/update-alternatives --install %{_bindir}/luacheck luacheck %{_bindir}/luacheck-%{flavor} %{lua_value}
%postun %postun
if [ "$1" = 0 ] ; then if [ "$1" = 0 ] ; then
%{_sbindir}/update-alternatives --remove luacheck %{_bindir}/luacheck-%{lua_version} %{_sbindir}/update-alternatives --remove luacheck %{_bindir}/luacheck-%{flavor}
fi fi
%files %files
@@ -97,7 +105,7 @@ fi
%license LICENSE %license LICENSE
%ghost %{_sysconfdir}/alternatives/luacheck %ghost %{_sysconfdir}/alternatives/luacheck
%{_bindir}/luacheck %{_bindir}/luacheck
%{_bindir}/luacheck-%{lua_version} %{_bindir}/luacheck-%{flavor}
%{lua_noarchdir}/luacheck/ %{lua_noarchdir}/luacheck/
%changelog %changelog

58
luacheck-lua55.patch Normal file
View File

@@ -0,0 +1,58 @@
---
src/luacheck/standards.lua | 24 ++++++++++++++----------
1 file changed, 14 insertions(+), 10 deletions(-)
Index: luacheck-1.1.0/src/luacheck/standards.lua
===================================================================
--- luacheck-1.1.0.orig/src/luacheck/standards.lua 2022-12-19 18:51:56.000000000 +0100
+++ luacheck-1.1.0/src/luacheck/standards.lua 2026-01-22 16:17:00.555611296 +0100
@@ -130,21 +130,25 @@
for field_name, field_def in pairs(fields) do
if type(field_name) == "string" or not ignore_array_part then
+
+ local actual_field_name = field_name
+ local actual_field_def = field_def
+
if type(field_name) ~= "string" then
- field_name = field_def
- field_def = infinitely_indexable_def
+ actual_field_name = field_def
+ actual_field_def = infinitely_indexable_def
end
if not def.fields then
def.fields = {}
end
- if not def.fields[field_name] then
- def.fields[field_name] = {}
+ if not def.fields[actual_field_name] then
+ def.fields[actual_field_name] = {}
end
- local existing_field_def = def.fields[field_name]
- local new_read_only = field_def.read_only
+ local existing_field_def = def.fields[actual_field_name]
+ local new_read_only = actual_field_def.read_only
if new_read_only == nil then
new_read_only = default_read_only
@@ -156,13 +160,13 @@
end
end
- if field_def.other_fields ~= nil then
- if overwrite or field_def.other_fields == true then
- existing_field_def.other_fields = field_def.other_fields
+ if actual_field_def.other_fields ~= nil then
+ if overwrite or actual_field_def.other_fields == true then
+ existing_field_def.other_fields = actual_field_def.other_fields
end
end
- add_fields(existing_field_def, field_def.fields, overwrite, false, nil)
+ add_fields(existing_field_def, actual_field_def.fields, overwrite, false, nil)
end
end
end