[gnome-tweak-tool] build: Add meson support



commit f229074af25ced05d014485dfe218669b000ffdf
Author: Florian Müllner <fmuellner gnome org>
Date:   Tue May 30 05:07:06 2017 +0200

    build: Add meson support
    
    Meson is on track to replace autotools as the build system of choice,
    so support it in addition to autotools.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=783228

 data/icons/meson.build |   12 +++++++++++
 data/meson.build       |   26 ++++++++++++++++++++++++
 gtweak/meson.build     |   50 ++++++++++++++++++++++++++++++++++++++++++++++++
 meson-postinstall.sh   |   10 +++++++++
 meson.build            |   41 +++++++++++++++++++++++++++++++++++++++
 po/meson.build         |    1 +
 6 files changed, 140 insertions(+), 0 deletions(-)
---
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..34c2523
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,12 @@
+icon_sizes = [
+  '16x16',
+  '22x22',
+  '24x24',
+  '32x32',
+  '48x48',
+  '256x256',
+  'scalable'
+]
+foreach size : icon_sizes
+  install_subdir(size, install_dir: icondir)
+endforeach
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..0b0c25e
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,26 @@
+subdir('icons')
+
+gui_data = [
+  'shell.ui',
+  'shell.css'
+]
+install_data(gui_data, install_dir: pkgdatadir)
+
+desktop_file = 'gnome-tweak-tool.desktop'
+i18n.merge_file(desktop_file,
+  input: desktop_file + '.in',
+  output: desktop_file,
+  po_dir: '../po',
+  install: true,
+  install_dir: desktopdir,
+  type: 'desktop'
+)
+
+appdata_file = 'gnome-tweak-tool.appdata.xml'
+i18n.merge_file(appdata_file,
+  input: appdata_file + '.in',
+  output: appdata_file,
+  po_dir: '../po',
+  install: true,
+  install_dir: appdatadir
+)
diff --git a/gtweak/meson.build b/gtweak/meson.build
new file mode 100644
index 0000000..43d3b7a
--- /dev/null
+++ b/gtweak/meson.build
@@ -0,0 +1,50 @@
+defs_conf = configuration_data()
+defs_conf.set('DATADIR', datadir)
+defs_conf.set('GSETTINGSSCHEMADIR', schemadir)
+defs_conf.set('LIBEXECDIR', libexecdir)
+defs_conf.set('LOCALEDIR', localedir)
+defs_conf.set('PKGDATADIR', pkgdatadir)
+defs_conf.set('TWEAKDIR', join_paths(gtweakdir, 'tweaks'))
+defs_conf.set('VERSION', meson.project_version())
+
+configure_file(
+  input: 'defs.py.in',
+  output: 'defs.py',
+  configuration: defs_conf,
+  install: true,
+  install_dir: gtweakdir
+)
+
+shell_sources = [
+  'app.py',
+  'egowrapper.py',
+  'gsettings.py',
+  'gshellwrapper.py',
+  'gtksettings.py',
+  '__init__.py',
+  'mainwindow.py',
+  'tweakmodel.py',
+  'tweakview.py',
+  'utils.py',
+  'widgets.py'
+]
+
+tweak_sources = [
+  'tweaks/__init__.py',
+  'tweaks/tweak_group_desktop.py',
+  'tweaks/tweak_group_font.py',
+  'tweaks/tweak_group_interface.py',
+  'tweaks/tweak_group_keymouse.py',
+  'tweaks/tweak_group_power.py',
+  'tweaks/tweak_group_shell_extensions.py',
+  'tweaks/tweak_group_startup.py',
+  'tweaks/tweak_group_test.py',
+  'tweaks/tweak_group_top_bar.py',
+  'tweaks/tweak_group_windows.py',
+  'tweaks/tweak_group_workspaces.py',
+  'tweaks/tweak_group_xkb.py',
+  'tweaks/tweak_wacom.py'
+]
+
+install_data(shell_sources, install_dir: gtweakdir)
+install_data(tweak_sources, install_dir: gtweakdir + '/tweaks')
diff --git a/meson-postinstall.sh b/meson-postinstall.sh
new file mode 100755
index 0000000..a659c80
--- /dev/null
+++ b/meson-postinstall.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Package managers set this so we don't need to run
+if [ -z "$DESTDIR" ]; then
+  echo Updating desktop database...
+  update-desktop-database -q ${MESON_INSTALL_PREFIX}/share/applications
+
+  echo Updating icon cache...
+  gtk-update-icon-cache -q -t -f ${MESON_INSTALL_PREFIX}/share/icons/hicolor
+fi
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..44f5935
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,41 @@
+project('gnome-tweak-tool', 'c',
+  version: '3.24.0',
+  meson_version: '>= 0.40.0'
+)
+
+gtk_req = '>= 3.12.0'
+pygobject_req = '>= 3.10'
+schemas_req = '>= 3.23.3'
+
+gnome = import('gnome')
+i18n = import('i18n')
+python3 = import('python3')
+
+prefix = get_option('prefix')
+
+bindir = join_paths(prefix, get_option('bindir'))
+datadir = join_paths(prefix, get_option('datadir'))
+libexecdir = join_paths(prefix, get_option('libexecdir'))
+localedir = join_paths(prefix, get_option('localedir'))
+pythondir = join_paths(prefix, python3.sysconfig_path('purelib'))
+
+pkgdatadir = join_paths(datadir, meson.project_name())
+
+appdatadir = join_paths(datadir, 'appdata')
+desktopdir = join_paths(datadir, 'applications')
+gtweakdir = join_paths(pythondir, 'gtweak')
+icondir = join_paths(datadir, 'icons', 'hicolor')
+schemadir = join_paths(datadir, 'glib-2.0', 'schemas')
+
+gtk_dep = dependency('gtk+-3.0', version: gtk_req)
+pygobject_dep = dependency('pygobject-3.0', version: pygobject_req)
+schemas_dep = dependency('gsettings-desktop-schemas', version: schemas_req)
+
+install_data('gnome-tweak-tool', install_dir: bindir)
+install_data('gnome-tweak-tool-lid-inhibitor', install_dir: libexecdir)
+
+subdir('gtweak')
+subdir('data')
+subdir('po')
+
+meson.add_install_script('meson-postinstall.sh')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..1d84d93
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext('gnome-tweak-tool', preset: 'glib')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]