Fix #1215: Unable to build with webp-pixbuf-loader on non-Debian systems
authorColin Clark <colin.clark@cclark.uk>
Wed, 20 Dec 2023 13:06:28 +0000 (13:06 +0000)
committerColin Clark <colin.clark@cclark.uk>
Wed, 20 Dec 2023 13:06:28 +0000 (13:06 +0000)
https://github.com/BestImageViewer/geeqie/issues/1215

Include check for pacman.

I assume that DNF is still a problem.

meson.build

index 056a20f..a77a108 100644 (file)
@@ -537,16 +537,26 @@ else
 endif
 
 webp_pixbuf_loader_version = '0.0'
-webp_pixbuf_loader_subproject = 'disabled'
 option = get_option('webp-pixbuf-loader')
 if not option.disabled()
     cmd = find_program('dpkg-query', required: false)
     if cmd.found()
-        dpkg_res = run_command(cmd, '--show', 'webp-pixbuf-loader', check: false)
+        pkg_res = run_command(cmd, '--show', 'webp-pixbuf-loader', check: false)
+    endif
+
+    if not cmd.found()
+               cmd = find_program('pacman', required: false)
+        if cmd.found()
+            pkg_res = run_command(cmd, '-Q', 'webp-pixbuf-loader', check: false)
+        endif
+    endif
 
-        if dpkg_res.returncode() == 0
-            dpkg_list = dpkg_res.stdout().split()
-            webp_pixbuf_loader_version = dpkg_list.get(1)
+       if cmd.found()
+        if pkg_res.returncode() == 0
+            pkg_list = pkg_res.stdout().split()
+            px = pkg_list.get(1)
+            pkg_list2 = px.split('-')
+            webp_pixbuf_loader_version= pkg_list.get(1).split('-').get(0)
         endif
 
         # Loader version 0.2.1 is OK. Versions 0.2.2 to 0.2.4 need patching via a subproject
@@ -579,7 +589,7 @@ if not option.disabled()
             endif
         endif
     else
-        summary({'webp_pixbuf_loader' : ['dpkg not found - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
+        summary({'webp_pixbuf_loader' : ['dpkg or pacman not found - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
     endif
 else
     summary({'webp_pixbuf_loader' : ['disabled - webp files supported:', false]}, section : 'Configuration', bool_yn : true)