GLIB_LIBRARY=glib-2.0
endif
-GLib-2.0.gir: $(G_IR_SCANNER) $(G_IR_SCANNER_FILES) Makefile glib-2.0.c
+GLib-2.0.gir: $(G_IR_SCANNER) $(G_IR_SCANNER_FILES) glib-2.0.c
PYTHONPATH=$(G_IR_SCANNER_PYTHONPATH) $(G_IR_SCANNER) \
-v --namespace GLib --nsversion=2.0 \
--add-include-path=. \
GOBJECT_LIBRARY=gobject-2.0
endif
-GObject-2.0.gir: GLib-2.0.gir $(G_IR_SCANNER) $(G_IR_SCANNER_FILES) Makefile
+GObject-2.0.gir: GLib-2.0.gir $(G_IR_SCANNER) $(G_IR_SCANNER_FILES)
PYTHONPATH=$(G_IR_SCANNER_PYTHONPATH) $(G_IR_SCANNER) \
-v --namespace GObject --nsversion=2.0 \
--add-include-path=. \
GIO_LIBRARY=gio-2.0
endif
-Gio-2.0.gir: GObject-2.0.gir $(G_IR_SCANNER) $(G_IR_SCANNER_FILES) Makefile $(srcdir)/gio-2.0.c
+Gio-2.0.gir: GObject-2.0.gir $(G_IR_SCANNER) $(G_IR_SCANNER_FILES) $(srcdir)/gio-2.0.c
PYTHONPATH=$(G_IR_SCANNER_PYTHONPATH) $(G_IR_SCANNER) \
-v --namespace Gio --nsversion=2.0 \
--add-include-path=. \
$(GLIB_INCLUDEDIR)/gio/*.h
BUILT_SOURCES += Gio-2.0.gir
EXTRA_DIST += gio-2.0.c
-CLEANFILES = $(BUILT_SOURCES)
+# girepository
+GIREPOSITORY_INCLUDEDIR=`pkg-config --variable=includedir girepository-2.0`/glib-2.0
+GIREPOSITORY_LIBDIR=`pkg-config --variable=libdir girepository-2.0`
+
+GIRepository-2.0.gir: GObject-2.0.gir $(G_IR_SCANNER) $(G_IR_SCANNER_FILES)
+ PYTHONPATH=$(G_IR_SCANNER_PYTHONPATH) $(G_IR_SCANNER) \
+ -v --namespace GIRepository --nsversion=1.0\
+ --add-include-path=. \
+ --noclosure \
+ --output $@ \
+ --strip-prefix=g \
+ --include=GObject-2.0 \
+ --library=$(top_builddir)/girepository/libgirepository.la \
+ -I$(srcdir)/girepository \
+ --pkg glib-2.0 \
+ --pkg gobject-2.0 \
+ $(top_srcdir)/girepository/girepository.c \
+ $(top_srcdir)/girepository/girepository.h
+BUILT_SOURCES += GIRepository-2.0.gir
+
+# Generic rules
+CLEANFILES = $(BUILT_SOURCES)
girdir=$(datadir)/gir
dist_gir_DATA = $(BUILT_SOURCES)
-%.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT) Makefile
+%.typelib: %.gir $(top_builddir)/tools/g-ir-compiler$(EXEEXT)
$(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $@
typelibsdir = $(libdir)/girepository
-typelibs_DATA = GLib-2.0.typelib GModule-2.0.typelib GObject-2.0.typelib Gio-2.0.typelib
+typelibs_DATA = \
+ GLib-2.0.typelib \
+ GModule-2.0.typelib \
+ GObject-2.0.typelib \
+ Gio-2.0.typelib \
+ GIRepository-2.0.typelib
+
CLEANFILES += $(typelibs_DATA)
# Check that typelib -> gir -> typelib transformation is lossless.
# values, etc.) but the typelibs should identical as long as the gir files are
# semantically equivalent.
-%.test.gir: %.typelib $(top_builddir)/tools/g-ir-generate$(EXEEXT) Makefile
+%.test.gir: %.typelib $(top_builddir)/tools/g-ir-generate$(EXEEXT)
$(DEBUG) $(top_builddir)/tools/g-ir-generate$(EXEEXT) --includedir=. $< -o $@
-testlib-%: %.test.gir $(top_builddir)/tools/g-ir-generate$(EXEEXT) Makefile
+testlib-%: %.test.gir $(top_builddir)/tools/g-ir-generate$(EXEEXT)
$(DEBUG) $(top_builddir)/tools/g-ir-compiler$(EXEEXT) --includedir=. $(G_IR_COMPILER_OPTS) $< -o $*.test.typelib
cmp $*.typelib $*.test.typelib && rm $*.test.typelib
found_libname = os.path.abspath(libname)
elif os.path.exists(libtool_libname):
found_libname = extract_libtool(libtool_libname)
- elif libname.endswith('.la'):
- found_libname = extract_libtool(libname)
+ libname = os.path.basename(found_libname)
else:
found_libname = find_library(libname)
+
+ if libname.endswith('.la'):
+ found_libname = extract_libtool(libname)
+ libname = os.path.basename(found_libname)
if not found_libname:
raise ValueError("Failed to find library: %r" % (libname, ))
self._libraries.append(ctypes.cdll.LoadLibrary(found_libname))
+ return libname
def _print_statistics(self):
nodes = list(self._names.names.itervalues())
if self._namespace_name == 'GLib':
# No GObjects in GLib
return False
+ if func.parameters:
+ return False
# GType *_get_type(void)
if func.retval.type.name not in ['Type',
'GType',
print ("Warning: *_get_type function returns '%r'"
", not GObject.Type") % (func.retval.type.name, )
return False
- if func.parameters:
- return False
if not self._libraries:
print "Warning: No libraries loaded, cannot call %s" % (symbol, )
if not options.libraries:
_error("Must specify --library at least one primary library")
- libraries = options.libraries
for package in options.packages:
output = subprocess.Popen(['pkg-config', '--cflags', package],
os.environ['LPATH'] = ':'.join([lpath, library_path])
else:
os.environ['LPATH'] = library_path
-
filenames = []
for arg in args:
if (arg.endswith('.c') or
# Transform the C AST nodes into higher level
# GLib/GObject nodes
glibtransformer = GLibTransformer(transformer, noclosure=options.noclosure)
+ libraries = []
if options.libraries:
for library in options.libraries:
- glibtransformer.add_library(library)
+ libraries.append(glibtransformer.add_library(library))
namespace = glibtransformer.parse()