build GObject introspection data

Adapted from:
a4dcd9177a
0488ffe5d2
This commit is contained in:
JosephMcc 2016-12-26 10:56:42 -08:00
parent 2ddd92171c
commit c6f5fd5e1d
5 changed files with 106 additions and 32 deletions

View File

@ -172,6 +172,16 @@ PKG_CHECK_MODULES(EGG_SMCLIENT, [sm >= 1.0.0])
AC_SUBST(EGG_SMCLIENT_CFLAGS)
AC_SUBST(EGG_SMCLIENT_LIBS)
# Introspection
GOBJECT_INTROSPECTION_CHECK([0.9.3])
if test "$found_introspection" = "yes"; then
have_introspection=yes
AC_DEFINE([HAVE_INTROSPECTION], [1], [Define to enable GObject Introspection])
else
have_introspection=no
fi
dnl ================================================================
dnl GSettings related settings
dnl ================================================================
@ -265,5 +275,6 @@ Configuration:
Compiler: ${CC}
Spell Plugin enabled: $enable_enchant
Gvfs metadata enabled: $enable_gvfs_metadata
GObject Introspection: ${have_introspection}
Tests enabled: $enable_tests
"

28
debian/control vendored
View File

@ -4,10 +4,12 @@ Priority: optional
Maintainer: Linux Mint <root@linuxmint.com>
Build-Depends: autotools-dev,
debhelper (>= 9),
gobject-introspection,
gtk-doc-tools,
intltool,
iso-codes,
libenchant-dev,
libgirepository1.0-dev,
libglib2.0-dev,
libgtk-3-dev,
libgtksourceview-3.0-dev,
@ -137,3 +139,29 @@ Description: generic text editor (documentation files)
ChangeLogs, and adjusting indentation levels.
.
This package contains the documentation files.
Package: gir1.2-xed
Architecture: any
Depends: ${gir:Depends},
${misc:Depends},
${shlibs:Depends},
Description: GObject introspection data for Xed
Xed is a text editor which supports most standard editor features,
extending this basic functionality with other features not usually
found in simple text editors. Xed is a graphical application which
supports editing multiple text files in one window (known sometimes as
tabs or MDI).
.
Xed fully supports international text through its use of the
Unicode UTF-8 encoding in edited files. Its core feature set includes syntax
highlighting of source code, auto indentation and printing and print preview
support.
.
Xed is also extensible through its plugin system, which currently
includes support for spell checking, comparing files, viewing CVS
ChangeLogs, and adjusting indentation levels.
.
This package contains introspection data for Xed.
.
It can be used by packages using the GIRepository format to generate
dynamic bindings.

2
debian/gir1.2-xed.install vendored Normal file
View File

@ -0,0 +1,2 @@
usr/lib/*/girepository-1.0
usr/share/gir-1.0

View File

@ -11,6 +11,7 @@ AM_CPPFLAGS = \
-I$(srcdir)/smclient \
$(XED_CFLAGS) \
$(WARN_CFLAGS) \
$(INTROSPECTION_CFLAGS) \
$(DISABLE_DEPRECATED_CFLAGS) \
-DDATADIR=\""$(datadir)"\" \
-DLIBDIR=\""$(libdir)"\"
@ -18,7 +19,7 @@ AM_CPPFLAGS = \
xed_SOURCES = \
xed.c
xed_LDADD = libxed.la $(XED_LIBS) $(EGG_SMCLIENT_LIBS)
xed_LDADD = libxed.la $(XED_LIBS) $(EGG_SMCLIENT_LIBS) $(INTROSPECTION_LIBS)
xed_LDFLAGS = -export-dynamic -no-undefined -export-symbols-regex "^[[^_]].*"
@ -104,10 +105,7 @@ header_DATA = \
$(INST_H_FILES)
libxed_la_SOURCES = \
$(BUILT_SOURCES) \
$(BACON_FILES) \
$(POSIXIO_FILES) \
libxed_c_files = \
xed-app.c \
xed-close-button.c \
xed-commands-documents.c \
@ -162,7 +160,13 @@ libxed_la_SOURCES = \
xed-utils.c \
xed-view.c \
xed-window.c \
xedtextregion.c \
xedtextregion.c
libxed_la_SOURCES = \
$(libxed_c_files) \
$(BUILT_SOURCES) \
$(BACON_FILES) \
$(POSIXIO_FILES) \
$(NOINST_H_FILES) \
$(INST_H_FILES)
@ -198,6 +202,27 @@ EXTRA_DIST = \
CLEANFILES = $(BUILT_SOURCES)
if HAVE_INTROSPECTION
-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS = Xed-1.0.gir
INTROSPECTION_SCANNER_ARGS = -I$(top_srcdir) --warn-all
Xed-1.0.gir: xed
Xed_1_0_gir_INCLUDES = Gtk-3.0 GtkSource-3.0
Xed_1_0_gir_FILES = $(INST_H_FILES) $(libxed_c_files) $(BUILT_SOURCES)
Xed_1_0_gir_VERSION = 1.0
Xed_1_0_gir_PROGRAM = $(builddir)/xed
Xed_1_0_gir_NAMESPACE = Xed
girdir = $(datadir)/gir-1.0
gir_DATA = $(INTROSPECTION_GIRS)
typelibdir = $(libdir)/girepository-1.0
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib)
CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif
dist-hook:
cd $(distdir); rm -f $(BUILT_SOURCES)

View File

@ -42,6 +42,10 @@
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#ifdef HAVE_INTROSPECTION
#include <girepository.h>
#endif
#include "xed-app.h"
#include "xed-commands.h"
#include "xed-debug.h"
@ -522,6 +526,10 @@ main (int argc, char *argv[])
g_option_context_add_group (context, gtk_get_option_group (FALSE));
g_option_context_add_group (context, egg_sm_client_get_option_group ());
#ifdef HAVE_INTROSPECTION
g_option_context_add_group (context, g_irepository_get_option_group ());
#endif
gtk_init (&argc, &argv);
if (!g_option_context_parse (context, &argc, &argv, &error))