1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122 | 09:52 <jdstrand> I thought I looked at gdk-pixbuf a bit-- is it assuming a hardcoded path?
09:53 <desrt> the package would be
09:53 <jdstrand> cause I tried to use gdk-pixbuf-query-loaders
09:53 <desrt> libgdk-pixbuf2.0-0:amd64.triggers:interest /usr/lib/gdk-pixbuf-2.0/2.10.0/loaders
09:53 <desrt> libgdk-pixbuf2.0-0:amd64.triggers:interest /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders
09:53 <jdstrand> I think that is what it was
09:53 <desrt> the arguments to this tool are slightly non-obvious
09:54 <desrt> take a look at the postinst
09:54 <desrt> /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders \
09:54 <desrt> $(find $LOADERS_DIR $LOADERS_DIR_OLD -name *.so 2> /dev/null) \
09:54 <desrt> > /usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/2.10.0/loaders.cache || true
09:54 <jdstrand> ah
09:54 <jdstrand> ok, that should be doable
09:55 <desrt> so ya... pixbuf loaders, icons, gsettings schemas, gio modules...
09:55 <desrt> those 4, really...
09:55 <desrt> icons are probably the least important
09:55 <jdstrand> it doesn't matter if these things are writable by the user or not, right? I was thinking I could generate loaders.cache and put it in a writable area in $HOME using the above, then setting the appropriate env var
09:55 <desrt> gtk will happily read the directory contents if the cache does not exist
09:56 <jdstrand> oh
09:56 <desrt> don't do that
09:56 <desrt> these cache files should be part of the app image
09:56 <desrt> ie: they are a cache of what is installed on the system... not a cache in the webbrowser sense
09:56 <jdstrand> if those 4 cache files don't exist, gtk will be happy?
09:57 <jdstrand> ish?
09:57 <desrt> it's like the ldconfig cache... you run it once when you do an install and the user never has any business updating it
09:57 <desrt> no.
09:57 <desrt> the icon cache only is optional
09:57 <jdstrand> I see
09:57 <desrt> the others are quite mandatory
09:57 <jdstrand> ok
09:57 <desrt> (and even the icon cache is a good idea if you want to get rid of the complaints)
09:57 * jdstrand notes again that this is simply trying to get it to work at all nto for being proper
09:58 <desrt> do pixbufs first
09:58 <jdstrand> I was just thinking I might be able to do this quicker if stuff was in HOME
09:58 <desrt> this is absolutely essential
09:58 <jdstrand> anyhoo, ok
09:58 <desrt> if you want the ability to load (for example) pngs...
09:58 <desrt> i guess you could _maybe_ steal that one from your system.....
09:59 <jdstrand> that didn't seem to work
09:59 <desrt> it's probably pretty much always the sameish
09:59 <desrt> huh
09:59 <desrt> oh... because of the paths i guess
09:59 <jdstrand> I tried to copy that in
09:59 <desrt> snap is trying to use some weird other path, right?
09:59 <desrt> instead of using filesystem namespaces
09:59 <jdstrand> yes
10:00 <desrt> ya... this is just not going to work
10:00 <jdstrand> /snaps/gnome-calculator/<version>/usr/lib/...
10:00 <desrt> like, those packages were built for a specific install directory
10:00 <desrt> and it's not that
10:00 <jdstrand> that was what I was wondering about
10:00 <jdstrand> so there are compile time options
10:00 <jdstrand> and that setting env vars isn't enough
10:01 <jdstrand> so, assume for a moment that I was inside a snap in a shell
10:01 <jdstrand> and I shipped ./usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders
10:02 <jdstrand> could I then run ./usr/lib/x86_64-linux-gnu/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders, from within the snap, similarly to have postinst ran it?
10:02 <desrt> gdk-pixbuf has an option to be built "relocatable"
10:02 <jdstrand> perhaps seeting GTK_DATA_PREFIX=$SNAP/usr
10:02 <desrt> but we don't do that in the ubuntu package
10:03 <jdstrand> I see. so I need to rebuild gdk-pixbuf
10:03 <desrt> there is one possible workaround from what i am seeing
10:03 <desrt> write yourself a custom loaders.cache file
10:03 <desrt> that contains the correct /snap/bleh paths
10:03 <desrt> and then set GDK_PIXBUF_MODULE_FILE to point to that file
10:03 <desrt> i bet that would do the trick
10:04 <desrt> gsettings will be fine -- it uses xdg_data_dirs
10:04 <desrt> icons too
10:04 <jdstrand> I actually started going down this route: http://bazaar.launchpad.net/~jdstrand/+junk/gnome-calculator/view/head:/loaders.cache
10:05 <jdstrand> but I don't recall that I set GDK_PIXBUF_MODULE_FILE
10:05 <desrt> you'll need to
10:05 * jdstrand nods
10:05 <desrt> because otherwise it hardcodes the location to the compiled libdir
10:05 <jdstrand> I may have tried, but I might've removed it at the wrong time
10:05 <jdstrand> cool
10:05 <desrt> gio modules will also need an envvar
10:05 <jdstrand> ok, let me play with this for a bit
10:05 <jdstrand> ah, what env var is that?
10:06 <desrt> * The `GIO_EXTRA_MODULES` environment variable can be used to
10:06 <desrt> * specify additional directories to automatically load modules
10:06 <desrt> * from. This environment variable has the same syntax as the
10:06 <desrt> * `PATH`.
10:06 <jdstrand> rockin
10:06 <desrt> but ya... make sure you have the cache file there too, with sensible values
10:06 <jdstrand> ok, thank you :) I'm sure I'll have some more questions, but this has been super-helpful
10:06 <desrt> :)
10:06 <desrt> happy to help
10:09 <jdstrand> what about gscemas?
10:09 <jdstrand> gschemas?
10:09 <desrt> this is easy.. it will just go by XDG_DATA_DIRS
10:09 <desrt> which i assume you are setting properly
10:10 <jdstrand> ok
10:10 <desrt> if you really have a need, there is an extra variable you can set for that too
10:10 <jdstrand> gchemas.compiled?
10:11 <jdstrand> I am attempting to set XDG_DATA_DIRS, I'll just keep it in mind
10:11 <desrt> GSETTINGS_SCHEMA_DIR
10:11 <jdstrand> cool
10:11 <desrt> don't use that one tho
10:11 * jdstrand won't
10:11 <desrt> if you can't make XDG_DATA_DIRS work then talk to me first
10:11 <jdstrand> ok
10:11 <desrt> it should be set to /snap/bleh/usr/share
10:11 <jdstrand> yeah, I'm doing that already
10:11 <desrt> good
10:11 <jdstrand> but what about usr/share/glib-2.0/schemas/gschemas.compiled?
10:11 <desrt> what about it?
10:12 <jdstrand> isn't that a postinst thing I need to account for?
10:12 <desrt> if by 'usr/share' you mean the relative path under /snaps/ where you set XDG_DATA_DIRS then it will find gschemas.compiled at that path
10:12 <desrt> oh yes. definitely.
10:12 <desrt> gsettings never reads .xml
10:12 <desrt> it needs that cache
10:12 <jdstrand> ok, so I'll add that to the list
10:12 <desrt> well... it's not even really a cache.. it's compiled...
10:13 <jdstrand> maybe that was in the list already...
10:13 <desrt> right.. there's the 4 things: schemas, icons, loaders, modules
10:13 <jdstrand> anyhoo, lots to play with
10:13 <desrt> icons is the only one that you can maybe skip
10:13 <jdstrand> ok
10:13 <jdstrand> great
10:13 <desrt> (but don't) :)
10:13 <desrt> good luck :)
10:13 <jdstrand> I'm cautiously optimistic
10:13 <jdstrand> :)
|