Cannot specify distinct module search paths for GTK 2 and 3 (+ 3's default path not as documented)
I have a locally built input module (a patched version of uim) installed under /usr/local/lib
. Specifically, I have /usr/local/lib/gtk-2.0/2.10.0/immodules
and /usr/local/lib/gtk-3.0/3.0.0/immodules
(the same directory structure as the default IM modules under /usr/lib
). I would like to use it in GTK applications, which I currently can't, since /usr/local
is not covered by the default ModulesPath.
I understand that (per GTK 2 and GTK 3 documentation) I can use the environment variable GTK_PATH
to prepend to the ModulesPath. However:
-
I cannot simply add
/usr/local/lib
, since GTK will not look for the appropriategtk-2.0
orgtk-3.0
directory (only the structure under it). -
I am reluctant to add both
/usr/local/lib/gtk-2.0
and/usr/local/lib/gtk-3.0
. Although this shouldn't break anything now, since the paths of bothimmodules
directories contain aversion
element, that element is explicitly optional. If the local build structure ever changes, both GTK versions might see incompatible modules, which is, as the docs say, "unsuitable". -
I cannot symlink
~/.gtk-2.0
and~/.gtk-3.0
to their equivalents under/usr/local/lib
. Although the documentation pages state (in identical language) that GTK 2 and 3 search these directories (respectively) before the system default, only GTK 2 actually does so: unlike the ModulesPath reported by gtk-query-immodules-2.0, the path reported by -3.0 does not include anything under/home
.
Is there some other way this is intended to be done? If not, I assume there's a good reason for the shared GTK_PATH
, but is there one why its entries are not appended with the major version when the system libdir
is? And is GTK 3's failure to search in the home directory a case of outdated documentation, or a bug?
Version information:
- GTK 2 version 2.24.32
- GTK 3 version 3.24.23
- Arch Linux 5.8.12-arch1-1
Related:
- #237 (obsolete?)