[gnome-boxes/wip/feborges/meson] Port to meson



commit 53741b8ef22f700db8ec309251c17ef67ca10a11
Author: Felipe Borges <felipeborges gnome org>
Date:   Tue May 30 13:56:06 2017 +0200

    Port to meson

 build-aux/post_install.py |   19 ++++++
 data/meson.build          |   51 +++++++++++++++++
 help/meson.build          |   53 +++++++++++++++++
 meson.build               |   75 ++++++++++++++++++++++++
 po/meson.build            |    1 +
 src/meson.build           |  138 +++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 337 insertions(+), 0 deletions(-)
---
diff --git a/build-aux/post_install.py b/build-aux/post_install.py
new file mode 100755
index 0000000..c1faf09
--- /dev/null
+++ b/build-aux/post_install.py
@@ -0,0 +1,19 @@
+#!/usr/bin/python3
+
+import os
+import pathlib
+import subprocess
+
+prefix = pathlib.Path(os.environ.get('MESON_INSTALL_PREFIX', '/usr/local'))
+datadir = prefix / 'share'
+destdir = os.environ.get('DESTDIR', '')
+
+if not destdir:
+    print('Compiling gsettings schemas...')
+    subprocess.call(['glib-compile-schemas', str(datadir / 'glib-2.0' / 'schemas')])
+
+    print('Updating icon cache...')
+    subprocess.call(['gtk-update-icon-cache', '-qtf', str(datadir / 'icons' / 'hicolor')])
+
+    print('Updating desktop database...')
+    subprocess.call(['update-desktop-database', '-q', str(datadir / 'applications')])
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..1b8f2a4
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,51 @@
+icons_dir = join_paths (data_dir, 'icons', 'hicolor')
+foreach size: ['16x16', '22x22', '32x32', '48x48', '256x256', 'symbolic']
+  install_subdir('icons/hicolor/' + size, install_dir: icons_dir)
+endforeach
+
+# osinfo?
+
+resource_files = files ('gnome-boxes.gresource.xml')
+resources = gnome.compile_resources ('org.gnome.Boxes', #is this right?
+                                     resource_files,
+                                     c_name: 'resources')
+
+custom_target ('desktop-file',
+              input: files ('org.gnome.Boxes.desktop.in.in'),
+              output: 'org.gnome.Boxes.desktop',
+              install: true,
+              install_dir: join_paths (data_dir, 'applications'),
+              command: [msgfmt, '--desktop', '-d', '../po', '--template', '@INPUT@', '-o', '@OUTPUT@'])
+
+dbus_conf = configuration_data ()
+dbus_conf.set ('bindir', join_paths (get_option ('prefix'), get_option ('bindir')))
+configure_file (
+  input: 'org.gnome.Boxes.service',
+  output: 'org.gnome.Boxes.service',
+  configuration: dbus_conf,
+  install: true,
+  install_dir: join_paths (data_dir, 'dbus-1', 'services')
+)
+
+custom_target ('appdata-file',
+  input: 'org.gnome.Boxes.appdata.xml.in',
+  output: 'org.gnome.Boxes.appdata.xml',
+  install: true,
+  install_dir: join_paths (data_dir, 'appdata'),
+  command: [ msgfmt, '--xml', '--template', '@INPUT@', '-d', po_dir, '-o', '@OUTPUT@' ],
+)
+
+
+install_data ('gnome-boxes-search-provider.ini',
+              install_dir: join_paths (data_dir, 'gnome-shell', 'search-providers'),
+)
+
+gsettings_conf = configuration_data ()
+gsettings_conf.set ('GETTEXT_PACKAGE', meson.project_name ())
+configure_file (
+  input: 'org.gnome.boxes.gschema.xml.in',
+  output: 'org.gnome.boxes.gschema.xml',
+  configuration: gsettings_conf,
+  install: true,
+  install_dir: join_paths(data_dir, 'glib-2.0', 'schemas'),
+)
diff --git a/help/meson.build b/help/meson.build
new file mode 100644
index 0000000..09aa9f2
--- /dev/null
+++ b/help/meson.build
@@ -0,0 +1,53 @@
+help_files = [
+  'clipboard.page',
+  'connect.page',
+  'continuous.page',
+  'create.page',
+  'delete.page',
+  'disk-images.page',
+  'index.page',
+  'interface.page',
+  'keystrokes.page',
+  'legal.xml',
+  'prop-system.page',
+  'prop-trouble.page',
+  'search.page',
+  'shortcuts.page',
+  'shutdown.page',
+  'snapshot-create.page',
+  'snapshot-delete.page',
+  'snapshot-rename.page',
+  'snapshot-revert.page',
+  'supported-protocols.page',
+  'system-requirements.page',
+  'usb-redirection.page',
+  'virtualization.page',
+  'what-is-a-virtual-machine.page',
+  'why-do-i-need-virtual-machine.page',
+]
+
+help_media = [
+  'figures/boxes_icon.png',
+  'figures/input-keyboard-symbolic.svg',
+  'figures/open-menu-symbolic.svg'
+]
+
+help_linguas = [
+  'cs',
+  'de',
+  'el',
+  'es',
+  'fr',
+  'hu',
+  'it',
+  'ko',
+  'pt_BR',
+  'sv'
+]
+
+gnome.yelp (meson.project_name (),
+            sources: help_files,
+            media: help_media,
+            languages: help_linguas,
+            symlink_media: true,
+)
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..c7a4b95
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,75 @@
+project ('gnome-boxes',
+         ['vala', 'c'],
+         version: '3.25.2',
+         license: 'GPL2+',
+         meson_version: '>= 0.37',
+)
+
+gnome = import ('gnome')
+i18n = import ('i18n')
+
+glib = dependency ('glib-2.0', version: '>= 2.44')
+gio = dependency ('gio-2.0', version: '>= 2.44')
+gobject = dependency ('gobject-2.0', version: '>= 2.44')
+govirt = dependency ('govirt-1.0', version: '>= 0.3.4')
+gtk = dependency ('gtk+-3.0', version: '>= 3.19.8')
+gtk_vnc = dependency ('gtk-vnc-2.0', version: '>= 0.4.4')
+libsecret = dependency ('libsecret-1')
+libvirt_glib = dependency ('libvirt-gobject-1.0', version: '>= 0.2.0')
+libvirt_gconfig = dependency ('libvirt-gconfig-1.0', version: '>= 0.2.0')
+libxml = dependency ('libxml-2.0', version: '>= 2.7.8')
+libusb = dependency ('libusb-1.0', version: '>= 1.0.9')
+spice_client_gtk = dependency ('spice-client-gtk-3.0', version: '>= 0.32')
+gudev = dependency ('gudev-1.0', version: '>= 165')
+libosinfo = dependency ('libosinfo-1.0', version: '>= 0.2.12')
+libsoup = dependency ('libsoup-2.4', version: '>= 2.38')
+libarchive = dependency ('libarchive', version: '>= 3.0.0')
+tracker = dependency ('tracker-sparql-1.0')
+
+cc = meson.get_compiler ('c')
+
+libgd = subproject (
+  'libgd',
+  default_options: [
+    'static=true',
+    'with-gtk-hacks=true',
+    'with-main-view=true',
+    'with-view-common=true',
+    'with-introspection=true',
+    'with-vapi=true',
+    'pkgdatadir=' + get_option ('datadir'),
+    'pkglibdir=' + get_option ('datadir'),
+  ],
+)
+libgd_dep = libgd.get_variable ('libgd_dep')
+
+msgfmt = find_program ('msgfmt')
+
+po_dir = join_paths (meson.source_root (), 'po')
+data_dir = join_paths (get_option ('prefix'), get_option ('datadir'))
+locale_dir = join_paths (data_dir, '/locale')
+
+#conf = configuration_data ()
+#conf.set_quoted ('G_LOG_DOMAIN', 'org.gnome.Boxes')
+#conf.set_quoted ('PACKAGE_NAME', meson.project_name ())
+#conf.set_quoted ('PACKAGE_VERSION', meson.project_version ())
+#conf.set_quoted ('VERSION', meson.project_version ())
+#conf.set_quoted ('GETTEXT_PACKAGE', meson.project_name ())
+#conf.set_quoted ('DATADIR', data_dir)
+#conf.set_quoted ('GNOMELOCALEDIR', locale_dir)
+
+#configure_file (output: 'config.h', configuration: conf)
+config_h_dir = include_directories ('.')
+
+# meson.add_install_script ?
+
+run_target ('release',
+            command: [
+                join_paths ('build_aux', 'release.sh'),
+                meson.project_name (), meson.project_version ()
+           ])
+
+subdir ('data')
+subdir ('help')
+subdir ('po')
+subdir ('src')
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..b2e9e42
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext (meson.project_name (), preset: 'glib')
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..971e629
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,138 @@
+vala_sources = [
+  'app.vala',
+  'app-window.vala',
+  'actions-popover.vala',
+  'archive-reader.vala',
+  'archive-writer.vala',
+  'auth-notification.vala',
+  'collection.vala',
+  'collection-filter-switcher.vala',
+  'collection-toolbar.vala',
+  'display-page.vala',
+  'display-toolbar.vala',
+  'display.vala',
+  'editable-entry.vala',
+  'i-properties-provider.vala',
+  'i-collection-view.vala',
+  'icon-view.vala',
+  'installer-media.vala',
+  'installed-media.vala',
+  'keys-input-popover.vala',
+  'libvirt-cloned-media.vala',
+  'libvirt-media.vala',
+  'iso-extractor.vala',
+  'libvirt-broker.vala',
+  'libvirt-machine.vala',
+  'libvirt-machine-properties.vala',
+  'list-view.vala',
+  'list-view-row.vala',
+  'machine.vala',
+  'machine-thumbnailer.vala',
+  'main.vala',
+  'media-manager.vala',
+  'resource-graph.vala',
+  'notification.vala',
+  'notificationbar.vala',
+  'os-database.vala',
+  'ovirt-broker.vala', # FIXME: only if HAVE_OVIRT 
+  'ovirt-machine.vala', # SAME
+  'properties.vala',
+  'properties-window.vala',
+  'properties-page-widget.vala',
+  'properties-toolbar.vala',
+  'remote-machine.vala',
+  'searchbar.vala',
+  'selectionbar.vala',
+  'selection-toolbar.vala',
+  'spice-display.vala',
+  'topbar.vala',
+  'ui.vala',
+  'unattended-installer.vala',
+  'unattended-file.vala',
+  'unattended-setup-box.vala',
+  'util-app.vala',
+  'vm-configurator.vala',
+  'vm-creator.vala',
+  'vm-importer.vala',
+  'libvirt-system-importer.vala',
+  'libvirt-vm-cloner.vala',
+  'libvirt-vm-importer.vala',
+  'vnc-display.vala',
+  'wizard-window.vala',
+  'wizard-source.vala',
+  'wizard-toolbar.vala',
+  'wizard.vala',
+  'downloader.vala',
+  'empty-boxes.vala',
+  'tracker-iso-query.vala',
+  'troubleshoot-log.vala',
+  'snapshot-list-row.vala',
+  'snapshots-property.vala',
+]
+
+boxes_sources = [
+  vala_sources,
+  resources
+]
+
+vala_args = [
+  '--enable-experimental',
+  '--target-glib', '2.44',
+  '--vapidir', meson.current_source_dir (),
+  '--vapidir', join_paths (meson.source_root (), 'subprojects', 'libgd'),
+  '--vapidir', join_paths (meson.source_root (), 'vapi'),
+  '--vapidir', join_paths (meson.source_root (), 'vapi', 'upstream'),
+  '--pkg', 'config',
+  '--pkg', 'common',
+  '--pkg', 'gd-1.0',
+  '--pkg', 'gdk-pixbuf-2.0',
+  '--pkg', 'gio-2.0-workaround',
+  '--pkg', 'glib-2.0',
+  '--pkg', 'gtk-vnc-2.0',
+  '--pkg', 'gudev-1.0',
+  '--pkg', 'libarchive',
+  '--pkg', 'libsecret-1',
+  '--pkg', 'libsoup-2.4',
+  '--pkg', 'libosinfo-1.0',
+  '--pkg', 'libvirt-gconfig-1.0',
+  '--pkg', 'libvirt-gobject-1.0',
+  '--pkg', 'libxml-2.0',
+  '--pkg', 'posix',
+  '--pkg', 'linux',
+  '--pkg', 'govirt-1.0', # test
+  '--pkg', 'rest-0.7', #test
+  '--pkg', 'libusb-1.0',
+  '--pkg', 'spice-client-gtk-3.0',
+  '--pkg', 'tracker-sparql-1.0',
+  '--pkg', 'gmodule-2.0',
+  '--gresources', resource_files,
+]
+
+dependencies = [
+  glib,
+  gio,
+  gobject,
+  govirt,
+  gtk,
+  gtk_vnc,
+  libgd_dep,
+  libsecret,
+  libvirt_glib,
+  libvirt_gconfig,
+  libxml,
+  libusb,
+  spice_client_gtk,
+  gudev,
+  libosinfo,
+  libsoup,
+  libarchive,
+  tracker,
+]
+
+executable ('gnome-boxes', boxes_sources,
+            include_directories: config_h_dir,
+            vala_args: vala_args,
+            c_args : [ '-DVERSION="' + meson.project_version() + '"', '-DGETTEXT_PACKAGE="gnome-usage"', 
'-DGNOMELOCALEDIR="' + get_option('prefix') + '/' + get_option('localedir') + '"', join_paths 
(meson.source_root(), 'subprojects', 'libgd') ],
+            dependencies: dependencies,
+            install: true
+)


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