~online-accounts/libsignon-glib/packaging

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
lib_LTLIBRARIES = \
	libsignon-glib.la

libsignon_glib_la_CPPFLAGS = \
	-I$(top_srcdir) \
	-I$(srcdir) \
	-I$(top_builddir) \
	-I$(builddir)
libsignon_glib_la_CFLAGS = \
	$(DEPS_CFLAGS) \
	$(COVERAGE_CFLAGS) \
	-Wall -Werror -Wno-error=deprecated-declarations
libsignon_glib_la_LIBADD = $(DEPS_LIBS)
libsignon_glib_la_LDFLAGS = \
	$(COVERAGE_LDFLAGS) \
	-version-info 1:0:0 \
	-export-symbols-regex '^signon_'

nodist_libsignon_glib_la_SOURCES = \
	signon-marshal.c \
	signon-marshal.h \
	signon-enum-types.h \
	signon-enum-types.c \
	signon-errors-enum.c \
	sso-auth-service-gen.c \
	sso-auth-service-gen.h \
	sso-auth-session-gen.c \
	sso-auth-session-gen.h \
	sso-identity-gen.c \
	sso-identity-gen.h \
	stamp-signon-enum-types.h

BUILT_SOURCES = \
	$(nodist_libsignon_glib_la_SOURCES) \
	signon-errors-map.c

CLEANFILES = \
	$(BUILT_SOURCES) \
	sso-auth-service-gen-doc-com.google.code.AccountsSSO.SingleSignOn.AuthService.xml \
	sso-auth-session-gen-doc-com.google.code.AccountsSSO.SingleSignOn.AuthSession.xml \
	sso-identity-gen-doc-com.google.code.AccountsSSO.SingleSignOn.Identity.xml

libsignon_glib_la_SOURCES = \
	signon-auth-service.h \
	signon-identity-info.h \
	signon-identity.h \
	signon-dbus-queue.h \
	signon-auth-session.h \
	signon-internals.h \
	signon-auth-service.c \
	signon-identity-info.c \
	signon-identity.c \
	signon-dbus-queue.c \
	signon-auth-session.c \
	signon-errors.h \
	signon-errors.c \
	signon-utils.h \
	signon-utils.c \
	signon-types.h \
	sso-auth-service.c \
	sso-auth-service.h

libsignon_glib_includedir = $(includedir)/libsignon-glib
libsignon_glib_include_HEADERS = \
	signon-auth-service.h \
	signon-auth-session.h \
	signon-identity-info.h \
	signon-identity.h \
	signon-errors.h \
	signon-enum-types.h \
	signon-glib.h \
	signon-types.h \
	$(signon_headers)

# Headers with enums to be parsed with glib-mkenums;
# signon-errors.h is handled separately
libsignon_glib_headers_with_enums = \
	signon-auth-session.h \
	signon-identity-info.h

DBUS_INTERFACES_DIR = $(datadir)/dbus-1/interfaces

sso-auth-service-gen.h sso-auth-service-gen.c: $(DBUS_INTERFACES_DIR)/com.google.code.AccountsSSO.SingleSignOn.AuthService.xml
	$(AM_V_GEN)gdbus-codegen \
		--generate-c-code sso-auth-service-gen \
		--generate-docbook sso-auth-service-gen-doc \
		--annotate "com.google.code.AccountsSSO.SingleSignOn.AuthService" org.gtk.GDBus.C.Name SsoAuthService \
		$<

sso-auth-session-gen.h sso-auth-session-gen.c: $(DBUS_INTERFACES_DIR)/com.google.code.AccountsSSO.SingleSignOn.AuthSession.xml
	$(AM_V_GEN)gdbus-codegen \
		--generate-c-code sso-auth-session-gen \
		--generate-docbook sso-auth-session-gen-doc \
		--annotate "com.google.code.AccountsSSO.SingleSignOn.AuthSession" org.gtk.GDBus.C.Name SsoAuthSession \
		$<

sso-identity-gen.h sso-identity-gen.c: $(DBUS_INTERFACES_DIR)/com.google.code.AccountsSSO.SingleSignOn.Identity.xml
	$(AM_V_GEN)gdbus-codegen \
		--generate-c-code sso-identity-gen \
		--generate-docbook sso-identity-gen-doc \
		--annotate "com.google.code.AccountsSSO.SingleSignOn.Identity" org.gtk.GDBus.C.Name SsoIdentity \
		$<

signon-marshal.h: signon-marshal.list Makefile
	$(AM_V_GEN)glib-genmarshal --header --prefix=_signon_marshal $< > $@

signon-marshal.c: signon-marshal.list Makefile
	$(AM_V_GEN)glib-genmarshal --body --prefix=_signon_marshal $< > $@

signon-enum-types.h: stamp-signon-enum-types.h
	$(AM_V_at)true

stamp-signon-enum-types.h: Makefile \
	$(libsignon_glib_headers_with_enums) signon-errors.h
	$(AM_V_GEN)( cd $(srcdir) &&  glib-mkenums \
	    --fhead "#ifndef __SIGNON_ENUM_TYPES_H__\n#define __SIGNON_ENUM_TYPES_H__\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
	    --fprod "/* enumerations from \"@filename@\" */\n" \
	    --vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define SIGNON_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
	    --ftail "G_END_DECLS\n\n#endif /* __SIGNON_ENUM_TYPES_H__ */" \
	    $(libsignon_glib_headers_with_enums) signon-errors.h ) >> xgen-geth \
	    && (cmp -s xgen-geth signon-enum-types.h || cp xgen-geth signon-enum-types.h ) \
	    && rm -f xgen-geth \
	    && echo timestamp > $(@F)

signon-enum-types.c: Makefile $(libsignon_glib_headers_with_enums)
	$(AM_V_GEN)( cd $(srcdir) && glib-mkenums \
	    --fhead "#include \"signon-enum-types.h\"\n" \
	    --fhead "#include \"signon-identity-info.h\"\n" \
			--fhead "#include \"signon-auth-session.h\"\n" \
			--fhead "#define g_intern_static_string(s) (s)\n" \
	    --fprod "\n/* enumerations from \"@filename@\" */" \
	    --ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \
	    --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {" \
	    --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
	    --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n  }\n  return etype;\n}\n" \
	    $(libsignon_glib_headers_with_enums) ) > xgen-getc \
	    && cp xgen-getc signon-enum-types.c  \
	    && rm -f xgen-getc

signon-errors-enum.c: Makefile signon-errors.h
	$(AM_V_GEN)( cd $(srcdir) && glib-mkenums \
	    --fhead "#include \"signon-enum-types.h\"\n#include \"signon-errors.h\"\n#include \"signoncommon.h\"\n#define g_intern_static_string(s) (s)\n" \
	    --fprod "\n/* enumerations from \"@filename@\" */" \
	    --ftail "\n#define __SIGNON_ENUM_TYPES_C__\n" \
	    --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {" \
	    --vprod "      { @VALUENAME@, SED@VALUENAME@, \"@valuenick@\" }," \
	    --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n  }\n  return etype;\n}\n" \
	    signon-errors.h ) | \
	    $(SED) -e 's/SEDSIGNON_ERROR_\([^,]*\)/SIGNOND_\1_ERR_NAME/' \
	    > xgen-getc-enum \
	    && cp xgen-getc-enum signon-errors-enum.c  \
	    && rm -f xgen-getc-enum

signon-errors-map.c: Makefile signon-errors.h
	$(AM_V_GEN)( cd $(srcdir) && \
	  echo "static const GDBusErrorEntry signon_error_entries[] = {" && \
	  grep "^ *SIGNON_ERROR_" signon-errors.h | \
	    $(SED) -e 's/SIGNON_ERROR_\([A-Z_0-9]*\).*/{ SIGNON_ERROR_\1, SIGNOND_\1_ERR_NAME },/' && \
	  echo -e "};\n" ) > signon-errors-map.c

dist_noinst_DATA = \
	signon-marshal.list \
	stamp-signon-enum-types.h

-include $(INTROSPECTION_MAKEFILE)
INTROSPECTION_GIRS =
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir)
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir)

if HAVE_INTROSPECTION
introspection_sources = \
	signon-auth-service.c \
	signon-auth-service.h \
	signon-auth-session.c \
	signon-auth-session.h \
	signon-enum-types.h \
	signon-enum-types.c \
	signon-errors.c \
	signon-errors.h \
	signon-identity-info.c \
	signon-identity-info.h \
	signon-identity.c \
	signon-identity.h

Signon-1.0.gir: libsignon-glib.la
Signon_1_0_gir_INCLUDES = GObject-2.0 Gio-2.0
Signon_1_0_gir_SCANNERFLAGS = \
	--identifier-prefix=Signon \
	--symbol-prefix=signon \
	--c-include="libsignon-glib/signon-glib.h" \
	--warn-all
Signon_1_0_gir_CFLAGS = \
	-I$(top_srcdir) \
	-I$(top_builddir) \
	$(DEPS_CFLAGS)
Signon_1_0_gir_LIBS = libsignon-glib.la
Signon_1_0_gir_FILES = $(introspection_sources)
INTROSPECTION_GIRS += Signon-1.0.gir

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

# Vala bindings
vapidir = $(datadir)/vala/vapi
dist_vapi_DATA = \
	signon.vapi