From 2f55f848197ef974a5d99e2107130a31e8066194 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Sun, 7 May 2023 11:51:14 +0100 Subject: [PATCH] Fix #1080: Cannot build with meson 0.56.2 https://github.com/BestImageViewer/geeqie/issues/1080 --- doc/meson.build | 4 ++-- meson.build | 20 ++++++++++++-------- po/meson.build | 2 +- src/meson.build | 2 +- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/doc/meson.build b/doc/meson.build index fe1c5863..11e7fa35 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -39,8 +39,8 @@ if running_from_git if not option.disabled() doxygen = find_program('doxygen', required : false) if doxygen.found() - srcdir = join_paths(meson.source_root()) - destdir = join_paths(meson.build_root(), 'doc', 'html', 'lua-api') + srcdir = join_paths(meson.project_source_root()) + destdir = join_paths(meson.project_build_root(), 'doc', 'html', 'lua-api') run_command(find_program('create-doxygen-lua-api.sh'), srcdir, destdir, check : false) summary({'lua-api' : ['lua-api help file created:', true]}, section : 'Documentation', bool_yn : true) else diff --git a/meson.build b/meson.build index 4fdb9520..b1642f91 100644 --- a/meson.build +++ b/meson.build @@ -44,7 +44,7 @@ project( 'cpp', version : run_command('./version.sh', check : true).stdout().strip(), license : ['GPL-2.0-or-later'], - meson_version : '>=0.53.0', + meson_version : '>=0.56.2', default_options : ['warning_level=3', 'buildtype=debugoptimized', 'cpp_link_args=-rdynamic'] ) @@ -140,8 +140,8 @@ htmldir = join_paths(prefix, gq_htmldir) icondir = join_paths(datadir, 'pixmaps') mandir1 = join_paths(datadir, 'man', 'man1') -podir = join_paths(meson.source_root(), 'po') -scriptsdir = join_paths(meson.source_root(), 'scripts') +podir = join_paths(meson.project_source_root(), 'po') +scriptsdir = join_paths(meson.project_source_root(), 'scripts') summary({'gq_appdir': gq_appdir, 'gq_bindir': gq_helpdir, @@ -536,13 +536,17 @@ endif # libpixbufloader-webp is not loaded as part of libgdk-pixbuf. Just issue # a warning if not installed -libwebp_dir = dependency('gdk-pixbuf-2.0', method: 'pkg-config').get_variable('gdk_pixbuf_moduledir') -libwebp_dep = cc.find_library('libpixbufloader-webp', dirs : libwebp_dir, required : false) +libwebp_dir = dependency('gdk-pixbuf-2.0', method: 'pkg-config').get_variable(pkgconfig: 'gdk_pixbuf_moduledir', internal: 'gdk_pixbuf_moduledir') -if libwebp_dep.found() - summary({'webp' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true) +if libwebp_dir.contains('loaders') + libwebp_dep = cc.find_library('pixbufloader-webp', dirs : libwebp_dir, required : false) + if libwebp_dep.found() + summary({'webp' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true) + else + summary({'webp' : ['webp-pixbuf-loader not installed - webp files supported:', false]}, section : 'Configuration', bool_yn : true) + endif else - summary({'webp' : ['webp-pixbuf-loader not installed - webp files supported:', false]}, section : 'Configuration', bool_yn : true) + summary({'webp' : ['webp-pixbuf-loader not installed - webp files supported:', false]}, section : 'Configuration', bool_yn : true) endif # Check for nl_langinfo and _NL_TIME_FIRST_WEEKDAY diff --git a/po/meson.build b/po/meson.build index 0e180e77..f6801e42 100644 --- a/po/meson.build +++ b/po/meson.build @@ -59,7 +59,7 @@ po_sources = files([ po_source_list = '' foreach name : po_sources - po_source_list = po_source_list + meson.source_root() + '/' + '@0@'.format(name) + '\n' + po_source_list = po_source_list + meson.project_source_root() + '/' + '@0@'.format(name) + '\n' endforeach translators_sh = join_paths(scriptsdir, 'translators.sh') diff --git a/src/meson.build b/src/meson.build index e381ceba..4b6a9a9b 100644 --- a/src/meson.build +++ b/src/meson.build @@ -257,7 +257,7 @@ ui_icons_h = custom_target('ui_icons', output : 'ui_icons.h', project_sources += ui_icons_h if conf_data.has('HAVE_LCMS') - xxd_sh = find_program('generate-ClayRGB1998-icc-h.sh', dirs : join_paths(meson.source_root(), 'scripts')) + xxd_sh = find_program('generate-ClayRGB1998-icc-h.sh', dirs : join_paths(meson.project_source_root(), 'scripts')) ClayRGB1998_icc_h = custom_target('ClayRGB1998', input: 'ClayRGB1998.icc', -- 2.20.1