1 # This file is a part of Geeqie project (https://www.geeqie.org/).
2 # Copyright (C) 2008 - 2022 The Geeqie Team
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # Meson default directories used in this project:
23 # Project expanded default directories:
25 # bindir /usr/local/bin geeqie executable
26 # gq_bindir /usr/local/lib/geeqie * plugins scripts
27 # datadir /usr/local/share/
28 # /usr/local/share/applications org.geeqie.Geeqie.desktop
29 # [gq_]appdir /usr/local/share/geeqie/ * org,geeqie.template.desktop
30 # desktopdir /usr/local/share/geeqie/applications plugin desktop files
31 # appdatadir /usr/local/share/metainfo org.geeqie.Geeqie.appdata.xml
32 # icondir /usr/local/share/pixmaps geeqie.png icon
33 # [gq_]helpdir /usr/local/share/doc/geeqie * readme files etc.
34 # [gq_]htmldir /usr/local/share/doc/geeqie/html * help files
35 # gq_localedir /usr/locale/share/locale
36 # mandir1 /usr/local/share/man/man1 man page
37 # completionsdir /usr/local/share/bash-completion/completions bash command line completions
38 # podir project_root/po
40 # * See meson_options.txt file
46 version : run_command('./version.sh', check : true).stdout().strip(),
47 license : ['GPL-2.0-or-later'],
48 meson_version : '>=1.0.0',
49 default_options : ['cpp_std=c++14', 'warning_level=3', 'buildtype=debugoptimized', 'cpp_link_args=-rdynamic']
52 # To inhibit warnings from the generated file icons.h
53 add_global_arguments('-Wno-overlength-strings', language : 'c')
55 # To compile originally-C files as C++
56 add_global_arguments('-Wno-error=deprecated-declarations', language : 'cpp')
58 # Project requirements
60 gnome = import('gnome')
61 thread_dep = dependency('threads')
62 cc = meson.get_compiler('cpp')
65 configuration_inc = include_directories('.')
67 # Extended stack trace using backward-app
68 option = get_option('devel')
70 if cc.has_link_argument('-ldwarf')
71 add_project_link_arguments('-ldwarf', language: 'cpp')
76 glib_compile_resources = find_program('glib-compile-resources', required : true)
77 glib_genmarshal = find_program('glib-genmarshal', required : true)
79 option = get_option('git')
80 if not option.disabled()
81 running_from_git = find_program('git', required: false).found() and fs.is_dir('.git')
83 running_from_git = false
84 summary({'git' : ['disabled - ChangeLog, ChangeLog.html, lua-api help file created:', false]}, section : 'Documentation', bool_yn : true)
87 debug = get_option('debug')
89 # Note that main.cc sets prefix to the directory above where the executable is run from.
90 # This is to allow AppImages to be used
92 # These gq_* variables are paths relative to /prefix/,
93 # and are also used in defines in the source as GQ_*
94 if get_option('gq_appdir') == ''
95 gq_appdir = join_paths(get_option('datadir'), 'geeqie')
97 gq_appdir = get_option('gq_appdir')
100 # This is not the same as Meson bindir
101 if get_option('gq_bindir') == ''
102 gq_bindir = 'lib/geeqie'
104 gq_bindir = get_option('gq_bindir')
107 if get_option('gq_helpdir') == ''
108 gq_helpdir = join_paths(get_option('datadir'), 'doc/geeqie')
110 gq_helpdir = get_option('gq_helpdir')
113 if get_option('gq_htmldir') == ''
114 gq_htmldir = join_paths(get_option('datadir'), 'doc/geeqie/html')
116 gq_htmldir = get_option('gq_htmldir')
119 if get_option('gq_localedir') == ''
120 gq_localedir = join_paths(get_option('datadir'), 'locale')
122 gq_localedir = get_option('gq_localedir')
126 # Set up the absolute directory paths used
127 prefix = get_option('prefix')
128 datadir = join_paths(prefix, get_option('datadir'))
130 # Installation paths are absolute
131 appdir = join_paths(prefix, gq_appdir)
132 appdatadir = join_paths(datadir, 'metainfo')
133 desktopdir = join_paths(datadir, meson.project_name(), 'applications')
134 helpdir = join_paths(prefix, gq_helpdir)
135 htmldir = join_paths(prefix, gq_htmldir)
136 icondir = join_paths(datadir, 'pixmaps')
137 mandir1 = join_paths(datadir, 'man', 'man1')
138 completionsdir = join_paths(datadir, 'bash-completion', 'completions')
139 podir = join_paths(meson.project_source_root(), 'po')
140 scriptsdir = join_paths(meson.project_source_root(), 'scripts')
142 summary({'gq_appdir': gq_appdir,
143 'gq_bindir': gq_helpdir,
144 'gq_helpdir': gq_helpdir,
145 'gq_htmldir': gq_htmldir,
146 'gq_localedir': gq_localedir,
147 }, section: 'Directories')
149 # Create the define constants used in the sources. Set via config.h.in
150 conf_data = configuration_data()
151 conf_data.set('DEBUG', debug)
153 conf_data.set('HAVE_GTK4', 0)
154 option = get_option('gtk4')
156 gtk_dep = dependency('gtk4', required: true)
157 conf_data.set('HAVE_GTK4', 1)
159 gtk_dep = dependency('gtk+-3.0', version : '>=3.24', required: true)
161 glib_dep = dependency('glib-2.0', version : '>=2.52', required: true)
163 # Required only when backward-cpp is used
164 conf_data.set('HAVE_DEVELOPER', 0)
167 option = get_option('devel')
169 libdw_dep = dependency('libdw', required : true)
171 libunwind_dep = dependency('libunwind', required : true)
172 if libunwind_dep.found()
173 conf_data.set('HAVE_DEVELOPER', 1)
174 summary({'developer mode' : ['extended stacktrace:', true]}, section : 'Debugging', bool_yn : true)
176 summary({'developer mode' : ['libunwind not found. extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
179 summary({'developer mode' : ['libdw not found. extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
182 summary({'developer mode' : ['extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
185 # Required only for seg. fault stacktrace and backtrace debugging
186 conf_data.set('HAVE_EXECINFO_H', 0)
187 option = get_option('execinfo')
189 if not option.disabled()
190 result = cc.check_header('execinfo.h')
192 # Include unconditionally dependency for NetBSD.
193 libexecinfo_dep = cc.find_library('execinfo', required : false)
194 conf_data.set('HAVE_EXECINFO_H', 1)
195 summary({'execinfo' : ['stacktrace supported:', true]}, section : 'Debugging', bool_yn : true)
197 summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
200 summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
203 conf_data.set('HAVE_ARCHIVE', 0)
205 req_version = '>=3.4.0'
206 option = get_option('archive')
207 if not option.disabled()
208 libarchive_dep = dependency('libarchive', version : req_version, required : get_option('archive'))
209 if libarchive_dep.found()
210 conf_data.set('HAVE_ARCHIVE', 1)
211 summary({'archive' : ['archive files e.g. .zip supported:', true]}, section : 'Configuration', bool_yn : true)
213 summary({'archive' : ['libarchive ' + req_version + ' not found - archive files e.g. .zip supported::', false]}, section : 'Configuration', bool_yn : true)
216 summary({'archive' : ['disabled - archive files e.g. .zip supported:', false]}, section : 'Configuration', bool_yn : true)
219 conf_data.set('HAVE_LCMS', 0)
220 conf_data.set('HAVE_LCMS2', 0)
222 req_version = '>=2.0'
223 option = get_option('cms')
224 if not option.disabled()
225 xxd = find_program('xxd', 'xxdi.pl', required : false)
227 lcms_dep = dependency('lcms2', version : req_version, required : get_option('cms'))
229 conf_data.set('HAVE_LCMS', 1)
230 conf_data.set('HAVE_LCMS2', 1)
231 summary({'cms' : ['color management supported:', true]}, section : 'Configuration', bool_yn : true)
233 summary({'cms' : ['lcms2' + req_version + ' not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
236 summary({'cms' : ['xxd or xxdi.pl not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
239 summary({'cms' : ['disabled - color management supported:', false]}, section : 'Configuration', bool_yn : true)
242 conf_data.set('HAVE_DJVU', 0)
244 req_version = '>=2.5.27'
245 option = get_option('djvu')
246 if not option.disabled()
247 ddjvuapi_dep = dependency('ddjvuapi', version : req_version, required : get_option('djvu'))
248 if ddjvuapi_dep.found()
249 conf_data.set('HAVE_DJVU', 1)
250 summary({'djvu' : ['djvu files supported:', true]}, section : 'Configuration', bool_yn : true)
252 summary({'djvu' : ['ddjvuapi ' + req_version + ' not found - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
255 summary({'djvu' : ['disabled - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
258 option = get_option('evince')
259 if not option.disabled()
260 evince = find_program('evince', required : false)
262 summary({'print preview' : ['print preview supported:', true]}, section : 'Configuration', bool_yn : true)
264 summary({'print preview' : ['evince not found - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
267 summary({'print preview' : ['disabled - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
270 # Required only for seg. fault stacktrace and backtrace debugging
271 conf_data.set('HAVE_EXECINFO_H', 0)
272 option = get_option('execinfo')
273 if not option.disabled()
274 result = cc.check_header('execinfo.h')
276 conf_data.set('HAVE_EXECINFO_H', 1)
277 summary({'execinfo' : ['stacktrace supported:', true]}, section : 'Configuration', bool_yn : true)
279 summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
282 summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
285 conf_data.set('HAVE_EXIV2', 0)
287 req_version = '>=0.18'
288 option = get_option('exiv2')
289 if not option.disabled()
290 exiv2_dep = dependency('exiv2', version : req_version, required : get_option('exiv2'))
292 conf_data.set('HAVE_EXIV2', 1)
293 summary({'exiv2' : ['image metadata processed by exiv2:', true]}, section : 'Configuration', bool_yn : true)
295 summary({'exiv2' : ['exiv2 ' + req_version + ' not found - image data not processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
298 summary({'exiv2' : ['disabled - image data processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
301 conf_data.set('HAVE_CLUTTER', 0)
302 conf_data.set('HAVE_LIBCHAMPLAIN', 0)
303 conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 0)
305 champlain_gtk_dep = []
308 req_version_champlain = '>=0.12'
309 req_version_champlain_gtk = '>=0.12'
310 req_version_clutter = '>=1.0'
311 req_version_clutter_gtk = '>=1.0'
312 option = get_option('gps-map')
313 if not option.disabled()
314 champlain_dep = dependency('champlain-0.12', version : req_version_champlain, required : get_option('gps-map'))
315 champlain_gtk_dep = dependency('champlain-gtk-0.12', version : req_version_champlain_gtk, required : get_option('gps-map'))
316 if champlain_dep.found() and champlain_gtk_dep.found()
317 clutter_dep = dependency('clutter-1.0', version : req_version_clutter, required : get_option('gps-map'))
318 clutter_gtk_dep = dependency('clutter-gtk-1.0', version : req_version_clutter_gtk, required : get_option('gps-map'))
319 if clutter_dep.found() and clutter_gtk_dep.found()
320 conf_data.set('HAVE_CLUTTER', 1)
321 conf_data.set('HAVE_LIBCHAMPLAIN', 1)
322 conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 1)
323 summary({'gps-map' : ['GPS map displayed', true]}, section : 'Configuration', bool_yn : true)
325 if not clutter_dep.found()
326 summary({'gps-map-clutter' : ['clutter-1.0 ' + req_version_clutter + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
328 if not clutter_gtk_dep.found()
329 summary({'gps-map-clutter-gtk' : ['clutter-gtk-1.0 ' + req_version_clutter_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
333 if not champlain_dep.found()
334 summary({'gps-map-champlain' : ['champlain-0.12 ' + req_version_champlain + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
336 if not champlain_gtk_dep.found()
337 summary({'gps-map-champlain-gtk' : ['champlain-gtk-0.12 ' + req_version_champlain_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
341 summary({'gps-map' : ['disabled - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
344 conf_data.set('HAVE_HEIF', 0)
346 req_version = '>=1.3.2'
347 option = get_option('heif')
348 if not option.disabled()
349 libheif_dep = dependency('libheif', version : req_version, required : get_option('heif'))
350 if libheif_dep.found()
351 conf_data.set('HAVE_HEIF', 1)
352 summary({'heif' : ['heif files supported:', true]}, section : 'Configuration', bool_yn : true)
354 summary({'heif' : ['libheif ' + req_version + ' not found - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
357 summary({'heif' : ['disabled - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
360 conf_data.set('HAVE_J2K', 0)
362 req_version = '>=2.3.0'
363 option = get_option('j2k')
364 if not option.disabled()
365 libopenjp2_dep = dependency('libopenjp2', version : req_version, required : get_option('j2k'))
366 if libopenjp2_dep.found()
367 conf_data.set('HAVE_J2K', 1)
368 summary({'j2k' : ['j2k files supported:', true]}, section : 'Configuration', bool_yn : true)
370 summary({'j2k' : ['libopenjp2 ' + req_version + ' not found - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
373 summary({'j2k' : ['disabled - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
376 conf_data.set('HAVE_JPEG', 0)
378 option = get_option('jpeg')
379 if not option.disabled()
380 libjpeg_dep = dependency('libjpeg', required : get_option('jpeg'))
381 if libjpeg_dep.found()
382 if cc.has_function('jpeg_destroy_decompress', dependencies : libjpeg_dep)
383 conf_data.set('HAVE_JPEG', 1)
384 summary({'jpeg' : ['jpeg files supported:', true]}, section : 'Configuration', bool_yn : true)
386 summary({'jpeg' : ['jpeg_destroy_decompress not found - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
389 summary({'jpeg' : ['libjpeg: not found', false]}, section : 'Configuration', bool_yn : true)
392 summary({'jpeg' : ['disabled - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
395 conf_data.set('HAVE_JPEGXL', 0)
397 req_version = '>=0.3.7'
398 option = get_option('jpegxl')
399 if not option.disabled()
400 libjxl_dep = dependency('libjxl', version : req_version, required : get_option('jpegxl'))
401 if libjxl_dep.found()
402 conf_data.set('HAVE_JPEGXL', 1)
403 summary({'jpegxl' : ['jpegxl files supported:', true]}, section : 'Configuration', bool_yn : true)
405 summary({'jpegxl' : ['libjxl ' + req_version + ' not found - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
408 summary({'jpegxl' : ['disabled - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
411 conf_data.set('HAVE_RAW', 0)
413 req_version = '>=0.20'
414 option = get_option('libraw')
415 if not option.disabled()
416 libraw_dep = dependency('libraw', version : req_version, required : get_option('libraw'))
417 if libraw_dep.found()
418 conf_data.set('HAVE_RAW', 1)
419 summary({'libraw' : ['.cr3 files supported:', true]}, section : 'Configuration', bool_yn : true)
421 summary({'libraw' : ['libraw ' + req_version + ' not found - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
424 summary({'libraw' : ['disabled - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
427 conf_data.set('HAVE_LUA', 0)
429 req_version = '>=5.3'
430 option = get_option('lua')
431 if not option.disabled()
432 lua_dep = dependency('lua', 'lua5.3', 'lua-5.3', 'lua53', version: req_version, required: get_option('lua'))
434 conf_data.set('HAVE_LUA', 1)
435 summary({'lua' : ['lua supported:', true]}, section : 'Configuration', bool_yn : true)
437 summary({'lua' : ['lua ' + req_version + ' not found - lua supported:', false]}, section : 'Configuration', bool_yn : true)
440 summary({'lua' : ['disabled - lua supported:', false]}, section : 'Configuration', bool_yn : true)
443 # Install standard documents
444 option = get_option('pandoc')
445 if not option.disabled()
446 pandoc = find_program('pandoc', required : false)
448 readme_html = custom_target(
451 output: 'README.html',
452 command: [pandoc, '@INPUT@', '-o', '@OUTPUT@'],
454 install_dir: helpdir)
456 summary({'README' : ['README.html created:', true]}, section : 'Documentation', bool_yn : true)
458 summary({'README' : ['pandoc not found - README.html created:', false]}, section : 'Documentation', bool_yn : true)
461 summary({'pandoc' : ['disabled - README.html created:', false]}, section : 'Documentation', bool_yn : true)
463 install_data('README.md', 'COPYING', 'TODO', install_dir : helpdir)
465 conf_data.set('HAVE_PDF', 0)
466 poppler_glib_dep = []
467 req_version = '>=0.62'
468 option = get_option('pdf')
469 if not option.disabled()
470 poppler_glib_dep = dependency('poppler-glib', version : req_version, required : get_option('pdf'))
471 if poppler_glib_dep.found()
472 conf_data.set('HAVE_PDF', 1)
473 summary({'pdf' : ['pdf files supported:', true]}, section : 'Configuration', bool_yn : true)
475 summary({'pdf' : ['poppler-glib ' + req_version + ' not found - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
478 summary({'pdf' : ['disabled - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
481 conf_data.set('HAVE_SPELL', 0)
483 req_version = '>=1.6'
484 option = get_option('spell')
485 if not option.disabled()
486 gspell_dep = dependency('gspell-1', version : req_version, required: get_option('spell'))
487 if gspell_dep.found()
488 conf_data.set('HAVE_SPELL', 1)
489 summary({'spell' : ['spelling checks enabled', true]}, section : 'Configuration', bool_yn : true)
491 summary({'spell' : ['gspell-1 ' + req_version + ' not found - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
494 summary({'spell' : ['disabled - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
497 conf_data.set('HAVE_TIFF', 0)
499 option = get_option('tiff')
500 if not option.disabled()
501 tiff_dep = dependency('libtiff-4', required: get_option('tiff'))
503 if cc.has_function('TIFFClientOpen', dependencies : tiff_dep)
504 conf_data.set('HAVE_TIFF', 1)
505 summary({'tiff' : ['tiff files supported:', true]}, section : 'Configuration', bool_yn : true)
507 summary({'tiff' : ['TIFFClientOpen not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
510 summary({'tiff' : ['libtiff not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
513 summary({'tiff' : ['disabled - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
516 conf_data.set('HAVE_FFMPEGTHUMBNAILER', 0)
517 conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 0)
518 conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 0)
519 conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 0)
520 libffmpegthumbnailer_dep = []
521 req_version = '>=2.1.0'
522 option = get_option('videothumbnailer')
523 if not option.disabled()
524 libffmpegthumbnailer_dep = dependency('libffmpegthumbnailer',
525 version : req_version,
526 required : get_option('videothumbnailer'))
528 if libffmpegthumbnailer_dep.found()
529 conf_data.set('HAVE_FFMPEGTHUMBNAILER', 1)
530 summary({'videothumbnailer' : ['thumbnails of video files supported:', true]}, section : 'Configuration', bool_yn : true)
532 result = cc.has_member('struct video_thumbnailer_struct', 'prefer_embedded_metadata', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>')
534 conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 1)
536 summary({'fmpegthumbnailer_metadata' : ['fmpegthumbnailer_metadata found:', result]}, section : 'Thumbnailer', bool_yn : true)
538 result = cc.has_member('struct image_data_struct', 'image_data_width', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>' )
540 conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 1)
542 summary({'fmpegthumbnailer_rgb' : ['fmpegthumbnailer_rgb found:', result]}, section : 'Thumbnailer', bool_yn : true)
544 result = cc.has_function('video_thumbnailer_set_size', dependencies : libffmpegthumbnailer_dep)
546 conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 1)
548 summary({'fmpegthumbnailer_set_size' : ['fmpegthumbnailer_set_size found:', result]}, section : 'Thumbnailer', bool_yn : true)
550 summary({'videothumbnailer' : ['libvideothumbnailer ' + req_version + ' not found - thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
553 summary({'videothumbnailer' : ['disabled -thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
556 conf_data.set('HAVE_WEBP', 0)
558 req_version = '>=0.6.1'
559 option = get_option('webp')
560 if not option.disabled()
561 libwebp_dep = dependency('libwebp', version : req_version, required : get_option('webp'))
562 if libwebp_dep.found()
563 conf_data.set('HAVE_WEBP', 1)
564 summary({'webp' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true)
566 summary({'webp' : ['libwebp ' + req_version + ' not found - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
569 summary({'webp' : ['disabled - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
572 # Check for nl_langinfo and _NL_TIME_FIRST_WEEKDAY
573 conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 0)
574 code = '''#include <langinfo.h>
576 int main (int argc, char ** argv) {
578 c = nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
581 if cc.links(code, name : 'nl_langinfo and _NL_TIME_FIRST_WEEKDAY')
582 conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 1)
583 summary({'nl_langinfo' : ['first weekday depends on locale:', true]}, section : 'Documentation', bool_yn : true)
585 summary({'nl_langinfo' : ['nl_langinfo not found - first weekday depends on locale:', false, 'first weekday defaults to Monday']}, section : 'Documentation', bool_yn : true)
588 conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
589 conf_data.set_quoted('GQ_APPDIR', gq_appdir)
590 conf_data.set_quoted('GQ_BINDIR', gq_bindir)
591 conf_data.set_quoted('GQ_HELPDIR', gq_helpdir)
592 conf_data.set_quoted('GQ_HTMLDIR', gq_htmldir)
593 conf_data.set_quoted('GQ_LOCALEDIR', gq_localedir)
595 conf_data.set_quoted('PACKAGE', meson.project_name())
596 conf_data.set_quoted('PACKAGE_NAME', meson.project_name())
597 conf_data.set_quoted('PACKAGE_STRING', meson.project_version())
598 conf_data.set_quoted('PACKAGE_TARNAME', meson.project_name())
599 conf_data.set_quoted('PACKAGE_VERSION', meson.project_version())
600 conf_data.set_quoted('VERSION', meson.project_version())
602 configure_file(input : 'config.h.in',
605 configuration : conf_data)
607 # For gtk builder checks on .ui files
610 # Process subdirs before the sources
614 # Generate the executable
617 # Generate the help files
620 # Generate the command line auto-complete file
621 subdir('auto-complete')
623 # Install other project files
625 cmd = [find_program('gen_changelog.sh'), meson.current_source_dir(), meson.current_build_dir()]
628 input: 'ChangeLog.gqview',
629 output: ['ChangeLog', 'ChangeLog.html'],
632 install_dir: helpdir)
633 meson.add_dist_script(cmd)
634 summary({'ChangeLog' : ['ChangeLog, ChangeLog.html created:', true]}, section : 'Documentation', bool_yn : true)
635 elif fs.exists('ChangeLog.html')
636 install_data('ChangeLog', 'ChangeLog.html', install_dir: helpdir)
637 summary({'ChangeLog' : ['ChangeLog, ChangeLog.html installed from dist:', true]}, section : 'Documentation', bool_yn : true)
640 install_data('geeqie.png', install_dir : icondir)
641 install_data('geeqie.1', install_dir : mandir1)
644 input : 'org.geeqie.Geeqie.desktop.in',
645 output : 'org.geeqie.Geeqie.desktop',
649 install_dir : join_paths(datadir, 'applications'))
652 input : 'org.geeqie.Geeqie.appdata.xml.in',
653 output : 'org.geeqie.Geeqie.appdata.xml',
657 install_dir : appdatadir)
659 configure_file(input: 'geeqie.spec.in', output: 'geeqie.spec', configuration: conf_data)
661 # Basic test of the executable
662 # is_parallel false is to avoid problems with images tests
663 xvfb = find_program('xvfb-run', required : false)
665 test('Basic test', xvfb, args: ['--auto-servernum', geeqie_exe, '--version'], is_parallel : false, timeout: 100)
666 summary({'xvfb' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
668 summary({'xvfb' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
671 # The tests are run on GitHub with all options disabled, and then
672 # Image tests use option devel as a flag so that normal users do not
673 # download the test image database.
676 option = get_option('devel')
679 get_test_images_sh = find_program('get-test-images.sh', dirs : scriptsdir, required : true)
680 image_test_sh = find_program('image-test.sh', dirs : scriptsdir, required : true)
682 images_dir = join_paths(meson.current_build_dir(), 'test-images.p')
684 message('Downloading test images')
685 sources_list = run_command(get_test_images_sh, images_dir, 'https://github.com/caclark/geeqie-test.git', check: true)
687 sources = sources_list.stdout().strip().split('\n')
689 foreach image : sources
690 image_path = '@0@'.format(image)
691 path_array = image_path.split('/')
692 image_name = path_array[path_array.length() - 1]
694 if image_name.startswith('fail')
695 test('Image_ ' + image_name, image_test_sh, args: [geeqie_exe, image], is_parallel : false, should_fail : true, timeout: 100)
697 test('Image_ ' + image_name, image_test_sh, args: [geeqie_exe, image], is_parallel : false, timeout: 100)
700 summary({'Image tests' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
702 summary({'Image tests' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
705 summary({'Image tests' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
708 # Code correctness checks
710 clang_tidy_exe = find_program('clang-tidy', required : false)
711 if clang_tidy_exe.found()
712 git_exe = find_program('git', required : true)
714 foreach source_file : main_sources + pan_view_sources + view_file_sources
715 if fs.name(source_file).endswith('.cc')
716 source_file_name = fs.name(source_file)
717 config_file = join_paths(meson.project_source_root(), '.clang-tidy')
719 test('Code Correctness_ ' + source_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', '--config-file', config_file, source_file], timeout : 100)
723 summary({'Code Correctness' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
725 summary({'Code Correctness' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
728 summary({'Code Correctness' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
731 # Single value enum checks
732 enum_check_sh = find_program('enum-check.sh', dirs : scriptsdir, required : true)
733 if enum_check_sh.found()
734 foreach source_file : main_sources + pan_view_sources + view_file_sources
735 source_file_name = fs.name(source_file)
736 test('Single Value enum_ ' + source_file_name, enum_check_sh, args : [source_file], timeout : 100)
739 summary({'Single Value enum' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
741 summary({'Single Value enum' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
744 # Debug statement checks
745 debug_check_sh = find_program('debug-check.sh', dirs : scriptsdir, required : true)
746 if debug_check_sh.found()
747 foreach source_file : main_sources + pan_view_sources + view_file_sources
748 source_file_name = fs.name(source_file)
749 if (source_file_name != 'debug.h')
750 test('Debug Statements_ ' + source_file_name, debug_check_sh, args : [source_file], timeout : 100)
754 summary({'Debug Statements' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
756 summary({'Debug Statements' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
760 option = get_option('lua')
761 if not option.disabled()
764 lua_test_sh = find_program('lua-test.sh', dirs : scriptsdir, required : true)
765 test('Lua test', lua_test_sh, args: [geeqie_exe], is_parallel : false, timeout: 100)
767 summary({'lua' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
769 summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
772 summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
775 summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
778 # Ancillary files test
779 test_ancillary_files_sh = find_program('test-ancillary-files.sh', dirs : scriptsdir, required : true)
780 test('Ancillary files', test_ancillary_files_sh, args: [meson.current_source_dir()], timeout: 100)
782 summary({'Ancillary files' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)