[glade/wip/tintou/meson] Initial work on meson build system
- From: Corentin Noël <corentinnoel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glade/wip/tintou/meson] Initial work on meson build system
- Date: Fri, 22 Mar 2019 16:36:14 +0000 (UTC)
commit 8a6c9a41684a7c402b1332ce62e0e00ca14b00fe
Author: Corentin Noël <corentin noel collabora com>
Date: Fri Mar 22 17:35:27 2019 +0100
Initial work on meson build system
data/icons/meson.build | 20 +++++
data/meson.build | 33 ++++++++
doc/meson.build | 40 ++++++++++
gladeui/meson.build | 211 +++++++++++++++++++++++++++++++++++++++++++++++++
help/meson.build | 7 ++
meson.build | 50 ++++++++++++
meson_options.txt | 1 +
po/meson.build | 4 +
src/meson.build | 33 ++++++++
9 files changed, 399 insertions(+)
---
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 00000000..d090694b
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,20 @@
+install_data(
+ 'devhelp.png',
+ 'plus.png',
+ 'fixed-bg.png',
+ 'placeholder.png',
+ 'deprecated-16x16.png',
+ 'deprecated-22x22.png',
+ install_dir: join_paths(get_option('datadir'), meson.project_name(), 'pixmaps')
+)
+
+install_data(
+ 'hicolor/scalable/apps/org.gnome.Glade.svg',
+ install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'scalable', 'apps')
+)
+
+install_data(
+ 'hicolor/symbolic/apps/org.gnome.Glade-symbolic.svg',
+ 'hicolor/symbolic/apps/glade-brand-symbolic.svg',
+ install_dir: join_paths(get_option('datadir'), 'icons', 'hicolor', 'symbolic', 'apps')
+)
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 00000000..ab97c61f
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,33 @@
+data_dict = configuration_data()
+data_dict.set('VERSION', '@0@'.format (meson.project_version()))
+glade_desktop_in = configure_file(
+ input: 'glade.desktop.in.in',
+ output: 'glade.desktop.in',
+ configuration: data_dict
+)
+
+i18n.merge_file(
+ input: glade_desktop_in,
+ output: 'glade.desktop',
+ po_dir: join_paths(meson.source_root(), 'po'),
+ type: 'desktop',
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'applications'),
+)
+
+i18n.merge_file(
+ input: 'glade.appdata.xml.in',
+ output: 'glade.appdata.xml',
+ po_dir: join_paths(meson.source_root(), 'po'),
+ type: 'xml',
+ install: true,
+ install_dir: join_paths(get_option('datadir'), 'metainfo'),
+)
+
+install_data(
+ 'gettext/its/glade-catalog.loc',
+ 'gettext/its/glade-catalog.its',
+ install_dir: join_paths(get_option('datadir'), 'gettext', 'its'),
+)
+
+subdir('icons')
diff --git a/doc/meson.build b/doc/meson.build
new file mode 100644
index 00000000..db6cfe05
--- /dev/null
+++ b/doc/meson.build
@@ -0,0 +1,40 @@
+version_xml_data = configuration_data()
+version_xml_data.set('PACKAGE_STRING', '@0@ @1@'.format (meson.project_name(), meson.project_version()))
+version_xml = configure_file(
+ input: 'version.xml.in',
+ output: 'version.xml',
+ configuration: version_xml_data
+)
+
+gnome.gtkdoc(
+ 'gladeui',
+ main_sgml: 'gladeui-docs.sgml',
+ content_files: [
+ version_xml,
+ 'catalogintro.sgml',
+ 'widgetclasses.sgml',
+ 'properties.sgml',
+ 'gladepython.sgml',
+ ],
+ ignore_headers: [
+ 'glade-builtins.h',
+ 'glade-debug.h',
+ 'glade-accumulators.h',
+ 'glade-marshallers.h',
+ 'glade-paths.h',
+ 'glade-custom.h',
+ 'glade-cursor.h',
+ 'glade-id-allocator.h',
+ 'glade-catalog.h',
+ 'glade.h',
+ 'glade-design-layout.h',
+ 'glade-popup.h',
+ 'glade-gtk.h',
+ 'glade-palette-expander.h',
+ 'glade-palette-item.h',
+ 'glade-named-icon-chooser-dialog.h',
+ 'glade-palette-box.h',
+ ],
+ src_dir: join_paths(meson.source_root(), 'gladeui'),
+ dependencies: gladeui_deps,
+)
diff --git a/gladeui/meson.build b/gladeui/meson.build
new file mode 100644
index 00000000..a7502c64
--- /dev/null
+++ b/gladeui/meson.build
@@ -0,0 +1,211 @@
+common_c_args = [
+ '-DG_LOG_DOMAIN="GladeUI"',
+ '-DGLADE_CATALOGSDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'),
meson.project_name(), 'catalogs')),
+ '-DGLADE_MODULESDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('libdir'),
meson.project_name(), 'modules')),
+ '-DGLADE_PIXMAPSDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'),
meson.project_name(), 'pixmaps')),
+ '-DGLADE_LOCALEDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('datadir'), 'locale')),
+ '-DGLADE_BINDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('bindir'))),
+ '-DGLADE_LIBDIR="@0@"'.format(join_paths(get_option('prefix'), get_option('libdir'))),
+]
+
+glade_marshallers = gnome.genmarshal(
+ 'glade-marshallers',
+ sources: files('glade-marshallers.list'),
+ prefix: '_glade_marshal',
+)
+
+gladeui_resources = gnome.compile_resources(
+ 'gladeui-resources',
+ 'gladeui-resources.gresource.xml',
+ source_dir: meson.current_source_dir(),
+ c_name: '_gladeui'
+)
+
+gladeui_sources = files(
+ 'glade-accumulators.c',
+ 'glade-app.c',
+ 'glade-base-editor.c',
+ 'glade-adaptor-chooser-widget.c',
+ 'glade-adaptor-chooser.c',
+ 'glade-builtins.c',
+ 'glade-catalog.c',
+ 'glade-cell-renderer-icon.c',
+ 'glade-clipboard.c',
+ 'glade-command.c',
+ 'glade-cursor.c',
+ 'glade-debug.c',
+ 'glade-design-layout.c',
+ 'glade-design-view.c',
+ 'glade-displayable-values.c',
+ 'glade-editable.c',
+ 'glade-editor.c',
+ 'glade-editor-property.c',
+ 'glade-editor-skeleton.c',
+ 'glade-editor-table.c',
+ 'glade-id-allocator.c',
+ 'glade-id-allocator.h',
+ 'glade-object-stub.c',
+ 'glade-inspector.c',
+ 'glade-name-context.c',
+ 'glade-named-icon-chooser-dialog.c',
+ 'glade-named-icon-chooser-dialog.h',
+ 'glade-palette.c',
+ 'glade-placeholder.c',
+ 'glade-popup.c',
+ 'glade-preview.c',
+ 'glade-project.c',
+ 'glade-project-properties.c',
+ 'glade-property.c',
+ 'glade-property-class.c',
+ 'glade-property-label.c',
+ 'glade-property-shell.c',
+ 'glade-signal.c',
+ 'glade-signal-class.c',
+ 'glade-signal-editor.c',
+ 'glade-signal-model.c',
+ 'glade-template.c',
+ 'glade-tsort.c',
+ 'glade-utils.c',
+ 'glade-widget.c',
+ 'glade-widget-action.c',
+ 'glade-widget-adaptor.c',
+ 'glade-xml-utils.c',
+ 'glade-drag.c',
+ 'glade-dnd.c',
+)
+
+gladeui_headers = files(
+ 'glade.h',
+ 'glade-app.h',
+ 'glade-adaptor-chooser.h',
+ 'glade-base-editor.h',
+ 'glade-builtins.h',
+ 'glade-catalog.h',
+ 'glade-cell-renderer-icon.h',
+ 'glade-clipboard.h',
+ 'glade-command.h',
+ 'glade-cursor.h',
+ 'glade-debug.h',
+ 'glade-design-view.h',
+ 'glade-displayable-values.h',
+ 'glade-editable.h',
+ 'glade-editor.h',
+ 'glade-editor-property.h',
+ 'glade-editor-skeleton.h',
+ 'glade-editor-table.h',
+ 'glade-inspector.h',
+ 'glade-name-context.h',
+ 'glade-palette.h',
+ 'glade-placeholder.h',
+ 'glade-project.h',
+ 'glade-property.h',
+ 'glade-property-class.h',
+ 'glade-property-label.h',
+ 'glade-property-shell.h',
+ 'glade-signal.h',
+ 'glade-signal-class.h',
+ 'glade-signal-editor.h',
+ 'glade-signal-model.h',
+ 'glade-utils.h',
+ 'glade-widget.h',
+ 'glade-widget-action.h',
+ 'glade-widget-adaptor.h',
+ 'glade-xml-utils.h',
+)
+
+gladeui_headers_noninst = files(
+ 'glade-accumulators.h',
+ 'glade-adaptor-chooser-widget.h',
+ 'glade-design-layout.h',
+ 'glade-design-private.h',
+ 'glade-object-stub.h',
+ 'glade-path.h',
+ 'glade-popup.h',
+ 'glade-preview.h',
+ 'glade-preview-tokens.h',
+ 'glade-previewer.h',
+ 'glade-preview-template.h',
+ 'glade-private.h',
+ 'glade-project-properties.h',
+ 'glade-tsort.h',
+ 'glade-drag.h',
+ 'glade-dnd.h',
+)
+
+gladeui_enum_types = gnome.mkenums_simple(
+ 'gladeui-enum-types',
+ sources : gladeui_headers
+)
+
+gladeui_deps = [
+ glib_dep,
+ gtk_dep,
+ libxml_dep,
+ gmodule_dep,
+ m_dep,
+]
+
+gladeui_library = library(
+ 'gladeui',
+ gladeui_sources,
+ gladeui_headers,
+ gladeui_headers_noninst,
+ glade_marshallers,
+ gladeui_resources,
+ gladeui_enum_types,
+ config_header,
+ c_args: [
+ common_c_args,
+ ],
+ dependencies: gladeui_deps,
+ install: true,
+ include_directories: root_directory,
+)
+
+gladeui_dep = declare_dependency(
+ link_with: gladeui_library,
+ sources: [
+ glade_marshallers,
+ gladeui_resources,
+ gladeui_enum_types,
+ config_header,
+ ],
+ dependencies: gladeui_deps,
+ include_directories: [
+ root_directory,
+ include_directories('.'),
+ ],
+)
+
+install_headers(
+ gladeui_headers,
+ subdir: join_paths('libgladeui-2.0', 'gladeui')
+)
+
+pkg.generate(
+ gladeui_library,
+ filebase: 'gladeui-2.0',
+ name: 'Glade',
+ description: 'Glade interface designer library',
+ url: 'http://glade.gnome.org',
+ subdirs: 'libgladeui-2.0',
+ variables: [
+ 'catalogdir=${datadir}/@0@/catalogs'.format (meson.project_name()),
+ 'pixmapdir=${datadir}/@0@/pixmaps'.format (meson.project_name()),
+ 'moduledir=${libdir}/@0@/modules'.format (meson.project_name()),
+ ],
+ requires: [
+ glib_dep,
+ gtk_dep,
+ libxml_dep,
+ ]
+)
+
+executable(
+ 'glade-previewer',
+ 'glade-previewer-main.c',
+ 'glade-previewer.c',
+ 'glade-preview-template.c',
+ dependencies: gladeui_dep,
+ install: true,
+)
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 00000000..b616b288
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,7 @@
+gnome.yelp(
+ 'glade',
+ media: 'figures/main-window.png',
+ sources: [
+ 'legal.xml'
+ ]
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 00000000..9af0296b
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,50 @@
+project('glade', 'c', version: '3.22.0')
+
+gnome = import('gnome')
+i18n = import('i18n')
+pkg = import('pkgconfig')
+
+cc = meson.get_compiler('c')
+
+glib_dep = dependency('glib-2.0', version: '>=2.53.2')
+gtk_dep = dependency('gtk+-3.0', version: '>=3.22.0')
+gmodule_dep = dependency('gmodule-2.0')
+libxml_dep = dependency('libxml-2.0', version: '>=2.4.0')
+gmodule_export_dep = dependency('gmodule-export-2.0')
+m_dep = cc.find_library('m', required: false)
+
+if cc.has_function ('gtk_print_unix_dialog_new', dependencies: gtk_dep)
+ add_project_arguments('-DHAVE_GTK_UNIX_PRINT', language: 'c')
+endif
+if cc.has_function ('_gtk_widget_class_template_unset_only_for_glade', dependencies: gtk_dep)
+ add_project_arguments('-DHAVE_GTK_TEMPLATE_UNSET', language: 'c')
+endif
+
+webkit2gtk_dep = dependency('webkit2gtk-4.0', version: '>=2.12.0', required: get_option('webkit2gtk'))
+if webkit2gtk_dep.found()
+ add_project_arguments('-DBUILD_WEBKIT2GTK', language: 'c')
+endif
+
+add_project_arguments('-DGETTEXT_PACKAGE="@0@"'.format(meson.project_name()), language: 'c')
+add_project_arguments('-DPACKAGE_NAME="@0@"'.format(meson.project_name()), language: 'c')
+add_project_arguments('-DPACKAGE_STRING="@0@"'.format(meson.project_name()), language: 'c')
+add_project_arguments('-DPACKAGE_VERSION="@0@"'.format(meson.project_version()), language: 'c')
+add_project_arguments('-DVERSION="@0@"'.format(meson.project_version()), language: 'c')
+version_parts = meson.project_version().split('.')
+add_project_arguments('-DGLADE_MAJOR_VERSION=@0@'.format(version_parts[0]), language: 'c')
+add_project_arguments('-DGLADE_MINOR_VERSION=@0@'.format(version_parts[1]), language: 'c')
+add_project_arguments('-DGLADE_MICRO_VERSION=@0@'.format(version_parts[2]), language: 'c')
+
+root_directory = include_directories('.')
+
+config_header = configure_file(
+ output: 'config.h',
+ configuration: configuration_data()
+)
+
+subdir('gladeui')
+subdir('src')
+subdir('doc')
+subdir('help')
+subdir('po')
+subdir('data')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 00000000..943099c7
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1 @@
+option('webkit2gtk', type : 'feature', value : 'enabled')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 00000000..66362aa5
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,4 @@
+i18n.gettext(
+ meson.project_name(),
+ preset: 'glib'
+)
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 00000000..52016f65
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,33 @@
+glade_resources = gnome.compile_resources(
+ 'glade-resources',
+ 'glade-resources.gresource.xml',
+ source_dir: meson.current_source_dir(),
+ c_name: '_glade'
+)
+
+glade_sources = files(
+ 'glade-window.c',
+ 'glade-intro.c',
+ 'glade-preferences.c',
+ 'glade-http.c',
+ 'glade-registration.c',
+ 'main.c',
+)
+
+glade_headers = files(
+ 'glade-window.h',
+ 'glade-intro.h',
+ 'glade-preferences.h',
+ 'glade-logo.h',
+ 'glade-registration.h',
+ 'glade-http.h',
+)
+
+executable(
+ 'glade',
+ glade_sources,
+ glade_headers,
+ glade_resources,
+ dependencies: gladeui_dep,
+ install: true,
+)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]