support multiple extension locations
I was looking into how one might provide inkscape extensions using 0install[1], which basically amounts to adding extensions _without_ touching any well-known paths, typically using environment variables.
I've done the same thing for gnome-shell, by essentially adding each extension's location to $XDG_DATA_DIRS. So for example to run gnome-shell with the shellshape extension[2], $XDG_DATA_DIRS might contain the following dir:
/home/tim/.cache/0install.net/implementations/sha256=2437376cd245ee4f09b0738e1cc7392a04750a9cec4b0875bf71606703d9ee01/xdg
which contains a `gnome-shell` directory with the files you would normally put in /usr/share/gnome-shell if you were installing them system-wide.
I wondered if this would work for inkscape as well, but after having a look at the source, it doesn't seem likely. Based on the `profile_path` function in inkscape.cpp:
- inkscape seems to assume that there will be at most one folder for each of (user, system) level preferences - it assumes preferences and extensions will all live in the same location.
These both go against the XDG spec[3], which recommends that config and data live in different locations and should be able to be looked up in a cascading fashion (i.e supporting multiple paths in $XDG_DATA_DIRS). These restrictions also make it very difficult to use 0install to distribute extensions since that would require: - readonly `extensions` directories - all 0install implementation directories must be read-only as they can be shared between users (among other reasons) - cascading lookup of extensions in _all_ paths in $XDG_DATA_DIRS - adding or removing plugins must be possible by affecting what is in XDG_DATA_DIRS, rather than modifying folders in the filesystem.
So, I guess my questions are: - am I wrong about my conclusions here? I've looked at the source, but may have missed something. - is there any interest in extending the extension loading mechanism to support loading extensions across all $XDG_DATA_DIRS? Presumably this would be implemented for _all_ data types (gradients, icons, etc) as well as just extensions.
Cheers, - Tim.
[1]: http://0install.net/ [2]: http://gfxmonk.net/dist/0install/shellshape.xml [3]: http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
2012/1/21 Tim Cuthbertson <tim@...2743...>:
So, I guess my questions are: - am I wrong about my conclusions here? I've looked at the source, but may have missed something.
I think you are right. There was recently some work to get us more in line with XDG specifications for user directories, but it was not as thorough as it should be.
- is there any interest in extending the extension loading mechanism to support loading extensions across all $XDG_DATA_DIRS? Presumably this would be implemented for _all_ data types (gradients, icons, etc) as well as just extensions.
There is some interest (as in, "we need to do that eventually") but I think no one is actively working on it at the moment.
Regards, Krzysztof
On Feb 1, 2012, at 1:06 PM, Krzysztof Kosiński wrote:
2012/1/21 Tim Cuthbertson <tim@...2743...>:
- is there any interest in extending the extension loading mechanism
to support loading extensions across all $XDG_DATA_DIRS? Presumably this would be implemented for _all_ data types (gradients, icons, etc) as well as just extensions.
There is some interest (as in, "we need to do that eventually") but I think no one is actively working on it at the moment.
Exactly.
So if you want to lend a hand there, that would be a big help. Especially on OS X, there are some hardcodings left in our code that cause a fair bit of headache. If you'd like to get started on that, I do have some notes here and there related to more of what needs to be fixed.
Oh, and to highlight the problem... much of what you're seeing wrong in the code comes from legacy C coding back in the days before Inkscape proper, when macros ruled the land and 'puters ran on dinosaur treadmill power.
On Thu, Feb 2, 2012 at 4:21 PM, Jon Cruz <jon@...18...> wrote:
On Feb 1, 2012, at 1:06 PM, Krzysztof Kosiński wrote:
2012/1/21 Tim Cuthbertson <tim@...2743...>:
- is there any interest in extending the extension loading mechanism to support loading extensions across all $XDG_DATA_DIRS? Presumably this would be implemented for _all_ data types (gradients, icons, etc) as well as just extensions.
There is some interest (as in, "we need to do that eventually") but I think no one is actively working on it at the moment.
Exactly.
So if you want to lend a hand there, that would be a big help. Especially on OS X, there are some hardcodings left in our code that cause a fair bit of headache. If you'd like to get started on that, I do have some notes here and there related to more of what needs to be fixed.
Oh, and to highlight the problem... much of what you're seeing wrong in the code comes from legacy C coding back in the days before Inkscape proper, when macros ruled the land and 'puters ran on dinosaur treadmill power.
I'd like to help, but I'm afraid I don't have the spare time for it, and don't use OSX any more. So I'm afraid I can't actually lend a hand there.
Regards, - Tim.
participants (3)
-
Jon Cruz
-
Krzysztof Kosiński
-
Tim Cuthbertson