[grilo-plugins/ebassi/subproject-variables: 1/2] build: Fix libsoup dependency detection




commit 4e6ee4a62cea9cbf3463656c5d43fe25e79b587d
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Sep 27 14:36:16 2022 +0100

    build: Fix libsoup dependency detection
    
    The current check fails in multiple ways:
    
    - the variable 'soupapiversion' needs to be checked in the pkg-config
      file; using get_variable() will only check inside the dependency's
      build system when used as a subproject
    - grilo does not have a variable named 'soupapiversion' anyway; it's
      called 'soup_api_version'
    - this is far from being idiomatic Meson
    
    We need to split the check into two:
    
    - check for pkg-config variables when using a system dependency
    - check for a variable in the internal dependency when using grilo as a
      subproject
    
    In order to make this work we are going to need the following MR in
    Grilo:
    
      https://gitlab.gnome.org/GNOME/grilo/-/merge_requests/95

 meson.build | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index dce2069a..0408142d 100644
--- a/meson.build
+++ b/meson.build
@@ -57,7 +57,11 @@ gom_dep = dependency('gom-1.0', version: '>= 0.4', required: false)
 grilo_net_dep = dependency('grilo-net-0.3', version: '>= 0.3.0', required: false,
                            fallback: ['grilo', 'libgrlnet_dep'])
 if grilo_net_dep.found()
-  soup_api_version = grilo_net_dep.get_variable('soupapiversion', default_value: '2.4')
+  soup_api_version = grilo_net_dep.get_variable(
+      pkgconfig: 'soupapiversion',
+      internal: 'soupapiversion',
+      default_value: '2.4',
+  )
 else
   soup_api_version = '2.4'
 endif


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