lua scripts and flatpak

Hi,
I am trying to use LUA script RL_out_sharp when DT is installed from Flatpak.
gmic (what the script uses) is installed under

/usr/bin/gmic

Is there a way to configure DT (maybe flatseal) to be able to access the above location?

I checked this thread

I was able to make the script work under the appimage but not sure how to achieve it with the Flatpak installation.

you should look in /run/host/usr/bin/gmic and make sure the flatpak has access to the full filesystem with filesystem = host.

Not very successful here.

I am running flatpak as a user. I was unable to find /run/host/usr/bin/gmic
When I execute

flatpak run org.darktable.Darktable -d lua

The error is

/run/user/1001/doc/37a37708/gmic: error while loading shared libraries: libGraphicsMagick++-Q16.so.12: cannot open shared object file: No such file or directory

Looking under the folder - I can see gmic but that is all.

image

and I did give access to the FS
image

not sure what am I missing

I find it strange that the documentation of flatpak points to /usr being restricted (blacklisted)
At the same time it does say that it is mounted under /var/run/host/

bojo@serval2:/var$ ls -la run
lrwxrwxrwx 1 root root 4 Apr  3  2020 run -> /run
bojo@serval2:/var/run$ ls -la host
ls: cannot access 'host': No such file or directory
bojo@serval2:/var/run$ ls -la host*
ls: cannot access 'host*': No such file or directory

There is no instructions how exactly to do the mount.
My perception is that either I have to have links (tried and did not work) or literally have a mount command and /usr to be accessible from 2 locations. likely modifying fstab

This is the location relative to the root of the flatpak sandbox.

I am running darktable via Flatpak, and Hugin via flatpak, and I am having the same issue.

I can’t make darktable export images to hugin.

I can now make it open hugin, by creating my own script that performs a flatpak-spawn command, and enabling darktable acess to the talk.freedesktop.Flatpak session D BUS (via flatseal) but it isn’t loading the images.

I am out of my depth. So, a very quick question:

Do the Darktable Lua scripts work when programs are installed as individual Flatpaks? If yes, can anybody do a bit of hand-holding and help me configure it?

Thanks.

1 Like

I believe you’d need to edit the lua scripts to use flatpak spawn and also make sure that the hugin flatpak has read permission to the location where darktable is exporting the images to.

@wpferguson to confirm please

1 Like

I’ll have to build a VM and test. We already differentiate between Windows and Linux/MacOS so adding another spawning method shouldn’t be too difficult. I’ll open an issue on the lua-scripts repository.

Issue is here.

Disclaimer: I don’t use flatpaks and know next to nothing about them so it will be a bit of a learning curve for me.

Thanks for opening the issue.

If I want to hack the Lua scripts myself (in a VM off course) can I simply edit them in place? I have never used Lua but my bash scripting and Python isn’t too shabby so I fancy having a play.

Its a git repo, better to branch.

I mean can I simply edit the lua scripts that are installed within my Darktable flatpak folders, simply to play around? Am I right in thinking Lua scripts are interpreted as opposed to compiled?

Yes. The scripts automatically update if there are changes. If you edit them, the the automatic update wont work because it does a git pull to update the scripts. If you add a script, update still works. So, you might want to copy the script to a different name and edit that. The Lua docs are at darktable lua documentation - Home.

Great, many thanks. I fancy taking a look if I can find some time, see if I can hack it into working. Very interested to see if it can get updated in the future to be flatpak compatible.

1 Like