diff options
-rw-r--r-- | configure.ac | 9 | ||||
-rw-r--r-- | gir/Makefile.am | 2 | ||||
-rw-r--r-- | girepository/girparser.c | 10 | ||||
-rw-r--r-- | giscanner/config.py.in | 2 | ||||
-rw-r--r-- | giscanner/transformer.py | 5 |
5 files changed, 23 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac index c3429307..2567702e 100644 --- a/configure.ac +++ b/configure.ac @@ -108,6 +108,15 @@ GOBJECT_INTROSPECTION_LIBDIR="$EXPANDED_LIBDIR" AC_SUBST(GOBJECT_INTROSPECTION_LIBDIR) AC_DEFINE_UNQUOTED(GOBJECT_INTROSPECTION_LIBDIR,"$GOBJECT_INTROSPECTION_LIBDIR", [Directory prefix for typelib installation]) +#### Directory to install the gir files +GIR_SUFFIX="gir-1.0" +AC_SUBST(GIR_SUFFIX) +AC_DEFINE_UNQUOTED(GIR_SUFFIX, "$GIR_SUFFIX", [Name of the gir directory]) + +GIR_DIR="$EXPANDED_DATADIR/$GIR_SUFFIX" +AC_SUBST(GIR_DIR) +AC_DEFINE_UNQUOTED(GIR_DIR, "$GIR_DIR", [Director prefix for gir installation]) + PKG_CHECK_MODULES(GOBJECT, [gobject-2.0 gio-2.0]) PKG_CHECK_MODULES(GTHREAD, [gthread-2.0]) PKG_CHECK_MODULES(GIO_UNIX, [gio-unix-2.0], have_gio_unix=true, have_gio_unix=false) diff --git a/gir/Makefile.am b/gir/Makefile.am index f3b1dbab..010839d4 100644 --- a/gir/Makefile.am +++ b/gir/Makefile.am @@ -201,7 +201,7 @@ GIRSOURCES = \ $(BASE_GIRSOURCES) \ $(BUILT_GIRSOURCES) -girdir = $(datadir)/gir-1.0 +girdir = $(GIR_DIR) dist_gir_DATA = $(GIRSOURCES) %.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) diff --git a/girepository/girparser.c b/girepository/girparser.c index 2e8890ea..0a06aa08 100644 --- a/girepository/girparser.c +++ b/girepository/girparser.c @@ -27,6 +27,7 @@ #include "girmodule.h" #include "girnode.h" #include "gtypelib.h" +#include "config.h" struct _GIrParser { @@ -245,13 +246,18 @@ locate_gir (GIrParser *parser, } for (dir = datadirs; *dir; dir++) { - path = g_build_filename (*dir, "gir-1.0", girname, NULL); + path = g_build_filename (*dir, GIR_SUFFIX, girname, NULL); if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) return path; g_free (path); path = NULL; } - return path; + + path = g_build_filename (GIR_DIR, girname, NULL); + if (g_file_test (path, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_REGULAR)) + return path; + g_free (path); + return NULL; } #define MISSING_ATTRIBUTE(ctx,error,element,attribute) \ diff --git a/giscanner/config.py.in b/giscanner/config.py.in index 8d571309..9de1f48c 100644 --- a/giscanner/config.py.in +++ b/giscanner/config.py.in @@ -21,3 +21,5 @@ DATADIR = "@datarootdir@" DATADIR = DATADIR.replace( "${prefix}", "@prefix@") +GIR_DIR = "@GIR_DIR@" +GIR_SUFFIX = "@GIR_SUFFIX@" diff --git a/giscanner/transformer.py b/giscanner/transformer.py index 88cbc150..cc9e0b54 100644 --- a/giscanner/transformer.py +++ b/giscanner/transformer.py @@ -25,7 +25,7 @@ from .ast import (Bitfield, Callback, Enum, Function, Namespace, Member, Type, Array, Alias, Interface, Class, Node, Union, Varargs, Constant, type_name_from_ctype, type_names, TYPE_STRING, BASIC_GIR_TYPES) -from .config import DATADIR +from .config import DATADIR, GIR_DIR, GIR_SUFFIX from .glibast import GLibBoxed from .girparser import GIRParser from .odict import odict @@ -117,7 +117,8 @@ class Transformer(object): def _find_include(self, include): searchdirs = self._includepaths[:] for path in _xdg_data_dirs: - searchdirs.append(os.path.join(path, 'gir-1.0')) + searchdirs.append(os.path.join(path, GIR_SUFFIX)) + searchdirs.append(GIR_DIR) girname = '%s-%s.gir' % (include.name, include.version) for d in searchdirs: |