First off, thank you for your project. I came here as part of the effort to migrate Fedora's lua to 5.5 and I'm grateful for all the work you've done in your fork/modernization of lgi. Fedora has lua-lgi but only as a dependency of awesome (a lua window manager). I modified awesome to replace all the lgi calls with LuaGObject calls and then I ran into this oddity:
Error:
/usr/bin/lua: /home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/gears/color.lua:170: cairo.Pattern: no `add_color_stop_rgba'
stack traceback:
[C]: in upvalue 'error'
/usr/share/lua/5.5/LuaGObject/component.lua:141: in function </usr/share/lua/5.5/LuaGObject/component.lua:137>
[C]: in metamethod 'index'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/gears/color.lua:170: in upvalue 'add_stops_table'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/gears/color.lua:212: in function 'gears.color.create_linear_pattern'
(...tail calls...)
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/wibox/widget/graph.lua:333: in local 'build_fallback_nan_color'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/wibox/widget/graph.lua:349: in main chunk
[C]: in global 'require'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/wibox/widget/init.lua:22: in main chunk
[C]: in global 'require'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/wibox/container/tile.lua:14: in main chunk
[C]: in global 'require'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/wibox/container/init.lua:20: in main chunk
[C]: in global 'require'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/wibox/init.lua:30: in main chunk
[C]: in global 'require'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/awful/widget/common.lua:17: in main chunk
[C]: in global 'require'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/lib/awful/widget/taglist.lua:49: in main chunk
[C]: in global 'require'
/home/spot/git/sandbox/lua55/awesome/awesome-4.3-build/awesome-73b20cc3eca34c0dbe40e7798f469e1df787f44d/tests/examples/sequences/template.lua:15: in main chunk
[C]: in ?
My best guess here is that this lookup is failing because of how Cairo inheritance is being done? The awesome code (from lib/gears/color.lua) is this:
--- Add a list of stops to a given pattern
local function add_stops_table(pat, arg)
for _, stop in ipairs(arg) do
pat:add_color_stop_rgba(stop[1], color.parse_color(stop[2]))
end
end
local pat
pat = cairo.Pattern.create_linear(arg.from[1], arg.from[2], arg.to[1], arg.to[2])
add_stops_table(pat, arg.stops)
If I copy the add_color_stop_rgba method define from GradientPattern into Pattern, this error goes away, but I'm not at all convinced this is the correct fix. Thanks for any insights you can add here!
First off, thank you for your project. I came here as part of the effort to migrate Fedora's lua to 5.5 and I'm grateful for all the work you've done in your fork/modernization of lgi. Fedora has lua-lgi but only as a dependency of awesome (a lua window manager). I modified awesome to replace all the lgi calls with LuaGObject calls and then I ran into this oddity:
My best guess here is that this lookup is failing because of how Cairo inheritance is being done? The awesome code (from lib/gears/color.lua) is this:
If I copy the add_color_stop_rgba method define from GradientPattern into Pattern, this error goes away, but I'm not at all convinced this is the correct fix. Thanks for any insights you can add here!