Commit b15e3bae authored by Lubomir Rintel's avatar Lubomir Rintel
Browse files

build: generate VAPI files

network-manager-applet#49
parent 31ee3f1a
Pipeline #124512 passed with stages
in 11 minutes and 47 seconds
......@@ -4,6 +4,7 @@
*.la
*.swp
*.bak
*.vapi
Makefile
Makefile.in*
configure
......
......@@ -30,6 +30,7 @@
gtk3-devel
NetworkManager-libnm-devel
pkgconfig
/usr/bin/vapigen
/usr/bin/autopoint
gcr-devel
gobject-introspection-devel redhat-rpm-config
......@@ -57,6 +58,7 @@
-Dld_gc=false
-Dgtk_doc=false
-Dintrospection=false
-Dvapi=false
-Dmore_asserts=no
libnma-*/ build
- ninja -v -C build
......@@ -78,6 +80,7 @@
-Dld_gc=true
-Dgtk_doc=true
-Dintrospection=true
-Dvapi=true
-Dmore_asserts=yes
libnma-*/ build
- ninja -v -C build
......@@ -100,6 +103,7 @@
--disable-mobile-broadband-provider-info
--disable-gtk-doc
--disable-introspection
--disable-vala
--disable-more-warnings
--without-gcr
- make -j$(nproc)
......@@ -122,6 +126,7 @@
--enable-mobile-broadband-provider-info
--enable-gtk-doc
--enable-introspection
--enable-vala
--enable-more-warnings
--with-gcr
- make -j$(nproc)
......@@ -179,6 +184,7 @@ centos7:
NetworkManager-libnm-devel
pkgconfig
/usr/bin/autopoint
/usr/bin/vapigen
gcr-devel
gobject-introspection-devel redhat-rpm-config
gtk-doc
......@@ -196,6 +202,7 @@ centos7:
--enable-mobile-broadband-provider-info
--enable-gtk-doc
--enable-introspection
--enable-vala
--enable-more-warnings
--with-gcr
- make -j$(nproc)
......
include $(GLIB_MAKEFILE)
-include $(INTROSPECTION_MAKEFILE)
-include $(VAPIGEN_MAKEFILE)
include $(top_srcdir)/gtk-doc.make
ACLOCAL_AMFLAGS = -I m4 ${ACLOCAL_FLAGS}
......@@ -51,6 +52,12 @@ BUILT_SOURCES += $(typelib_DATA)
INTROSPECTION_GIRS =
if ENABLE_VAPIGEN
vapidir = $(datadir)/vala/vapi
VAPIGEN_VAPIS =
vapi_DATA = $(VAPIGEN_VAPIS) $(VAPIGEN_VAPIS:.vapi=.deps)
endif
SUBDIRS = \
. \
po
......@@ -382,6 +389,13 @@ src_NMA_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=NMA --symbol-prefi
INTROSPECTION_GIRS += src/NMA-1.0.gir
endif
if ENABLE_VAPIGEN
VAPIGEN_VAPIS += src/libnma.vapi
src_libnma_vapi_FILES = $(builddir)/src/NMA-1.0.gir
src_libnma_vapi_DEPS = libnm gtk+-3.0 gio-2.0
src/libnma.vapi: $(src_libnma_vapi_FILES) $(srcdir)/src/libnma.deps
endif
check_PROGRAMS_norun += src/tests/mobile-wizard
src_tests_mobile_wizard_CPPFLAGS = \
......@@ -569,6 +583,13 @@ src_NMA4_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=NMA --symbol-pref
INTROSPECTION_GIRS += src/NMA4-1.0.gir
endif
if ENABLE_VAPIGEN
VAPIGEN_VAPIS += src/libnma-gtk4.vapi
src_libnma_gtk4_vapi_FILES = $(builddir)/src/NMA4-1.0.gir
src_libnma_gtk4_vapi_DEPS = libnm gtk4 gio-2.0
src/libnma-gtk4.vapi: $(src_libnma_gtk4_vapi_FILES) $(srcdir)/src/libnma-gtk4.deps
endif
check_PROGRAMS_norun += src/tests/mobile-wizard-gtk4
src_tests_mobile_wizard_gtk4_SOURCES = \
......@@ -716,6 +737,8 @@ EXTRA_DIST += \
src/libnma.pc.in \
src/libnma-gtk4.pc.in \
src/libnma.ver \
src/libnma-gtk4.deps \
src/libnma.deps \
src/wifi.ui \
src/nma-mobile-wizard.ui \
src/nma-bar-code-widget.ui \
......@@ -805,5 +828,6 @@ EXTRA_DIST += \
CLEANFILES += \
$(INTROSPECTION_GIRS) \
$(typelib_DATA) \
$(VAPIGEN_VAPIS) \
\
$(BUILT_SOURCES)
......@@ -221,6 +221,9 @@ AM_CONDITIONAL(WITH_GCR, test "${have_gcr}" == "yes")
dnl Check for gobject introspection
GOBJECT_INTROSPECTION_CHECK([0.9.6])
dnl Check for VAPI generator
VAPIGEN_CHECK(0.17.1.24)
GLIB_CONFIG_NMA
GLIB_GSETTINGS
AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
......
......@@ -268,6 +268,15 @@ if enable_introspection
assert(gir_dep.found(), 'introspection support was requested, but the gobject-introspection library is not available. Use -Dintrospection=false to build without it.')
endif
# Vala bindings
enable_vapi = get_option('vapi')
if enable_vapi
assert(enable_introspection, 'vala api require GObject introspection. Use -Dvapi=false to disable it')
add_languages('vala')
#assert(meson.get_compiler('vala').version().version_compare(vala_req_version),
# 'vala ' + vala_req_version + ' is required to build. Use -Dvapi=false to disable it')
endif
more_asserts = get_option('more_asserts')
if more_asserts == 'no'
more_asserts = 0
......
......@@ -6,3 +6,4 @@ option('mobile_broadband_provider_info', type: 'boolean', value: true, descripti
option('ld_gc', type: 'boolean', value: true, description: 'Enable garbage collection of unused symbols on linking')
option('gtk_doc', type: 'boolean', value: true, description: 'use gtk-doc to build documentation')
option('introspection', type: 'boolean', value: true, description: 'Enable introspection for this build')
option('vapi', type: 'boolean', value: true, description: 'build Vala bindings')
libnm
gtk4
gio-2.0
libnm
gtk+-3.0
gio-2.0
......@@ -171,7 +171,7 @@ if enable_introspection
gir_dir = join_paths(nma_datadir, 'gir-' + nma_gir_version)
typelib_dir = join_paths(nma_libdir, 'girepository-' + nma_gir_version)
gnome.generate_gir(
libnma_gir = gnome.generate_gir(
libnma,
sources: gir_sources + gir_headers,
nsversion: nma_gir_version,
......@@ -186,7 +186,7 @@ if enable_introspection
)
if enable_libnma_gtk4
gnome.generate_gir(
libnma_gtk4_gir = gnome.generate_gir(
libnma,
sources: gir_sources + gir_headers,
nsversion: nma_gir_version,
......@@ -201,3 +201,21 @@ if enable_introspection
)
endif
endif
if enable_vapi
gnome.generate_vapi(
'libnma',
sources: libnma_gir[0],
packages: [ 'libnm', 'gtk+-3.0', 'gio-2.0' ],
install: true,
)
if enable_libnma_gtk4
gnome.generate_vapi(
'libnma-gtk4',
sources: libnma_gtk4_gir[0],
packages: [ 'libnm', 'gtk4', 'gio-2.0' ],
install: true,
)
endif
endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment