leafo / gifine

Quickly record and edit gifs and videos of your desktop
285 stars 14 forks source link

Update the code to work on Lua 5.3 (and 5.2) #25

Closed hardpenguin closed 1 year ago

hardpenguin commented 3 years ago

I tried installing it and ended up with the following error:

$ gifine
/usr/bin/lua5.3: /usr/local/share/lua/5.3/gifine/main.lua:4: attempt to call a nil value (global 'unpack')
stack traceback:
    /usr/local/share/lua/5.3/gifine/main.lua:4: in main chunk
    [C]: in function 'require'
    /usr/local/lib/luarocks/rocks/gifine/dev-1/bin/gifine:2: in main chunk
    [C]: in ?

Quick Google search told me that "in Lua 5.2, unpack was moved to table.unpack."

The alternatives system on my Debian system selected lua5.3 as the default version. This version is also available in stable releases of Debian and Ubuntu.

Replacing unpack with table.unpack in command.lua and main.lua which can be found in /usr/local/share/lua/5.3/gifine/ did the trick for me.

Since Gifine did not really met my needs, there will be no PR from me today. Perhaps in the future.

hsandt commented 1 year ago

Exactly, and if you want retrocompatibility with Lua 5.1, I suppose you could do some unpack = unpack or table.unpack.

The README mentions Ubuntu 16.04 so I though the project received no update for a while, but it turns out there was a lgi version upgrade commit 3 months ago, so we can expect some update on this one too.

I'll try gifine once more on my new computer and if I keep using it, I can consider a PR on my side.