[packages/lua-lgi] Rel 5

arekm arekm at pld-linux.org
Tue May 19 19:49:03 CEST 2026


commit edfc66b53c256d179083860282af52c9df257c0f
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue May 19 19:48:47 2026 +0200

    Rel 5

 lua-lgi-glib-2.86-fix.patch | 58 +++++++++++++++++++++++++++++++++++++++++++++
 lua-lgi.spec                |  4 +++-
 2 files changed, 61 insertions(+), 1 deletion(-)
---
diff --git a/lua-lgi.spec b/lua-lgi.spec
index 3f2babd..9cb6dc8 100644
--- a/lua-lgi.spec
+++ b/lua-lgi.spec
@@ -2,12 +2,13 @@ Summary:	Lua bindings to GObject libraries
 Summary(pl.UTF-8):	Wiązania języka Lua do bibliotek GObject
 Name:		lua-lgi
 Version:	0.9.2
-Release:	4
+Release:	5
 License:	MIT
 Group:		Development/Libraries
 #Source0Download: https://github.com/pavouk/lgi/tags
 Source0:	https://github.com/pavouk/lgi/archive/%{version}/lgi-%{version}.tar.gz
 # Source0-md5:	ad5d2e7a4427069f926f2ca472a5fe6d
+Patch0:		%{name}-glib-2.86-fix.patch
 URL:		https://github.com/pavouk/lgi
 BuildRequires:	glib2-devel >= 2.0
 BuildRequires:	gobject-introspection-devel >= 0.10.8
@@ -29,6 +30,7 @@ używanie bibliotek opartych na GObject bezpośrednio z języka Lua.
 
 %prep
 %setup -q -n lgi-%{version}
+%patch -P0 -p1
 
 %build
 LIBS="$(pkg-config --libs lua51)" \
diff --git a/lua-lgi-glib-2.86-fix.patch b/lua-lgi-glib-2.86-fix.patch
new file mode 100644
index 0000000..93ebb14
--- /dev/null
+++ b/lua-lgi-glib-2.86-fix.patch
@@ -0,0 +1,58 @@
+diff -urN a/lgi/ffi.lua b/lgi/ffi.lua
+--- a/lgi/ffi.lua	2026-05-19 19:44:01.744406590 +0200
++++ b/lgi/ffi.lua	2026-05-19 19:44:01.746022435 +0200
+@@ -17,12 +17,11 @@
+ local gi = core.gi
+ local component = require 'lgi.component'
+ local enum = require 'lgi.enum'
+-local record = require 'lgi.record'
+ 
+ local ffi = {}
+ 
+-local gobject = gi.require('GObject')
+-local glib = gi.require('GLib')
++local gobject = assert(gi.require('GObject'))
++local glib = assert(gi.require('GLib'))
+ 
+ -- Gather all basic types.  We have to 'steal' them from well-known
+ -- declarations, because girepository API does not allow synthesizing
+@@ -76,18 +75,33 @@
+ 
+ -- Creates new enum/flags table with all values from specified gtype.
+ function ffi.load_enum(gtype, name)
+-   local GObject = core.repo.GObject
++   local GLib, GObject = core.repo.GLib, core.repo.GObject
+    local is_flags = GObject.Type.is_a(gtype, GObject.Type.FLAGS)
+    local enum_component = component.create(
+       gtype, is_flags and enum.bitflags_mt or enum.enum_mt, name)
+-   local type_class = GObject.TypeClass.ref(gtype)
++   local type_class
++   -- GLib >= 2.86 deprecates GObject.TypeClass.ref() in favour of .get()
++   if GLib.check_version(2, 86, 0) then
++      type_class = GObject.TypeClass.ref(gtype)
++   else
++      type_class = GObject.TypeClass.get(gtype)
++   end
+    local enum_class = core.record.cast(
+       type_class, is_flags and GObject.FlagsClass or GObject.EnumClass)
+-   for i = 0, enum_class.n_values - 1 do
+-      local val = core.record.fromarray(enum_class.values, i)
+-      enum_component[core.upcase(val.value_nick):gsub('%-', '_')] = val.value
++   if GLib.check_version(2, 87, 0) then
++      for i = 0, enum_class.n_values - 1 do
++         local val = core.record.fromarray(enum_class.values, i)
++         enum_component[core.upcase(val.value_nick):gsub('%-', '_')] = val.value
++      end
++   else
++      for _, val in ipairs(enum_class.values) do
++         enum_component[core.upcase(val.value_nick):gsub('%-', '_')] = val.value
++      end
++   end
++   -- For GLib versions below 2.86, type_class was ref'd and needs to be unref'd
++   if GLib.check_version(2, 86, 0) then
++      type_class:unref()
+    end
+-   type_class:unref()
+    return enum_component
+ end
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/lua-lgi.git/commitdiff/edfc66b53c256d179083860282af52c9df257c0f



More information about the pld-cvs-commit mailing list