diff --git a/README.md b/README.md index b461b32..94b680c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,4 @@ # lgi +Dynamic Lua binding to GObject libraries using GObject-Introspection. + diff --git a/lgi-0.9.2-lua-5.4.patch b/lgi-0.9.2-lua-5.4.patch new file mode 100644 index 0000000..d024cf7 --- /dev/null +++ b/lgi-0.9.2-lua-5.4.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 e96d3af4..3234b64f 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 bf11cbec..26a11bd9 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/lgi.spec b/lgi.spec new file mode 100644 index 0000000..56119fa --- /dev/null +++ b/lgi.spec @@ -0,0 +1,89 @@ +Name: lgi +Version: 0.9.2 +Release: 1mamba +Summary: Dynamic Lua binding to GObject libraries using GObject-Introspection +Group: System/Libraries +Vendor: openmamba +Distribution: openmamba +Packager: Silvan Calarco +URL: https://github.com/lgi-devs/lgi +Source: https://github.com/lgi-devs/lgi.git/%{version}/lgi-%{version}.tar.bz2 +Patch0: lgi-0.9.2-lua-5.4.patch +License: MIT +## AUTOBUILDREQ-BEGIN +BuildRequires: glibc-devel +BuildRequires: gobject-introspection-devel +BuildRequires: libffi-devel +BuildRequires: libglib-devel +## AUTOBUILDREQ-END +BuildRequires: liblua-devel +BuildRequires: liblua51-devel +Requires: lib%{name} = %{?epoch:%epoch:}%{version}-%{release} + +%description +Dynamic Lua binding to GObject libraries using GObject-Introspection. + +%package -n lua-%{name} +Summary: Dynamic Lua binding to GObject libraries using GObject-Introspection +Group: System/Libraries + +%description -n lua-%{name} +Dynamic Lua binding to GObject libraries using GObject-Introspection. + +%package -n lua51-%{name} +Summary: Dynamic Lua binding to GObject libraries using GObject-Introspection +Group: System/Libraries + +%description -n lua51-%{name} +Dynamic Lua binding to GObject libraries using GObject-Introspection. + +%debug_package + +%prep +%setup -q -c -a0 +mv lgi-%{version} lgi +cd lgi +%patch 0 -p1 -b .lua-5.4 +cd .. + +cp -a lgi lgi-51 + +%build +CFLAGS="%{optflags} `pkg-config --cflags lua`" make -C lgi all +CFLAGS="%{optflags} `pkg-config --cflags lua51`" make -C lgi-51 all + +%install +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%makeinstall -C lgi \ + CFLAGS="%{optflags} `pkg-config --cflags lua`" \ + LUA_LIBDIR=%{_libdir}/lua/5.4 \ + LUA_SHAREDIR=%{_datadir}/lua/5.4 + +%makeinstall -C lgi-51 \ + CFLAGS="%{optflags} `pkg-config --cflags lua51`" \ + LUA_LIBDIR=%{_libdir}/lua/5.1 \ + LUA_SHAREDIR=%{_datadir}/lua/5.1 + +%clean +[ "%{buildroot}" != / ] && rm -rf "%{buildroot}" + +%files -n lua-%{name} +%defattr(-,root,root) +%{_libdir}/lua/5.4/lgi/corelgilua51.so +%{_datadir}/lua/5.4/lgi.lua +%dir %{_datadir}/lua/5.4/lgi +%{_datadir}/lua/5.4/lgi/* +%doc lgi/LICENSE + +%files -n lua51-%{name} +%defattr(-,root,root) +%{_libdir}/lua/5.1/lgi/corelgilua51.so +%{_datadir}/lua/5.1/lgi.lua +%dir %{_datadir}/lua/5.1/lgi +%{_datadir}/lua/5.1/lgi/* +%doc lgi/LICENSE + +%changelog +* Sat May 11 2024 Silvan Calarco 0.9.2-1mamba +- package created using the webbuild interface