From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jun 25 12:00:00 2013 Return-Path: Delivered-To: freebsd-ports-bugs@smarthost.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CFD42AE5 for ; Tue, 25 Jun 2013 12:00:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id B219016B4 for ; Tue, 25 Jun 2013 12:00:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.7/8.14.7) with ESMTP id r5PC000H052218 for ; Tue, 25 Jun 2013 12:00:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.7/8.14.7/Submit) id r5PC00Sl052217; Tue, 25 Jun 2013 12:00:00 GMT (envelope-from gnats) Resent-Date: Tue, 25 Jun 2013 12:00:00 GMT Resent-Message-Id: <201306251200.r5PC00Sl052217@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Vitaly Magerya Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 41E19723 for ; Tue, 25 Jun 2013 11:50:31 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from oldred.freebsd.org (oldred.freebsd.org [8.8.178.121]) by mx1.freebsd.org (Postfix) with ESMTP id 1A6E2161D for ; Tue, 25 Jun 2013 11:50:31 +0000 (UTC) Received: from oldred.freebsd.org ([127.0.1.6]) by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id r5PBoUAq046207 for ; Tue, 25 Jun 2013 11:50:30 GMT (envelope-from nobody@oldred.freebsd.org) Received: (from nobody@localhost) by oldred.freebsd.org (8.14.5/8.14.5/Submit) id r5PBoUxs046187; Tue, 25 Jun 2013 11:50:30 GMT (envelope-from nobody) Message-Id: <201306251150.r5PBoUxs046187@oldred.freebsd.org> Date: Tue, 25 Jun 2013 11:50:30 GMT From: Vitaly Magerya To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: ports/179960: [patch] devel/lua-lgi 0.7.1 doesn't work with gtk2 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 25 Jun 2013 12:00:00 -0000 >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 (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: