From db95a09715494db519f47315e970cf602cb97a88 Mon Sep 17 00:00:00 2001 From: Colin Clark Date: Mon, 25 Jul 2022 17:19:38 +0100 Subject: [PATCH] Fix #1004, 1005: Various meson problems https://github.com/BestImageViewer/geeqie/issues/1004 https://github.com/BestImageViewer/geeqie/issues/1005 - Revise meson.build to run v 0.53 - Show user configuration summary from meson.build - Remove ClayRGB1998_icch from repo. - A few other minor bug fixes --- CODING.md | 3 +- README.md | 3 + config.h.in | 3 - doc/create-doxygen-lua-api.sh | 6 + doc/diagrams.c | 5 - doc/html/meson.build | 2 - doc/meson.build | 19 +- meson.build | 394 +++++++++++++----- meson_options.txt | 3 +- plugins/camera-import/meson.build | 2 +- plugins/export-jpeg/meson.build | 2 +- plugins/geocode-parameters/meson.build | 2 +- plugins/image-crop/meson.build | 2 +- plugins/lens/meson.build | 2 +- plugins/random-image/meson.build | 2 +- plugins/rotate/meson.build | 2 +- plugins/symlink/meson.build | 2 +- plugins/tethered-photography/meson.build | 2 +- scripts/check-compiles.sh | 26 +- .../generate-ClayRGB1998-icc-h.sh | 10 +- src/ClayRGB1998_icc.h | 57 --- src/color-man.c | 24 +- src/exif.c | 30 +- src/format_canon.c | 4 +- src/format_fuji.c | 2 +- src/format_nikon.c | 4 +- src/format_olympus.c | 2 +- src/icons/meson.build | 2 +- src/image-load.c | 27 +- src/image_load_libraw.c | 4 +- src/layout_util.c | 25 +- src/lua.c | 3 +- src/main.c | 5 +- src/meson.build | 15 +- src/misc.c | 2 +- 35 files changed, 429 insertions(+), 269 deletions(-) rename doc/html/lua-api/meson.build => scripts/generate-ClayRGB1998-icc-h.sh (55%) mode change 100644 => 100755 delete mode 100644 src/ClayRGB1998_icc.h diff --git a/CODING.md b/CODING.md index e33bcdf5..f7ac26ad 100644 --- a/CODING.md +++ b/CODING.md @@ -197,7 +197,8 @@ Variables declarations should be followed by a blank line and should always be a Use glib types when possible (ie. gint and gchar instead of int and char). Use glib functions when possible (i.e. `g_ascii_isspace()` instead of `isspace()`). -Check if used functions are not deprecated. +Check if used functions are not deprecated. +Use UNUSED() for unused function parameters. --- diff --git a/README.md b/README.md index ad751ff3..26d10afb 100644 --- a/README.md +++ b/README.md @@ -142,6 +142,9 @@ Apply options e.g.: `meson configure -Dpdf=enable -Dwebp=disable` `ninja -C build install` +Re-display configuration data: +`ninja -C build reconfigure` + Meaning of options: `auto` If the library is not found, continue the installation `enable` If the library is not found, stop the installation diff --git a/config.h.in b/config.h.in index 6fdc7e03..e1f5da35 100644 --- a/config.h.in +++ b/config.h.in @@ -195,9 +195,6 @@ /* Define if the GNU gettext() function is already present or preinstalled. */ #define HAVE_GETTEXT 1 -/* Define if you have gthread library */ -#define HAVE_GTHREAD 1 - /* Define to 1 if you have the header file. */ #define HAVE_INTTYPES_H 1 diff --git a/doc/create-doxygen-lua-api.sh b/doc/create-doxygen-lua-api.sh index f08e1a5b..764e949f 100755 --- a/doc/create-doxygen-lua-api.sh +++ b/doc/create-doxygen-lua-api.sh @@ -32,6 +32,12 @@ ## that are useful as part of an API description. ## +if ! command -v doxygen > /dev/null +then + printf '%s\n' "doxygen not installed" + exit 1 +fi + export PROJECT="Geeqie" VERSION=$(git tag --list v[1-9]* | tail -1) export VERSION diff --git a/doc/diagrams.c b/doc/diagrams.c index 03ba92b4..f477043a 100644 --- a/doc/diagrams.c +++ b/doc/diagrams.c @@ -357,7 +357,6 @@ * object image_load_begin * object image_loader_start * object image_loader_start_thread - * object image_loader_start_idle * object image_loader_setup_source * object image_loader_thread_run * object image_loader_begin @@ -372,7 +371,6 @@ * image_load_begin : image.c * image_loader_start : image_load.c * image_loader_start_thread : image_load.c - * image_loader_start_idle : image_load.c * image_loader_thread_run : image_load.c * image_loader_begin : image_load.c * image_loader_setuploader : image_load.c @@ -390,7 +388,6 @@ * image_change_complete --> image_load_begin * image_load_begin --> image_loader_start * image_loader_start --> image_loader_start_thread - * image_loader_start --> image_loader_start_idle : Obsolete - no threads version * image_loader_start_thread --> image_loader_thread_run * image_loader_start_thread --> image_loader_setup_source * image_loader_setup_source --> exif_get_preview_ @@ -491,5 +488,3 @@ * DupeItem --> group * @enduml */ - - diff --git a/doc/html/meson.build b/doc/html/meson.build index d2def943..2fa45474 100644 --- a/doc/html/meson.build +++ b/doc/html/meson.build @@ -9,5 +9,3 @@ # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # - -subdir('lua-api') diff --git a/doc/meson.build b/doc/meson.build index f5a65186..6b8e82d4 100644 --- a/doc/meson.build +++ b/doc/meson.build @@ -14,19 +14,24 @@ subdir('html') guideindex_xml = files('docbook/GuideIndex.xml') -destdir = join_paths(meson.project_build_root(), 'doc', 'html/') -iconsdir = join_paths(meson.project_source_root(), 'doc', 'icons/') +destdir = join_paths(meson.current_build_dir(), 'html/') +iconsdir = join_paths(meson.current_source_dir(), 'icons/') guideindex_html = join_paths(destdir, 'GuideIndex.html') guideindex_ln = join_paths(destdir, 'index.html') run_command(gnome_doc_tool, 'html', '-o', destdir, '-p', iconsdir, guideindex_xml, check : false) run_command(find_program('ln'), '-s', '-f', guideindex_html, guideindex_ln, check : false) -install_subdir(destdir, install_dir : helpdir, install_tag : 'help') +install_subdir(destdir, install_dir : helpdir, exclude_directories : 'lua-api/latex') -srcdir = join_paths(meson.project_source_root()) -destdir = join_paths(meson.project_build_root(), 'doc', 'html', 'lua-api') +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') -run_command(find_program('create-doxygen-lua-api.sh'), srcdir, destdir, check : false) + run_command(find_program('create-doxygen-lua-api.sh'), srcdir, destdir, check : false) -install_subdir(destdir, install_dir : htmldir, install_tag : 'html') + user_documentation_message += 'lua-api help file will be created\n' +else + user_documentation_message += 'doxygen ' + notfound + ' - lua-api help file will not be created\n' +endif diff --git a/meson.build b/meson.build index 733107a7..56fc0e17 100644 --- a/meson.build +++ b/meson.build @@ -44,13 +44,19 @@ project( 'cpp', version : run_command('./version.sh', check : true).stdout().strip(), license : ['GPL-2.0-or-later'], - meson_version : '>= 0.60.0', + meson_version : '>=0.53.0', default_options : ['warning_level=3', 'buildtype=debugoptimized'] ) # To inhibit warnings from the generated files icons_inline.h and ui_icons.h add_global_arguments('-Wno-overlength-strings', language : 'c') +# Used for colored text in user messages +c_red = '\033[91m' +c_end = '\033[0m' +disabled = c_red + 'DISABLED' + c_end +notfound = c_red + ' NOT FOUND' + c_end + # Project requirements project_sources = [] gnome = import('gnome') @@ -59,12 +65,18 @@ cc = meson.get_compiler('c') i18n = import('i18n') configuration_inc = include_directories('.') +user_options_message = 'Optional features:\n' +user_documentation_message = 'Documentation and other features:\n' +user_thumbnailer_message = 'Thumbnailer options:\n' + # External programs gdk_pixbuf_csource = find_program('gdk-pixbuf-csource', required : true) glib_genmarshal = find_program('glib-genmarshal', required : true) gnome_doc_tool = find_program('yelp-build', required : false) -if not gnome_doc_tool.found() - message('yelp-build not found. Help files not created.') +if gnome_doc_tool.found() + user_documentation_message += 'Help files will be created\n' +else + user_documentation_message += 'yelp-build ' + notfound + ' - Help files not created\n' endif debug = get_option('debug') @@ -119,7 +131,7 @@ htmldir = join_paths(prefix, gq_htmldir) icondir = join_paths(datadir, 'pixmaps') mandir1 = join_paths(datadir, 'man', 'man1') -podir = join_paths(meson.project_source_root(), 'po') +podir = join_paths(meson.source_root(), 'po') # Create the define constants used in the sources. Set via config.h.in conf_data = configuration_data() @@ -127,143 +139,311 @@ conf_data.set_quoted('VERSION', run_command('./version.sh', check : true).stdout conf_data.set('DEBUG', debug) gtk_dep = dependency('gtk+-3.0', version : '>=3.22', required: true) -glib_dep = dependency('glib-2.0', version: '>=2.52', required: true) +glib_dep = dependency('glib-2.0', version : '>=2.52', required: true) libarchive_dep = [] -libarchive_dep = dependency('libarchive', version: '>=3.4.0', required : get_option('archive')) -if libarchive_dep.found() - conf_data.set('HAVE_ARCHIVE', 1) +req_version = '>=3.4.0' +option = get_option('archive') +if not option.disabled() + libarchive_dep = dependency('libarchive', version : req_version, required : get_option('archive')) + if libarchive_dep.found() + conf_data.set('HAVE_ARCHIVE', 1) + user_options_message += 'archive: archive files e.g. .zip supported\n' + else + user_options_message += 'archive: libarchive ' + req_version + notfound + ' - archive files e.g. .zip not supported\n' + endif +else + user_options_message += 'archive: ' + disabled + ' - archive files e.g. .zip not supported\n' endif lcms_dep = [] -lcms_dep = dependency('lcms2', version: '>=2.0', required : get_option('cms')) -if lcms_dep.found() - conf_data.set('HAVE_LCMS', 1) - conf_data.set('HAVE_LCMS2', 1) +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) + user_options_message += 'cms: color management supported\n' + else + user_options_message += 'cms: lcms2 '+ req_version + notfound + ' - color management not supported\n' + endif +else + user_options_message += 'cms: ' + disabled + ' - color management not supported\n' endif ddjvuapi_dep = [] -ddjvuapi_dep = dependency('ddjvuapi', version: '>=3.5.27', required : get_option('djvu')) -if ddjvuapi_dep.found() - conf_data.set('HAVE_DJVU', 1) +req_version = '>=2.5.27' +option = get_option('djvu') +if not option.disabled() + ddjvuapi_dep = dependency('ddjvuapi', version : req_version, required : get_option('djvu')) + if ddjvuapi_dep.found() + conf_data.set('HAVE_DJVU', 1) + user_options_message += 'djvu: djvu files supported\n' + else + user_options_message += 'djvu: ddjvuapi ' + req_version + notfound + ' - djvu files not supported\n' + endif +else + user_options_message += 'djvu: ' + disabled + ' - djvu files not supported\n' endif exiv2_dep = [] -exiv2_dep = dependency('exiv2', version: '>=0.11', required : get_option('exiv2')) -if exiv2_dep.found() - conf_data.set('HAVE_EXIV2', 1) +req_version = '>=0.11' +option = get_option('exiv2') +if not option.disabled() + exiv2_dep = dependency('exiv2', version : req_version, required : get_option('exiv2')) + if exiv2_dep.found() + conf_data.set('HAVE_EXIV2', 1) + user_options_message += 'exiv2: image metadata processed by exiv2\n' + else + user_options_message += 'exiv2: exiv2 ' + req_version + notfound + ' - image data not processed by exiv2\n' + endif +else + user_options_message += 'exiv2: ' + disabled + '- image data not processed by exiv2\n' endif libffmpegthumbnailer_dep = [] -libffmpegthumbnailer_dep = dependency('libffmpegthumbnailer', - version: '>=2.1.0', - required : get_option('ffmpegthumbnailer')) - -if libffmpegthumbnailer_dep.found() - conf_data.set('HAVE_FFMPEGTHUMBNAILER', 1) - - if cc.has_member('struct video_thumbnailer_struct', 'prefer_embedded_metadata', - prefix : '#include ') - - conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 1) - endif - - if cc.has_member('struct image_data_struct', 'image_data_width', - prefix : '#include ' ) - - conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 1) +req_version = '>=2.1.0' +option = get_option('videothumbnailer') +if not option.disabled() + libffmpegthumbnailer_dep = dependency('libffmpegthumbnailer', + version : req_version, + required : get_option('videothumbnailer')) + + if libffmpegthumbnailer_dep.found() + conf_data.set('HAVE_FFMPEGTHUMBNAILER', 1) + user_options_message += 'videothumbnailer: thumbnails of video files supported\n' + + if cc.has_member('struct video_thumbnailer_struct', 'prefer_embedded_metadata', + prefix : '#include ') + + conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 1) + user_thumbnailer_message += 'fmpegthumbnailer_metadata: found\n' + else + user_thumbnailer_message += 'ffmpegthumbnailer_metadata: ' + notfound + '\n' + endif + + if cc.has_member('struct image_data_struct', 'image_data_width', + prefix : '#include ' ) + + conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 1) + user_thumbnailer_message += 'ffmpegthumbnailer_rgb: found\n' + else + user_thumbnailer_message += 'ffmpegthumbnailer_rgb: ' + notfound + '\n' + endif + + if cc.has_function('video_thumbnailer_set_size', + dependencies : libffmpegthumbnailer_dep) + + conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 1) + user_thumbnailer_message += 'ffmpegthumbnailer_set_size: found\n' + else + user_thumbnailer_message += 'ffmpegthumbnailer_set_size: ' + notfound + '\n' + endif + else + user_options_message += 'videothumbnailer: libvideothumbnailer ' + req_version + notfound + ' - no thumbnails of video files\n' endif - - if cc.has_function('video_thumbnailer_set_size', - dependencies : libffmpegthumbnailer_dep) - - conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 1) - endif +else + user_options_message += 'videothumbnailer: ' + disabled + '- no thumbnails of video files\n' endif champlain_dep = [] champlain_gtk_dep = [] -champlain_dep = dependency('champlain-0.12', version: '>=0.12', required : get_option('gps-map')) -champlain_gtk_dep = dependency('champlain-gtk-0.12', version: '>=0.12', required : get_option('gps-map')) -if champlain_dep.found() and champlain_gtk_dep.found() - clutter_dep = [] - clutter_gtk_dep = [] - clutter_dep = dependency('clutter-1.0', required : true) - clutter_gtk_dep = dependency('clutter-gtk-1.0', required : true) - if clutter_dep.found() and clutter_gtk_dep.found() - conf_data.set('HAVE_CLUTTER', 1) - conf_data.set('HAVE_LIBCHAMPLAIN', 1) - conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 1) +clutter_dep = [] +clutter_gtk_dep = [] +req_version_champlain = '>=0.12' +req_version_champlain_gtk = '>=0.12' +req_version_clutter = '>=1.0' +req_version_clutter_gtk = '>=1.0' +option = get_option('gps-map') +if not option.disabled() + champlain_dep = dependency('champlain-0.12', version : req_version_champlain, required : get_option('gps-map')) + champlain_gtk_dep = dependency('champlain-gtk-0.12', version : req_version_champlain_gtk, required : get_option('gps-map')) + if champlain_dep.found() and champlain_gtk_dep.found() + clutter_dep = dependency('clutter-1.0', version : req_version_clutter, required : get_option('gps-map')) + clutter_gtk_dep = dependency('clutter-gtk-1.0', version : req_version_clutter_gtk, required : get_option('gps-map')) + if clutter_dep.found() and clutter_gtk_dep.found() + conf_data.set('HAVE_CLUTTER', 1) + conf_data.set('HAVE_LIBCHAMPLAIN', 1) + conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 1) + user_options_message += 'gps-map: GPS map displayed\n' + else + if not clutter_dep.found() + user_options_message += 'gps-map: clutter-1.0 ' + req_version_clutter + notfound + ' - GPS map not displayed\n' + endif + if not clutter_gtk_dep.found() + user_options_message += 'gps-map: clutter-gtk-1.0 ' + req_version_clutter_gtk + notfound + ' - GPS map not displayed\n' + endif + endif + else + if not champlain_dep.found() + user_options_message += 'gps-map: champlain-0.12 ' + req_version_champlain + notfound + ' - GPS map not displayed\n' + endif + if not champlain_gtk_dep.found() + user_options_message += 'gps-map: champlain-gtk-0.12 ' + req_version_champlain_gtk + notfound + ' - GPS map not displayed\n' + endif endif +else + user_options_message += 'gps-map: ' + disabled + ' - GPS map not displayed\n' endif libheif_dep = [] -libheif_dep = dependency('libheif', version: '>=1.3.2', required : get_option('heif')) -if libheif_dep.found() - conf_data.set('HAVE_HEIF', 1) +req_version = '>=1.3.2' +option = get_option('heif') +if not option.disabled() + libheif_dep = dependency('libheif', version : req_version, required : get_option('heif')) + if libheif_dep.found() + conf_data.set('HAVE_HEIF', 1) + user_options_message += 'heif: heif files supported\n' + else + user_options_message += 'heif: libheif ' + req_version + notfound + ' - heif files not supported\n' + endif +else + user_options_message += 'heif: ' + disabled + ' - heif files not supported\n' endif libopenjp2_dep = [] -libopenjp2_dep = dependency('libopenjp2', version: '>=2.3.0', required : get_option('j2k')) -if libopenjp2_dep.found() - conf_data.set('HAVE_J2K', 1) +req_version = '>=2.3.0' +option = get_option('j2k') +if not option.disabled() + libopenjp2_dep = dependency('libopenjp2', version : req_version, required : get_option('j2k')) + if libopenjp2_dep.found() + conf_data.set('HAVE_J2K', 1) + user_options_message += 'j2k: j2k files supported\n' + else + user_options_message += 'j2k: libopenjp2 ' + req_version + notfound + ' - j2k files not supported\n' + endif +else + user_options_message += 'j2k: ' + disabled + ' - j2k files not supported\n' endif libjpeg_dep = [] +option = get_option('jpeg') +if not option.disabled() libjpeg_dep = dependency('libjpeg', required : get_option('jpeg')) -if libjpeg_dep.found() - if cc.has_function('jpeg_destroy_decompress', - dependencies : libjpeg_dep) - - conf_data.set('HAVE_JPEG', 1) + if libjpeg_dep.found() + if cc.has_function('jpeg_destroy_decompress', dependencies : libjpeg_dep) + conf_data.set('HAVE_JPEG', 1) + user_options_message += 'jpeg: jpeg files supported\n' + else + user_options_message += 'jpeg: jpeg_destroy_decompress ' + notfound + ' - jpeg files not supported\n' + endif + else + user_options_message += 'jpeg: libjpeg: ' + notfound + '\n' endif +else + user_options_message += 'jpeg: ' + disabled + ' - jpeg files not supported\n' endif libjxl_dep = [] -libjxl_dep = dependency('libjxl', version: '>=0.3.7', required : get_option('jpegxl')) -if libjxl_dep.found() - conf_data.set('HAVE_JPEGXL', 1) +req_version = '>=0.3.7' +option = get_option('jpegxl') +if not option.disabled() + libjxl_dep = dependency('libjxl', version : req_version, required : get_option('jpegxl')) + if libjxl_dep.found() + conf_data.set('HAVE_JPEGXL', 1) + user_options_message += 'jpegxl: jpegxl files supported\n' + else + user_options_message += 'jpegxl: libjxl ' + req_version + notfound + ' - jpegxl files not supported\n' + endif +else + user_options_message += 'jpegxl: ' + disabled + ' - jpegxl files not supported\n' endif libraw_dep = [] -libraw_dep = dependency('libraw', version: '>=0.20', required : get_option('libraw')) -if libraw_dep.found() - conf_data.set('HAVE_RAW', 1) +req_version = '>=0.20' +option = get_option('libraw') +if not option.disabled() + libraw_dep = dependency('libraw', version : req_version, required : get_option('libraw')) + if libraw_dep.found() + conf_data.set('HAVE_RAW', 1) + user_options_message += 'libraw: .cr3 files supported\n' + else + user_options_message += 'libraw: libraw ' + req_version + notfound + ' - .cr3 files not supported\n' + endif +else + user_options_message += 'libraw: ' + disabled + ' - .cr3 files not supported\n' endif lua_dep = [] -lua_dep = dependency('lua5.1', required : get_option('lua')) -if lua_dep.found() - conf_data.set('HAVE_LUA', 1) +req_version = '>=5.1' +option = get_option('lua') +if not option.disabled() + lua_dep = dependency('lua5.1', version : req_version, required : get_option('lua')) + if lua_dep.found() + conf_data.set('HAVE_LUA', 1) + user_options_message += 'lua: lua supported\n' + else + user_options_message += 'lua: lua5.1 ' + req_version + notfound + ' - lua not supported\n' + endif +else + user_options_message += 'lua: ' + disabled + ' - lua not supported\n' endif poppler_glib_dep = [] -poppler_glib_dep = dependency('poppler-glib', version: '>=0.62', required : get_option('pdf')) -if poppler_glib_dep.found() - conf_data.set('HAVE_PDF', 1) +req_version = '>=0.62' +option = get_option('pdf') +if not option.disabled() + poppler_glib_dep = dependency('poppler-glib', version : req_version, required : get_option('pdf')) + if poppler_glib_dep.found() + conf_data.set('HAVE_PDF', 1) + user_options_message += 'pdf: pdf files supported\n' + else + user_options_message += 'pdf: poppler-glib ' + req_version + notfound + ' - pdf files not supported\n' + endif +else + user_options_message += 'pdf: ' + disabled + ' - pdf files not supported\n' endif gspell_dep = [] -gspell_dep = dependency('gspell-1', required: get_option('spell')) -if gspell_dep.found() - conf_data.set('HAVE_SPELL', 1) +req_version = '>=1.6' +option = get_option('spell') +if not option.disabled() + gspell_dep = dependency('gspell-1', version : req_version, required: get_option('spell')) + if gspell_dep.found() + conf_data.set('HAVE_SPELL', 1) + user_options_message += 'spell: spelling checks enabled\n' + else + user_options_message += 'spell: gspell-1 ' + req_version + notfound + ' - spelling checks not enabled\n' + endif +else + user_options_message += 'spell: ' + disabled + ' - spelling checks not enabled\n' endif tiff_dep = [] -tiff_dep = cc.find_library('tiff', required: get_option('tiff')) -if tiff_dep.found() - if cc.has_function('TIFFClientOpen', - dependencies : tiff_dep) - - conf_data.set('HAVE_TIFF', 1) +option = get_option('tiff') +if not option.disabled() + tiff_dep = cc.find_library('libtiff', required: get_option('tiff')) + if tiff_dep.found() + if cc.has_function('TIFFClientOpen', + dependencies : tiff_dep) + + conf_data.set('HAVE_TIFF', 1) + user_options_message += 'tiff: tiff files supported\n' + else + user_options_message += 'tiff: TIFFClientOpen ' + notfound + ' - tiff files not supported\n' + endif + else + user_options_message += 'tiff: libtiff ' + notfound + ' - tiff files not supported\n' endif +else + user_options_message += 'tiff: ' + disabled + ' - tiff files not supported\n' endif libwebp_dep = [] - libwebp_dep = dependency('libwebp', version: '>=0.6.1', required : get_option('webp')) +req_version = '>=0.6.1' +option = get_option('webp') +if not option.disabled() + libwebp_dep = dependency('libwebp', version : req_version, required : get_option('webp')) if libwebp_dep.found() conf_data.set('HAVE_WEBP', 1) + user_options_message += 'webp: webp files supported\n' + else + user_options_message += 'webp: libwebp ' + req_version + notfound + ' - webp files not supported\n' endif +else + user_options_message += 'webp: ' + disabled + ' - webp files not supported\n' +endif # Check for nl_langinfo and _NL_TIME_FIRST_WEEKDAY code = '''#include @@ -275,6 +455,9 @@ int main (int argc, char ** argv) { }''' if cc.links(code, name : 'nl_langinfo and _NL_TIME_FIRST_WEEKDAY') conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 1) + user_documentation_message += 'nl_langinfo - first weekday depends on locale\n' +else + user_documentation_message += 'nl_langinfo ' + notfound + ' - first weekday defaults to Monday\n' endif conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name()) @@ -300,24 +483,44 @@ configure_file(input : 'config.h.in', subdir('po') subdir('plugins') -# Generate the executable and the help files +# Generate the executable subdir('src') + +# Generate the help files subdir('doc') # Install other project files -run_command(find_program('gen_changelog.sh'), meson.project_source_root(), meson.project_build_root(), check : true) - -run_command(find_program('gen_readme.sh'), meson.project_source_root(), meson.project_build_root(), check : true) +run_command(find_program('gen_changelog.sh'), meson.source_root(), meson.build_root(), check : true) -pandoc = find_program('pandoc') +pandoc = find_program('pandoc', required : false) if pandoc.found() - install_data('README.md', 'COPYING', join_paths(meson.project_build_root(), 'ChangeLog'), 'TODO', 'AUTHORS', join_paths(meson.project_build_root(), 'README.html'), join_paths(meson.project_build_root(), 'ChangeLog.html'), install_dir : helpdir, install_tag : 'help') + run_command(find_program('gen_readme.sh'), meson.source_root(), meson.build_root(), check : false) + + install_data('README.md', 'COPYING', 'TODO', 'AUTHORS', + join_paths(meson.build_root(), 'ChangeLog'), + join_paths(meson.build_root(), 'README.html'), + join_paths(meson.build_root(), 'ChangeLog.html'), + install_dir : helpdir) + + user_documentation_message += 'README.html created\n' +else + install_data('README.md', 'COPYING', 'TODO', 'AUTHORS', + join_paths(meson.build_root(), 'ChangeLog'), + join_paths(meson.build_root(), 'ChangeLog.html'), + install_dir : helpdir) + + user_documentation_message += 'pandoc ' + notfound + ' - README.html not created\n' +endif + +evince = find_program('evince', required : false) +if evince.found() + user_documentation_message += 'print preview supported \n' else - install_data('README.md', 'COPYING', join_paths(meson.project_build_root(), 'ChangeLog'), 'TODO', 'README.lirc', 'AUTHORS', install_dir : helpdir, install_tag : 'help') + user_documentation_message += 'evince ' + notfound + ' - print preview not available\n' endif -install_data('geeqie.png', install_dir : icondir, install_tag : 'icons') -install_data('geeqie.1', install_dir : mandir1, install_tag : 'man') +install_data('geeqie.png', install_dir : icondir) +install_data('geeqie.1', install_dir : mandir1) i18n.merge_file( input : 'geeqie.desktop.in', @@ -336,3 +539,6 @@ i18n.merge_file( install_dir : appdatadir) configure_file(input: 'geeqie.spec.in', output: 'geeqie.spec', configuration: conf_data) + +user_message = ''.join('Configuration Summary -\n\n', user_options_message, '\n', user_documentation_message, '\n', user_thumbnailer_message) +message(user_message) diff --git a/meson_options.txt b/meson_options.txt index 9ac99658..b42a9cac 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -27,7 +27,7 @@ option('archive', type : 'feature', value : 'auto', description : 'archive files option('cms', type : 'feature', value : 'auto', description : 'color management system') option('djvu', type : 'feature', value : 'auto', description : 'djvu') option('exiv2', type : 'feature', value : 'auto', description : 'exiv2') -option('ffmpegthumbnailer', type : 'feature', value : 'auto', description : 'ffmpegthumbnailer') +option('videothumbnailer', type : 'feature', value : 'auto', description : 'video thumbnailer') option('gps-map', type : 'feature', value : 'auto', description : 'gps map') option('heif', type : 'feature', value : 'auto', description : 'heif') option('j2k', type : 'feature', value : 'auto', description : 'j2k') @@ -35,7 +35,6 @@ option('jpeg', type : 'feature', value : 'auto', description : 'jpeg') option('jpegxl', type : 'feature', value : 'auto', description : 'jpegxl') option('libraw', type : 'feature', value : 'auto', description : 'libraw') option('lua', type : 'feature', value : 'auto', description : 'lua') -option('markdown', type : 'feature', value : 'auto', description : 'markdown') option('pdf', type : 'feature', value : 'auto', description : 'pdf') option('spell', type : 'feature', value : 'auto', description : 'spelling checks') option('tiff', type : 'feature', value : 'auto', description : 'tiff') diff --git a/plugins/camera-import/meson.build b/plugins/camera-import/meson.build index 1c8242d2..e60f2d2e 100644 --- a/plugins/camera-import/meson.build +++ b/plugins/camera-import/meson.build @@ -11,7 +11,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -install_data('geeqie-camera-import', 'geeqie-camera-import-hook-script', install_dir : gq_bindir, install_tag : 'plugins') +install_data('geeqie-camera-import', 'geeqie-camera-import-hook-script', install_dir : gq_bindir) i18n.merge_file( input : 'camera-import.desktop.in', diff --git a/plugins/export-jpeg/meson.build b/plugins/export-jpeg/meson.build index 86b204a1..65af68d4 100644 --- a/plugins/export-jpeg/meson.build +++ b/plugins/export-jpeg/meson.build @@ -11,7 +11,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -install_data('geeqie-export-jpeg', install_dir : gq_bindir, install_tag : 'plugins') +install_data('geeqie-export-jpeg', install_dir : gq_bindir) i18n.merge_file( input : 'export-jpeg.desktop.in', diff --git a/plugins/geocode-parameters/meson.build b/plugins/geocode-parameters/meson.build index 8e7e74cf..921ad35b 100644 --- a/plugins/geocode-parameters/meson.build +++ b/plugins/geocode-parameters/meson.build @@ -11,4 +11,4 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -install_data('geocode-parameters.awk', install_dir : gq_bindir, install_tag : 'plugins') +install_data('geocode-parameters.awk', install_dir : gq_bindir) diff --git a/plugins/image-crop/meson.build b/plugins/image-crop/meson.build index d023b1f8..9df7e329 100644 --- a/plugins/image-crop/meson.build +++ b/plugins/image-crop/meson.build @@ -11,7 +11,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -install_data('geeqie-image-crop', install_dir : gq_bindir, install_tag : 'plugins') +install_data('geeqie-image-crop', install_dir : gq_bindir) i18n.merge_file( input : 'image-crop.desktop.in', diff --git a/plugins/lens/meson.build b/plugins/lens/meson.build index dd314bf2..bf40c033 100644 --- a/plugins/lens/meson.build +++ b/plugins/lens/meson.build @@ -11,4 +11,4 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -install_data('lensID', install_dir : gq_bindir, install_tag : 'plugins') +install_data('lensID', install_dir : gq_bindir) diff --git a/plugins/random-image/meson.build b/plugins/random-image/meson.build index 5db10b51..9b7f1f3b 100644 --- a/plugins/random-image/meson.build +++ b/plugins/random-image/meson.build @@ -11,7 +11,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -install_data('geeqie-random-image', install_dir : gq_bindir, install_tag : 'plugins') +install_data('geeqie-random-image', install_dir : gq_bindir) i18n.merge_file( input : 'random-image.desktop.in', diff --git a/plugins/rotate/meson.build b/plugins/rotate/meson.build index fc5871b8..5d6f3b52 100644 --- a/plugins/rotate/meson.build +++ b/plugins/rotate/meson.build @@ -11,7 +11,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -install_data('geeqie-rotate', install_dir : gq_bindir, install_tag : 'plugins') +install_data('geeqie-rotate', install_dir : gq_bindir) i18n.merge_file( input : 'rotate.desktop.in', diff --git a/plugins/symlink/meson.build b/plugins/symlink/meson.build index 55495003..989b99f7 100644 --- a/plugins/symlink/meson.build +++ b/plugins/symlink/meson.build @@ -11,7 +11,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -install_data('geeqie-symlink', install_dir : gq_bindir, install_tag : 'plugins') +install_data('geeqie-symlink', install_dir : gq_bindir) i18n.merge_file( input : 'symlink.desktop.in', diff --git a/plugins/tethered-photography/meson.build b/plugins/tethered-photography/meson.build index 536877aa..63326221 100644 --- a/plugins/tethered-photography/meson.build +++ b/plugins/tethered-photography/meson.build @@ -11,7 +11,7 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # -install_data('geeqie-tethered-photography', 'geeqie-tethered-photography-hook-script', install_dir : gq_bindir, install_tag : 'plugins') +install_data('geeqie-tethered-photography', 'geeqie-tethered-photography-hook-script', install_dir : gq_bindir) i18n.merge_file( input : 'tethered-photography.desktop.in', diff --git a/scripts/check-compiles.sh b/scripts/check-compiles.sh index 0b5f8872..6bc373bd 100755 --- a/scripts/check-compiles.sh +++ b/scripts/check-compiles.sh @@ -30,14 +30,28 @@ compile() compiler="$1" printf '\e[32m%s\n' "$compiler all disabled" -meson configure build -Darchive=disabled -Dcms=disabled -Ddjvu=disabled -Dexiv2=disabled -Dffmpegthumbnailer=disabled -Dgps-map=disabled -Dheif=disabled -Dj2k=disabled -Djpeg=disabled -Djpegxl=disabled -Dlibraw=disabled -Dlua=disabled -Dmarkdown=disabled -Dpdf=disabled -Dspell=disabled -Dtiff=disabled -Dwebp=disabled -ninja -C build clean > /dev/null 2>&1 -ninja -C build > /dev/null 2>&1 +meson configure build -Darchive=disabled -Dcms=disabled -Ddjvu=disabled -Dexiv2=disabled -Dvideothumbnailer=disabled -Dgps-map=disabled -Dheif=disabled -Dj2k=disabled -Djpeg=disabled -Djpegxl=disabled -Dlibraw=disabled -Dlua=disabled -Dpdf=disabled -Dspell=disabled -Dtiff=disabled -Dwebp=disabled + +if (! ninja -C build clean > /dev/null 2>&1) +then + echo "ERROR" +fi +if (! ninja -C build > /dev/null 2>&1) +then + echo "ERROR" +fi printf '\e[32m%s\n' "$compiler none disabled" -meson configure build -Darchive=auto -Dcms=auto -Ddjvu=auto -Dexiv2=auto -Dffmpegthumbnailer=auto -Dgps-map=auto -Dheif=auto -Dj2k=auto -Djpeg=auto -Djpegxl=auto -Dlibraw=auto -Dlua=auto -Dmarkdown=auto -Dpdf=auto -Dspell=auto -Dtiff=auto -Dwebp=auto -ninja -C build clean > /dev/null 2>&1 -ninja -C build > /dev/null 2>&1 +meson configure build -Darchive=auto -Dcms=auto -Ddjvu=auto -Dexiv2=auto -Dvideothumbnailer=auto -Dgps-map=auto -Dheif=auto -Dj2k=auto -Djpeg=auto -Djpegxl=auto -Dlibraw=auto -Dlua=auto -Dpdf=auto -Dspell=auto -Dtiff=auto -Dwebp=auto + +if (! ninja -C build clean > /dev/null 2>&1) +then + echo "ERROR" +fi +if (! ninja -C build > /dev/null 2>&1) +then + echo "ERROR" +fi } export CC=clang diff --git a/doc/html/lua-api/meson.build b/scripts/generate-ClayRGB1998-icc-h.sh old mode 100644 new mode 100755 similarity index 55% rename from doc/html/lua-api/meson.build rename to scripts/generate-ClayRGB1998-icc-h.sh index 2fa45474..8a55c22c --- a/doc/html/lua-api/meson.build +++ b/scripts/generate-ClayRGB1998-icc-h.sh @@ -1,11 +1,17 @@ +#!/bin/sh +# This file is a part of Geeqie project (https://www.geeqie.org/). # Copyright (C) 2008 - 2022 The Geeqie Team # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or +# the Free Software: foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# +# GNU General Public License for more details. + +# To generate the required code, xxd has to run in the same folder as the source +cd "$(dirname "$1")" || return 1 +xxd -i "$(basename "$1")" diff --git a/src/ClayRGB1998_icc.h b/src/ClayRGB1998_icc.h deleted file mode 100644 index 36cf9abd..00000000 --- a/src/ClayRGB1998_icc.h +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This file was generated from ClayRGB1998.icc, DO NOT EDIT - * http://www.argyllcms.com/ClayRGB1998.zip - */ -unsigned char ClayRGB1998_icc[] = { - 0x00, 0x00, 0x02, 0x44, 0x61, 0x72, 0x67, 0x6c, 0x02, 0x20, 0x00, 0x00, - 0x6d, 0x6e, 0x74, 0x72, 0x52, 0x47, 0x42, 0x20, 0x58, 0x59, 0x5a, 0x20, - 0x07, 0xd6, 0x00, 0x07, 0x00, 0x08, 0x00, 0x03, 0x00, 0x1c, 0x00, 0x2f, - 0x61, 0x63, 0x73, 0x70, 0x4d, 0x53, 0x46, 0x54, 0x00, 0x00, 0x00, 0x00, - 0x6e, 0x6f, 0x6e, 0x65, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0xd6, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x2d, 0x61, 0x72, 0x67, 0x6c, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, - 0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x00, 0xfc, 0x00, 0x00, 0x00, 0x7b, - 0x63, 0x70, 0x72, 0x74, 0x00, 0x00, 0x01, 0x78, 0x00, 0x00, 0x00, 0x35, - 0x77, 0x74, 0x70, 0x74, 0x00, 0x00, 0x01, 0xb0, 0x00, 0x00, 0x00, 0x14, - 0x62, 0x6b, 0x70, 0x74, 0x00, 0x00, 0x01, 0xc4, 0x00, 0x00, 0x00, 0x14, - 0x72, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x01, 0xd8, 0x00, 0x00, 0x00, 0x14, - 0x67, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x01, 0xec, 0x00, 0x00, 0x00, 0x14, - 0x62, 0x58, 0x59, 0x5a, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x14, - 0x72, 0x54, 0x52, 0x43, 0x00, 0x00, 0x02, 0x14, 0x00, 0x00, 0x00, 0x0e, - 0x67, 0x54, 0x52, 0x43, 0x00, 0x00, 0x02, 0x24, 0x00, 0x00, 0x00, 0x0e, - 0x62, 0x54, 0x52, 0x43, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x00, 0x0e, - 0x64, 0x65, 0x73, 0x63, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x21, - 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x69, 0x62, 0x6c, 0x65, 0x20, 0x77, - 0x69, 0x74, 0x68, 0x20, 0x41, 0x64, 0x6f, 0x62, 0x65, 0x20, 0x52, 0x47, - 0x42, 0x20, 0x28, 0x31, 0x39, 0x39, 0x38, 0x29, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, 0x00, - 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x20, 0x44, 0x6f, 0x6d, 0x61, 0x69, - 0x6e, 0x2e, 0x20, 0x4e, 0x6f, 0x20, 0x57, 0x61, 0x72, 0x72, 0x61, 0x6e, - 0x74, 0x79, 0x2c, 0x20, 0x55, 0x73, 0x65, 0x20, 0x61, 0x74, 0x20, 0x6f, - 0x77, 0x6e, 0x20, 0x72, 0x69, 0x73, 0x6b, 0x2e, 0x00, 0x00, 0x00, 0x00, - 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf3, 0x51, - 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x16, 0xcc, 0x58, 0x59, 0x5a, 0x20, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x9c, 0x18, 0x00, 0x00, 0x4f, 0xa5, 0x00, 0x00, 0x04, 0xfc, - 0x58, 0x59, 0x5a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x8d, - 0x00, 0x00, 0xa0, 0x2c, 0x00, 0x00, 0x0f, 0x95, 0x58, 0x59, 0x5a, 0x20, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x26, 0x31, 0x00, 0x00, 0x10, 0x2f, - 0x00, 0x00, 0xbe, 0x9c, 0x63, 0x75, 0x72, 0x76, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x01, 0x02, 0x33, 0x00, 0x00, 0x63, 0x75, 0x72, 0x76, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x33, 0x00, 0x00, - 0x63, 0x75, 0x72, 0x76, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, - 0x02, 0x33, 0x00, 0x00 -}; -unsigned int ClayRGB1998_icc_len = 580; -/* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/color-man.c b/src/color-man.c index 5b1f68a0..6c392574 100644 --- a/src/color-man.c +++ b/src/color-man.c @@ -494,25 +494,25 @@ void color_man_update(void) /*** color support not enabled ***/ -ColorMan *color_man_new(ImageWindow *imd, GdkPixbuf *pixbuf, - ColorManProfileType input_type, const gchar *input_file, - ColorManProfileType screen_type, const gchar *screen_file, - guchar *screen_data, guint screen_data_len) +ColorMan *color_man_new(ImageWindow *UNUSED(imd), GdkPixbuf *UNUSED(pixbuf), + ColorManProfileType UNUSED(input_type), const gchar *UNUSED(input_file), + ColorManProfileType UNUSED(screen_type), const gchar *UNUSED(screen_file), + guchar *UNUSED(screen_data), guint UNUSED(screen_data_len)) { /* no op */ return NULL; } -ColorMan *color_man_new_embedded(ImageWindow *imd, GdkPixbuf *pixbuf, - guchar *input_data, guint input_data_len, - ColorManProfileType screen_type, const gchar *screen_file, - guchar *screen_data, guint screen_data_len) +ColorMan *color_man_new_embedded(ImageWindow *UNUSED(imd), GdkPixbuf *UNUSED(pixbuf), + guchar *UNUSED(input_data), guint UNUSED(input_data_len), + ColorManProfileType UNUSED(screen_type), const gchar *UNUSED(screen_file), + guchar *UNUSED(screen_data), guint UNUSED(screen_data_len)) { /* no op */ return NULL; } -void color_man_free(ColorMan *cm) +void color_man_free(ColorMan *UNUSED(cm)) { /* no op */ } @@ -522,17 +522,17 @@ void color_man_update(void) /* no op */ } -void color_man_correct_region(ColorMan *cm, GdkPixbuf *pixbuf, gint x, gint y, gint w, gint h) +void color_man_correct_region(ColorMan *UNUSED(cm), GdkPixbuf *UNUSED(pixbuf), gint UNUSED(x), gint UNUSED(y), gint UNUSED(w), gint UNUSED(h)) { /* no op */ } -void color_man_start_bg(ColorMan *cm, ColorManDoneFunc done_func, gpointer done_data) +void color_man_start_bg(ColorMan *UNUSED(cm), ColorManDoneFunc UNUSED(done_func), gpointer UNUSED(done_data)) { /* no op */ } -gboolean color_man_get_status(ColorMan *cm, gchar **image_profile, gchar **screen_profile) +gboolean color_man_get_status(ColorMan *UNUSED(cm), gchar **UNUSED(image_profile), gchar **UNUSED(screen_profile)) { return FALSE; } diff --git a/src/exif.c b/src/exif.c index 44b59fff..526139f7 100644 --- a/src/exif.c +++ b/src/exif.c @@ -747,7 +747,7 @@ static const ExifMarker *exif_marker_from_tag(guint16 tag, const ExifMarker *lis static void rational_from_data(ExifRational *r, gpointer src, ExifByteOrder bo) { r->num = exif_byte_get_int32(src, bo); - r->den = exif_byte_get_int32(src + sizeof(guint32), bo); + r->den = exif_byte_get_int32((guchar *)src + sizeof(guint32), bo); } /* src_format and item->format must be compatible @@ -792,7 +792,7 @@ void exif_item_copy_data(ExifItem *item, gpointer src, guint len, case EXIF_FORMAT_SHORT: for (i = 0; i < ne; i++) { - ((guint16 *)dest)[i] = exif_byte_get_int16(src + i * bs, bo); + ((guint16 *)dest)[i] = exif_byte_get_int16((guchar *)src + i * bs, bo); } break; case EXIF_FORMAT_LONG_UNSIGNED: @@ -807,7 +807,7 @@ void exif_item_copy_data(ExifItem *item, gpointer src, guint len, for (i = 0; i < ne; i++) { ((gint32 *)dest)[i] = - (gint32)exif_byte_get_int16(src + i * ss, bo); + (gint32)exif_byte_get_int16((guchar *)src + i * ss, bo); } } else @@ -815,7 +815,7 @@ void exif_item_copy_data(ExifItem *item, gpointer src, guint len, for (i = 0; i < ne; i++) { ((gint32 *)dest)[i] = - exif_byte_get_int32(src + i * bs, bo); + exif_byte_get_int32((guchar *)src + i * bs, bo); } } break; @@ -823,13 +823,13 @@ void exif_item_copy_data(ExifItem *item, gpointer src, guint len, case EXIF_FORMAT_RATIONAL: for (i = 0; i < ne; i++) { - rational_from_data(&((ExifRational *)dest)[i], src + i * bs, bo); + rational_from_data(&((ExifRational *)dest)[i], (guchar *)src + i * bs, bo); } break; case EXIF_FORMAT_FLOAT: for (i = 0; i < ne; i++) { - ((float *)dest)[i] = exif_byte_get_int32(src + i * bs, bo); + ((float *)dest)[i] = exif_byte_get_int32((guchar *)src + i * bs, bo); } break; case EXIF_FORMAT_DOUBLE: @@ -837,7 +837,7 @@ void exif_item_copy_data(ExifItem *item, gpointer src, guint len, { ExifRational r; - rational_from_data(&r, src + i * bs, bo); + rational_from_data(&r, (guchar *)src + i * bs, bo); if (r.den) ((gdouble *)dest)[i] = (gdouble)r.num / r.den; } break; @@ -1103,13 +1103,13 @@ guchar *exif_get_color_profile(ExifData *exif, guint *data_len) } -gchar* exif_get_image_comment(FileData* fd) +gchar* exif_get_image_comment(FileData* UNUSED(fd)) { log_printf("%s", _("Can't get image comment: not compiled with Exiv2.\n")); return g_strdup(""); } -void exif_set_image_comment(FileData* fd, const gchar* comment) +void exif_set_image_comment(FileData* UNUSED(fd), const gchar* UNUSED(comment)) { log_printf("%s", _("Can't set image comment: not compiled with Exiv2.\n")); } @@ -1213,7 +1213,7 @@ void exif_free(ExifData *exif) g_free(exif); } -ExifData *exif_read(gchar *path, gchar *sidecar_path, GHashTable *modified_xmp) +ExifData *exif_read(gchar *path, gchar *UNUSED(sidecar_path), GHashTable *UNUSED(modified_xmp)) { ExifData *exif; gpointer f; @@ -1445,7 +1445,7 @@ static gchar *exif_item_get_data_as_text_full(ExifItem *item, MetadataFormat for return text; } -gchar *exif_item_get_string(ExifItem *item, gint idx) +gchar *exif_item_get_string(ExifItem *item, gint UNUSED(idx)) { return exif_item_get_data_as_text_full(item, METADATA_PLAIN); } @@ -1580,20 +1580,20 @@ void exif_write_data_list(ExifData *exif, FILE *f, gint human_readable_list) g_fprintf(f, "----------------------------------------------------\n"); } -gboolean exif_write(ExifData *exif) +gboolean exif_write(ExifData *UNUSED(exif)) { log_printf("Not compiled with EXIF write support\n"); return FALSE; } -gboolean exif_write_sidecar(ExifData *exif, gchar *path) +gboolean exif_write_sidecar(ExifData *UNUSED(exif), gchar *UNUSED(path)) { log_printf("Not compiled with EXIF write support\n"); return FALSE; } -gint exif_update_metadata(ExifData *exif, const gchar *key, const GList *values) +gint exif_update_metadata(ExifData *UNUSED(exif), const gchar *UNUSED(key), const GList *UNUSED(values)) { return 0; } @@ -1636,7 +1636,7 @@ struct _UnmapData static GList *exif_unmap_list = 0; -guchar *exif_get_preview(ExifData *exif, guint *data_len, gint requested_width, gint requested_height) +guchar *exif_get_preview(ExifData *exif, guint *data_len, gint UNUSED(requested_width), gint UNUSED(requested_height)) { guint offset; const gchar* path; diff --git a/src/format_canon.c b/src/format_canon.c index c6599c53..29b678db 100644 --- a/src/format_canon.c +++ b/src/format_canon.c @@ -119,7 +119,7 @@ static gint canon_cr2_tiff_table(guchar *data, const guint len, guint offset, Ex } gboolean format_canon_raw_cr2(guchar *data, const guint len, - guint *image_offset, guint *exif_offset) + guint *image_offset, guint *UNUSED(exif_offset)) { guint jpeg_offset = 0; ExifByteOrder bo; @@ -152,7 +152,7 @@ gboolean format_canon_raw_cr2(guchar *data, const guint len, #define CRW_DIR_ENTRY_SIZE 10 gboolean format_canon_raw_crw(guchar *data, const guint len, - guint *image_offset, guint *exif_offset) + guint *image_offset, guint *UNUSED(exif_offset)) { guint block_offset; guint data_length; diff --git a/src/format_fuji.c b/src/format_fuji.c index 98ba8b83..cf355ffd 100644 --- a/src/format_fuji.c +++ b/src/format_fuji.c @@ -175,7 +175,7 @@ EXIF_MARKER_LIST_END gboolean format_fuji_makernote(ExifData *exif, guchar *tiff, guint offset, - guint size, ExifByteOrder bo) + guint size, ExifByteOrder UNUSED(bo)) { guchar *data; guint ifdstart; diff --git a/src/format_nikon.c b/src/format_nikon.c index 2984f14e..6de527d5 100644 --- a/src/format_nikon.c +++ b/src/format_nikon.c @@ -137,7 +137,7 @@ static guint nikon_tiff_table(guchar *data, const guint len, guint offset, ExifB } gboolean format_nikon_raw(guchar *data, const guint len, - guint *image_offset, guint *exif_offset) + guint *image_offset, guint *UNUSED(exif_offset)) { guint i_off = 0; guint i_len = 0; @@ -410,7 +410,7 @@ gboolean format_nikon_makernote(ExifData *exif, guchar *tiff, guint offset, ExifItem *shadow; shadow = exif_item_new(marker.format, marker.tag, 1, &marker); - memcpy(shadow->data, item->data + 2, 2); + memcpy(shadow->data, (char *)item->data + 2, 2); exif->items = g_list_prepend(exif->items, shadow); } diff --git a/src/format_olympus.c b/src/format_olympus.c index 70b11047..f77b04b0 100644 --- a/src/format_olympus.c +++ b/src/format_olympus.c @@ -48,7 +48,7 @@ static guint olympus_tiff_table(guchar *data, const guint len, guint offset, Exi static void olympus_tiff_entry(guchar *data, const guint len, guint offset, ExifByteOrder bo, - gint level, + gint UNUSED(level), guint *image_offset, guint *exif_offset) { guint tag; diff --git a/src/icons/meson.build b/src/icons/meson.build index ba4bc2f9..ee55ab3a 100644 --- a/src/icons/meson.build +++ b/src/icons/meson.build @@ -62,7 +62,7 @@ icons_inline_pairs = [ 'icon_split_pane_sync', files('icon_split_pane_sync.png') ] -icons_inline_h = custom_target( output : 'icons_inline.h', +icons_inline_h = custom_target('icons_inline', output : 'icons_inline.h', command : [gdk_pixbuf_csource, '--raw', '--extern', '--build-list', icons_inline_pairs], capture : true) diff --git a/src/image-load.c b/src/image-load.c index ddda3967..49af0f78 100644 --- a/src/image-load.c +++ b/src/image-load.c @@ -122,17 +122,11 @@ static void image_loader_init(GTypeInstance *instance, gpointer UNUSED(g_class)) il->can_destroy = TRUE; -#ifdef HAVE_GTHREAD -#if GLIB_CHECK_VERSION(2,32,0) il->data_mutex = g_new(GMutex, 1); g_mutex_init(il->data_mutex); il->can_destroy_cond = g_new(GCond, 1); g_cond_init(il->can_destroy_cond); -#else - il->data_mutex = g_mutex_new(); - il->can_destroy_cond = g_cond_new(); -#endif -#endif + DEBUG_1("new image loader %p, bufsize=%" G_GSIZE_FORMAT " idle_loop=%u", (void *)il, il->read_buffer_size, il->idle_read_loop_count); } @@ -245,17 +239,11 @@ static void image_loader_finalize(GObject *object) if (il->error) g_error_free(il->error); file_data_unref(il->fd); -#ifdef HAVE_GTHREAD -#if GLIB_CHECK_VERSION(2,32,0) + g_mutex_clear(il->data_mutex); g_free(il->data_mutex); g_cond_clear(il->can_destroy_cond); g_free(il->can_destroy_cond); -#else - g_mutex_free(il->data_mutex); - g_cond_free(il->can_destroy_cond); -#endif -#endif } void image_loader_free(ImageLoader *il) @@ -1215,7 +1203,6 @@ static gboolean image_loader_start_idle(ImageLoader *il) /**************************************************************************************/ /* execution via thread */ -#ifdef HAVE_GTHREAD static GThreadPool *image_loader_thread_pool = NULL; static GCond *image_loader_prio_cond = NULL; @@ -1319,15 +1306,10 @@ static gboolean image_loader_start_thread(ImageLoader *il) if (!image_loader_thread_pool) { image_loader_thread_pool = g_thread_pool_new(image_loader_thread_run, NULL, -1, FALSE, NULL); -#if GLIB_CHECK_VERSION(2,32,0) if (!image_loader_prio_cond) image_loader_prio_cond = g_new(GCond, 1); g_cond_init(image_loader_prio_cond); if (!image_loader_prio_mutex) image_loader_prio_mutex = g_new(GMutex, 1); g_mutex_init(image_loader_prio_mutex); -#else - image_loader_prio_cond = g_cond_new(); - image_loader_prio_mutex = g_mutex_new(); -#endif } il->can_destroy = FALSE; /* ImageLoader can't be freed until image_loader_thread_run finishes */ @@ -1337,7 +1319,6 @@ static gboolean image_loader_start_thread(ImageLoader *il) return TRUE; } -#endif /* HAVE_GTHREAD */ /**************************************************************************************/ @@ -1350,11 +1331,7 @@ gboolean image_loader_start(ImageLoader *il) if (!il->fd) return FALSE; -#ifdef HAVE_GTHREAD return image_loader_start_thread(il); -#else - return image_loader_start_idle(il); -#endif } diff --git a/src/image_load_libraw.c b/src/image_load_libraw.c index bed4efc5..dc4ce64c 100644 --- a/src/image_load_libraw.c +++ b/src/image_load_libraw.c @@ -135,11 +135,11 @@ guchar *libraw_get_preview(ImageLoader *il, guint *data_len) #else /* !define HAVE_RAW */ -void libraw_free_preview(guchar *buf) +void libraw_free_preview(guchar *UNUSED(buf)) { } -guchar *libraw_get_preview(ImageLoader *il, guint *data_len) +guchar *libraw_get_preview(ImageLoader *UNUSED(il), guint *UNUSED(data_len)) { return NULL; } diff --git a/src/layout_util.c b/src/layout_util.c index a6766726..3213c6f5 100644 --- a/src/layout_util.c +++ b/src/layout_util.c @@ -1809,10 +1809,9 @@ static void layout_menu_keyword_autocomplete_cb(GtkAction *UNUSED(action), gpoin * color profile button (and menu) *----------------------------------------------------------------------------- */ - +#ifdef HAVE_LCMS static void layout_color_menu_enable_cb(GtkToggleAction *action, gpointer data) { -#ifdef HAVE_LCMS LayoutWindow *lw = data; if (layout_image_color_profile_get_use(lw) == gtk_toggle_action_get_active(action)) return; @@ -1820,12 +1819,16 @@ static void layout_color_menu_enable_cb(GtkToggleAction *action, gpointer data) layout_image_color_profile_set_use(lw, gtk_toggle_action_get_active(action)); layout_util_sync_color(lw); layout_image_refresh(lw); -#endif } +#else +static void layout_color_menu_enable_cb() +{ +} +#endif +#ifdef HAVE_LCMS static void layout_color_menu_use_image_cb(GtkToggleAction *action, gpointer data) { -#ifdef HAVE_LCMS LayoutWindow *lw = data; gint input; gboolean use_image; @@ -1835,12 +1838,16 @@ static void layout_color_menu_use_image_cb(GtkToggleAction *action, gpointer dat layout_image_color_profile_set(lw, input, gtk_toggle_action_get_active(action)); layout_util_sync_color(lw); layout_image_refresh(lw); -#endif } +#else +static void layout_color_menu_use_image_cb() +{ +} +#endif +#ifdef HAVE_LCMS static void layout_color_menu_input_cb(GtkRadioAction *action, GtkRadioAction *UNUSED(current), gpointer data) { -#ifdef HAVE_LCMS LayoutWindow *lw = data; gint type; gint input; @@ -1854,8 +1861,12 @@ static void layout_color_menu_input_cb(GtkRadioAction *action, GtkRadioAction *U layout_image_color_profile_set(lw, type, use_image); layout_image_refresh(lw); -#endif } +#else +static void layout_color_menu_input_cb() +{ +} +#endif /* diff --git a/src/lua.c b/src/lua.c index c6888f4e..b09e3e92 100644 --- a/src/lua.c +++ b/src/lua.c @@ -425,6 +425,7 @@ gchar *lua_callvalue(FileData *fd, const gchar *file, const gchar *function) } // if (error) { ... } else return data; } - +#else +typedef int dummy_variable; #endif /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/main.c b/src/main.c index 5285d777..23808958 100644 --- a/src/main.c +++ b/src/main.c @@ -1167,10 +1167,8 @@ gint main(gint argc, gchar *argv[]) gdk_set_allowed_backends("x11,*"); -#ifdef HAVE_GTHREAD gdk_threads_init(); gdk_threads_enter(); -#endif /* init execution time counter (debug only) */ init_exec_time(); @@ -1469,9 +1467,8 @@ gint main(gint argc, gchar *argv[]) DEBUG_1("%s main: gtk_main", get_exec_time()); gtk_main(); -#ifdef HAVE_GTHREAD + gdk_threads_leave(); -#endif return 0; } /* vim: set shiftwidth=8 softtabstop=0 cindent cinoptions={1s: */ diff --git a/src/meson.build b/src/meson.build index b433a33c..ea2dbf83 100644 --- a/src/meson.build +++ b/src/meson.build @@ -250,19 +250,20 @@ icon_pairs = [ 'icon_tabcomp', files('ui_tabcomp.png'), ] -ui_icons_h = custom_target(output : 'ui_icons.h', +ui_icons_h = custom_target('ui_icons', output : 'ui_icons.h', command : [gdk_pixbuf_csource, '--raw', '--extern', '--build-list', icon_pairs], capture : true) project_sources += ui_icons_h -xxd = find_program('xxd') -run_command(xxd, '-i', - 'ClayRGB1998.icc', - join_paths(meson.project_build_root(), 'src', 'ClayRGB1998_icc.h'), - check : true) +xxd = find_program('generate-ClayRGB1998-icc-h.sh', dirs : join_paths(meson.source_root(), 'scripts')) -project_sources += 'ClayRGB1998_icc.h' +ClayRGB1998_icc_h = custom_target('ClayRGB1998', + output : 'ClayRGB1998_icc.h', + command : [xxd, join_paths(meson.current_source_dir(), 'ClayRGB1998.icc')], + capture : true) + +project_sources += ClayRGB1998_icc_h executable('geeqie', project_sources, dependencies : [ diff --git a/src/misc.c b/src/misc.c index 4d695ac7..1b02004a 100644 --- a/src/misc.c +++ b/src/misc.c @@ -390,7 +390,7 @@ void tree_path_free_wrapper(void *data, void *UNUSED(useradata)) /* Copied from the libarchive .repo. examples */ #ifndef HAVE_ARCHIVE -gchar *open_archive(FileData *fd) +gchar *open_archive(FileData *UNUSED(fd)) { log_printf("%s", _("Warning: libarchive not installed")); return NULL; -- 2.20.1