[simple-scan/wip/cdavis/consistency-updates: 8/13] build: Add libhandy as a subproject




commit a8fe5ac433a82ea74d8fcf80d3dc2578e1e0810d
Author: Christopher Davis <brainblasted disroot org>
Date:   Wed Feb 10 17:37:40 2021 -0800

    build: Add libhandy as a subproject
    
    This is required to make the native builds happy,
    as we require libhandy 1.1.0 which no distro ships yet.

 meson.build               | 22 +++++++++++++++++++++-
 subprojects/libhandy.wrap |  4 ++++
 2 files changed, 25 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index fb7507c7..223ece2a 100644
--- a/meson.build
+++ b/meson.build
@@ -23,7 +23,7 @@ glib_dep = dependency ('glib-2.0', version: '>= 2.38')
 gtk_dep = dependency ('gtk+-3.0', version: '>=3.22')
 gmodule_dep = dependency ('gmodule-export-2.0')
 gthread_dep = dependency ('gthread-2.0')
-libhandy_dep = dependency ('libhandy-1', version: '>=1.1.0')
+libhandy_dep = dependency ('libhandy-1', version: '>= 1.1.90', required: false)
 zlib_dep = dependency ('zlib')
 cairo_dep = dependency ('cairo')
 gdk_pixbuf_dep = dependency ('gdk-pixbuf-2.0')
@@ -36,6 +36,26 @@ sane_dep = dependency ('sane-backends')
 msgfmt = find_program  ('msgfmt')
 itstool = find_program  ('itstool')
 
+libhandy_subproj = libhandy_dep
+if not libhandy_dep.found()
+  libhandy_subproj = subproject(
+    'libhandy',
+    default_options: [
+      'examples=false',
+      'glade_catalog=disabled',
+      'tests=false',
+    ]
+  )
+
+  # When using libhandy as subproject, make sure we get the VAPI file
+  libhandy_dep = declare_dependency(
+    dependencies: [
+      libhandy_subproj.get_variable('libhandy_dep'),
+      libhandy_subproj.get_variable('libhandy_vapi'),
+    ]
+  )
+endif
+
 subdir ('po')
 subdir ('data')
 subdir ('help')
diff --git a/subprojects/libhandy.wrap b/subprojects/libhandy.wrap
new file mode 100644
index 00000000..a3806c8d
--- /dev/null
+++ b/subprojects/libhandy.wrap
@@ -0,0 +1,4 @@
+[wrap-git]
+directory=libhandy
+url=https://gitlab.gnome.org/GNOME/libhandy.git
+revision=origin/master


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