[geary/mjog/1193-conversation-buttons-resize-race] build: Pull in libhandy as a submodule until 1.2.1 is packaged




commit 48e8a510cf75e9eb5f92166a9238c3ca538a5153
Author: Michael Gratton <mike vee net>
Date:   Tue Apr 13 19:08:39 2021 +1000

    build: Pull in libhandy as a submodule until 1.2.1 is packaged

 .gitlab-ci.yml       |  3 +++
 .gitmodules          |  0
 meson.build          | 22 +++++++++++++++++++++-
 org.gnome.Geary.json | 18 ++++++++++++++++++
 org.gnome.Geary.yaml | 13 +++++++++++++
 src/meson.build      |  9 ++++++++-
 6 files changed, 63 insertions(+), 2 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 2b02d93e3..4d54c00e0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,6 +17,7 @@ variables:
   # Build
   BUILD_DIR: build
   CONFIG_CMD: meson --buildtype=debug $BUILD_DIR
+  SUBPROJECT_CMD: meson subprojects download
   BUILD_CMD: ninja -v -C $BUILD_DIR
   TEST_CMD: xvfb-run meson test -v --no-stdsplit -C $BUILD_DIR $TEST_ARGS
   INSTALL_CMD: ninja -v -C $BUILD_DIR install
@@ -49,6 +50,7 @@ fedora:
     - dnf update -y --nogpgcheck
     - dnf install -y --nogpgcheck $FEDORA_DEPS $FEDORA_TEST_DEPS
   script:
+    - $SUBPROJECT_CMD
     - $CONFIG_CMD
     - $BUILD_CMD
     - $TEST_CMD
@@ -69,6 +71,7 @@ ubuntu:
     - apt-get install -q -y --no-install-recommends $UBUNTU_DEPS $UBUNTU_TEST_DEPS
     - locale-gen $TEST_LOCALE
   script:
+    - $SUBPROJECT_CMD
     - $CONFIG_CMD
     - $BUILD_CMD
     - $TEST_CMD
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..e69de29bb
diff --git a/meson.build b/meson.build
index 85ec18a4f..5d8269188 100644
--- a/meson.build
+++ b/meson.build
@@ -89,7 +89,7 @@ icu_uc = dependency('icu-uc', version: '>=60')
 iso_codes = dependency('iso-codes')
 javascriptcoregtk = dependency('javascriptcoregtk-4.0', version: '>=' + target_webkit)
 json_glib = dependency('json-glib-1.0', version: '>= 1.0')
-libhandy = dependency('libhandy-1', version: '>= 1.2.1')
+libhandy = dependency('libhandy-1', version: '>= 1.2.1', required: false)
 libmath = cc.find_library('m')
 libpeas = dependency('libpeas-1.0', version: '>= 1.24.0')
 libpeas_gtk = dependency('libpeas-gtk-1.0', version: '>= 1.24.0')
@@ -138,6 +138,26 @@ libstemmer = declare_dependency(
   ],
 )
 
+# Required until libhandy 1.2.1 is GA
+libhandy_vapi = ''
+if not libhandy.found()
+  libhandy_project = subproject(
+    'libhandy',
+    default_options: [
+      'examples=false',
+      'package_subdir=geary',
+      'tests=false',
+    ]
+  )
+  libhandy = declare_dependency(
+    dependencies: [
+      libhandy_project.get_variable('libhandy_dep'),
+      libhandy_project.get_variable('libhandy_vapi')
+    ]
+  )
+  libhandy_vapi = meson.build_root() / 'subprojects' / 'libhandy' / 'src'
+endif
+
 # Optional dependencies
 appstream_util = find_program('appstream-util', required: false)
 desktop_file_validate = find_program('desktop-file-validate', required: false)
diff --git a/org.gnome.Geary.json b/org.gnome.Geary.json
index 2d5565113..83c79872a 100644
--- a/org.gnome.Geary.json
+++ b/org.gnome.Geary.json
@@ -78,6 +78,24 @@
                 "/share"
             ]
         },
+        {
+            "name": "libhandy",
+            "buildsystem": "meson",
+            "config-opts": [
+                "-Dglade_catalog=disabled"
+            ],
+            "sources": [
+                {
+                    "type": "git",
+                    "url": "https://gitlab.gnome.org/GNOME/libhandy.git";,
+                    "branch": "master"
+                }
+            ],
+            "cleanup": [
+                "/bin",
+                "/share"
+            ]
+        },
         {
             "name": "libical",
             "buildsystem": "cmake-ninja",
diff --git a/org.gnome.Geary.yaml b/org.gnome.Geary.yaml
index c3908a89a..b7d06d525 100644
--- a/org.gnome.Geary.yaml
+++ b/org.gnome.Geary.yaml
@@ -111,6 +111,19 @@ modules:
       - /bin
       - /share
 
+  # Geary dependency
+  - name: libhandy
+    buildsystem: meson
+    config-opts:
+      - "-Dglade_catalog=disabled"
+    sources:
+      - type: git
+        url: "https://gitlab.gnome.org/GNOME/libhandy.git";
+        branch: master
+    cleanup:
+      - /bin
+      - /share
+
   # EDS dependency
   - name: libical
     buildsystem: cmake-ninja
diff --git a/src/meson.build b/src/meson.build
index d2b018038..a67336af2 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -139,6 +139,9 @@ valadoc_vapi_dirs = [
   vapi_dir,
   meson.current_build_dir()
 ]
+if libhandy_vapi != ''
+  valadoc_vapi_dirs += libhandy_vapi
+endif
 
 # Hopefully Meson will get baked-in valadoc support, so we don't have
 # to resort to these kinds of hacks any more. See
@@ -147,7 +150,11 @@ valadoc_vapi_dirs = [
 valadoc_dep_args = []
 foreach dep : valadoc_dependencies
   valadoc_dep_args += '--pkg'
-  valadoc_dep_args += dep.name()
+  if dep != libhandy
+    valadoc_dep_args += dep.name()
+  else
+    valadoc_dep_args += 'libhandy-1'
+  endif
 endforeach
 valadoc_dep_args += [ '--pkg', 'icu-uc' ]
 valadoc_dep_args += [ '--pkg', 'libstemmer' ]


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