[gnome-weather] Add Basic Meson Manifests
- From: Christopher Davis <christopherdavis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-weather] Add Basic Meson Manifests
- Date: Sun, 27 Jan 2019 03:25:20 +0000 (UTC)
commit 11d9dc98c7acd5cf891be6ca1ed680e2dd4b8ed0
Author: Falk Alexander Seidl <fseidl gnome org>
Date: Tue Nov 6 18:47:06 2018 +0100
Add Basic Meson Manifests
Cleared every autotools remaining stuff and added basic meson manifests.
Remove All Autotools Scripts
Remove unnecessary i18n import
Makefile.am | 30 ---
autogen.sh | 24 ---
configure.ac | 75 -------
data/Makefile.am | 78 -------
data/icons/meson.build | 4 +
data/meson.build | 85 ++++++++
git.mk | 333 -----------------------------
glib-tap.mk | 134 ------------
m4/glibtests.m4 | 28 ---
meson.build | 61 ++++++
meson_options.txt | 9 +
meson_post_install.py | 15 ++
po/meson.build | 2 +
src/Makefile.am | 59 -----
src/meson.build | 38 ++++
src/org.gnome.Weather.Application.in | 0
src/org.gnome.Weather.BackgroundService.in | 0
tests/Makefile.am | 33 ---
18 files changed, 214 insertions(+), 794 deletions(-)
---
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..7b01484
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,4 @@
+install_subdir(
+ 'hicolor',
+ install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'icons')
+)
\ No newline at end of file
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..1bacc30
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,85 @@
+gnome = import('gnome')
+
+data_conf = configuration_data()
+data_conf.set('application_id', application_id)
+data_conf.set('PACKAGE_NAME', meson.project_name())
+data_conf.set('DATA_DIR', DATA_DIR)
+data_conf.set('pkgdatadir', pkgdatadir)
+
+message('Compiling resources')
+
+gnome.compile_resources(
+ application_id + '.Application.data',
+ application_id + '.Application.data.gresource.xml',
+ gresource_bundle: true,
+ source_dir: '.',
+ install_dir: DATA_DIR,
+ install: true
+)
+
+gnome.compile_resources(
+ application_id + '.BackgroundService.data',
+ application_id + '.BackgroundService.data.gresource.xml',
+ gresource_bundle: true,
+ source_dir: '.',
+ install_dir: DATA_DIR,
+ install: true
+)
+
+# Installing the schema file
+install_data(
+ application_id + '.Application.gschema.xml',
+ install_dir: 'share/glib-2.0/schemas'
+)
+
+# Building desktop file
+desktop_conf = configuration_data()
+desktop = i18n.merge_file(
+ 'desktop',
+ input: 'org.gnome.Weather.Application.desktop.in',
+ output: 'org.gnome.Weather.Application.desktop',
+ po_dir: join_paths(meson.source_root(), 'po'),
+ type: 'desktop',
+ install: true,
+ install_dir: join_paths(get_option('prefix'), get_option('datadir'), 'applications')
+)
+
+# Validating 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(), application_id + '.desktop')
+ )
+endif
+
+# Building app data
+appdata_conf = configuration_data()
+appdata = i18n.merge_file(
+ 'appdata',
+ input: 'org.gnome.Weather.appdata.xml.in',
+ output: application_id + '.appdata.xml',
+ install: true,
+ install_dir: join_paths(join_paths('share'), 'metainfo'),
+ po_dir: join_paths(meson.source_root(), 'po')
+)
+
+
+configure_file(
+ input: application_id + '.Application.service.in',
+ output: application_id + '.Application.service',
+ configuration: data_conf,
+ install: true,
+ install_dir: join_paths(DATA_DIR, 'dbus-1', 'services')
+)
+
+configure_file(
+ input: application_id + '.BackgroundService.service.in',
+ output: application_id + '.BackgroundService.service',
+ configuration: data_conf,
+ install: true,
+ install_dir: join_paths(DATA_DIR, 'dbus-1', 'services')
+)
+
+subdir('icons')
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..db8fd6c
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,61 @@
+project('gnome-weather', 'c',
+ version: '3.31.1',
+ meson_version: '>= 0.46.0',
+ license: 'GPL2+'
+)
+
+prefix = get_option('prefix')
+i18n = import('i18n')
+gnome = import('gnome')
+application_id = 'org.gnome.Weather'
+
+message('Looking for dependencies')
+dependency('glib-2.0')
+dependency('gobject-introspection-1.0', version: '>=1.35.9')
+dependency('gtk+-3.0', version :'>=3.20')
+dependency('gjs-1.0', version: '>= 1.40.0')
+dependency('geoclue-2.0', version: '>= 0.12.99')
+dependency('gweather-3.0', version: '>= 3.28')
+
+env = environment()
+
+LIBEXEC_DIR = join_paths(get_option('prefix'), get_option('libexecdir'))
+EXTENSION_DIR = join_paths(get_option('prefix'), get_option('libdir'), meson.project_name())
+DATA_DIR = join_paths(get_option('prefix'), get_option('datadir'), application_id)
+BIN_DIR = join_paths(get_option('prefix'), get_option('bindir'))
+pkgdatadir = join_paths(DATA_DIR, meson.project_name())
+
+# Profiles
+if get_option('profile') == 'development'
+ profile = 'Devel'
+ name_suffix = ' (Development)'
+else
+ profile = ''
+ name_suffix = ''
+endif
+
+conf = configuration_data()
+conf.set('PACKAGE_URL', 'https://gitlab.gnome.org/GNOME/gnome-weather')
+conf.set('DATA_DIR', DATA_DIR)
+conf.set('EXTENSION_DIR', EXTENSION_DIR)
+conf.set('LOCALE_DIR', join_paths(get_option('prefix'), get_option('datadir'), 'locale'))
+conf.set('libexecdir', LIBEXEC_DIR)
+
+if get_option('profile') == 'development'
+ conf.set('VERSION', ''.join([run_command(['git', 'describe', '--long', '--tags']).stdout(),
get_option('profile')]))
+else
+ conf.set('VERSION', meson.project_version())
+endif
+
+conf.set_quoted('PROFILE', profile)
+
+if get_option('profile') == 'development'
+ application_id = 'org.gnome.WeatherDevel'
+endif
+conf.set('APP_ID', application_id)
+
+subdir('data')
+subdir('po')
+subdir('src')
+
+meson.add_install_script('meson_post_install.py')
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..89112a5
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,9 @@
+option(
+ 'profile',
+ type: 'combo',
+ choices: [
+ 'default',
+ 'development'
+ ],
+ value: 'default'
+)
diff --git a/meson_post_install.py b/meson_post_install.py
new file mode 100644
index 0000000..01ea4c0
--- /dev/null
+++ b/meson_post_install.py
@@ -0,0 +1,15 @@
+#!/usr/bin/env python3
+
+from os import environ, path
+from subprocess import call
+
+prefix = environ.get('MESON_INSTALL_PREFIX', '/usr/local')
+datadir = path.join(prefix, 'share')
+destdir = environ.get('DESTDIR', '')
+
+if not destdir:
+ print('Updating icon cache...')
+ call(['gtk-update-icon-cache', '-qtf', path.join(datadir, 'icons', 'hicolor')])
+ print("Installing new Schemas")
+ call(['glib-compile-schemas', path.join(datadir, 'glib-2.0/schemas')])
+
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..a63dece
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1,2 @@
+message('Update translations')
+i18n.gettext('gnome-weather', preset: 'glib')
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..d18a0e6
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,38 @@
+source_conf = configuration_data()
+source_conf.set('GJS', find_program('gjs').path())
+source_conf.set('DATA_DIR', DATA_DIR)
+source_conf.set('PACKAGE_VERSION', meson.project_version())
+source_conf.set('libdir', EXTENSION_DIR)
+source_conf.set('prefix', prefix)
+
+configure_file(
+ input: application_id + '.Application.in',
+ output: application_id + '.Application',
+ configuration: source_conf,
+ install: true,
+ install_dir: DATA_DIR
+)
+
+configure_file(
+ input: application_id + '.BackgroundService.in',
+ output: application_id + '.BackgroundService',
+ configuration: source_conf,
+ install: true,
+ install_dir: DATA_DIR
+)
+
+gnome.compile_resources(
+ application_id + '.Application.src',
+ application_id + '.Application.src.gresource.xml',
+ gresource_bundle: true,
+ install: true,
+ install_dir: DATA_DIR
+)
+
+gnome.compile_resources(
+ application_id + '.BackgroundService.src',
+ application_id + '.BackgroundService.src.gresource.xml',
+ gresource_bundle: true,
+ install: true,
+ install_dir: DATA_DIR
+)
diff --git a/src/org.gnome.Weather.Application.in b/src/org.gnome.Weather.Application.in
old mode 100644
new mode 100755
diff --git a/src/org.gnome.Weather.BackgroundService.in b/src/org.gnome.Weather.BackgroundService.in
old mode 100644
new mode 100755
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]