Fix #1002: New build-dependency xxd
authorColin Clark <colin.clark@cclark.uk>
Sat, 21 Jan 2023 16:38:37 +0000 (16:38 +0000)
committerColin Clark <colin.clark@cclark.uk>
Sat, 21 Jan 2023 16:38:37 +0000 (16:38 +0000)
https://github.com/BestImageViewer/geeqie/issues/1002

Include checks for xxd or xxdi.pl in meson.build. If neither exist,
disable color management.

meson.build

index d9f2e95..4552e8c 100644 (file)
@@ -168,13 +168,18 @@ lcms_dep = []
 req_version = '>=2.0'
 option = get_option('cms')
 if not option.disabled()
-    lcms_dep = dependency('lcms2', version : req_version, required : get_option('cms'))
-    if lcms_dep.found()
-        conf_data.set('HAVE_LCMS', 1)
-        conf_data.set('HAVE_LCMS2', 1)
-        summary({'cms' : ['color management supported:', true]}, section : 'Configuration', bool_yn : true)
+    xxd = find_program('xxd', 'xxdi.pl', required : false)
+    if xxd.found()
+        lcms_dep = dependency('lcms2', version : req_version, required : get_option('cms'))
+        if lcms_dep.found()
+            conf_data.set('HAVE_LCMS', 1)
+            conf_data.set('HAVE_LCMS2', 1)
+            summary({'cms' : ['color management supported:', true]}, section : 'Configuration', bool_yn : true)
+        else
+            summary({'cms' : ['lcms2' + req_version + ' not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
+        endif
     else
-        summary({'cms' : ['lcms2' + req_version + ' not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
+        summary({'cms' : ['xxd or xxdi.pl not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
     endif
 else
     summary({'cms' : ['disabled - color management supported:', false]}, section : 'Configuration', bool_yn : true)