From cf97ea3ea1209307d186ed2299f9015526423a11 Mon Sep 17 00:00:00 2001 From: Kleis Auke Wolthuizen Date: Fri, 29 Jul 2022 12:09:51 +0200 Subject: [PATCH] Deduplicate `--vips-config` with the build summary (#2957) * Deduplicate `--vips-config` with the build summary * Ensure output is identical Helps parses. --- libvips/include/vips/meson.build | 56 +++++------------ meson.build | 105 ++++++++++++++++--------------- 2 files changed, 67 insertions(+), 94 deletions(-) diff --git a/libvips/include/vips/meson.build b/libvips/include/vips/meson.build index 5eaabdcc..426d637c 100644 --- a/libvips/include/vips/meson.build +++ b/libvips/include/vips/meson.build @@ -84,48 +84,20 @@ enumtypes = gnome.mkenums( ) vips_verbose_config = [] -vips_verbose_config += 'enable debug: @0@'.format(get_option('debug')) -vips_verbose_config += 'enable deprecated: @0@'.format(get_option('deprecated')) -vips_verbose_config += 'enable modules: @0@'.format(modules_enabled) -vips_verbose_config += 'enable RAD load/save: @0@'.format(get_option('radiance')) -vips_verbose_config += 'enable Analyze7 load/save: @0@'.format(get_option('analyze')) -vips_verbose_config += 'enable PPM load/save: @0@'.format(get_option('ppm')) -vips_verbose_config += 'enable GIF load: @0@'.format(get_option('nsgif')) -vips_verbose_config += 'use fftw for FFTs: @0@'.format(fftw_dep.found()) -vips_verbose_config += 'accelerate loops with ORC: @0@'.format(orc_dep.found()) -vips_verbose_config += 'ICC profile support with lcms: @0@'.format(lcms_dep.found()) -vips_verbose_config += 'zlib: @0@'.format(zlib_dep.found()) -vips_verbose_config += 'text rendering with pangocairo: @0@'.format(pangocairo_dep.found()) -vips_verbose_config += 'font file support with fontconfig: @0@'.format(fontconfig_found) -vips_verbose_config += 'EXIF metadata support with libexif: @0@'.format(libexif_dep.found()) -vips_verbose_config += 'JPEG load/save with libjpeg: @0@'.format(libjpeg_dep.found()) -vips_verbose_config += 'JXL load/save with libjxl: @0@ (dynamic module: @1@)'.format(libjxl_found, libjxl_module) -vips_verbose_config += 'JPEG2000 load/save with OpenJPEG: @0@'.format(libopenjp2_dep.found()) -vips_verbose_config += 'PNG load/save with libspng: @0@'.format(spng_found) -vips_verbose_config += 'PNG load/save with libpng: @0@'.format(png_dep.found()) -vips_verbose_config += 'selected quantisation package: @0@'.format(quantisation_package.found() ? quantisation_package.name() : 'none') -vips_verbose_config += 'TIFF load/save with libtiff: @0@'.format(libtiff_dep.found()) -vips_verbose_config += 'image pyramid save with libgsf: @0@'.format(gsf_dep.found()) -vips_verbose_config += 'HEIC/AVIF load/save with libheif: @0@ (dynamic module: @1@)'.format(libheif_dep.found(), libheif_module) -vips_verbose_config += 'WebP load/save with libwebp: @0@'.format(libwebp_dep.found()) -vips_verbose_config += 'PDF load with PDFium: @0@'.format(pdfium_dep.found()) -vips_verbose_config += 'PDF load with poppler-glib: @0@ (dynamic module: @1@)'.format(libpoppler_found, libpoppler_module) -vips_verbose_config += 'SVG load with librsvg: @0@'.format(librsvg_found) -vips_verbose_config += 'EXR load with OpenEXR: @0@'.format(openexr_dep.found()) -vips_verbose_config += 'OpenSlide load: @0@ (dynamic module: @1@)'.format(openslide_dep.found(), openslide_module) -vips_verbose_config += 'Matlab load with libmatio: @0@'.format(matio_dep.found()) -vips_verbose_config += 'NIfTI load/save with niftiio: @0@'.format(libnifti_dep.found()) -vips_verbose_config += 'FITS load/save with cfitsio: @0@'.format(cfitsio_dep.found()) -vips_verbose_config += 'GIF save with cgif: @0@'.format(cgif_dep.found()) -vips_verbose_config += 'selected Magick package: @0@ (dynamic module: @1@)'.format(magick_found ? magick_dep.name() : 'none', magick_module) -if magick_dep.found() - magick_version_str = 'magick' + magick_dep.version().split('.')[0] -else - magick_version_str = 'none' -endif -vips_verbose_config += 'Magick API version: @0@'.format(magick_version_str) -vips_verbose_config += 'Magick load: @0@'.format(magick_found and 'load' in get_option('magick-features')) -vips_verbose_config += 'Magick save: @0@'.format(magick_found and 'save' in get_option('magick-features')) +foreach _, section : build_summary + foreach key, arr : section + if key.contains('gtk-doc') or \ + key.contains('doxygen') or \ + key.contains('introspection') + continue + endif + + vips_verbose_config += '@0@: @1@@2@@3@@4@'.format(key, arr[0], + arr.length() > 1 ? arr[1] : '', + arr.length() > 2 ? arr[2] : '', + arr.length() > 3 ? arr[3] : '') + endforeach +endforeach version_data = configuration_data() version_data.set('VIPS_VERSION', meson.project_version()) diff --git a/meson.build b/meson.build index f18bc24b..3f2a627f 100644 --- a/meson.build +++ b/meson.build @@ -624,6 +624,59 @@ config_dep = declare_dependency( libvips_deps += config_dep +build_summary = { + 'Build options': + {'enable debug': [get_option('debug')], + 'enable deprecated': [get_option('deprecated')], + 'enable modules': [modules_enabled], + 'enable gtk-doc': [get_option('gtk_doc')], + 'enable doxygen': [get_option('doxygen')], + 'enable introspection': [get_option('introspection')], + 'enable RAD load/save': [get_option('radiance')], + 'enable Analyze7 load/save': [get_option('analyze')], + 'enable PPM load/save': [get_option('ppm')], + 'enable GIF load': [get_option('nsgif')], + }, + 'Optional external packages': + {'use fftw for FFTs': [fftw_dep.found()], + 'accelerate loops with ORC': [orc_dep.found()], + 'ICC profile support with lcms': [lcms_dep.found()], + 'zlib': [zlib_dep.found()], + 'text rendering with pangocairo': [pangocairo_dep.found()], + 'font file support with fontconfig': [fontconfig_found], + 'EXIF metadata support with libexif': [libexif_dep.found()], + }, + 'External image format libraries': + {'JPEG load/save with libjpeg': [libjpeg_dep.found()], + 'JXL load/save with libjxl': [libjxl_found, ' (dynamic module: ', libjxl_module, ')'], + 'JPEG2000 load/save with OpenJPEG': [libopenjp2_dep.found()], + 'PNG load/save with libspng': [spng_found], + 'PNG load/save with libpng': [png_dep.found()], + 'selected quantisation package': [quantisation_package.found() ? quantisation_package.name() : 'none'], + 'TIFF load/save with libtiff': [libtiff_dep.found()], + 'image pyramid save with libgsf': [gsf_dep.found()], + 'HEIC/AVIF load/save with libheif': [libheif_dep.found(), ' (dynamic module: ', libheif_module, ')'], + 'WebP load/save with libwebp': [libwebp_dep.found()], + 'PDF load with PDFium': [pdfium_dep.found()], + 'PDF load with poppler-glib': [libpoppler_found, ' (dynamic module: ', libpoppler_module, ')'], + 'SVG load with librsvg': [librsvg_found], + 'EXR load with OpenEXR': [openexr_dep.found()], + 'OpenSlide load': [openslide_dep.found(), ' (dynamic module: ', openslide_module, ')'], + 'Matlab load with libmatio': [matio_dep.found()], + 'NIfTI load/save with niftiio': [libnifti_dep.found()], + 'FITS load/save with cfitsio': [cfitsio_dep.found()], + 'GIF save with cgif': [cgif_dep.found()], + 'selected Magick package': [magick_found ? magick_dep.name() : 'none', ' (dynamic module: ', magick_module, ')'], + 'Magick API version': [magick_found ? 'magick' + magick_dep.version().split('.')[0] : 'none'], + 'Magick load': [magick_found and 'load' in get_option('magick-features')], + 'Magick save': [magick_found and 'save' in get_option('magick-features')], + }, +} + +foreach section_title, section : build_summary + summary(section, bool_yn: true, list_sep: '', section: section_title) +endforeach + subdir('libvips') if get_option('gtk_doc') subdir('doc') @@ -634,55 +687,3 @@ subdir('po') subdir('tools') subdir('test') subdir('fuzz') - -build_summary = { - 'Build options': - {'enable debug': get_option('debug'), - 'enable deprecated': get_option('deprecated'), - 'enable modules': modules_enabled, - 'enable gtk-doc': get_option('gtk_doc'), - 'enable doxygen': get_option('doxygen'), - 'enable introspection': get_option('introspection'), - 'enable RAD load/save': get_option('radiance'), - 'enable Analyze7 load/save': get_option('analyze'), - 'enable PPM load/save': get_option('ppm'), - 'enable GIF load': get_option('nsgif'), - }, - 'Optional external packages': - {'use fftw for FFTs': fftw_dep.found(), - 'accelerate loops with ORC': orc_dep.found(), - 'ICC profile support with lcms': lcms_dep.found(), - 'zlib': zlib_dep.found(), - 'text rendering with pangocairo': pangocairo_dep.found(), - 'font file support with fontconfig': fontconfig_found, - 'EXIF metadata support with libexif ': libexif_dep.found(), - }, - 'External image format libraries': - {'JPEG load/save with libjpeg': libjpeg_dep.found(), - 'JXL load/save with libjxl': [libjxl_found, libjxl_module ? ' (dynamic module)' : ''], - 'JPEG2000 load/save with OpenJPEG': libopenjp2_dep.found(), - 'PNG load/save with libspng': spng_found, - 'PNG load/save with libpng': png_dep.found(), - 'selected quantisation package': quantisation_package.found() ? quantisation_package.name() : 'none', - 'TIFF load/save with libtiff': libtiff_dep.found(), - 'image pyramid save with libgsf': gsf_dep.found(), - 'HEIC/AVIF load/save with libheif': [libheif_dep.found(), libheif_module ? ' (dynamic module)' : ''], - 'WebP load/save with libwebp': libwebp_dep.found(), - 'PDF load with PDFium': pdfium_dep.found(), - 'PDF load with poppler-glib': [libpoppler_found, libpoppler_module ? ' (dynamic module)' : ''], - 'SVG load with librsvg': librsvg_found, - 'EXR load with OpenEXR': openexr_dep.found(), - 'OpenSlide load': [openslide_dep.found(), openslide_module ? ' (dynamic module)' : ''], - 'Matlab load with libmatio': matio_dep.found(), - 'NIfTI load/save with niftiio': libnifti_dep.found(), - 'FITS load/save with cfitsio': cfitsio_dep.found(), - 'GIF save with cgif': cgif_dep.found(), - 'selected Magick package': [magick_found ? magick_dep.name() : 'none', magick_module ? ' (dynamic module)' : ''], - 'Magick load': magick_found and 'load' in get_option('magick-features'), - 'Magick save': magick_found and 'save' in get_option('magick-features'), - }, -} - -foreach section_title, section : build_summary - summary(section, bool_yn: true, list_sep: '', section: section_title) -endforeach