From 5bf0d877d329e268f5b439aec60774fbe3db3780 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Genov=C3=A9s?= Date: Mon, 1 Apr 2019 17:15:33 +0200 Subject: [PATCH] meson initial approach --- .gitignore | 2 +- data/meson.build | 75 ++++++++++++++++++++++++++++++++++++++++++++++++ meson.build | 17 +++-------- 3 files changed, 80 insertions(+), 14 deletions(-) create mode 100644 data/meson.build diff --git a/.gitignore b/.gitignore index 879b4db..d5e4595 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,4 @@ data/ui/shortcut_handlers .vscode/ *.glade~ dist/uberwriter-2.0b0-py3.7.egg -buildir/* +builddir/* diff --git a/data/meson.build b/data/meson.build new file mode 100644 index 0000000..4e306b3 --- /dev/null +++ b/data/meson.build @@ -0,0 +1,75 @@ +gnome = import('gnome') + +message('Compiling resources') + +# gnome.compile_resources( +# meson.project_name(), +# meson.project_name() + '.gresource.xml', +# gresource_bundle: true, +# source_dir: '.', +# install_dir: DATA_DIR, +# install: true, +# dependencies: configure_file( +# input: 'AboutDialog.ui.in', +# output: 'AboutDialog.ui', +# configuration: conf +# ) +# ) + +# Installing the schema file +install_data( + project_id + '.gschema.xml', + install_dir: 'share/glib-2.0/schemas' +) + +# Merging the translations with the desktop file +# i18n.merge_file( +# output: project_id + '.desktop', +# input: project_id + '.desktop.in', +# po_dir: join_paths(meson.source_root(), 'subprojects/po'), +# type: 'desktop', +# install: true, +# install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'applications') +# ) + +# Validating the desktop file +desktop_file_validate = find_program('desktop-file-validate', required:false) +if desktop_file_validate.found() + test ( + 'Validate desktop file', + desktop_file_validate, + args: join_paths(meson.current_build_dir (), project_id + '.desktop') + ) + message(join_paths(meson.current_build_dir (), project_id + '.desktop')) +endif + +# Merging the translations with the appdata file +# i18n.merge_file( +# output: project_id + '.appdata.xml', +# input: project_id + '.appdata.xml.in', +# po_dir: join_paths(meson.source_root(), 'subprojects/po'), +# install: true, +# install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'metainfo') +# ) + +# Validating the appdata file +appstreamcli = find_program('appstream-util', required: false) +if appstreamcli.found() + test ( + 'Validate appdata file', + appstreamcli, + args: ['validate-relax', join_paths(meson.current_build_dir (), project_id + '.appdata.xml')] + ) +endif + +# Validating schemas +compile_schemas = find_program('glib-compile-schemas', required: false) +if compile_schemas.found() + test('Validate schema file', compile_schemas, + args: ['--strict', '--dry-run', meson.current_source_dir()] + ) +endif + + +message('Making a list of icons') +# subdir('icons') diff --git a/meson.build b/meson.build index 4e2985b..5487948 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('uberwriter', - version: '2.1.4', + version: '2.1.5', meson_version: '>= 0.40.0' ) i18n = import('i18n') @@ -20,6 +20,7 @@ dependency('gtk+-3.0', version :'>=3.20') python_dir = join_paths(get_option('prefix'), python.sysconfig_path('purelib')) LIBEXEC_DIR = join_paths(get_option('prefix'), get_option('libexecdir')) DATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), meson.project_name()) +message(DATA_DIR) bindir = join_paths(get_option('prefix'), get_option('bindir')) conf = configuration_data() @@ -32,24 +33,14 @@ conf.set('libexecdir', LIBEXEC_DIR) conf.set('VERSION', meson.project_version()) conf.set('PYTHON', python_bin.path()) -#subdir('data') +subdir('data') #subdir('po') - +message(python_dir) install_subdir( 'uberwriter', install_dir: python_dir ) -install_subdir( - 'data', - install_dir: DATA_DIR -) - -install_subdir( - 'thirdparty', - install_dir: join_paths(python_dir, 'lollypop') -) - message('Preparing init file') configure_file( input: 'bin/uberwriter',