Move the module cache files below libdir

These files contain architecture-dependent paths, and thus placing
them into sysconfdir causes unnecessary hassle. Now the immodule cache
file is looked for in libdir/gtk-3.0/3.0.0/immodules.cache, and the
pixbuf loader cache is looked for in libdir/gtk-3.0/3.0.0/loaders.cache.
This commit is contained in:
Matthias Clasen
2010-05-17 21:30:46 -04:00
parent 8a487aca2c
commit 0b0f176ac4
9 changed files with 1480 additions and 1469 deletions

View File

@ -35,6 +35,12 @@ If called without arguments, it looks for modules in the
If called with arguments, it looks for the specified modules. The arguments
may be absolute or relative paths.
</para>
<para>
Normally, the output of <command>gdk-pixbuf-queryloaders-3.0</command> is written
to <filename><replaceable>libdir</replaceable>gtk-3.0/3.0.0/loaders.cache</filename>, where <application>gdk-pixbuf</application> looks for it by default. If it is written to some other
location, the environment variable <link linkend="GDK_PIXBUF_MODULE_FILE"><envar>GDK_PIXBUF_MODULE_FILE</envar></link>
can be set to point <application>gdk-pixbuf</application> at the file.
</para>
</refsect1>
<refsect1><title>Environment</title>

View File

@ -18,7 +18,7 @@ a #GdkPixbufModuleFillVtableFunc function named
In order to make format-checking work before actually loading the modules
(which may require dlopening image libraries), modules export their
signatures (and other information) via the <function>fill_info</function>
function. An external utility, <command>gdk-pixbuf-query-loaders</command>,
function. An external utility, <command>gdk-pixbuf-query-loaders-3.0</command>,
uses this to create a text file containing a list of all available loaders and
their signatures. This file is then read at runtime by &gdk-pixbuf; to obtain
the list of available loaders and their signatures.
@ -38,13 +38,13 @@ supply a generic #load implementation wrapping the incremental loading.
Installing a module is a two-step process:
<itemizedlist>
<listitem><para>copy the module file(s) to the loader directory (normally
<filename><replaceable>libdir</replaceable>/gtk-2.0/<replaceable>version</replaceable>/loaders</filename>,
<filename><replaceable>libdir</replaceable>/gtk-3.0/<replaceable>version</replaceable>/loaders</filename>,
unless overridden by the environment variable
<envar>GDK_PIXBUF_MODULEDIR</envar>)
</para></listitem>
<listitem><para>call <command>gdk-pixbuf-query-loaders</command> to update the
<listitem><para>call <command>gdk-pixbuf-query-loaders-3.0</command> to update the
module file (normally
<filename><replaceable>sysconfdir</replaceable>/gtk-2.0/gdk-pixbuf.loaders</filename>,
<filename><replaceable>libdir</replaceable>/gtk-3.0/<replaceable>version</replaceable>/loaders.cache</filename>,
unless overridden by the environment variable
<envar>GDK_PIXBUF_MODULE_FILE</envar>)
</para></listitem>

View File

@ -34,6 +34,12 @@ module path.
If called with arguments, it looks for the specified modules. The arguments
may be absolute or relative paths.
</para>
<para>
Normally, the output of <command>gtk-query-immodules-3.0</command> is written
to <filename><replaceable>libdir</replaceable>gtk-3.0/3.0.0/immodules.cache</filename>, where GTK+ looks for it by default. If it is written to some other
location, the environment variable <link linkend="GTK_IM_MODULE_FILE"><envar>GTK_IM_MODULE_FILE</envar></link>
can be set to point GTK+ at the file.
</para>
</refsect1>
<refsect1><title>Environment</title>

View File

@ -262,9 +262,8 @@ additional environment variables.
Specifies the file listing the IM modules to load. This environment
variable overrides the <literal>im_module_file</literal> specified in
the RC files, which in turn overrides the default value
<filename><replaceable>sysconfdir</replaceable>/gtk-3.0/gtk.immodules</filename>
(<replaceable>sysconfdir</replaceable> is the sysconfdir specified when GTK+ was configured,
usually <filename>/usr/local/etc</filename>.)
<filename><replaceable>libdir</replaceable>/gtk-3.0/3.0.0/immodules.cache</filename>
(<replaceable>libdir</replaceable> has the same meaning here as explained for <envar>GTK_PATH</envar>).
</para>
</formalpara>

View File

@ -509,7 +509,7 @@ INCLUDES = \
-I$(top_srcdir) -I$(top_builddir) \
-I$(top_srcdir)/gdk-pixbuf \
-I$(top_builddir)/gdk-pixbuf \
-DGTK_SYSCONFDIR=\"$(sysconfdir)\" \
-DGTK_LIBDIR=\"$(libdir)\" \
-DGTK_VERSION=\"$(GTK_VERSION)\" \
-DGTK_BINARY_VERSION=\"$(GTK_BINARY_VERSION)\" \
-DGTK_PREFIX=\"$(prefix)\" \

View File

@ -305,7 +305,7 @@ gdk_pixbuf_get_module_file (void)
gchar *result = g_strdup (g_getenv ("GDK_PIXBUF_MODULE_FILE"));
if (!result)
result = g_build_filename (GTK_SYSCONFDIR, "gtk-3.0", "gdk-pixbuf.loaders", NULL);
result = g_build_filename (GTK_LIBDIR, "gtk-3.0", GTK_BINARY_VERSION, "loaders.cache", NULL);
return result;
}

View File

@ -452,7 +452,7 @@ gtk_rc_get_im_module_file (void)
if (im_module_file)
result = g_strdup (im_module_file);
else
result = g_build_filename (GTK_SYSCONFDIR, "gtk-3.0", "gtk.immodules", NULL);
result = gtk_rc_make_default_dir ("immodules.cache");
}
return result;

View File

@ -1,7 +1,7 @@
/* GTK+
* querymodules.c:
*
* Copyright (C) 2000 Red Hat Software
* Copyright (C) 2000-2010 Red Hat Software
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@ -189,7 +189,7 @@ int main (int argc, char **argv)
dirs = pango_split_file_list (path);
dirs_done = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, NULL);
for (i=0; dirs[i]; i++)
for (i = 0; dirs[i]; i++)
if (!g_hash_table_lookup (dirs_done, dirs[i]))
{
GDir *dir = g_dir_open (dirs[i], 0, NULL);
@ -215,7 +215,7 @@ int main (int argc, char **argv)
{
cwd = g_get_current_dir ();
for (i=1; i<argc; i++)
for (i = 1; i < argc; i++)
error |= query_module (cwd, argv[i]);
g_free (cwd);