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 # podir project_root/po
39 # * See meson_options.txt file
45 version : run_command('./version.sh', check : true).stdout().strip(),
46 license : ['GPL-2.0-or-later'],
47 meson_version : '>=1.0.0',
48 default_options : ['cpp_std=c++14', 'warning_level=3', 'buildtype=debugoptimized', 'cpp_link_args=-rdynamic']
51 # To inhibit warnings from the generated file icons.h
52 add_global_arguments('-Wno-overlength-strings', language : 'c')
54 # To compile originally-C files as C++
55 add_global_arguments('-Wno-error=deprecated-declarations', language : 'cpp')
57 # Project requirements
59 gnome = import('gnome')
60 thread_dep = dependency('threads')
61 cc = meson.get_compiler('cpp')
64 configuration_inc = include_directories('.')
66 # Extended stack trace using backward-app
67 option = get_option('devel')
69 if cc.has_link_argument('-ldwarf')
70 add_project_link_arguments('-ldwarf', language: 'cpp')
75 glib_compile_resources = find_program('glib-compile-resources', required : true)
76 glib_genmarshal = find_program('glib-genmarshal', required : true)
78 option = get_option('git')
79 if not option.disabled()
80 running_from_git = find_program('git', required: false).found() and fs.is_dir('.git')
82 running_from_git = false
83 summary({'git' : ['disabled - ChangeLog, ChangeLog.html, lua-api help file created:', false]}, section : 'Documentation', bool_yn : true)
86 debug = get_option('debug')
88 # Note that main.cc sets prefix to the directory above where the executable is run from.
89 # This is to allow AppImages to be used
91 # These gq_* variables are paths relative to /prefix/,
92 # and are also used in defines in the source as GQ_*
93 if get_option('gq_appdir') == ''
94 gq_appdir = join_paths(get_option('datadir'), 'geeqie')
96 gq_appdir = get_option('gq_appdir')
99 # This is not the same as Meson bindir
100 if get_option('gq_bindir') == ''
101 gq_bindir = 'lib/geeqie'
103 gq_bindir = get_option('gq_bindir')
106 if get_option('gq_helpdir') == ''
107 gq_helpdir = join_paths(get_option('datadir'), 'doc/geeqie')
109 gq_helpdir = get_option('gq_helpdir')
112 if get_option('gq_htmldir') == ''
113 gq_htmldir = join_paths(get_option('datadir'), 'doc/geeqie/html')
115 gq_htmldir = get_option('gq_htmldir')
118 if get_option('gq_localedir') == ''
119 gq_localedir = join_paths(get_option('datadir'), 'locale')
121 gq_localedir = get_option('gq_localedir')
125 # Set up the absolute directory paths used
126 prefix = get_option('prefix')
127 datadir = join_paths(prefix, get_option('datadir'))
129 # Installation paths are absolute
130 appdir = join_paths(prefix, gq_appdir)
131 appdatadir = join_paths(datadir, 'metainfo')
132 desktopdir = join_paths(datadir, meson.project_name(), 'applications')
133 helpdir = join_paths(prefix, gq_helpdir)
134 htmldir = join_paths(prefix, gq_htmldir)
135 icondir = join_paths(datadir, 'pixmaps')
136 mandir1 = join_paths(datadir, 'man', 'man1')
138 podir = join_paths(meson.project_source_root(), 'po')
139 scriptsdir = join_paths(meson.project_source_root(), 'scripts')
141 summary({'gq_appdir': gq_appdir,
142 'gq_bindir': gq_helpdir,
143 'gq_helpdir': gq_helpdir,
144 'gq_htmldir': gq_htmldir,
145 'gq_localedir': gq_localedir,
146 }, section: 'Directories')
148 # Create the define constants used in the sources. Set via config.h.in
149 conf_data = configuration_data()
150 conf_data.set('DEBUG', debug)
152 conf_data.set('HAVE_GTK4', 0)
153 option = get_option('gtk4')
155 gtk_dep = dependency('gtk4', required: true)
156 conf_data.set('HAVE_GTK4', 1)
158 gtk_dep = dependency('gtk+-3.0', version : '>=3.24', required: true)
160 glib_dep = dependency('glib-2.0', version : '>=2.52', required: true)
162 # Required only when backward-cpp is used
163 conf_data.set('HAVE_DEVELOPER', 0)
166 option = get_option('devel')
168 libdw_dep = dependency('libdw', required : true)
170 libunwind_dep = dependency('libunwind', required : true)
171 if libunwind_dep.found()
172 conf_data.set('HAVE_DEVELOPER', 1)
173 summary({'developer mode' : ['extended stacktrace:', true]}, section : 'Debugging', bool_yn : true)
175 summary({'developer mode' : ['libunwind not found. extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
178 summary({'developer mode' : ['libdw not found. extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
181 summary({'developer mode' : ['extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
184 # Required only for seg. fault stacktrace and backtrace debugging
185 conf_data.set('HAVE_EXECINFO_H', 0)
186 option = get_option('execinfo')
188 if not option.disabled()
189 result = cc.check_header('execinfo.h')
191 # Include unconditionally dependency for NetBSD.
192 libexecinfo_dep = cc.find_library('execinfo', required : false)
193 conf_data.set('HAVE_EXECINFO_H', 1)
194 summary({'execinfo' : ['stacktrace supported:', true]}, section : 'Debugging', bool_yn : true)
196 summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
199 summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
202 conf_data.set('HAVE_ARCHIVE', 0)
204 req_version = '>=3.4.0'
205 option = get_option('archive')
206 if not option.disabled()
207 libarchive_dep = dependency('libarchive', version : req_version, required : get_option('archive'))
208 if libarchive_dep.found()
209 conf_data.set('HAVE_ARCHIVE', 1)
210 summary({'archive' : ['archive files e.g. .zip supported:', true]}, section : 'Configuration', bool_yn : true)
212 summary({'archive' : ['libarchive ' + req_version + ' not found - archive files e.g. .zip supported::', false]}, section : 'Configuration', bool_yn : true)
215 summary({'archive' : ['disabled - archive files e.g. .zip supported:', false]}, section : 'Configuration', bool_yn : true)
218 conf_data.set('HAVE_LCMS', 0)
219 conf_data.set('HAVE_LCMS2', 0)
221 req_version = '>=2.0'
222 option = get_option('cms')
223 if not option.disabled()
224 xxd = find_program('xxd', 'xxdi.pl', required : false)
226 lcms_dep = dependency('lcms2', version : req_version, required : get_option('cms'))
228 conf_data.set('HAVE_LCMS', 1)
229 conf_data.set('HAVE_LCMS2', 1)
230 summary({'cms' : ['color management supported:', true]}, section : 'Configuration', bool_yn : true)
232 summary({'cms' : ['lcms2' + req_version + ' not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
235 summary({'cms' : ['xxd or xxdi.pl not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
238 summary({'cms' : ['disabled - color management supported:', false]}, section : 'Configuration', bool_yn : true)
241 conf_data.set('HAVE_DJVU', 0)
243 req_version = '>=2.5.27'
244 option = get_option('djvu')
245 if not option.disabled()
246 ddjvuapi_dep = dependency('ddjvuapi', version : req_version, required : get_option('djvu'))
247 if ddjvuapi_dep.found()
248 conf_data.set('HAVE_DJVU', 1)
249 summary({'djvu' : ['djvu files supported:', true]}, section : 'Configuration', bool_yn : true)
251 summary({'djvu' : ['ddjvuapi ' + req_version + ' not found - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
254 summary({'djvu' : ['disabled - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
257 option = get_option('evince')
258 if not option.disabled()
259 evince = find_program('evince', required : false)
261 summary({'print preview' : ['print preview supported:', true]}, section : 'Configuration', bool_yn : true)
263 summary({'print preview' : ['evince not found - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
266 summary({'print preview' : ['disabled - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
269 # Required only for seg. fault stacktrace and backtrace debugging
270 conf_data.set('HAVE_EXECINFO_H', 0)
271 option = get_option('execinfo')
272 if not option.disabled()
273 result = cc.check_header('execinfo.h')
275 conf_data.set('HAVE_EXECINFO_H', 1)
276 summary({'execinfo' : ['stacktrace supported:', true]}, section : 'Configuration', bool_yn : true)
278 summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
281 summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
284 conf_data.set('HAVE_EXIV2', 0)
286 req_version = '>=0.18'
287 option = get_option('exiv2')
288 if not option.disabled()
289 exiv2_dep = dependency('exiv2', version : req_version, required : get_option('exiv2'))
291 conf_data.set('HAVE_EXIV2', 1)
292 summary({'exiv2' : ['image metadata processed by exiv2:', true]}, section : 'Configuration', bool_yn : true)
294 summary({'exiv2' : ['exiv2 ' + req_version + ' not found - image data not processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
297 summary({'exiv2' : ['disabled - image data processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
300 conf_data.set('HAVE_CLUTTER', 0)
301 conf_data.set('HAVE_LIBCHAMPLAIN', 0)
302 conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 0)
304 champlain_gtk_dep = []
307 req_version_champlain = '>=0.12'
308 req_version_champlain_gtk = '>=0.12'
309 req_version_clutter = '>=1.0'
310 req_version_clutter_gtk = '>=1.0'
311 option = get_option('gps-map')
312 if not option.disabled()
313 champlain_dep = dependency('champlain-0.12', version : req_version_champlain, required : get_option('gps-map'))
314 champlain_gtk_dep = dependency('champlain-gtk-0.12', version : req_version_champlain_gtk, required : get_option('gps-map'))
315 if champlain_dep.found() and champlain_gtk_dep.found()
316 clutter_dep = dependency('clutter-1.0', version : req_version_clutter, required : get_option('gps-map'))
317 clutter_gtk_dep = dependency('clutter-gtk-1.0', version : req_version_clutter_gtk, required : get_option('gps-map'))
318 if clutter_dep.found() and clutter_gtk_dep.found()
319 conf_data.set('HAVE_CLUTTER', 1)
320 conf_data.set('HAVE_LIBCHAMPLAIN', 1)
321 conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 1)
322 summary({'gps-map' : ['GPS map displayed', true]}, section : 'Configuration', bool_yn : true)
324 if not clutter_dep.found()
325 summary({'gps-map-clutter' : ['clutter-1.0 ' + req_version_clutter + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
327 if not clutter_gtk_dep.found()
328 summary({'gps-map-clutter-gtk' : ['clutter-gtk-1.0 ' + req_version_clutter_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
332 if not champlain_dep.found()
333 summary({'gps-map-champlain' : ['champlain-0.12 ' + req_version_champlain + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
335 if not champlain_gtk_dep.found()
336 summary({'gps-map-champlain-gtk' : ['champlain-gtk-0.12 ' + req_version_champlain_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
340 summary({'gps-map' : ['disabled - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
343 conf_data.set('HAVE_HEIF', 0)
345 req_version = '>=1.3.2'
346 option = get_option('heif')
347 if not option.disabled()
348 libheif_dep = dependency('libheif', version : req_version, required : get_option('heif'))
349 if libheif_dep.found()
350 conf_data.set('HAVE_HEIF', 1)
351 summary({'heif' : ['heif files supported:', true]}, section : 'Configuration', bool_yn : true)
353 summary({'heif' : ['libheif ' + req_version + ' not found - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
356 summary({'heif' : ['disabled - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
359 conf_data.set('HAVE_J2K', 0)
361 req_version = '>=2.3.0'
362 option = get_option('j2k')
363 if not option.disabled()
364 libopenjp2_dep = dependency('libopenjp2', version : req_version, required : get_option('j2k'))
365 if libopenjp2_dep.found()
366 conf_data.set('HAVE_J2K', 1)
367 summary({'j2k' : ['j2k files supported:', true]}, section : 'Configuration', bool_yn : true)
369 summary({'j2k' : ['libopenjp2 ' + req_version + ' not found - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
372 summary({'j2k' : ['disabled - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
375 conf_data.set('HAVE_JPEG', 0)
377 option = get_option('jpeg')
378 if not option.disabled()
379 libjpeg_dep = dependency('libjpeg', required : get_option('jpeg'))
380 if libjpeg_dep.found()
381 if cc.has_function('jpeg_destroy_decompress', dependencies : libjpeg_dep)
382 conf_data.set('HAVE_JPEG', 1)
383 summary({'jpeg' : ['jpeg files supported:', true]}, section : 'Configuration', bool_yn : true)
385 summary({'jpeg' : ['jpeg_destroy_decompress not found - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
388 summary({'jpeg' : ['libjpeg: not found', false]}, section : 'Configuration', bool_yn : true)
391 summary({'jpeg' : ['disabled - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
394 conf_data.set('HAVE_JPEGXL', 0)
396 req_version = '>=0.3.7'
397 option = get_option('jpegxl')
398 if not option.disabled()
399 libjxl_dep = dependency('libjxl', version : req_version, required : get_option('jpegxl'))
400 if libjxl_dep.found()
401 conf_data.set('HAVE_JPEGXL', 1)
402 summary({'jpegxl' : ['jpegxl files supported:', true]}, section : 'Configuration', bool_yn : true)
404 summary({'jpegxl' : ['libjxl ' + req_version + ' not found - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
407 summary({'jpegxl' : ['disabled - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
410 conf_data.set('HAVE_RAW', 0)
412 req_version = '>=0.20'
413 option = get_option('libraw')
414 if not option.disabled()
415 libraw_dep = dependency('libraw', version : req_version, required : get_option('libraw'))
416 if libraw_dep.found()
417 conf_data.set('HAVE_RAW', 1)
418 summary({'libraw' : ['.cr3 files supported:', true]}, section : 'Configuration', bool_yn : true)
420 summary({'libraw' : ['libraw ' + req_version + ' not found - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
423 summary({'libraw' : ['disabled - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
426 conf_data.set('HAVE_LUA', 0)
428 req_version = '>=5.3'
429 option = get_option('lua')
430 if not option.disabled()
431 lua_dep = dependency('lua', 'lua5.3', 'lua-5.3', 'lua53', version: req_version, required: get_option('lua'))
433 conf_data.set('HAVE_LUA', 1)
434 summary({'lua' : ['lua supported:', true]}, section : 'Configuration', bool_yn : true)
436 summary({'lua' : ['lua ' + req_version + ' not found - lua supported:', false]}, section : 'Configuration', bool_yn : true)
439 summary({'lua' : ['disabled - lua supported:', false]}, section : 'Configuration', bool_yn : true)
442 # Install standard documents
443 option = get_option('pandoc')
444 if not option.disabled()
445 pandoc = find_program('pandoc', required : false)
447 readme_html = custom_target(
450 output: 'README.html',
451 command: [pandoc, '@INPUT@', '-o', '@OUTPUT@'],
453 install_dir: helpdir)
455 summary({'README' : ['README.html created:', true]}, section : 'Documentation', bool_yn : true)
457 summary({'README' : ['pandoc not found - README.html created:', false]}, section : 'Documentation', bool_yn : true)
460 summary({'pandoc' : ['disabled - README.html created:', false]}, section : 'Documentation', bool_yn : true)
462 install_data('README.md', 'COPYING', 'TODO', install_dir : helpdir)
464 conf_data.set('HAVE_PDF', 0)
465 poppler_glib_dep = []
466 req_version = '>=0.62'
467 option = get_option('pdf')
468 if not option.disabled()
469 poppler_glib_dep = dependency('poppler-glib', version : req_version, required : get_option('pdf'))
470 if poppler_glib_dep.found()
471 conf_data.set('HAVE_PDF', 1)
472 summary({'pdf' : ['pdf files supported:', true]}, section : 'Configuration', bool_yn : true)
474 summary({'pdf' : ['poppler-glib ' + req_version + ' not found - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
477 summary({'pdf' : ['disabled - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
480 conf_data.set('HAVE_SPELL', 0)
482 req_version = '>=1.6'
483 option = get_option('spell')
484 if not option.disabled()
485 gspell_dep = dependency('gspell-1', version : req_version, required: get_option('spell'))
486 if gspell_dep.found()
487 conf_data.set('HAVE_SPELL', 1)
488 summary({'spell' : ['spelling checks enabled', true]}, section : 'Configuration', bool_yn : true)
490 summary({'spell' : ['gspell-1 ' + req_version + ' not found - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
493 summary({'spell' : ['disabled - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
496 conf_data.set('HAVE_TIFF', 0)
498 option = get_option('tiff')
499 if not option.disabled()
500 tiff_dep = dependency('libtiff-4', required: get_option('tiff'))
502 if cc.has_function('TIFFClientOpen', dependencies : tiff_dep)
503 conf_data.set('HAVE_TIFF', 1)
504 summary({'tiff' : ['tiff files supported:', true]}, section : 'Configuration', bool_yn : true)
506 summary({'tiff' : ['TIFFClientOpen not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
509 summary({'tiff' : ['libtiff not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
512 summary({'tiff' : ['disabled - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
515 conf_data.set('HAVE_FFMPEGTHUMBNAILER', 0)
516 conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 0)
517 conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 0)
518 conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 0)
519 libffmpegthumbnailer_dep = []
520 req_version = '>=2.1.0'
521 option = get_option('videothumbnailer')
522 if not option.disabled()
523 libffmpegthumbnailer_dep = dependency('libffmpegthumbnailer',
524 version : req_version,
525 required : get_option('videothumbnailer'))
527 if libffmpegthumbnailer_dep.found()
528 conf_data.set('HAVE_FFMPEGTHUMBNAILER', 1)
529 summary({'videothumbnailer' : ['thumbnails of video files supported:', true]}, section : 'Configuration', bool_yn : true)
531 result = cc.has_member('struct video_thumbnailer_struct', 'prefer_embedded_metadata', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>')
533 conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 1)
535 summary({'fmpegthumbnailer_metadata' : ['fmpegthumbnailer_metadata found:', result]}, section : 'Thumbnailer', bool_yn : true)
537 result = cc.has_member('struct image_data_struct', 'image_data_width', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>' )
539 conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 1)
541 summary({'fmpegthumbnailer_rgb' : ['fmpegthumbnailer_rgb found:', result]}, section : 'Thumbnailer', bool_yn : true)
543 result = cc.has_function('video_thumbnailer_set_size', dependencies : libffmpegthumbnailer_dep)
545 conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 1)
547 summary({'fmpegthumbnailer_set_size' : ['fmpegthumbnailer_set_size found:', result]}, section : 'Thumbnailer', bool_yn : true)
549 summary({'videothumbnailer' : ['libvideothumbnailer ' + req_version + ' not found - thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
552 summary({'videothumbnailer' : ['disabled -thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
555 conf_data.set('HAVE_WEBP', 0)
557 req_version = '>=0.6.1'
558 option = get_option('webp')
559 if not option.disabled()
560 libwebp_dep = dependency('libwebp', version : req_version, required : get_option('webp'))
561 if libwebp_dep.found()
562 conf_data.set('HAVE_WEBP', 1)
563 summary({'webp' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true)
565 summary({'webp' : ['libwebp ' + req_version + ' not found - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
568 summary({'webp' : ['disabled - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
571 # Check for nl_langinfo and _NL_TIME_FIRST_WEEKDAY
572 conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 0)
573 code = '''#include <langinfo.h>
575 int main (int argc, char ** argv) {
577 c = nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
580 if cc.links(code, name : 'nl_langinfo and _NL_TIME_FIRST_WEEKDAY')
581 conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 1)
582 summary({'nl_langinfo' : ['first weekday depends on locale:', true]}, section : 'Documentation', bool_yn : true)
584 summary({'nl_langinfo' : ['nl_langinfo not found - first weekday depends on locale:', false, 'first weekday defaults to Monday']}, section : 'Documentation', bool_yn : true)
587 conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
588 conf_data.set_quoted('GQ_APPDIR', gq_appdir)
589 conf_data.set_quoted('GQ_BINDIR', gq_bindir)
590 conf_data.set_quoted('GQ_HELPDIR', gq_helpdir)
591 conf_data.set_quoted('GQ_HTMLDIR', gq_htmldir)
592 conf_data.set_quoted('GQ_LOCALEDIR', gq_localedir)
594 conf_data.set_quoted('PACKAGE', meson.project_name())
595 conf_data.set_quoted('PACKAGE_NAME', meson.project_name())
596 conf_data.set_quoted('PACKAGE_STRING', meson.project_version())
597 conf_data.set_quoted('PACKAGE_TARNAME', meson.project_name())
598 conf_data.set_quoted('PACKAGE_VERSION', meson.project_version())
599 conf_data.set_quoted('VERSION', meson.project_version())
601 configure_file(input : 'config.h.in',
604 configuration : conf_data)
606 # For gtk builder checks on .ui files
609 # Process subdirs before the sources
613 # Generate the executable
616 # Generate the help files
619 # Install other project files
621 cmd = [find_program('gen_changelog.sh'), meson.current_source_dir(), meson.current_build_dir()]
624 input: 'ChangeLog.gqview',
625 output: ['ChangeLog', 'ChangeLog.html'],
628 install_dir: helpdir)
629 meson.add_dist_script(cmd)
630 summary({'ChangeLog' : ['ChangeLog, ChangeLog.html created:', true]}, section : 'Documentation', bool_yn : true)
631 elif fs.exists('ChangeLog.html')
632 install_data('ChangeLog', 'ChangeLog.html', install_dir: helpdir)
633 summary({'ChangeLog' : ['ChangeLog, ChangeLog.html installed from dist:', true]}, section : 'Documentation', bool_yn : true)
636 install_data('geeqie.png', install_dir : icondir)
637 install_data('geeqie.1', install_dir : mandir1)
640 input : 'org.geeqie.Geeqie.desktop.in',
641 output : 'org.geeqie.Geeqie.desktop',
645 install_dir : join_paths(datadir, 'applications'))
648 input : 'org.geeqie.Geeqie.appdata.xml.in',
649 output : 'org.geeqie.Geeqie.appdata.xml',
653 install_dir : appdatadir)
655 configure_file(input: 'geeqie.spec.in', output: 'geeqie.spec', configuration: conf_data)
657 # Basic test of the executable
658 # is_parallel false is to avoid problems with images tests
659 xvfb = find_program('xvfb-run', required : false)
661 test('Basic test', xvfb, args: ['--auto-servernum', geeqie_exe, '--version'], is_parallel : false, timeout: 100)
662 summary({'xvfb' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
664 summary({'xvfb' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
667 # The tests are run on GitHub with all options disabled, and then
668 # Image tests use option devel as a flag so that normal users do not
669 # download the test image database.
672 option = get_option('devel')
675 get_test_images_sh = find_program('get-test-images.sh', dirs : scriptsdir, required : true)
676 image_test_sh = find_program('image-test.sh', dirs : scriptsdir, required : true)
678 images_dir = join_paths(meson.current_build_dir(), 'test-images.p')
680 message('Downloading test images')
681 sources_list = run_command(get_test_images_sh, images_dir, 'https://github.com/caclark/geeqie-test.git', check: true)
683 sources = sources_list.stdout().strip().split('\n')
685 foreach image : sources
686 image_path = '@0@'.format(image)
687 path_array = image_path.split('/')
688 image_name = path_array[path_array.length() - 1]
690 if image_name.startswith('fail')
691 test('Image_ ' + image_name, image_test_sh, args: [geeqie_exe, image], is_parallel : false, should_fail : true, timeout: 100)
693 test('Image_ ' + image_name, image_test_sh, args: [geeqie_exe, image], is_parallel : false, timeout: 100)
696 summary({'Image tests' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
698 summary({'Image tests' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
701 summary({'Image tests' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
704 # Code correctness checks
706 clang_tidy_exe = find_program('clang-tidy', required : false)
707 if clang_tidy_exe.found()
708 git_exe = find_program('git', required : true)
709 modified_file_list = run_command(git_exe, 'diff', 'origin/master', '--name-only', './src/*.cc', './src/pan-view/*.cc', './src/view-file/*.cc', check: true)
710 modified_files = modified_file_list.stdout().strip().split('\n')
712 foreach modified_file : modified_files
713 if modified_file.endswith('.cc')
714 modified_file_path = '@0@'.format(modified_file)
715 path_array = modified_file_path.split('/')
716 modified_file_name = path_array[path_array.length() - 1]
717 modified_file_full_path = join_paths(meson.project_source_root(), modified_file)
718 config_file = join_paths(meson.project_source_root(), '.clang-tidy')
720 test('Code Correctness_ ' + modified_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', '--config-file', config_file, modified_file_full_path], timeout : 100)
724 summary({'Code Correctness' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
726 summary({'Code Correctness' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
729 summary({'Code Correctness' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
733 option = get_option('lua')
734 if not option.disabled()
737 lua_test_sh = find_program('lua-test.sh', dirs : scriptsdir, required : true)
738 test('Lua test', lua_test_sh, args: [geeqie_exe], is_parallel : false, timeout: 100)
740 summary({'lua' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
742 summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
745 summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
748 summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
751 # Ancillary files test
752 test_ancillary_files_sh = find_program('test-ancillary-files.sh', dirs : scriptsdir, required : true)
753 test('Ancillary files', test_ancillary_files_sh, args: [meson.current_source_dir()], timeout: 100)
755 summary({'Ancillary files' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)