Date: Tue, 25 Jun 2013 11:50:30 GMT From: Vitaly Magerya <vmagerya@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/179960: [patch] devel/lua-lgi 0.7.1 doesn't work with gtk2 Message-ID: <201306251150.r5PBoUxs046187@oldred.freebsd.org> Resent-Message-ID: <201306251200.r5PC00Sl052217@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 179960 >Category: ports >Synopsis: [patch] devel/lua-lgi 0.7.1 doesn't work with gtk2 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Tue Jun 25 12:00:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Vitaly Magerya >Release: FreeBSD 9.1-STABLE amd64 >Organization: >Environment: >Description: Install devel/lua-lgi (version 0.7.1). Try to run the samples/gtkhello.lua example from lgi distribution. Alternatively, run lua-5.1 and type this: lgi = require("lgi") gtk = lgi.Gtk You'll get this error: /usr/local/share/lua/5.1/lgi/override/Gdk.lua:57: attempt to index field 'RGBA' (a nil value) stack traceback: /usr/local/share/lua/5.1/lgi/override/Gdk.lua:57: in main chunk [C]: in function 'require' /usr/local/share/lua/5.1/lgi/namespace.lua:176: in function 'require' /usr/local/share/lua/5.1/lgi/namespace.lua:163: in function </usr/local/share/lua/5.1/lgi/namespace.lua:148> (tail call): ? stdin:1: in main chunk [C]: ? This happens because 'Gdk.RGBA' only exists in Gtk3, not Gtk2. The fix is to apply the patch from commit 8000f6d [1]. (See the attached patch). [1] https://github.com/pavouk/lgi/commit/8000f6d1362fc38ebe349119554d291f6226e04e >How-To-Repeat: >Fix: Patch attached with submission follows: diff -ruN lua-lgi.orig/files/patch-lgi-override-Gdk.lua lua-lgi/files/patch-lgi-override-Gdk.lua --- lua-lgi.orig/files/patch-lgi-override-Gdk.lua 1970-01-01 03:00:00.000000000 +0300 +++ lua-lgi/files/patch-lgi-override-Gdk.lua 2013-06-25 14:35:06.000000000 +0300 @@ -0,0 +1,31 @@ +--- lgi/override/Gdk.lua.orig 2013-06-25 14:33:15.000000000 +0300 ++++ lgi/override/Gdk.lua 2013-06-25 14:34:28.000000000 +0300 +@@ -54,16 +54,18 @@ + } do Gdk._constant[name] = Gdk.Atom(val) end + + -- Easier-to-use Gdk.RGBA.parse() override. +-local parse = Gdk.RGBA.parse +-function Gdk.RGBA._method.parse(arg1, arg2) +- if Gdk.RGBA:is_type_of(arg1) then +- -- Standard member method. +- return parse(arg1, arg2) +- else +- -- Static constructor variant. +- local rgba = Gdk.RGBA() +- return parse(rgba, arg1) and rgba or nil +- end ++if Gdk.RGBA then ++ local parse = Gdk.RGBA.parse ++ function Gdk.RGBA._method.parse(arg1, arg2) ++ if Gdk.RGBA:is_type_of(arg1) then ++ -- Standard member method. ++ return parse(arg1, arg2) ++ else ++ -- Static constructor variant. ++ local rgba = Gdk.RGBA() ++ return parse(rgba, arg1) and rgba or nil ++ end ++ end + end + + -- Gdk.Window.destroy() actually consumes 'self'. Prepare workaround >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201306251150.r5PBoUxs046187>