[bijiben/wip/inigomartinez/meson: 3/7] build: Updated meson build port
- From: Iñigo Martínez <inigomartinez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [bijiben/wip/inigomartinez/meson: 3/7] build: Updated meson build port
- Date: Tue, 4 Jul 2017 15:49:45 +0000 (UTC)
commit 57510df656d53a116153a1238920b2fbc77c00f3
Author: Iñigo Martínez <inigomartinez gmail com>
Date: Tue Jun 13 10:28:01 2017 +0200
build: Updated meson build port
Several changes have been made. The list of changes are as follows:
* Rebased with 3.24.0 version updates.
* Merged icon cache update, gsettins schema compilation and desktop
file validation in the same post install script.
* Added missing 24x24 application icon size.
* Changed appdata file installation directory to use the new
AppStream files location.
* Removed execution mode from desktop and gschema files.
* Added version and zeitgeist to output messages.
* Removed header files listing.
configure_meson | 1 -
data/icons/meson.build | 7 +-
data/meson.build | 55 +++++------
data/meson_compile_schemas.py | 10 --
data/meson_desktop_validate.py | 10 --
help/meson.build | 7 +-
meson.build | 100 ++++++++++----------
.../meson_post_install.py => meson_post_install.py | 10 ++
src/libbiji/meson.build | 91 ++++++------------
src/meson.build | 66 ++++---------
10 files changed, 144 insertions(+), 213 deletions(-)
---
diff --git a/configure_meson b/configure_meson
index 600a3f0..0b15691 100755
--- a/configure_meson
+++ b/configure_meson
@@ -157,7 +157,6 @@ echo "
prefix: ${prefix}
compiler: ${CC}
global flags: ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}
- nls: $(echooption nls)
zeitgeist: $(echooption zeitgeist)
update-mimedb: $(echooption update-mimedb)
diff --git a/data/icons/meson.build b/data/icons/meson.build
index ab0832f..6efcee6 100644
--- a/data/icons/meson.build
+++ b/data/icons/meson.build
@@ -1,9 +1,10 @@
apps_icon_sizes = [
'16x16',
'22x22',
+ '24x24',
'32x32',
'48x48',
- '256x256',
+ '256x256'
]
# must be renamed to org.gnome.bijiben.png
@@ -23,7 +24,7 @@ install_data(
actions_icon_sizes = [
'16x16',
'24x24',
- '48x48',
+ '48x48'
]
# must be renamed to note.png
@@ -39,5 +40,3 @@ install_data(
'_'.join(['hicolor', 'actions', 'scalable', 'link.svg']),
install_dir: join_paths(bijiben_pkgdatadir, 'icons', 'hicolor', 'scalable', 'actions')
)
-
-meson.add_install_script('meson_post_install.py')
diff --git a/data/meson.build b/data/meson.build
index 7ef8ed8..8759a36 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -3,15 +3,30 @@ po_dir = join_paths(meson.source_root(), 'po')
intltool_merge = find_program('intltool-merge')
intltool_cache = join_paths(po_dir, '.intltool-merge-cache')
-appdata = 'org.gnome.bijiben.appdata.xml'
+mime = 'org.gnome.bijiben.xml'
+
+custom_target(
+ mime,
+ input: mime + '.in',
+ output: mime,
+ command: [intltool_merge, '-x', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@'],
+ install: true,
+ install_dir: join_paths(bijiben_datadir, 'mime', 'packages')
+)
+
+if get_option('enable-update-mimedb')
+ meson.add_install_script('meson_update_mime.py')
+endif
+
+info = 'org.gnome.bijiben.metainfo.xml'
custom_target(
- appdata,
- input: '@0@.in'.format(appdata),
- output: appdata,
+ info,
+ input: 'org.gnome.bijiben.appdata.xml.in',
+ output: info,
command : [intltool_merge, '-x', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@'],
install: true,
- install_dir: join_paths(bijiben_datadir, 'appdata')
+ install_dir: join_paths(bijiben_datadir, 'metainfo')
)
desktop = 'org.gnome.bijiben.desktop'
@@ -20,8 +35,8 @@ desktop_conf = configuration_data()
desktop_conf.set('VERSION', bijiben_version)
desktop_in = configure_file(
- input: '@0 in in'.format(desktop),
- output: '@0@.in'.format(desktop),
+ input: desktop + '.in.in',
+ output: desktop + '.in',
configuration: desktop_conf
)
@@ -33,7 +48,6 @@ custom_target(
install: true,
install_dir: join_paths(bijiben_datadir, 'applications')
)
-meson.add_install_script('meson_desktop_validate.py')
service_conf = configuration_data()
service_conf.set('libexecdir', bijiben_libexecdir)
@@ -41,7 +55,7 @@ service_conf.set('libexecdir', bijiben_libexecdir)
service = 'org.gnome.bijiben.SearchProvider.service'
configure_file(
- input: '@0@.in'.format(service),
+ input: service + '.in',
output: service,
install: true,
install_dir: join_paths(bijiben_datadir, 'dbus-1', 'services'),
@@ -53,10 +67,10 @@ install_data(
install_dir: join_paths(bijiben_datadir, 'gnome-shell', 'search-providers')
)
-web_files = [
+web_files = files(
'Default.css',
'bijiben.js'
-]
+)
install_data(
web_files,
@@ -65,24 +79,7 @@ install_data(
install_data(
'org.gnome.bijiben.gschema.xml',
- install_dir: join_paths(bijiben_datadir, 'glib-2.0', 'schemas'),
- install_mode: 'rw-r--r--'
+ install_dir: join_paths(bijiben_datadir, 'glib-2.0', 'schemas')
)
-meson.add_install_script('meson_compile_schemas.py')
-
-mime = 'org.gnome.bijiben.xml'
-
-custom_target(
- mime,
- input: '@0@.in'.format(mime),
- output: mime,
- command : [intltool_merge, '-x', '-u', '-c', intltool_cache, po_dir, '@INPUT@', '@OUTPUT@'],
- install: true,
- install_dir: join_paths(bijiben_datadir, 'mime', 'packages')
-)
-
-if get_option('enable-update-mimedb')
- meson.add_install_script('meson_update_mime.py')
-endif
subdir('icons')
diff --git a/data/org.gnome.bijiben.desktop.in.in b/data/org.gnome.bijiben.desktop.in.in
old mode 100755
new mode 100644
diff --git a/data/org.gnome.bijiben.gschema.xml b/data/org.gnome.bijiben.gschema.xml
old mode 100755
new mode 100644
diff --git a/help/meson.build b/help/meson.build
index 9b150c4..04fd078 100644
--- a/help/meson.build
+++ b/help/meson.build
@@ -18,9 +18,9 @@ sources = [
]
media = [
- join_paths('figures', 'hicolor_apps_48x48_bijiben.png'),
- join_paths('figures', 'hicolor_apps_16x16_bijiben.png'),
- join_paths('figures', 'notes-3-12.png')
+ 'figures/hicolor_apps_48x48_bijiben.png',
+ 'figures/hicolor_apps_16x16_bijiben.png',
+ 'figures/notes-3-12.png'
]
linguas = [
@@ -31,6 +31,7 @@ linguas = [
'fr',
'hu',
'ko',
+ 'pl',
'pt_BR',
'sv'
]
diff --git a/meson.build b/meson.build
index c3e8964..73ed338 100644
--- a/meson.build
+++ b/meson.build
@@ -1,6 +1,6 @@
project(
'bijiben', 'c',
- version: '3.21.2',
+ version: '3.24.0',
license: 'GPL3',
default_options: [
'buildtype=debugoptimized',
@@ -21,38 +21,39 @@ bijiben_bindir = join_paths(bijiben_prefix, get_option('bindir'))
bijiben_libexecdir = join_paths(bijiben_prefix, get_option('libexecdir'))
bijiben_localedir = join_paths(bijiben_prefix, get_option('localedir'))
bijiben_datadir = join_paths(bijiben_prefix, get_option('datadir'))
-bijiben_pkgdatadir = join_paths(bijiben_prefix, get_option('datadir'), meson.project_name())
+
+bijiben_pkgdatadir = join_paths(bijiben_datadir, meson.project_name())
cc = meson.get_compiler('c')
-conf = configuration_data()
+config_h = configuration_data()
-conf.set_quoted('GETTEXT_PACKAGE', meson.project_name())
+config_h.set_quoted('GETTEXT_PACKAGE', meson.project_name())
# package
-conf.set_quoted('PACKAGE', meson.project_name())
-conf.set_quoted('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/enter_bug.cgi?product=bijiben')
-conf.set_quoted('PACKAGE_NAME', meson.project_name())
-conf.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), bijiben_version))
-conf.set_quoted('PACKAGE_TARNAME', meson.project_name())
-conf.set_quoted('PACKAGE_URL', 'https://wiki.gnome.org/Apps/Bijiben')
-conf.set_quoted('PACKAGE_VERSION', bijiben_version)
-conf.set_quoted('VERSION', bijiben_version)
+config_h.set_quoted('PACKAGE', meson.project_name())
+config_h.set_quoted('PACKAGE_BUGREPORT', 'https://bugzilla.gnome.org/enter_bug.cgi?product=bijiben')
+config_h.set_quoted('PACKAGE_NAME', meson.project_name())
+config_h.set_quoted('PACKAGE_STRING', '@0@ @1@'.format(meson.project_name(), bijiben_version))
+config_h.set_quoted('PACKAGE_TARNAME', meson.project_name())
+config_h.set_quoted('PACKAGE_URL', 'https://wiki.gnome.org/Apps/Bijiben')
+config_h.set_quoted('PACKAGE_VERSION', bijiben_version)
+config_h.set_quoted('VERSION', bijiben_version)
# headers
-conf.set('HAVE_DLFCN_H', cc.has_header('dlfcn.h'))
-conf.set('HAVE_INTTYPES_H', cc.has_header('inttypes.h'))
-conf.set('HAVE_MEMORY_H', cc.has_header('memory.h'))
-conf.set('HAVE_STDINT_H', cc.has_header('stdint.h'))
-conf.set('HAVE_STDLIB_H', cc.has_header('stdlib.h'))
-conf.set('HAVE_STRINGS_H', cc.has_header('strings.h'))
-conf.set('HAVE_STRING_H', cc.has_header('string.h'))
-conf.set('HAVE_SYS_STAT_H', cc.has_header('sys/stat.h'))
-conf.set('HAVE_SYS_TYPES_H', cc.has_header('sys/types.h'))
-conf.set('HAVE_UNISTD_H', cc.has_header('unistd.h'))
+config_h.set('HAVE_DLFCN_H', cc.has_header('dlfcn.h'))
+config_h.set('HAVE_INTTYPES_H', cc.has_header('inttypes.h'))
+config_h.set('HAVE_MEMORY_H', cc.has_header('memory.h'))
+config_h.set('HAVE_STDINT_H', cc.has_header('stdint.h'))
+config_h.set('HAVE_STDLIB_H', cc.has_header('stdlib.h'))
+config_h.set('HAVE_STRINGS_H', cc.has_header('strings.h'))
+config_h.set('HAVE_STRING_H', cc.has_header('string.h'))
+config_h.set('HAVE_SYS_STAT_H', cc.has_header('sys/stat.h'))
+config_h.set('HAVE_SYS_TYPES_H', cc.has_header('sys/types.h'))
+config_h.set('HAVE_UNISTD_H', cc.has_header('unistd.h'))
# functions
-conf.set('HAVE_GETTEXT', cc.has_function('gettext'))
+config_h.set('HAVE_GETTEXT', cc.has_function('gettext'))
# Compiler flags
test_cflags = [
@@ -61,7 +62,6 @@ test_cflags = [
'-Warray-bounds',
'-Wcast-align',
'-Wdeclaration-after-statement',
- #'-Werror',
'-Wextra',
'-Wformat-nonliteral',
'-Wformat-security',
@@ -93,56 +93,49 @@ test_cflags = [
'-Wswitch-enum',
'-Wundef',
'-Wunused-but-set-variable',
- '-Wwrite-strings',
+ '-Wwrite-strings'
]
-common_flags = [
+bijiben_flags = [
+ '-DHAVE_CONFIG_H',
'-DDATADIR="@0@"'.format(bijiben_datadir),
'-DPACKAGE_LOCALE_DIR="@0@"'.format(bijiben_localedir)
]
foreach cflag: test_cflags
if cc.has_argument(cflag)
- common_flags += [cflag]
+ bijiben_flags += [cflag]
endif
endforeach
-add_global_arguments(common_flags, language: 'c')
+add_project_arguments(bijiben_flags, language: 'c')
-tracker_sparql_dep = dependency(
- 'tracker-sparql-1.0',
- required: false
-)
+tracker_sparql_dep = dependency('tracker-sparql-1.0', required: false)
if not tracker_sparql_dep.found()
- tracker_sparql_dep = dependency(
- 'tracker-sparql-0.18',
- required: true
- )
+ tracker_sparql_dep = dependency('tracker-sparql-0.18', required: true)
endif
-libgd_options = [
- 'static=true',
- 'with-view-common=true',
- 'with-gtk-hacks=true',
- 'with-main-view=true',
- 'with-tagged-entry=true'
-]
-
libgd = subproject(
'libgd',
- default_options: libgd_options
+ default_options: [
+ 'static=true',
+ 'with-view-common=true',
+ 'with-gtk-hacks=true',
+ 'with-main-view=true',
+ 'with-tagged-entry=true'
+ ]
)
libgd_dep = libgd.get_variable('libgd_dep')
-bijiben_dep = [
- dependency('libecal-1.2', version: '>= 3.13.90'),
- dependency('libedataserver-1.2', version: '>= 3.13.90'),
+bijiben_deps = [
dependency('gio-unix-2.0'),
- dependency('goa-1.0'),
dependency('glib-2.0', version: '>= 2.28'),
+ dependency('goa-1.0'),
dependency('gtk+-3.0', version: '>= 3.11.4'),
+ dependency('libecal-1.2', version: '>= 3.13.90'),
+ dependency('libedataserver-1.2', version: '>= 3.13.90'),
dependency('libxml-2.0'),
dependency('uuid'),
dependency('webkit2gtk-4.0', version: '>= 2.10'),
@@ -152,12 +145,12 @@ bijiben_dep = [
]
if get_option('enable-zeitgeist')
- bijiben_dep += [dependency('zeitgeist-2.0')]
+ bijiben_deps += [dependency('zeitgeist-2.0')]
endif
configure_file(
output: 'config.h',
- configuration: conf
+ configuration: config_h
)
gnome = import('gnome')
@@ -169,3 +162,8 @@ subdir('src')
subdir('data')
subdir('po')
subdir('help')
+
+meson.add_install_script('meson_post_install.py')
+
+message(' Version: ' + bijiben_version)
+message(' Enable Zeitgeist ' + (get_option('enable-zeitgeist') ? 'yes' : 'no'))
diff --git a/data/icons/meson_post_install.py b/meson_post_install.py
similarity index 67%
rename from data/icons/meson_post_install.py
rename to meson_post_install.py
index 1c519f4..60fbc2e 100644
--- a/data/icons/meson_post_install.py
+++ b/meson_post_install.py
@@ -16,6 +16,16 @@ apps_icon_dir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'icons
[os.rename(file, os.path.join(os.path.dirname(file), name_pattern.search(file).group(1)))
for file in glob.glob(apps_icon_dir + search_pattern, recursive=True)]
+schemadir = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'glib-2.0', 'schemas')
+
+desktop_file = os.path.join(os.environ['MESON_INSTALL_PREFIX'], 'share', 'applications',
'org.gnome.bijiben.desktop')
+
if not os.environ.get('DESTDIR'):
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', apps_icon_dir])
+
+ print('Compile gsettings schemas...')
+ subprocess.call(['glib-compile-schemas', schemadir])
+
+ print('Validate desktop file...')
+ subprocess.call(['desktop-file-validate', desktop_file])
diff --git a/src/libbiji/meson.build b/src/libbiji/meson.build
index c6808f3..e512fab 100644
--- a/src/libbiji/meson.build
+++ b/src/libbiji/meson.build
@@ -1,39 +1,17 @@
-marshallers = gnome.genmarshal(
- 'biji-marshalers',
- sources: 'biji-marshalers.list',
- prefix: '_biji_marshal'
-)
-
-headers = [
- 'libbiji.h',
- 'biji-date-time.h',
- 'biji-error.h',
- 'biji-info-set.h',
- 'biji-item.h',
- 'biji-manager.h',
- 'biji-notebook.h',
- 'biji-note-id.h',
- 'biji-note-obj.h',
- 'biji-string.h',
- 'biji-timeout.h',
- 'biji-tracker.h',
- 'biji-zeitgeist.h',
- join_paths('deserializer', 'biji-lazy-deserializer.h'),
- join_paths('deserializer', 'biji-tomboy-reader.h'),
- join_paths('editor', 'biji-editor-selection.h'),
- join_paths('editor', 'biji-webkit-editor.h'),
- join_paths('provider', 'biji-import-provider.h'),
- join_paths('provider', 'biji-local-note.h'),
- join_paths('provider', 'biji-local-provider.h'),
- join_paths('provider', 'biji-memo-note.h'),
- join_paths('provider', 'biji-memo-provider.h'),
- join_paths('provider', 'biji-own-cloud-note.h'),
- join_paths('provider', 'biji-own-cloud-provider.h'),
- join_paths('provider', 'biji-provider.h'),
- join_paths('serializer', 'biji-lazy-serializer.h'),
-]
-
-sources = [
+sources = files(
+ 'deserializer/biji-lazy-deserializer.c',
+ 'deserializer/biji-tomboy-reader.c',
+ 'editor/biji-editor-selection.c',
+ 'editor/biji-webkit-editor.c',
+ 'provider/biji-import-provider.c',
+ 'provider/biji-local-note.c',
+ 'provider/biji-local-provider.c',
+ 'provider/biji-memo-note.c',
+ 'provider/biji-memo-provider.c',
+ 'provider/biji-own-cloud-note.c',
+ 'provider/biji-own-cloud-provider.c',
+ 'provider/biji-provider.c',
+ 'serializer/biji-lazy-serializer.c',
'biji-date-time.c',
'biji-error.c',
'biji-info-set.c',
@@ -45,26 +23,19 @@ sources = [
'biji-string.c',
'biji-timeout.c',
'biji-tracker.c',
- 'biji-zeitgeist.c',
- join_paths('deserializer', 'biji-lazy-deserializer.c'),
- join_paths('deserializer', 'biji-tomboy-reader.c'),
- join_paths('editor', 'biji-editor-selection.c'),
- join_paths('editor', 'biji-webkit-editor.c'),
- join_paths('provider', 'biji-import-provider.c'),
- join_paths('provider', 'biji-local-note.c'),
- join_paths('provider', 'biji-local-provider.c'),
- join_paths('provider', 'biji-memo-note.c'),
- join_paths('provider', 'biji-memo-provider.c'),
- join_paths('provider', 'biji-own-cloud-note.c'),
- join_paths('provider', 'biji-own-cloud-provider.c'),
- join_paths('provider', 'biji-provider.c'),
- join_paths('serializer', 'biji-lazy-serializer.c'),
-]
+ 'biji-zeitgeist.c'
+)
+
+sources += gnome.genmarshal(
+ 'biji-marshalers',
+ sources: 'biji-marshalers.list',
+ prefix: '_biji_marshal'
+)
ldflags = [
'-Wl,-Bsymbolic-functions',
'-Wl,-z,relro',
- '-Wl,-z,now',
+ '-Wl,-z,now'
]
libbiji_ldflags = []
@@ -77,23 +48,23 @@ if host_machine.system().contains('linux')
endforeach
endif
-libbiji_cflags = common_flags
+libbiji_cflags = bijiben_flags
+
if get_option('enable-zeitgeist')
libbiji_cflags += '-DBUILD_ZEITGEIST'
endif
-libbiji_lib = static_library(
+libbiji = library(
'libbiji',
- sources: sources + headers + marshallers,
+ sources: sources,
include_directories: top_inc,
- dependencies: bijiben_dep,
+ dependencies: bijiben_deps,
c_args: libbiji_cflags,
link_args: libbiji_ldflags
)
-libbiji_inc = include_directories('.')
libbiji_dep = declare_dependency(
- link_with: libbiji_lib,
- include_directories: libbiji_inc,
- dependencies: bijiben_dep
+ link_with: libbiji,
+ include_directories: include_directories('.'),
+ dependencies: bijiben_deps
)
diff --git a/src/meson.build b/src/meson.build
index 80fe483..a7f477b 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -1,88 +1,64 @@
subdir('libbiji')
-resources = gnome.compile_resources(
- 'bjb-resources',
- 'bjb.gresource.xml',
- export: true,
- source_dir: '.',
- c_name: 'bjb'
-)
-
-bijiben_sources = [
+sources = files(
'bjb-app-menu.c',
- 'bjb-app-menu.h',
'bjb-bijiben.c',
- 'bjb-bijiben.h',
'bjb-color-button.c',
- 'bjb-color-button.h',
'bjb-controller.c',
- 'bjb-controller.h',
'bjb-debug.c',
- 'bjb-debug.h',
'bjb-editor-toolbar.c',
- 'bjb-editor-toolbar.h',
'bjb-empty-results-box.c',
- 'bjb-empty-results-box.h',
- 'bjb-import-dialog.h',
'bjb-import-dialog.c',
'bjb-load-more-button.c',
- 'bjb-load-more-button.h',
'bjb-main.c',
'bjb-main-toolbar.c',
- 'bjb-main-toolbar.h',
'bjb-main-view.c',
- 'bjb-main-view.h',
'bjb-note-view.c',
- 'bjb-note-view.h',
'bjb-organize-dialog.c',
- 'bjb-organize-dialog.h',
'bjb-rename-note.c',
- 'bjb-rename-note.h',
'bjb-search-toolbar.c',
- 'bjb-search-toolbar.h',
'bjb-selection-toolbar.c',
- 'bjb-selection-toolbar.h',
'bjb-settings.c',
- 'bjb-settings.h',
'bjb-settings-dialog.c',
- 'bjb-settings-dialog.h',
'bjb-share.c',
- 'bjb-share.h',
- 'bjb-window-base.c',
- 'bjb-window-base.h'
-]
+ 'bjb-window-base.c'
+)
+
+sources += gnome.compile_resources(
+ 'bjb-resources',
+ 'bjb.gresource.xml',
+ export: true,
+ source_dir: '.',
+ c_name: 'bjb'
+)
-bijiben_cflags = common_flags + [
- '-DHAVE_CONFIG_H'
-]
+bijiben_deps += libbiji_dep
executable(
- 'bijiben',
- bijiben_sources + resources,
+ meson.project_name(),
+ sources,
include_directories: top_inc,
- dependencies: [bijiben_dep, libbiji_dep],
- c_args: bijiben_cflags,
+ dependencies: bijiben_deps,
install: true,
install_dir: bijiben_bindir
)
-gdbus_src = gnome.gdbus_codegen(
+search_provider_sources = files(
+ 'bijiben-shell-search-provider.c'
+)
+
+search_provider_sources += gnome.gdbus_codegen(
'bijiben-shell-search-provider-generated',
join_paths(meson.source_root(), 'data', 'shell-search-provider-dbus-interfaces.xml'),
interface_prefix: 'org.gnome.',
namespace: 'Bijiben'
)
-search_provider_sources = [
- gdbus_src,
- 'bijiben-shell-search-provider.c'
-]
-
executable(
'bijiben-shell-search-provider',
search_provider_sources,
include_directories: top_inc,
- dependencies: [bijiben_dep, libbiji_dep],
+ dependencies: bijiben_deps,
install: true,
install_dir: bijiben_libexecdir
)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]