-
Notifications
You must be signed in to change notification settings - Fork 79
/
meson.build
915 lines (817 loc) · 37.4 KB
/
meson.build
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
# 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
# (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.
# Meson default directories used in this project:
# prefix - /usr/local
# bindir - bin
# datadir - share
# Meson core options:
# buildtype
# debug
# Project expanded default directories:
# prefix /usr/local/
# bindir /usr/local/bin geeqie executable
# gq_bindir /usr/local/lib/geeqie * plugins scripts
# datadir /usr/local/share/
# /usr/local/share/applications org.geeqie.Geeqie.desktop
# [gq_]appdir /usr/local/share/geeqie/ * org,geeqie.template.desktop
# desktopdir /usr/local/share/geeqie/applications plugin desktop files
# appdatadir /usr/local/share/metainfo org.geeqie.Geeqie.appdata.xml
# icondir /usr/local/share/pixmaps geeqie.png icon
# [gq_]helpdir /usr/local/share/doc/geeqie * readme files etc.
# [gq_]htmldir /usr/local/share/doc/geeqie/html * help files
# gq_localedir /usr/locale/share/locale
# mandir1 /usr/local/share/man/man1 man page
# completionsdir /usr/local/share/bash-completion/completions bash command line completions
# podir project_root/po
# * See meson_options.txt file
project(
'geeqie',
'c',
'cpp',
version : run_command('./version.sh', check : true).stdout().strip(),
license : ['GPL-2.0-or-later'],
meson_version : '>=1.0.0',
default_options : ['cpp_std=c++14', 'warning_level=3', 'buildtype=debugoptimized', 'cpp_link_args=-rdynamic']
)
# To inhibit warnings from the generated file icons.h
add_global_arguments('-Wno-overlength-strings', language : 'c')
# To compile originally-C files as C++
add_global_arguments('-Wno-error=deprecated-declarations', language : 'cpp')
# Project requirements
# code_sources is all human-written geeqie C/C++ code
code_sources = []
# project_sources will include code_sources, as well as auto-generated code,
# third-party code, and some other code-like dependencies.
project_sources = []
gnome = import('gnome')
thread_dep = dependency('threads')
cc = meson.get_compiler('cpp')
i18n = import('i18n')
fs = import('fs')
configuration_inc = include_directories('.')
# External programs
glib_compile_resources = find_program('glib-compile-resources', required : true)
glib_genmarshal = find_program('glib-genmarshal', required : true)
option = get_option('git')
if not option.disabled()
running_from_git = find_program('git', required: false).found() and fs.is_dir('.git')
else
running_from_git = false
summary({'git' : ['disabled - ChangeLog, ChangeLog.html, lua-api help file created:', false]}, section : 'Documentation', bool_yn : true)
endif
debug = get_option('debug')
# Note that main.cc sets prefix to the directory above where the executable is run from.
# This is to allow AppImages to be used
# These gq_* variables are paths relative to /prefix/,
# and are also used in defines in the source as GQ_*
if get_option('gq_appdir') == ''
gq_appdir = join_paths(get_option('datadir'), 'geeqie')
else
gq_appdir = get_option('gq_appdir')
endif
# This is not the same as Meson bindir
if get_option('gq_bindir') == ''
gq_bindir = 'lib/geeqie'
else
gq_bindir = get_option('gq_bindir')
endif
if get_option('gq_helpdir') == ''
gq_helpdir = join_paths(get_option('datadir'), 'doc/geeqie')
else
gq_helpdir = get_option('gq_helpdir')
endif
if get_option('gq_htmldir') == ''
gq_htmldir = join_paths(get_option('datadir'), 'doc/geeqie/html')
else
gq_htmldir = get_option('gq_htmldir')
endif
if get_option('gq_localedir') == ''
gq_localedir = join_paths(get_option('datadir'), 'locale')
else
gq_localedir = get_option('gq_localedir')
endif
# Set up the absolute directory paths used
prefix = get_option('prefix')
datadir = join_paths(prefix, get_option('datadir'))
# Installation paths are absolute
appdir = join_paths(prefix, gq_appdir)
appdatadir = join_paths(datadir, 'metainfo')
desktopdir = join_paths(datadir, meson.project_name(), 'applications')
helpdir = join_paths(prefix, gq_helpdir)
htmldir = join_paths(prefix, gq_htmldir)
icondir = join_paths(datadir, 'pixmaps')
mandir1 = join_paths(datadir, 'man', 'man1')
completionsdir = join_paths(datadir, 'bash-completion', 'completions')
podir = join_paths(meson.project_source_root(), 'po')
scriptsdir = join_paths(meson.project_source_root(), 'scripts')
summary({'gq_appdir': gq_appdir,
'gq_bindir': gq_helpdir,
'gq_helpdir': gq_helpdir,
'gq_htmldir': gq_htmldir,
'gq_localedir': gq_localedir,
}, section: 'Directories')
# Create the define constants used in the sources. Set via config.h.in
conf_data = configuration_data()
conf_data.set('DEBUG', debug)
conf_data.set('HAVE_GTK4', 0)
option = get_option('gtk4')
if option.enabled()
gtk_dep = dependency('gtk4', required: true)
conf_data.set('HAVE_GTK4', 1)
else
gtk_dep = dependency('gtk+-3.0', version : '>=3.24', required: true)
endif
glib_dep = dependency('glib-2.0', version : '>=2.52', required: true)
# Required only when backward-cpp is used
conf_data.set('HAVE_DEVELOPER', 0)
libdw_dep = []
libunwind_dep = []
option = get_option('extended_stacktrace')
if not option.disabled()
libdw_dep = dependency('libdw', required : false)
if libdw_dep.found()
libunwind_dep = dependency('libunwind', required : false)
if libunwind_dep.found()
if cc.has_link_argument('-ldwarf')
add_project_link_arguments('-ldwarf', language: 'cpp')
conf_data.set('HAVE_DEVELOPER', 1)
summary({'developer mode' : ['extended stacktrace:', true]}, section : 'Debugging', bool_yn : true)
else
summary({'developer mode' : ['link argument -ldwarf not found. extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
endif
else
summary({'developer mode' : ['libunwind not found. extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
endif
else
summary({'developer mode' : ['libdw not found. extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
endif
else
summary({'developer mode' : ['extended stacktrace:', false]}, section : 'Debugging', bool_yn : true)
endif
# Required only for seg. fault stacktrace and backtrace debugging
conf_data.set('HAVE_EXECINFO_H', 0)
option = get_option('execinfo')
libexecinfo_dep = []
if not option.disabled()
result = cc.check_header('execinfo.h')
if result
# Include unconditionally dependency for NetBSD.
libexecinfo_dep = cc.find_library('execinfo', required : false)
conf_data.set('HAVE_EXECINFO_H', 1)
summary({'execinfo' : ['stacktrace supported:', true]}, section : 'Debugging', bool_yn : true)
else
summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
endif
else
summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
endif
conf_data.set('ENABLE_UNIT_TESTS', 0)
option = get_option('unit_tests')
if not option.disabled()
conf_data.set('ENABLE_UNIT_TESTS', 1)
# Summary is handled below, where the test() itself is defined.
endif
conf_data.set('HAVE_ARCHIVE', 0)
libarchive_dep = []
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)
summary({'archive' : ['archive files e.g. .zip supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'archive' : ['libarchive ' + req_version + ' not found - archive files e.g. .zip supported::', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'archive' : ['disabled - archive files e.g. .zip supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_LCMS', 0)
conf_data.set('HAVE_LCMS2', 0)
lcms_dep = []
req_version = '>=2.0'
option = get_option('cms')
if not option.disabled()
xxd = find_program('xxd', 'xxdi.pl', required : false)
if xxd.found()
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)
summary({'cms' : ['color management supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'cms' : ['lcms2' + req_version + ' not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'cms' : ['xxd or xxdi.pl not found - color management supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'cms' : ['disabled - color management supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_DJVU', 0)
ddjvuapi_dep = []
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)
summary({'djvu' : ['djvu files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'djvu' : ['ddjvuapi ' + req_version + ' not found - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'djvu' : ['disabled - djvu files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
option = get_option('evince')
if not option.disabled()
evince = find_program('evince', required : false)
if evince.found()
summary({'print preview' : ['print preview supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'print preview' : ['evince not found - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'print preview' : ['disabled - print preview supported:', false]}, section : 'Configuration', bool_yn : true)
endif
# Required only for seg. fault stacktrace and backtrace debugging
conf_data.set('HAVE_EXECINFO_H', 0)
option = get_option('execinfo')
if not option.disabled()
result = cc.check_header('execinfo.h')
if result
conf_data.set('HAVE_EXECINFO_H', 1)
summary({'execinfo' : ['stacktrace supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_EXIV2', 0)
exiv2_dep = []
req_version = '>=0.18'
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)
summary({'exiv2' : ['image metadata processed by exiv2:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'exiv2' : ['exiv2 ' + req_version + ' not found - image data not processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'exiv2' : ['disabled - image data processed by exiv2:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_EXR', 0)
exr_dep = []
req_version_exr = '>=3.0.0'
imath_dep = []
req_version_imath = '>=3.0.0'
option = get_option('exr')
if not option.disabled()
exr_dep = dependency('OpenEXR', version : req_version_exr, required : get_option('exr'))
if exr_dep.found()
imath_dep = dependency('Imath', version : req_version_imath, required : get_option('exr'))
if imath_dep.found()
conf_data.set('HAVE_EXR', 1)
summary({'exr' : ['exr files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'exr' : ['imath ' + req_version_imath + ' not found - exr files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'exr' : ['exr ' + req_version_exr + ' not found - exr files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'exr' : ['disabled - exr files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_FITS', 0)
fits_dep = []
option = get_option('fits')
if not option.disabled()
fits_dep = dependency('cfitsio', required: get_option('fits'))
if fits_dep.found()
conf_data.set('HAVE_FITS', 1)
summary({'fits' : ['fits files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'fits' : ['libcfitsio not found - fits files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'fits' : ['disabled - fits files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_CLUTTER', 0)
conf_data.set('HAVE_LIBCHAMPLAIN', 0)
conf_data.set('HAVE_LIBCHAMPLAIN_GTK', 0)
champlain_dep = []
champlain_gtk_dep = []
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)
summary({'gps-map' : ['GPS map displayed', true]}, section : 'Configuration', bool_yn : true)
else
if not clutter_dep.found()
summary({'gps-map-clutter' : ['clutter-1.0 ' + req_version_clutter + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
endif
if not clutter_gtk_dep.found()
summary({'gps-map-clutter-gtk' : ['clutter-gtk-1.0 ' + req_version_clutter_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
endif
endif
else
if not champlain_dep.found()
summary({'gps-map-champlain' : ['champlain-0.12 ' + req_version_champlain + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
endif
if not champlain_gtk_dep.found()
summary({'gps-map-champlain-gtk' : ['champlain-gtk-0.12 ' + req_version_champlain_gtk + ' not found - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
endif
endif
else
summary({'gps-map' : ['disabled - GPS map displayed:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_HEIF', 0)
libheif_dep = []
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)
summary({'heif' : ['heif files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'heif' : ['libheif ' + req_version + ' not found - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'heif' : ['disabled - heif files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_J2K', 0)
libopenjp2_dep = []
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)
summary({'j2k' : ['j2k files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'j2k' : ['libopenjp2 ' + req_version + ' not found - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'j2k' : ['disabled - j2k files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_JPEG', 0)
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)
summary({'jpeg' : ['jpeg files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'jpeg' : ['jpeg_destroy_decompress not found - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'jpeg' : ['libjpeg: not found', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'jpeg' : ['disabled - jpeg files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_JPEGXL', 0)
libjxl_dep = []
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)
summary({'jpegxl' : ['jpegxl files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'jpegxl' : ['libjxl ' + req_version + ' not found - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'jpegxl' : ['disabled - jpegxl files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_RAW', 0)
libraw_dep = []
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)
summary({'libraw' : ['.cr3 files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'libraw' : ['libraw ' + req_version + ' not found - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'libraw' : ['disabled - .cr3 files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_LUA', 0)
lua_dep = []
req_version = '>=5.3'
option = get_option('lua')
if not option.disabled()
lua_dep = dependency('lua', 'lua5.3', 'lua-5.3', 'lua53', version: req_version, required: get_option('lua'))
if lua_dep.found()
conf_data.set('HAVE_LUA', 1)
summary({'lua' : ['lua supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'lua' : ['lua ' + req_version + ' not found - lua supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'lua' : ['disabled - lua supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_NPY', 0)
option = get_option('npy')
if not option.disabled()
conf_data.set('HAVE_NPY', 1)
summary({'npy' : ['npy supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'npy' : ['npy supported:', false]}, section : 'Configuration', bool_yn : true)
endif
# Install standard documents
option = get_option('pandoc')
if not option.disabled()
pandoc = find_program('pandoc', required : false)
if pandoc.found()
readme_html = custom_target(
'README.html',
input: 'README.md',
output: 'README.html',
command: [pandoc, '@INPUT@', '-o', '@OUTPUT@'],
install: true,
install_dir: helpdir)
summary({'README' : ['README.html created:', true]}, section : 'Documentation', bool_yn : true)
else
summary({'README' : ['pandoc not found - README.html created:', false]}, section : 'Documentation', bool_yn : true)
endif
else
summary({'pandoc' : ['disabled - README.html created:', false]}, section : 'Documentation', bool_yn : true)
endif
install_data('README.md', 'COPYING', 'TODO', install_dir : helpdir)
conf_data.set('HAVE_PDF', 0)
poppler_glib_dep = []
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)
summary({'pdf' : ['pdf files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'pdf' : ['poppler-glib ' + req_version + ' not found - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'pdf' : ['disabled - pdf files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_SPELL', 0)
gspell_dep = []
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)
summary({'spell' : ['spelling checks enabled', true]}, section : 'Configuration', bool_yn : true)
else
summary({'spell' : ['gspell-1 ' + req_version + ' not found - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'spell' : ['disabled - spelling checks enabled', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_TIFF', 0)
tiff_dep = []
option = get_option('tiff')
if not option.disabled()
tiff_dep = dependency('libtiff-4', required: get_option('tiff'))
if tiff_dep.found()
if cc.has_function('TIFFClientOpen', dependencies : tiff_dep)
conf_data.set('HAVE_TIFF', 1)
summary({'tiff' : ['tiff files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'tiff' : ['TIFFClientOpen not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'tiff' : ['libtiff not found - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'tiff' : ['disabled - tiff files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_FFMPEGTHUMBNAILER', 0)
conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 0)
conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 0)
conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 0)
libffmpegthumbnailer_dep = []
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)
summary({'videothumbnailer' : ['thumbnails of video files supported:', true]}, section : 'Configuration', bool_yn : true)
result = cc.has_member('struct video_thumbnailer_struct', 'prefer_embedded_metadata', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>')
if result
conf_data.set('HAVE_FFMPEGTHUMBNAILER_METADATA', 1)
endif
summary({'fmpegthumbnailer_metadata' : ['fmpegthumbnailer_metadata found:', result]}, section : 'Thumbnailer', bool_yn : true)
result = cc.has_member('struct image_data_struct', 'image_data_width', prefix : '#include <libffmpegthumbnailer/videothumbnailerc.h>' )
if result
conf_data.set('HAVE_FFMPEGTHUMBNAILER_RGB', 1)
endif
summary({'fmpegthumbnailer_rgb' : ['fmpegthumbnailer_rgb found:', result]}, section : 'Thumbnailer', bool_yn : true)
result = cc.has_function('video_thumbnailer_set_size', dependencies : libffmpegthumbnailer_dep)
if result
conf_data.set('HAVE_FFMPEGTHUMBNAILER_WH', 1)
endif
summary({'fmpegthumbnailer_set_size' : ['fmpegthumbnailer_set_size found:', result]}, section : 'Thumbnailer', bool_yn : true)
else
summary({'videothumbnailer' : ['libvideothumbnailer ' + req_version + ' not found - thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'videothumbnailer' : ['disabled -thumbnails of video files supported', false]}, section : 'Configuration', bool_yn : true)
endif
conf_data.set('HAVE_WEBP', 0)
libwebp_dep = []
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)
summary({'webp' : ['webp files supported:', true]}, section : 'Configuration', bool_yn : true)
else
summary({'webp' : ['libwebp ' + req_version + ' not found - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
else
summary({'webp' : ['disabled - webp files supported:', false]}, section : 'Configuration', bool_yn : true)
endif
# Check for nl_langinfo and _NL_TIME_FIRST_WEEKDAY
conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 0)
code = '''#include <langinfo.h>
#include<stdio.h>
int main (int argc, char ** argv) {
char *c;
c = nl_langinfo(_NL_TIME_FIRST_WEEKDAY);
return 0;
}'''
if cc.links(code, name : 'nl_langinfo and _NL_TIME_FIRST_WEEKDAY')
conf_data.set('HAVE__NL_TIME_FIRST_WEEKDAY', 1)
summary({'nl_langinfo' : ['first weekday depends on locale:', true]}, section : 'Documentation', bool_yn : true)
else
summary({'nl_langinfo' : ['nl_langinfo not found - first weekday depends on locale:', false, 'first weekday defaults to Monday']}, section : 'Documentation', bool_yn : true)
endif
conf_data.set_quoted('GETTEXT_PACKAGE', meson.project_name())
conf_data.set_quoted('GQ_APPDIR', gq_appdir)
conf_data.set_quoted('GQ_BINDIR', gq_bindir)
conf_data.set_quoted('GQ_HELPDIR', gq_helpdir)
conf_data.set_quoted('GQ_HTMLDIR', gq_htmldir)
conf_data.set_quoted('GQ_LOCALEDIR', gq_localedir)
conf_data.set_quoted('PACKAGE', meson.project_name())
conf_data.set_quoted('PACKAGE_NAME', meson.project_name())
conf_data.set_quoted('PACKAGE_STRING', meson.project_version())
conf_data.set_quoted('PACKAGE_TARNAME', meson.project_name())
conf_data.set_quoted('PACKAGE_VERSION', meson.project_version())
conf_data.set_quoted('VERSION', meson.project_version())
configure_file(input : 'config.h.in',
output : 'config.h',
encoding : 'UTF-8',
configuration : conf_data)
# For gtk builder checks on .ui files
ui_sources = []
# Process subdirs before the sources
subdir('po')
subdir('plugins')
conditional_unit_test_deps = []
if conf_data.get('ENABLE_UNIT_TESTS', 0) == 1
system_gtest_dep = dependency('gtest', main : false, required : false)
system_gmock_dep = dependency('gmock', required : false)
if system_gtest_dep.found() and system_gmock_dep.found()
conditional_unit_test_deps += system_gtest_dep
conditional_unit_test_deps += system_gmock_dep
else
# Use the subproject gtest as a fallback.
gtest_subproj = subproject('gtest')
conditional_unit_test_deps += gtest_subproj.get_variable('gtest_dep')
conditional_unit_test_deps += gtest_subproj.get_variable('gmock_dep')
endif
endif
# Generate the executable
subdir('src')
# Generate the help files
subdir('doc')
# Generate the command line auto-complete file
subdir('auto-complete')
# Install other project files
if running_from_git
cmd = [find_program('gen_changelog.sh'), meson.current_source_dir(), meson.current_build_dir()]
custom_target(
'ChangeLog',
input: 'ChangeLog.gqview',
output: ['ChangeLog', 'ChangeLog.html'],
command: cmd,
install: true,
install_dir: helpdir)
meson.add_dist_script(cmd)
summary({'ChangeLog' : ['ChangeLog, ChangeLog.html created:', true]}, section : 'Documentation', bool_yn : true)
elif fs.exists('ChangeLog.html')
install_data('ChangeLog', 'ChangeLog.html', install_dir: helpdir)
summary({'ChangeLog' : ['ChangeLog, ChangeLog.html installed from dist:', true]}, section : 'Documentation', bool_yn : true)
endif
install_data('geeqie.png', install_dir : icondir)
install_data('geeqie.1', install_dir : mandir1)
i18n.merge_file(
input : 'org.geeqie.Geeqie.desktop.in',
output : 'org.geeqie.Geeqie.desktop',
type : 'desktop',
po_dir : podir,
install : true,
install_dir : join_paths(datadir, 'applications'))
i18n.merge_file(
input : 'org.geeqie.cache-maintenance.desktop.in',
output : 'org.geeqie.cache-maintenance.desktop',
type : 'desktop',
po_dir : podir,
install : true,
install_dir : join_paths(datadir, 'applications'))
i18n.merge_file(
input : 'org.geeqie.Geeqie.appdata.xml.in',
output : 'org.geeqie.Geeqie.appdata.xml',
type : 'xml',
po_dir : podir,
install : true,
install_dir : appdatadir)
configure_file(input: 'geeqie.spec.in', output: 'geeqie.spec', configuration: conf_data)
isolate_test_sh = find_program('isolate-test.sh', dirs : scriptsdir, required : true)
# Basic test of the executable
xvfb = find_program('xvfb-run', required : false)
if xvfb.found()
test_cmd = [xvfb.full_path(), '--auto-servernum', geeqie_exe.full_path(), '--version']
test('Basic test', isolate_test_sh, args: test_cmd, timeout: 100, suite: 'functional')
summary({'xvfb' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'xvfb' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
# The tests are run on GitHub with all options disabled, and then
# Image tests use option unit_tests as a flag so that normal users do not
# download the test image database.
# Image checks
option = get_option('unit_tests')
if option.enabled()
if xvfb.found()
get_test_images_sh = find_program('get-test-images.sh', dirs : scriptsdir, required : true)
image_test_py = find_program('image-test.py', dirs : scriptsdir, required : true)
images_dir = join_paths(meson.current_build_dir(), 'test-images.p')
message('Downloading test images')
sources_list = run_command(get_test_images_sh, images_dir, 'https://github.com/caclark/geeqie-test.git', check: true)
sources = sources_list.stdout().strip().split('\n')
foreach image : sources
path_array = image.split('/')
image_name = path_array[path_array.length() - 1]
should_fail = image_name.startswith('fail')
test_cmd = [image_test_py.full_path(), geeqie_exe.full_path(), image]
test('Image_ ' + image_name, isolate_test_sh, args: test_cmd, should_fail : should_fail, timeout: 100, suite: ['functional', 'image'])
endforeach
summary({'Image tests' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'Image tests' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
else
summary({'Image tests' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
# Code correctness checks
if running_from_git
clang_tidy_exe = find_program('clang-tidy', required : false)
if clang_tidy_exe.found()
git_exe = find_program('git', required : true)
foreach source_file : code_sources
if fs.name(source_file).endswith('.cc')
source_file_name = fs.name(source_file)
config_file = join_paths(meson.project_source_root(), '.clang-tidy')
test('Code Correctness_ ' + source_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', '--config-file', config_file, source_file], timeout : 100, suite : 'analysis')
endif
endforeach
summary({'Code Correctness' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'Code Correctness' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
else
summary({'Code Correctness' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
# Single value enum checks
enum_check_sh = find_program('enum-check.sh', dirs : scriptsdir, required : true)
if enum_check_sh.found()
foreach source_file : code_sources
source_file_name = fs.name(source_file)
test('Single Value enum_ ' + source_file_name, enum_check_sh, args : [source_file], timeout : 100, suite : 'analysis')
endforeach
summary({'Single Value enum' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'Single Value enum' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
# Debug statement checks
debug_check_sh = find_program('debug-check.sh', dirs : scriptsdir, required : true)
if debug_check_sh.found()
foreach source_file : code_sources
source_file_name = fs.name(source_file)
if (source_file_name != 'debug.h')
test('Debug Statements_ ' + source_file_name, debug_check_sh, args : [source_file], timeout : 100, suite : 'analysis')
endif
endforeach
summary({'Debug Statements' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'Debug Statements' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
# Temporary comments checks
tmp_comments_check_sh = find_program('temporary-comments-check.sh', dirs : scriptsdir, required : true)
if tmp_comments_check_sh.found()
foreach source_file : code_sources
source_file_name = fs.name(source_file)
if (source_file_name != 'debug.h')
test('Temporary Comments_ ' + source_file_name, tmp_comments_check_sh, args : [source_file], timeout : 100, suite : 'analysis')
endif
endforeach
summary({'Temporary Comments' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'Temporary Comments' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
# GTK4 migration regression checks
gtk4_migration_check_sh = find_program('gtk4-migration-regression-check.sh', dirs : scriptsdir, required : true)
if gtk4_migration_check_sh.found()
compat_cc = join_paths(meson.project_source_root(), 'src', 'compat.cc')
compat_h = join_paths(meson.project_source_root(), 'src', 'compat.h')
foreach source_file : code_sources
source_file_name = fs.name(source_file)
if (source_file_name != 'debug.h')
test('GTK4 migration_ ' + source_file_name, gtk4_migration_check_sh, args : [source_file, compat_cc, compat_h], timeout : 100, suite : 'analysis')
endif
endforeach
summary({'GTK4 migration' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'GTK4 migration' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
# Untranslated text checks
untranslated_text_sh = find_program('untranslated-text.sh', dirs : scriptsdir, required : true)
if untranslated_text_sh.found()
foreach source_file : code_sources
if fs.name(source_file).endswith('.cc')
source_file_name = fs.name(source_file)
test('Untranslated Text_ ' + source_file_name, untranslated_text_sh, args : [source_file], timeout : 200, suite : 'analysis')
endif
endforeach
summary({'Untranslated Text' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'Untranslated Text' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
# Lua test
option = get_option('lua')
if not option.disabled()
if lua_dep.found()
if xvfb.found()
lua_test_sh = find_program('lua-test.sh', dirs : scriptsdir, required : true)
test('Lua test', isolate_test_sh, args: [lua_test_sh.full_path(), geeqie_exe.full_path()], timeout: 100, suite : 'analysis')
summary({'lua' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
else
summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
else
summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
else
summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
endif
# Ancillary files test
test_ancillary_files_sh = find_program('test-ancillary-files.sh', dirs : scriptsdir, required : true)
test('Ancillary files', test_ancillary_files_sh, args: [meson.current_source_dir()], timeout: 100, suite : 'analysis')
summary({'Ancillary files' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
# Unit tests
if conf_data.get('ENABLE_UNIT_TESTS', 0) == 1
test('Unit tests', isolate_test_sh, args: [geeqie_exe.full_path(), '--run-unit-tests'], suite : 'unit')
summary({'unit_tests' : ['Tests run:', true]}, section : 'Testing', bool_yn : true)
else
summary({'unit_tests' : ['Tests run:', false]}, section : 'Testing', bool_yn : true)
endif