Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GIMP AppImage and the temporary mount directory #80

Closed
aferrero2707 opened this issue Aug 29, 2016 · 9 comments
Closed

GIMP AppImage and the temporary mount directory #80

aferrero2707 opened this issue Aug 29, 2016 · 9 comments

Comments

@aferrero2707
Copy link

I have a little issue with running my experimental GIMP AppImage (see the current Recipe here).

The AppImage gets mounted in a temporary directory of the form "/tmp/.mount_*". This means that the GIMP plug-ins are located in a different folder at each execution of the appimage. This in turn triggers the update of the GIMP plug-in registry at each execution, which significantly increases the GIMP initialisation time.

Would there be a way to tell the AppImage to mount to a fixed directory instead of an uniquely-generated one? Something like "/tmp/.mount_gimp_appimage"? Or is there a severe problem with this?

@probonopd
Copy link
Member

probonopd commented Aug 29, 2016

The mount point is always read-only. The AppImage cannot write anything at the mount point. Which means that if GIMP can be made to whatever gets mounted at the mount point in relative rather than absolute paths, everything should be fine.

For example, instead of hardcoding /tmp/.mount_0123456/usr/share/gimp/2.0 GIMP should be made to use ${gimp_data_dir}.

It seems like work has begun in this direction:
https://mail.gnome.org/archives/commits-list/2009-November/msg01994.html
But it seems not to be finished?

In theory, one could patch runtime.c to use fixed mount points, but I would like to avoid that; mainly to enforce clean relocateability.

@probonopd
Copy link
Member

probonopd commented Aug 30, 2016

Could ${gimp_dir}and/or ${gimp_data_dir} be used instead of absolute paths? They are mentioned in https://www.gimp.org/unix/gimprc.html. Possibly a shell script that replaces all occurences of /tmp/.mount_*/usr/share/gimp/2.0 with ${gimp_data_dir} before actually launching the app?

@aferrero2707
Copy link
Author

As far as I understand, GIMP always puts absolute paths in the pluginrc file, which explains why the file is re-built each time the appimage is executed.

${gimp_dir} tells GIMP where to look for plug-ins, however the actual path is used when storing the plug-in path in pluginrc.

Anyhow, I will bring the issue in the gimp-developer mailing list. If there is no solution, I think we can survive with a longer initialisation time...

@probonopd
Copy link
Member

Discussing this right now on #gimp on irc.gimp.org
https://gist.github.com/probonopd/7b093f98cf46773e9af43b3218562fdb

@probonopd probonopd reopened this Aug 30, 2016
@aferrero2707
Copy link
Author

aferrero2707 commented Aug 31, 2016

Interesting discussion... and thanks for taking care of contacting the GIMP developers! Unfortunately I have no time to discuss on irc.
I see that some people are not happy about the additional plug-ins... I wonder why, it is not clear from the discussion.

I hope that the GIMP developers will find a proper solution. Meanwhile, we cannot really say that the AppImage is not working, and I still believe that the longer initialisation time is a small price to pay for the advantage of having one package that runs everywhere (and this opinion is shared with few users I've been talking to on pixls.us).

I have updated the Recipe gist with my latest version, if you want to have look: https://gist.github.com/aferrero2707/2da99aae425eca8c8afb61b3fb5532f9

@probonopd
Copy link
Member

probonopd commented Aug 31, 2016

@aferrero2707 GIMP has been updated to not do this anymore:

GNOME/gimp@9f343f2

try to store plug-in paths in terms of ${gimp_plug_in_dir} so they get found without re-querying by relocatable GIMP packages

Also GNOME/gimp@6b39115

libgimpconfig: add gimp_config_path_unexpand() which is the opposite of gimp_config_path_expand() and replaces all occurences of well-known gimprc paths with their respective identifiers such as ${gimp_data_directory}, ${gimp_directory} etc.

And GNOME/gimp@12ac114

app: use gimp_config_path_unexpand() when writing pluginrc

Please do a new build and see whether it resolves the issue.

@aferrero2707
Copy link
Author

Wow!!! I'll update and test the appimage tomorrow, and report back here my findings... thanks for your support!

@aferrero2707
Copy link
Author

It works!, provided that I add the following lines in the wrapper script that launches the GIMP executable:

HERE="$(dirname "$(readlink -f "${0}")")"
export GTK_PATH=$HERE/../lib/gtk-2.0:$GTK_PATH
export GIMP2_PLUGINDIR=$(readlink -f "$HERE/../lib/gimp/2.0")

Now the paths in the pluginrc file are correctly starting with ${gimp_plug_in_dir}.

@probonopd
Copy link
Member

Awesome! 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants