commit d3dda587a005be93d22697ca0443210a93c0312d Author: tigro Date: Wed Jan 1 22:17:57 2025 +0300 import lua-lgi-0.9.2-20.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..36c1900 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/lgi-0.9.2.tar.gz diff --git a/.lua-lgi.metadata b/.lua-lgi.metadata new file mode 100644 index 0000000..ba21a15 --- /dev/null +++ b/.lua-lgi.metadata @@ -0,0 +1 @@ +1fed9371a131e5598faa477d31fdf9cc0de520ed SOURCES/lgi-0.9.2.tar.gz diff --git a/SOURCES/lgi-0.9.2-fix-gobject-warnings.patch b/SOURCES/lgi-0.9.2-fix-gobject-warnings.patch new file mode 100644 index 0000000..ed3a079 --- /dev/null +++ b/SOURCES/lgi-0.9.2-fix-gobject-warnings.patch @@ -0,0 +1,36 @@ +From 05c909b3b9eaf64ac5b37459d9cf101922dc854c Mon Sep 17 00:00:00 2001 +From: Uli Schlachter +Date: Fri, 8 Feb 2019 13:03:16 +0100 +Subject: [PATCH] Fix GObject warning in tests + +The subclass test caused the following warning: + + (lua5.2:14980): GLib-GObject-CRITICAL **: 13:02:03.551: Object class + LgiTestFakeMonitor1 doesn't implement property 'network-metered' from + interface 'GNetworkMonitor' + +This new property was added in Gio 2.46. The fix here is to implement +that property. That should not cause problems with older versions of +Gio, because there the extra property would just be ignored. + +Signed-off-by: Uli Schlachter +--- + tests/gobject.lua | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/tests/gobject.lua b/tests/gobject.lua +index 2eb2b14..82a21b8 100644 +--- a/tests/gobject.lua ++++ b/tests/gobject.lua +@@ -282,6 +282,11 @@ function gobject.subclass_prop_inherit() + 'LgiTestFakeMonitor1NetworkAvailable', + 'Whether the network is available.', + false, { GObject.ParamFlags.READABLE }) ++ FakeMonitor._property.network_metered = ++ GObject.ParamSpecBoolean('network-metered', ++ 'LgiTestFakeMonitor1NetworkMetered', ++ 'Whether the network is metered.', ++ false, { GObject.ParamFlags.READABLE }) + FakeMonitor._property.connectivity = + GObject.ParamSpecEnum('connectivity', + 'LgiTestFakeMonitor1Connectivity', diff --git a/SOURCES/lgi-0.9.2-fix-s390x.patch b/SOURCES/lgi-0.9.2-fix-s390x.patch new file mode 100644 index 0000000..5c23dd0 --- /dev/null +++ b/SOURCES/lgi-0.9.2-fix-s390x.patch @@ -0,0 +1,36 @@ +From a127f82af7b60fd4f76b694317eb77ff4c62bbf7 Mon Sep 17 00:00:00 2001 +From: Uli Schlachter +Date: Mon, 30 Oct 2017 21:14:11 +0100 +Subject: [PATCH] callable: Fix enum return from C functions + +According to [1], return values smaller than sizeof(long) are returned +as ffi_arg or ffi_sarg. Thus, the code here needs to use ffi_sarg +instead of int to work correctly. + +This fixes a test failure on s390x that boils down to +cairo_pattern_get_type() returning 2, but the C code here turns that +into a value of 0. + +A big "thank" you to Debian and specifically to Mattia Rizzolo for +giving me access to a porterbox so that I could debug this myself. + +[1]: https://linux.die.net/man/3/ffi_call + +Signed-off-by: Uli Schlachter +--- + lgi/callable.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lgi/callable.c b/lgi/callable.c +index 62387ed..86b7ed3 100644 +--- a/lgi/callable.c ++++ b/lgi/callable.c +@@ -769,7 +769,7 @@ callable_param_2lua (lua_State *L, Param *param, GIArgument *arg, + args + callable->has_self); + else + { +- union { GIArgument arg; int i; } *u = (gpointer) arg; ++ union { GIArgument arg; ffi_sarg i; } *u = (gpointer) arg; + lua_pushnumber (L, u->i); + } + } diff --git a/SOURCES/lgi-0.9.2-lua54.patch b/SOURCES/lgi-0.9.2-lua54.patch new file mode 100644 index 0000000..b343bd7 --- /dev/null +++ b/SOURCES/lgi-0.9.2-lua54.patch @@ -0,0 +1,54 @@ +From 5cfd42c386d3adae6d211fbb4011179c3c141b04 Mon Sep 17 00:00:00 2001 +From: Uli Schlachter +Date: Sun, 2 Aug 2020 16:14:27 +0200 +Subject: [PATCH 1/2] Fix the build with Lua 5.4 + +Lua 5.4 changed the API to lua_resume(). This commit changes the code to +cope with that. + +Signed-off-by: Uli Schlachter +--- + lgi/callable.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lgi/callable.c b/lgi/callable.c +index e96d3af..3234b64 100644 +--- a/lgi/callable.c ++++ b/lgi/callable.c +@@ -1355,7 +1355,10 @@ closure_callback (ffi_cif *cif, void *ret, void **args, void *closure_arg) + } + else + { +-#if LUA_VERSION_NUM >= 502 ++#if LUA_VERSION_NUM >= 504 ++ int nresults; ++ res = lua_resume (L, NULL, npos, &nresults); ++#elif LUA_VERSION_NUM >= 502 + res = lua_resume (L, NULL, npos); + #else + res = lua_resume (L, npos); + +From a2f834c2ebf5c4f523d5ed909b83e2a805237c0a Mon Sep 17 00:00:00 2001 +From: Uli Schlachter +Date: Sun, 2 Aug 2020 16:16:03 +0200 +Subject: [PATCH 2/2] Mention Lua 5.4 as "experimentally supported" + +Signed-off-by: Uli Schlachter +--- + README.md | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/README.md b/README.md +index bf11cbe..26a11bd 100644 +--- a/README.md ++++ b/README.md +@@ -14,6 +14,9 @@ LGI is tested and compatible with standard Lua 5.1, Lua 5.2, Lua 5.3 and + LuaJIT2. Compatibility with other Lua implementations is not tested + yet. + ++Lua 5.4 is only supported experimentally. It builds, but does not pass the ++test suite. See [#247](https://github.com/pavouk/lgi/issues/247) for details. ++ + If you need to support pre-gobject-introspection GTK (ancient GTK+ 2.x + releases), use [Lua-Gnome](http://sourceforge.net/projects/lua-gnome/). + diff --git a/SPECS/lua-lgi.spec b/SPECS/lua-lgi.spec new file mode 100644 index 0000000..3ad9a90 --- /dev/null +++ b/SPECS/lua-lgi.spec @@ -0,0 +1,298 @@ +%global luaver 5.4 +%global lualibdir %{_libdir}/lua/%{luaver} +%global luapkgdir %{_datadir}/lua/%{luaver} + +%global luacompatver 5.1 +%global luacompatlibdir %{_libdir}/lua/%{luacompatver} +%global luacompatpkgdir %{_datadir}/lua/%{luacompatver} +%global luacompatincludedir %{_includedir}/lua-%{luacompatver} +%global lua51dir %{_builddir}/lua51-%{name}-%{version}-%{release} + +Name: lua-lgi +Version: 0.9.2 +Release: 20%{?dist} +Summary: Lua bindings to GObject libraries +License: MIT +URL: https://github.com/pavouk/lgi +Source0: https://github.com/pavouk/lgi/archive/%{version}/lgi-%{version}.tar.gz +# see gh#212 (commit a127f82) +Patch0: lgi-0.9.2-fix-s390x.patch +# see gh#215 +Patch1: lgi-0.9.2-fix-gobject-warnings.patch +# see gh#249 +Patch2: lgi-0.9.2-lua54.patch +BuildRequires: pkgconfig(gobject-introspection-1.0) >= 0.10.8 +BuildRequires: pkgconfig(gmodule-2.0) +BuildRequires: pkgconfig(libffi) +BuildRequires: lua >= %{luaver} +BuildRequires: lua-devel >= %{luaver} +BuildRequires: lua-markdown +# for the testsuite: +BuildRequires: pkgconfig(gio-2.0) +BuildRequires: pkgconfig(cairo) +BuildRequires: pkgconfig(cairo-gobject) +BuildRequires: pkgconfig(gtk+-3.0) +BuildRequires: gcc +BuildRequires: make +BuildRequires: which +BuildRequires: Xvfb xauth +BuildRequires: dbus-x11 at-spi2-core + +%global __requires_exclude_from %{_docdir} +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} + +%description +LGI is gobject-introspection based dynamic Lua binding to GObject +based libraries. It allows using GObject-based libraries directly from +Lua. + + +%package samples +Summary: Examples of lua-lgi usage +# gtk-demo is LGPLv2+ +License: LGPLv2+ and MIT +Requires: %{name}%{?_isa} = %{version}-%{release} + +%description samples +%{summary} + + +%package compat +Summary: Lua bindings to GObject libraries for Lua 5.1 +BuildRequires: compat-lua >= %{luacompatver} +BuildRequires: compat-lua-devel >= %{luacompatver} + +%description compat +LGI is gobject-introspection based dynamic Lua binding to GObject +based libraries. It allows using GObject-based libraries directly from +Lua. + + +%prep +%autosetup -n lgi-%{version} -p1 +rm -rf %{lua51dir} +cp -a . %{lua51dir} + + +%build +export CFLAGS="%{optflags} -DLUA_COMPAT_APIINTCASTS" +%configure || : +make %{?_smp_mflags} + +pushd %{lua51dir} +%configure || : +make LUA_CFLAGS=-I%{luacompatincludedir} %{?_smp_mflags} +popd + +# generate html documentation +markdown.lua README.md docs/*.md + + +%install +mkdir -p \ + %{buildroot}%{lualibdir} \ + %{buildroot}%{luapkgdir} +make install \ + "PREFIX=%{_prefix}" \ + "LUA_LIBDIR=%{lualibdir}" \ + "LUA_SHAREDIR=%{luapkgdir}" \ + "DESTDIR=%{buildroot}" + +pushd %{lua51dir} +mkdir -p \ + %{buildroot}%{luacompatlibdir} \ + %{buildroot}%{luacompatpkgdir} +make install \ + "PREFIX=%{_prefix}" \ + "LUA_LIBDIR=%{luacompatlibdir}" \ + "LUA_SHAREDIR=%{luacompatpkgdir}" \ + "DESTDIR=%{buildroot}" +popd + +# install docs +mkdir -p %{buildroot}%{_pkgdocdir} +cp -av README.html docs/*.html \ + %{buildroot}%{_pkgdocdir} +cp -av samples %{buildroot}%{_pkgdocdir} +find %{buildroot}%{_pkgdocdir} -type f \ + -exec chmod -x {} \; + + +%check +export CFLAGS="%{optflags} -DLUA_COMPAT_APIINTCASTS" +%configure || : +# report failing tests, don't fail the build +timeout 60s xvfb-run -a -w 1 make check || : + +pushd %{lua51dir} +# report failing tests, don't fail the build +xvfb-run -a -w 1 make check \ + LUA=%{_bindir}/lua-5.1 \ + LUA_CFLAGS=-I%{luacompatincludedir} || : +popd + + +%files +%dir %{_pkgdocdir} +%license LICENSE +%{_pkgdocdir}/*.html +%{luapkgdir}/lgi.lua +%{luapkgdir}/lgi +%{lualibdir}/lgi + + +%files compat +%license LICENSE +%{luacompatpkgdir}/lgi.lua +%{luacompatpkgdir}/lgi +%{luacompatlibdir}/lgi + + +%files samples +%{_pkgdocdir}/samples + + +%changelog +* Wed Jan 01 2025 Arkady L. Shane - 0.9.2-20 +- Rebuilt for MSVSphere 10 + +* Thu Jul 18 2024 Fedora Release Engineering - 0.9.2-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild + +* Thu Jan 25 2024 Fedora Release Engineering - 0.9.2-19 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Sun Jan 21 2024 Fedora Release Engineering - 0.9.2-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Thu Jul 20 2023 Fedora Release Engineering - 0.9.2-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Sat Mar 4 2023 Thomas Moschny - 0.9.2-16 +- Apply patch by yselkowi@redhat.com: Drop unneeded Requires: lua. + +* Thu Jan 19 2023 Fedora Release Engineering - 0.9.2-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Thu Jul 21 2022 Fedora Release Engineering - 0.9.2-14 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Thu Jan 20 2022 Fedora Release Engineering - 0.9.2-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Sat Jan 08 2022 Miro HronĨok - 0.9.2-12 +- Rebuilt for https://fedoraproject.org/wiki/Changes/LIBFFI34 + +* Thu Jul 22 2021 Fedora Release Engineering - 0.9.2-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Tue Jan 26 2021 Fedora Release Engineering - 0.9.2-10 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Sun Nov 15 2020 Thomas Moschny - 0.9.2-9 +- Update for Lua 5.4. + +* Sat Aug 01 2020 Fedora Release Engineering - 0.9.2-8 +- Second attempt - Rebuilt for + https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Tue Jul 28 2020 Fedora Release Engineering - 0.9.2-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Wed Jan 29 2020 Fedora Release Engineering - 0.9.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Thu Jul 25 2019 Fedora Release Engineering - 0.9.2-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Fri Feb 8 2019 Thomas Moschny - 0.9.2-4 +- Update BRs. +- Add one patch to fix a problem on s390x, and one to fix a warning in + the testsuite. + +* Fri Feb 01 2019 Fedora Release Engineering - 0.9.2-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jul 13 2018 Fedora Release Engineering - 0.9.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon Jun 4 2018 Thomas Moschny - 0.9.2-1 +- Update to 0.9.2. +- Update BRs. + +* Thu Feb 08 2018 Fedora Release Engineering - 0.9.1-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Aug 03 2017 Fedora Release Engineering - 0.9.1-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Wed Jul 26 2017 Fedora Release Engineering - 0.9.1-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Mon Mar 20 2017 Thomas Moschny - 0.9.1-3 +- Add -compat subpackage (rhbz#1323428). +- Minor spec file cleanups. + +* Fri Feb 10 2017 Fedora Release Engineering - 0.9.1-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Jun 3 2016 Thomas Moschny - 0.9.1-1 +- Update to 0.9.1. + +* Thu Feb 04 2016 Fedora Release Engineering - 0.9.0-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Wed Jun 17 2015 Fedora Release Engineering - 0.9.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri Apr 24 2015 Thomas Moschny - 0.9.0-1 +- Update to 0.9.0. + +* Sat Mar 14 2015 Thomas Moschny - 0.8.0-4 +- Mark license with %%license. + +* Fri Jan 16 2015 Tom Callaway - 0.8.0-3 +- rebuild for lua 5.3 + +* Sun Aug 17 2014 Fedora Release Engineering - 0.8.0-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Fri Jul 4 2014 Thomas Moschny - 0.8.0-1 +- Update to 0.8.0. + +* Sat Jun 07 2014 Fedora Release Engineering - 0.7.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Apr 17 2014 Thomas Moschny - 0.7.2-1 +- Update to 0.7.2. +- Use a single package doc dir. + +* Sat Aug 03 2013 Fedora Release Engineering - 0.7.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Sun May 12 2013 Tom Callaway - 0.7.1-2 +- rebuild for lua 5.2 + +* Thu Mar 21 2013 Thomas Moschny - 0.7.1-1 +- Update to 0.7.1. + +* Thu Feb 14 2013 Fedora Release Engineering - 0.6.2-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Tue Jan 8 2013 Thomas Moschny - 0.6.2-5 +- Update license tag. + +* Mon Jan 7 2013 Thomas Moschny - 0.6.2-4 +- Remove unnecessary patch. +- Update license tag: gtk-demo is licensed under LGPLv2+. +- Put fully versioned dependency in subpackage. + +* Wed Jan 2 2013 Thomas Moschny - 0.6.2-3 +- Move samples to separate package. +- Generate HTML documentation from markdown docs. + +* Sun Dec 23 2012 Thomas Moschny - 0.6.2-2 +- Add gtk3 as BR, required by the testsuite. + +* Sun Dec 23 2012 Thomas Moschny - 0.6.2-1 +- New package.