Commit 27dbe6e1 authored by Jiří Techet's avatar Jiří Techet

Merge branch 'tchaik/libchamplain-wip/tchaik/meson'

parents fbae3ea1 0da7ae33
Pipeline #56730 passed with stages
in 4 minutes and 36 seconds
image: fedora:29
stages:
- build
- deploy
before_script:
- dnf install -y gcc ccache gettext gtk-doc meson ninja-build redhat-rpm-config
- dnf install -y glib2-devel clutter-devel gtk3-devel clutter-gtk-devel cairo-devel sqlite-devel libsoup-devel gobject-introspection-devel
.ccache-setup: &ccache-setup
variables:
CCACHE_BASEDIR: "${PWD}"
CCACHE_DIR: "${CCACHE_BASEDIR}/_ccache"
build-champlain:
stage: build
script:
- mkdir -p _ccache
- ccache --zero-stats
- ccache --show-stats
- meson -Dwidgetry=false -Dgtk_doc=true _build .
- ninja -C _build
- ninja -C _build test
- ninja -C _build champlain-doc
- ccache --show-stats
artifacts:
name: "champlain-gtk"
paths:
- _build/docs/reference/html
cache:
key: "$CI_JOB_NAME"
paths:
- _ccache/
<<: *ccache-setup
build-champlain-gtk:
stage: build
script:
- mkdir -p _ccache
- ccache --zero-stats
- ccache --show-stats
- meson -Dwidgetry=true -Dgtk_doc=true _build .
- ninja -C _build
- ninja -C _build test
- ninja -C _build champlain-gtk-doc
- ccache --show-stats
artifacts:
name: "champlain-gtk-doc"
paths:
- _build/docs/reference-gtk/html
cache:
key: "$CI_JOB_NAME"
paths:
- _ccache/
<<: *ccache-setup
pages:
stage: deploy
dependencies:
- build-champlain
- build-champlain-gtk
script:
- mkdir -p public/
- mv _build/docs/reference/html/ public/champlain/
- mv _build/docs/reference-gtk/html/ public/champlain-gtk/
artifacts:
paths:
- public
only:
- master
libchamplain_gtk_public_h = [
'champlain-gtk.h',
'gtk-champlain-embed.h',
]
libchamplain_gtk_sources = [
'gtk-champlain-embed.c',
]
libchamplain_gtk_deps = [
glib_dep,
gobject_dep,
gtk_dep,
clutter_gtk_dep,
libchamplain_dep,
]
libchamplain_gtk_srcdir = include_directories('.')
libchamplain_gtk_c_args = [
'-DHAVE_CONFIG_H',
'-DCHAMPLAIN_GTK_COMPILATION',
'-DG_LOG_DOMAIN="@0@"'.format(package_gtk_name),
]
libchamplain_gtk_link_args = [
]
libchamplain_gtk_marshals = gnome.genmarshal(
'champlain-gtk-marshal',
sources: 'champlain-gtk-marshal.list',
prefix: '_champlain_gtk_marshal',
install_header: true,
install_dir: join_paths(
pkgincludedir,
'champlain-gtk',
)
)
libchamplain_gtk_enums = gnome.mkenums(
'champlain-gtk-enum-types',
sources: libchamplain_gtk_public_h,
h_template: 'champlain-gtk-enum-types.h.in',
c_template: 'champlain-gtk-enum-types.c.in',
install_header: true,
install_dir: join_paths(
pkgincludedir,
'champlain-gtk',
)
)
libchamplain_gtk_marshals_h = libchamplain_gtk_marshals.get(1)
libchamplain_gtk_enums_h = libchamplain_gtk_enums.get(1)
libchamplain_gtk_sources += [
libchamplain_gtk_marshals,
libchamplain_gtk_enums,
]
install_headers(
libchamplain_gtk_public_h,
install_dir: join_paths(
pkgincludedir,
'champlain-gtk',
)
)
libchamplain_gtk_sha = library(
package_gtk_string,
libchamplain_gtk_sources,
version: lib_version,
include_directories: rootdir,
dependencies: libchamplain_gtk_deps,
c_args: libchamplain_gtk_c_args,
link_args: libchamplain_gtk_link_args,
install: true,
install_dir: libdir,
)
libchamplain_gtk_dep_sources = [
libchamplain_gtk_enums_h,
libchamplain_gtk_marshals_h,
]
if generate_gir == true
libchamplain_gtk_gir_includes = [
'GObject-2.0',
'Clutter-1.0',
'Gtk-3.0',
libchamplain_gir.get(0),
]
libchamplain_gtk_gir = gnome.generate_gir(
libchamplain_gtk_sha,
sources: libchamplain_gtk_sources + libchamplain_gtk_public_h,
nsversion: api_version,
namespace: 'GtkChamplain',
symbol_prefix: 'gtk_champlain',
identifier_prefix: 'GtkChamplain',
header: 'champlain-gtk/champlain-gtk.h',
export_packages: [package_gtk_string],
includes: ['Clutter-1.0', 'Gtk-3.0', libchamplain_gir.get(0)],
link_with: libchamplain_gtk_sha,
install: true,
install_dir_gir: girdir,
install_dir_typelib: typelibdir,
extra_args: [
'-DCHAMPLAIN_GTK_COMPILATION',
]
)
libchamplain_gtk_dep_sources += [
libchamplain_gtk_gir,
]
if generate_vapi == true
libchamplain_gtk_vapi_packages = [
'clutter-gtk-1.0',
'cogl-pango-1.0',
'gtk+-3.0',
'atk',
'pangocairo',
libchamplain_vapi,
]
libchamplain_gtk_vapi = gnome.generate_vapi(
package_gtk_string,
sources: libchamplain_gtk_gir.get(0),
packages: libchamplain_gtk_vapi_packages,
install: true,
install_dir: vapidir,
)
endif
endif
libchamplain_gtk_dep = declare_dependency(
link_with: libchamplain_gtk_sha,
include_directories: rootdir,
dependencies: libchamplain_gtk_deps,
sources: libchamplain_gtk_dep_sources,
)
libchamplain_gtk_pc = pkg.generate(
libchamplain_gtk_sha,
description: 'Gtk+ Widget wrapper for libchamplain',
subdirs: package_string,
install_dir: pkgconfigdir,
)
libchamplain_public_h = [
'champlain-adjustment.h',
'champlain-bounding-box.h',
'champlain-coordinate.h',
'champlain-custom-marker.h',
'champlain-defines.h',
'champlain-error-tile-renderer.h',
'champlain-exportable.h',
'champlain-file-cache.h',
'champlain-file-tile-source.h',
'champlain-image-renderer.h',
'champlain-kinetic-scroll-view.h',
'champlain-label.h',
'champlain-layer.h',
'champlain-license.h',
'champlain-location.h',
'champlain-map-source-chain.h',
'champlain-map-source-desc.h',
'champlain-map-source-factory.h',
'champlain-map-source.h',
'champlain-marker-layer.h',
'champlain-marker.h',
'champlain-memory-cache.h',
'champlain-network-bbox-tile-source.h',
'champlain-network-tile-source.h',
'champlain-null-tile-source.h',
'champlain-path-layer.h',
'champlain-point.h',
'champlain-renderer.h',
'champlain-scale.h',
'champlain-tile-cache.h',
'champlain-tile-source.h',
'champlain-tile.h',
'champlain-view.h',
'champlain-viewport.h',
'champlain.h',
]
if build_with_memphis == true
libchamplain_public_h += [
'champlain-memphis-renderer.h',
]
endif
libchamplain_sources = [
'champlain-adjustment.c',
'champlain-bounding-box.c',
'champlain-coordinate.c',
'champlain-custom-marker.c',
'champlain-debug.c',
'champlain-error-tile-renderer.c',
'champlain-exportable.c',
'champlain-file-cache.c',
'champlain-file-tile-source.c',
'champlain-image-renderer.c',
'champlain-kinetic-scroll-view.c',
'champlain-label.c',
'champlain-layer.c',
'champlain-license.c',
'champlain-location.c',
'champlain-map-source-chain.c',
'champlain-map-source-desc.c',
'champlain-map-source-factory.c',
'champlain-map-source.c',
'champlain-marker-layer.c',
'champlain-marker.c',
'champlain-memory-cache.c',
'champlain-network-bbox-tile-source.c',
'champlain-network-tile-source.c',
'champlain-null-tile-source.c',
'champlain-path-layer.c',
'champlain-point.c',
'champlain-renderer.c',
'champlain-scale.c',
'champlain-tile-cache.c',
'champlain-tile-source.c',
'champlain-tile.c',
'champlain-view.c',
'champlain-viewport.c',
]
if build_with_memphis == true
libchamplain_sources += [
'champlain-memphis-renderer.c',
]
endif
libchamplain_deps = [
libm_dep,
glib_dep,
gobject_dep,
gio_dep,
clutter_dep,
cairo_dep,
sqlite_dep,
libsoup_dep,
]
if build_with_memphis == true
libchamplain_deps += memphis_dep
endif
libchamplain_srcdir = include_directories('.')
libchamplain_c_args = [
'-DHAVE_CONFIG_H',
'-DCHAMPLAIN_COMPILATION',
'-DG_LOG_DOMAIN="@0@"'.format(package_name),
]
libchamplain_link_args = [
]
features_h = configuration_data()
if build_with_memphis == true
features_h.set('CHAMPLAIN_HAS_MEMPHIS', '1')
endif
libchamplain_features_h = configure_file(
output: 'champlain-features.h',
configuration: features_h,
install: true,
install_dir: join_paths(
pkgincludedir,
'champlain',
)
)
version_h = configuration_data()
version_h.set('CHAMPLAIN_MAJOR_VERSION', version_major)
version_h.set('CHAMPLAIN_MINOR_VERSION', version_minor)
version_h.set('CHAMPLAIN_MICRO_VERSION', version_micro)
version_h.set('CHAMPLAIN_VERSION', version)
libchamplain_version_h = configure_file(
input: 'champlain-version.h.in',
output: 'champlain-version.h',
configuration: version_h,
install: true,
install_dir: join_paths(
pkgincludedir,
'champlain',
)
)
libchamplain_public_h += [
libchamplain_features_h,
libchamplain_version_h,
]
libchamplain_marshals = gnome.genmarshal(
'champlain-marshal',
sources: 'champlain-marshal.list',
prefix: '_champlain_marshal',
install_header: true,
install_dir: join_paths(
pkgincludedir,
'champlain',
)
)
libchamplain_enums = gnome.mkenums(
'champlain-enum-types',
sources: libchamplain_public_h,
h_template: 'champlain-enum-types.h.in',
c_template: 'champlain-enum-types.c.in',
install_header: true,
install_dir: join_paths(
pkgincludedir,
'champlain',
)
)
libchamplain_marshals_h = libchamplain_marshals.get(1)
libchamplain_enums_h = libchamplain_enums.get(1)
libchamplain_sources += [
libchamplain_marshals,
libchamplain_enums,
]
install_headers(
libchamplain_public_h,
install_dir: join_paths(
pkgincludedir,
'champlain',
)
)
libchamplain_sha = library(
package_string,
libchamplain_sources,
version: lib_version,
include_directories: rootdir,
dependencies: libchamplain_deps,
c_args: libchamplain_c_args,
link_args: libchamplain_link_args,
install: true,
install_dir: libdir,
)
libchamplain_dep_sources = [
libchamplain_enums_h,
libchamplain_features_h,
libchamplain_marshals_h,
libchamplain_version_h,
]
if generate_gir == true
libchamplain_gir_includes = [
'GObject-2.0',
'Clutter-1.0',
]
if build_with_memphis == true
libchamplain_gir_includes += 'Memphis-0.2'
endif
libchamplain_gir = gnome.generate_gir(
libchamplain_sha,
sources: libchamplain_sources + libchamplain_public_h,
nsversion: api_version,
namespace: 'Champlain',
symbol_prefix: 'champlain',
identifier_prefix: 'Champlain',
header: 'champlain/champlain.h',
export_packages: [package_string],
includes: libchamplain_gir_includes,
link_with: libchamplain_sha,
install: true,
install_dir_gir: girdir,
install_dir_typelib: typelibdir,
extra_args: [
'-DCHAMPLAIN_COMPILATION',
]
)
libchamplain_dep_sources += [
libchamplain_gir,
]
if generate_vapi == true
libchamplain_vapi_packages = [
'clutter-1.0',
'cogl-pango-1.0',
'atk',
'pangocairo',
]
libchamplain_vapi = gnome.generate_vapi(
package_string,
sources: libchamplain_gir.get(0),
packages: libchamplain_vapi_packages,
install: true,
install_dir: vapidir,
)
endif
endif
libchamplain_dep = declare_dependency(
link_with: libchamplain_sha,
include_directories: rootdir,
dependencies: libchamplain_deps,
sources: libchamplain_dep_sources,
)
libchamplain_pc = pkg.generate(
libchamplain_sha,
name: package_string,
description: 'Map View for Clutter',
subdirs: package_string,
install_dir: pkgconfigdir,
)
libchamplain_demo_data = [
'emblem-favorite.png',
'emblem-generic.png',
'emblem-important.png',
'emblem-new.png',
]
custom_target(
'libchamplain-demo-data',
input: libchamplain_demo_data,
output: libchamplain_demo_data,
command: ['cp', '@INPUT@', '@OUTDIR@'],
build_by_default: true,
)
\ No newline at end of file
libchamplain_demos = [
['minimal', 'minimal.c'],
['launcher', ['launcher.c', 'markers.c']],
['animated-marker', 'animated-marker.c'],
['polygons', 'polygons.c'],
['url-marker', 'url-marker.c'],
['create_destroy_test', 'create-destroy-test.c'],
]
foreach demo: libchamplain_demos
demo_name = demo.get(0)
demo_sources = demo.get(1)
executable(
demo_name,
demo_sources,
install: false,
dependencies: [
libchamplain_dep,
]
)
endforeach
subdir('icons')
if build_gtk_widgetry == true
libchamplain_gtk_demos = [
['minimal-gtk', 'minimal-gtk.c'],
['launcher-gtk', ['launcher-gtk.c', 'markers.c']],
]
foreach demo: libchamplain_gtk_demos
demo_name = demo.get(0)
demo_sources = demo.get(1)
executable(
demo_name,
demo_sources,
install: false,
dependencies: [
libchamplain_dep,
libchamplain_gtk_dep,
]
)
endforeach
endif
if generate_vapi == true
libchamplain_vala_demos = [
['launcher-vala', ['launcher-vala.vala', 'markers-vala.vala']],
]
add_languages('vala')
foreach demo: libchamplain_vala_demos
demo_name = demo.get(0)
demo_sources = demo.get(1)
executable(
demo_name,
demo_sources,
install: false,
dependencies: [
libchamplain_dep,
libchamplain_gtk_dep,
libchamplain_vapi,
]
)
endforeach
endif
\ No newline at end of file
if build_gtk_doc == true
subdir('reference')
if build_gtk_widgetry == true
subdir('reference-gtk')
endif
endif
\ No newline at end of file
gtk_prefix = gtk_dep.get_pkgconfig_variable('prefix')
gtk_docpath = join_paths(gtk_prefix, 'share', 'gtk-doc', 'html', 'gtk3')
libchamplain_gtk_reference_ignored_h = [
'champlain-gtk-marshal.h',
'champlain-gtk.h',
]
version_xml = configuration_data()
version_xml.set('PACKAGE_VERSION', version)
configure_file(
input: 'version.xml.in',
output: 'version.xml',
configuration: version_xml,
install: false,
)
libchamplain_gtk_reference_scan_args = [
'--rebuild-types',
'--deprecated-guards=GTK_DISABLE_DEPRECATED',
'--ignore-headers=' + ' '.join(libchamplain_gtk_reference_ignored_h),
]
libchamplain_gtk_reference_mkdb_args = [
'--output-format=xml',
'--name-space=gtk_champlain',
]
libchamplain_gtk_reference_fixxref_args = [
'--html-dir=@0@'.format(join_paths(gtkdocdir, 'html', package_gtk_string)),
'--extra-dir=@0@'.format(gtk_docpath),
'--extra-dir=@0@'.format(join_paths(gtkdocdir, 'html', package_string)),
]
gnome.gtkdoc(
package_gtk_name,
main_sgml: 'libchamplain-gtk-docs.sgml',
gobject_typesfile: files('libchamplain-gtk.types'),
src_dir: libchamplain_gtk_srcdir,
dependencies: libchamplain_gtk_dep,
scan_args: libchamplain_gtk_reference_scan_args,
mkdb_args: libchamplain_gtk_reference_mkdb_args,
fixxref_args: libchamplain_gtk_reference_fixxref_args,
install: true,
install_dir: join_paths(
gtkdocdir,
'html',
package_gtk_string,
)
)
glib_prefix = glib_dep.get_pkgconfig_variable('prefix')
glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html', 'glib')
gobject_prefix = gobject_dep.get_pkgconfig_variable('prefix')
gobject_docpath = join_paths(gobject_prefix, 'share', 'gtk-doc', 'html', 'gobject')
clutter_prefix = clutter_dep.get_pkgconfig_variable('prefix')
clutter_docpath = join_paths(clutter_prefix, 'share', 'gtk-doc', 'html', 'clutter')
libchamplain_reference_ignored_h = [
'champlain-adjustment.h',
'champlain-debug.h',
'champlain-defines.h',
'champlain-enum-types.h',
'champlain-features.h',
'champlain-kinetic-scroll-view.h',
'champlain-marshal.h',
'champlain-private.h',
'champlain-viewport.h',
'champlain.h',
]
if build_with_memphis == false
libchamplain_reference_ignored_h += [
'champlain-memphis-renderer.h',
]
endif
version_xml = configuration_data()
version_xml.set('PACKAGE_VERSION', version)
configure_file(
input: 'version.xml.in',
output: 'version.xml',
configuration: version_xml,
install: false,
)
libchamplain_reference_scan_args = [
'--rebuild-types',
'--deprecated-guards=GTK_DISABLE_DEPRECATED',
'--ignore-headers=' + ' '.join(libchamplain_reference_ignored_h),