wmww / gtk4-layer-shell

A library to create panels and other desktop components for Wayland using the Layer Shell protocol and GTK4
MIT License
128 stars 4 forks source link

[HELP WANTED] Lua example not working on Arch #28

Open wmww opened 10 months ago

wmww commented 10 months ago

I've installed luajit and luajit-lgi on Arch (the latter from the AUR). When I run the following:

GI_TYPELIB_PATH=build/src/ LD_LIBRARY_PATH=build/src/ luajit ./examples/simple-example.lua

I get this:

luajit: /usr/share/lua/5.1/lgi/override/Gdk.lua:23: bad argument #1 to 'registerlock' (userdata expected, got nil)
stack traceback:
    [C]: in function 'registerlock'
    /usr/share/lua/5.1/lgi/override/Gdk.lua:23: in main chunk
    [C]: in function 'require'
    /usr/share/lua/5.1/lgi/namespace.lua:183: in function 'require'
    /usr/share/lua/5.1/lgi/namespace.lua:170: in function 'require'
    /usr/share/lua/5.1/lgi/namespace.lua:170: in function 'require'
    ./examples/simple-example.lua:13: in main chunk
    [C]: at 0x56412c33dcd0

This is also causing the tests to fail on Arch because they include running the lua example. this claims "LGI does not work with Gtk 4", but that doesn't add up because CI (which runs on Ubuntu) passes.

Either way I don't know much about lua or particularly care, so I'm likely to disable the test and mark the example deprecated unless someone from the community can help me solve it.

mfxbe commented 9 months ago

Haven't used Lua in a while but I think the problem is, that there hasn't been a release of lgi in years. If I see it correctly then the AUR uses version 0.9.2 from 2017 (latest release) but the Gtk4 support was introduced in 2021. The only working way to use lua-lgi with Gtk4 is to ether build it from git or use some package from luarocks (but also not the default one if I remember correctly). No idea why Ubuntu CI passes, maybe a newer version is used there?

Sorry not a full solution for the issue but maybe this hint can help.