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



commit fbade0f1ddeb09be280cfc0fd89bb2496f08574b
Author: Zeeshan Ali <zeenix gmail com>
Date:   Mon Oct 10 15:49:55 2016 +0200

    Port to meson
    
    This is a WIP patch to port the build system to meson. For now you can
    build our two binaries but they crash on startup. Also this patches uses
    some workarounds, which I would rather not use. One particular very
    annoying workaround is that you need to first separately build
    'libgd/gd-1.0.vapi target' first since meson is not picking up the right
    dependencies.

 Makefile.am       |   90 ----------------------
 autogen.sh        |   13 +++-
 configure.ac      |  213 -----------------------------------------------------
 libgd             |    2 +-
 meson.build       |   66 ++++++++++++++++
 meson_options.txt |   21 +++++
 src/Makefile.am   |  201 --------------------------------------------------
 src/meson.build   |  173 +++++++++++++++++++++++++++++++++++++++++++
 8 files changed, 271 insertions(+), 508 deletions(-)
---
diff --git a/autogen.sh b/autogen.sh
index 5b679c9..15fa919 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -8,11 +8,18 @@ test -z "$srcdir" && srcdir=.
 olddir=`pwd`
 
 cd "$srcdir"
+mkdir subprojects
+cd subprojects
 git submodule update --init --recursive
-autoreconf -v --force --install
-intltoolize -f
 
 cd "$olddir"
+
 if [ -z "$NOCONFIGURE" ]; then
-    "$srcdir"/configure --enable-maintainer-mode --enable-vala --enable-debug ${1+"$@"}
+    mkdir build
+    cd build
+    meson --enable-debug
+
+    cd "$olddir"
+
+    echo "Now run ninja (or ninja-build) in build director to build Boxes"
 fi
diff --git a/libgd b/libgd
index 752f65e..6c7e8e9 160000
--- a/libgd
+++ b/libgd
@@ -1 +1 @@
-Subproject commit 752f65e91ea0d9a2ee8a2d21343bbd97bd0d038a
+Subproject commit 6c7e8e90f82af621c461e5d869e943dcb3a14f21
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..a8b452e
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,66 @@
+#
+# Copyright (c) 2016 Pelagicore AB.
+#
+# Author: Zeeshan Ali <zeeshanak gnome org>
+#
+project('gnome-boxes', 'vala', 'c', version: '3.23.1')
+
+cc = meson.get_compiler('c')
+conf = configuration_data()
+
+#check_headers = [
+#    ['HAVE_DLFCN_H', 'dlfcn.h'],
+#    ['HAVE_INTTYPES_H', 'inttypes.h'],
+#    ['HAVE_MEMORY_H', 'memory.h'],
+#    ['HAVE_STDINT_H', 'stdint.h'],
+#    ['HAVE_STDLIB_H', 'stdlib.h'],
+#    ['HAVE_STRINGS_H', 'strings.h'],
+#    ['HAVE_STRING_H', 'string.h'],
+#    ['HAVE_SYS_STAT_H', 'sys/stat.h'],
+#    ['HAVE_SYS_TYPES_H', 'sys/types.h'],
+#    ['HAVE_UNISTD_H', 'unistd.h'],
+#]
+#
+#foreach h : check_headers
+#    if cc.has_header(h.get(1))
+#        conf.set(h.get(0), 1)
+#    endif
+#endforeach
+
+boxes_version = meson.project_version()
+conf.set('VERSION', '"' + boxes_version + '"')
+conf.set('PACKAGE_VERSION', '"' + boxes_version + '"')
+conf.set('PACKAGE_NAME', '"gnome-boxes"')
+conf.set('GETTEXT_PACKAGE', '"gnome-boxes"')
+conf.set('PACKAGE_TARNAME', '"gnome-boxes"')
+conf.set('PACKAGE_STRING', '"gnome-boxes ' + boxes_version + '"')
+conf.set('PACKAGE_URL', '"https://wiki.gnome.org/Apps/Boxes";')
+conf.set('PACKAGE_BUGREPORT', '"https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-boxes";')
+
+if get_option('strict-cc')
+    add_global_arguments('-Wall -Werror', language: 'c')
+endif
+
+if get_option('debug')
+    add_global_arguments('-O0 -ggdb3', language: 'c')
+    add_global_arguments('-g', language: 'vala')
+endif
+
+configure_file(output : 'config.h', configuration : conf)
+
+libgd_gtk_hacks = true
+libgd_main_view = true
+libgd_main_icon_view = true
+libgd_notification = true
+libgd_static = true
+libgd_vapi = true
+subdir('libgd')
+
+#subdir('data')
+#subdir('help')
+subdir('src')
+#subdir('po')
+#subdir('vapi')
+
+# MOVE TO data subdir
+#data/org.gnome.Boxes.desktop.in
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..85f03b7
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,21 @@
+option('strict-cc',
+       type:        'boolean',
+       value:       false,
+       description: 'Enable strict C compiler')
+
+option('debug',
+       type:        'boolean',
+       value:       false,
+       description: 'Enable debugging')
+
+option('enable-ovirt',
+       type:        'combo',
+       choices:     ['yes', 'no', 'auto'],
+       value:       'auto',
+       description: 'Enable oVirt')
+
+option('enable-installed-tests',
+       type:        'boolean',
+       value:       true,
+       description: 'Enable installed tests')
+
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..4e25ae3
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,173 @@
+#
+# Copyright (c) 2016 Pelagicore AB.
+#
+# Author: Zeeshan Ali <zeeshanak gnome org>
+#
+
+glib_min_version = '2.38.0'
+
+deps = [ dependency('glib-2.0', version: '>= ' + glib_min_version),
+         dependency('gio-2.0', version: '>= ' + glib_min_version),
+         dependency('gobject-introspection-1.0', version: '>= 0.9.6'),
+         dependency('gtk+-3.0', version: '>= 3.19.8'),
+         dependency('gtk-vnc-2.0', version: '>= 0.4.4'),
+         dependency('libvirt-gobject-1.0', version: '>= 0.2.3'),
+         dependency('libvirt-gconfig-1.0', version: '>= 0.2.0'),
+         dependency('libxml-2.0', version: '>= 2.7.8'),
+         dependency('libusb-1.0', version: '>= 1.0.9'),
+         dependency('spice-client-gtk-3.0', version: '>= 0.27'),
+         dependency('gudev-1.0', version: '>= 165'),
+         dependency('libosinfo-1.0', version: '>= 0.2.12'),
+#         dependency('uuid', version: '>= 1.41.3'),
+         dependency('libsoup-2.4', version: '>= 2.38'),
+         dependency('libarchive', version: '>= 3.0.0'),
+         dependency('tracker-sparql-1.0', version: '>= 0.13.1'),
+         dependency('gmodule-2.0'),
+         dependency('rest-0.7'),
+         libgd_dep ]
+
+include_dirs = include_directories(meson.source_root() + '/libgd')
+
+source_datadir = meson.source_root() + '/data'
+resources_file = source_datadir + '/gnome-boxes.gresource.xml'
+gresources = gnome.compile_resources('gnome-boxes.gresource',
+                                     resources_file,
+                                     source_dir: source_datadir)
+
+datadir = get_option('prefix') + '/' + get_option('datadir')
+
+vala_args = ['--pkg=config',
+             '--enable-experimental',
+             '--target-glib=' + glib_min_version,
+             # Should be covered by include_directories below & libgd_dep.
+             # See https://github.com/mesonbuild/meson/issues/906
+             '--vapidir=' + meson.current_source_dir(),
+             '--vapidir=' + meson.build_root(),
+             '--vapidir=' + meson.source_root() + '/vapi',
+             '--vapidir=' + meson.source_root() + '/vapi/upstream',
+             '--pkg=posix',
+             '--pkg=linux',
+             '--pkg=gd-1.0',
+             '--pkg=gio-2.0-workaround' ]
+c_args = ['-DDATADIR="' + datadir + '"',
+          '-DGNOMELOCALEDIR="' + datadir + '/locale"',
+          '-DCACHEDIR="/var/cache/"',
+          '-DG_LOG_DOMAIN="Boxes"' ]
+
+include_dirs = include_directories(meson.source_root(),
+                                   meson.current_source_dir(),
+                                   meson.build_root() + '/libgd',
+                                   meson.source_root() + '/vapi',
+                                   meson.source_root() + '/vapi/upstream')
+
+common_sources = [ 'async-launcher.vala',
+                   'box-config.vala',
+                   'collection-source.vala',
+                   'util.vala' ]
+
+search_provider_sources = common_sources + [
+                          'gnome-boxes-search-provider.vala' ]
+executable('gnome-boxes-search-provider',
+           search_provider_sources,
+           dependencies: deps,
+           install: true,
+           install_dir: get_option('libexecdir'),
+           c_args: c_args,
+           vala_args: vala_args,
+           include_directories: include_dirs)
+
+boxes_sources = common_sources + [
+                gresources,
+                'actions-popover.vala',
+                'app.vala',
+                'app-window.vala',
+                'archive-reader.vala',
+                'archive-writer.vala',
+                'auth-notification.vala',
+                'collection-filter-switcher.vala',
+                'collection-toolbar.vala',
+                'collection.vala',
+                'display-page.vala',
+                'display-toolbar.vala',
+                'display.vala',
+                'downloader.vala',
+                'editable-entry.vala',
+                'empty-boxes.vala',
+                'i-collection-view.vala',
+                'icon-view.vala',
+                'installed-media.vala',
+                'installer-media.vala',
+                'i-properties-provider.vala',
+                'iso-extractor.vala',
+                'keys-input-popover.vala',
+                'libvirt-broker.vala',
+                'libvirt-cloned-media.vala',
+                'libvirt-machine-properties.vala',
+                'libvirt-machine.vala',
+                'libvirt-media.vala',
+                'libvirt-system-importer.vala',
+                'libvirt-vm-cloner.vala',
+                'libvirt-vm-importer.vala',
+                'list-view-row.vala',
+                'list-view.vala',
+                'machine-thumbnailer.vala',
+                'machine.vala',
+                'main.vala',
+                'media-manager.vala',
+                'notificationbar.vala',
+                'notification.vala',
+                'os-database.vala',
+                'properties-page-widget.vala',
+                'properties-toolbar.vala',
+                'properties.vala',
+                'properties-window.vala',
+                'remote-machine.vala',
+                'resource-graph.vala',
+                'searchbar.vala',
+                'selectionbar.vala',
+                'selection-toolbar.vala',
+                'snapshot-list-row.vala',
+                'snapshots-property.vala',
+                'spice-display.vala',
+                'topbar.vala',
+                'tracker-iso-query.vala',
+                'troubleshoot-log.vala',
+                'ui.vala',
+                'unattended-file.vala',
+                'unattended-installer.vala',
+                'unattended-setup-box.vala',
+                'util-app.vala',
+                'vm-configurator.vala',
+                'vm-creator.vala',
+                'vm-importer.vala',
+                'vnc-display.vala',
+                'wizard-source.vala',
+                'wizard-toolbar.vala',
+                'wizard.vala',
+                'wizard-window.vala' ]
+
+enable_ovirt = get_option('enable-ovirt')
+if enable_ovirt == 'yes'
+    deps += dependency('govirt-1.0', version: '>= 0.2.0')
+    ovirt = true
+elif enable_ovirt == 'auto'
+    ovirt_dep = dependency('govirt-1.0', required : false)
+    ovirt = ovirt_dep.found()
+    if ovirt
+        deps += ovirt_dep
+    endif
+else
+    ovirt = false
+endif
+
+if ovirt
+    boxes_sources += ['ovirt-broker.vala', 'ovirt-machine.vala' ]
+endif
+
+executable('gnome-boxes',
+           boxes_sources,
+           dependencies: deps,
+           install: true,
+           c_args: c_args,
+           vala_args: vala_args,
+           include_directories: include_dirs)
diff --git a/vapi/uuid.vapi b/vapi/uuid.vapi
new file mode 100644
index 0000000..e69de29


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