[gnome-boxes] meson: Use meson's convention



commit db01f16c0f0c1db84519ccb487fedb0bf04fc62e
Author: Iñigo Martínez <inigomartinez gmail com>
Date:   Fri Dec 22 09:52:55 2017 +0100

    meson: Use meson's convention
    
    The convention when naming dependencies is to use the '_dep' suffix,
    which helps detecting dependency variables. The variables have been
    renamed to follow this convention.
    
    The dependencies that are also used once, are declared in the
    target's dependency array which helps meson processing less and also
    one less variable is needed.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=791421

 meson.build     |   28 ++++------------------------
 src/meson.build |   54 +++++++++++++++++++++++++++---------------------------
 2 files changed, 31 insertions(+), 51 deletions(-)
---
diff --git a/meson.build b/meson.build
index ede09fe..30ccac8 100644
--- a/meson.build
+++ b/meson.build
@@ -11,33 +11,13 @@ i18n = import ('i18n')
 cc = meson.get_compiler ('c')
 valac = meson.get_compiler ('vala')
 
-glib = dependency ('glib-2.0', version: '>= 2.38.0')
-gio = dependency ('gio-2.0', version: '>= 2.38.0')
-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')
-gudev = dependency ('gudev-1.0', version: '>= 165')
-libarchive = dependency ('libarchive', version: '>= 3.0.0')
-libosinfo = dependency ('libosinfo-1.0', version: '>= 1.1.0')
-libsecret = dependency ('libsecret-1')
-libsoup = dependency ('libsoup-2.4', version: '>= 2.38')
-libusb = dependency ('libusb-1.0', version: '>= 1.0.9')
-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')
-spice_client_gtk = dependency ('spice-client-gtk-3.0', version: '>= 0.32')
-tracker = dependency ('tracker-sparql-2.0')
-webkitgtk = dependency ('webkit2gtk-4.0')
+govirt_dep = dependency ('govirt-1.0', version: '>= 0.3.4')
+libarchive_dep = dependency ('libarchive', version: '>= 3.0.0')
 
 src_dir = join_paths (meson.source_root (), 'src')
 vapi_dir = join_paths (meson.source_root (), 'vapi')
 
-config = valac.find_library ('config', dirs: src_dir)
-gio_workaround = valac.find_library ('gio-2.0-workaround', dirs: vapi_dir)
-linux = valac.find_library ('linux')
-posix = valac.find_library ('posix')
-rest = valac.find_library ('rest-0.7')
+config_dep = valac.find_library ('config', dirs: src_dir)
 
 pkglibdir = join_paths (get_option ('libdir'), meson.project_name ())
 libgd = subproject (
@@ -72,7 +52,7 @@ conf.set_quoted ('CACHEDIR', '/var/cache')
 conf.set_quoted ('LOCALEDIR', locale_dir)
 conf.set('PACKAGE_BUGREPORT', '"https://bugzilla.gnome.org/enter_bug.cgi?product=gnome-boxes";')
 
-if govirt.found()
+if govirt_dep.found()
   conf.set10 ('HAVE_OVIRT', get_option ('ovirt'))
 endif
 
diff --git a/src/meson.build b/src/meson.build
index 28bf04d..46f6c55 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -14,10 +14,10 @@ vala_args = [
 ]
 
 common_dependencies = [
-  config,
-  glib,
-  gio,
-  libarchive,
+  config_dep,
+  libarchive_dep,
+  dependency ('gio-2.0', version: '>= 2.38.0'),
+  dependency ('glib-2.0', version: '>= 2.38.0')
 ]
 
 c_args = [
@@ -112,7 +112,7 @@ vala_sources = [
   'snapshots-property.vala',
 ]
 
-if govirt.found ()
+if govirt_dep.found ()
   if get_option ('ovirt')
     vala_sources += [
       'ovirt-broker.vala',
@@ -127,33 +127,33 @@ boxes_sources = [
 ]
 
 dependencies = [
-  config,
-  gio_workaround,
-  gobject,
-  gtk,
-  gtk_vnc,
+  config_dep,
+  libarchive_dep,
   libgd_dep,
   libgd_vapi_dep,
-  libsecret,
-  libvirt_glib,
-  libvirt_gconfig,
-  libxml,
-  libusb,
-  linux,
-  spice_client_gtk,
-  gudev,
-  libosinfo,
-  libsoup,
-  libarchive,
-  rest,
-  tracker,
-  posix,
-  webkitgtk,
+  dependency ('gobject-2.0', version: '>= 2.44'),
+  dependency ('gtk+-3.0', version: '>= 3.19.8'),
+  dependency ('gtk-vnc-2.0', version: '>= 0.4.4'),
+  dependency ('gudev-1.0', version: '>= 165'),
+  dependency ('libosinfo-1.0', version: '>= 1.1.0'),
+  dependency ('libsecret-1'),
+  dependency ('libsoup-2.4', version: '>= 2.38'),
+  dependency ('libusb-1.0', version: '>= 1.0.9'),
+  dependency ('libvirt-gconfig-1.0', version: '>= 0.2.0'),
+  dependency ('libvirt-gobject-1.0', version: '>= 0.2.0'),
+  dependency ('libxml-2.0', version: '>= 2.7.8'),
+  dependency ('spice-client-gtk-3.0', version: '>= 0.32'),
+  dependency ('tracker-sparql-2.0'),
+  dependency ('webkit2gtk-4.0'),
+  valac.find_library ('gio-2.0-workaround', dirs: vapi_dir),
+  valac.find_library ('linux'),
+  valac.find_library ('posix'),
+  valac.find_library ('rest-0.7')
 ]
 
-if govirt.found()
+if govirt_dep.found()
   if get_option ('ovirt')
-    dependencies += govirt
+    dependencies += govirt_dep
   endif
 endif
 


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