Move third-party sources to separate sub-directory
[geeqie.git] / meson.build
index bb40d8d..e888e07 100644 (file)
@@ -147,9 +147,9 @@ summary({'gq_appdir': gq_appdir,
 
 # Create the define constants used in the sources. Set via config.h.in
 conf_data = configuration_data()
-conf_data.set_quoted('VERSION', meson.project_version())
 conf_data.set('DEBUG', debug)
 
+conf_data.set('HAVE_GTK4', 0)
 option = get_option('gtk4')
 if option.enabled()
     gtk_dep = dependency('gtk4', required: true)
@@ -160,6 +160,7 @@ 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('devel')
@@ -181,6 +182,7 @@ else
 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()
@@ -197,6 +199,7 @@ else
     summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Debugging', bool_yn : true)
 endif
 
+conf_data.set('HAVE_ARCHIVE', 0)
 libarchive_dep = []
 req_version = '>=3.4.0'
 option = get_option('archive')
@@ -212,6 +215,8 @@ 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')
@@ -233,6 +238,7 @@ 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')
@@ -261,6 +267,7 @@ else
 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')
@@ -274,8 +281,9 @@ else
     summary({'execinfo' : ['stacktrace supported:', false]}, section : 'Configuration', bool_yn : true)
 endif
 
+conf_data.set('HAVE_EXIV2', 0)
 exiv2_dep = []
-req_version = '>=0.11'
+req_version = '>=0.18'
 option = get_option('exiv2')
 if not option.disabled()
     exiv2_dep = dependency('exiv2', version : req_version, required : get_option('exiv2'))
@@ -289,6 +297,9 @@ else
     summary({'exiv2' : ['disabled - image data processed by exiv2:', 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 = []
@@ -329,6 +340,7 @@ 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')
@@ -344,6 +356,7 @@ 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')
@@ -359,10 +372,11 @@ 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'))
+    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)
@@ -377,6 +391,7 @@ 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')
@@ -392,6 +407,7 @@ 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')
@@ -407,6 +423,7 @@ 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')
@@ -444,6 +461,7 @@ else
 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')
@@ -459,6 +477,7 @@ 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')
@@ -474,6 +493,7 @@ 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()
@@ -492,6 +512,10 @@ 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')
@@ -528,6 +552,7 @@ 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')
@@ -544,6 +569,7 @@ else
 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) {
@@ -577,19 +603,9 @@ configure_file(input : 'config.h.in',
                encoding : 'UTF-8',
                configuration : conf_data)
 
-# For shellcheck on scripts
-script_sources = []
-subdir('scripts')
-
-# For markdownlint on .md files
-mdl_sources = []
-
 # For gtk builder checks on .ui files
 ui_sources = []
 
-# For checks on .desktop files
-desktop_sources = []
-
 # Process subdirs before the sources
 subdir('po')
 subdir('plugins')
@@ -649,78 +665,9 @@ else
 endif
 
 # The tests are run on GitHub with all options disabled, and then
-# with all or most options enabled. Shellcheck and GtkBuilder need only
-# be run once when options are disabled. Use option archive as a flag.
 # Image tests use option devel as a flag so that normal users do not
 # download the test image database.
 
-# Shellcheck
-option = get_option('archive')
-if option.disabled()
-    shellcheck_exe = find_program('shellcheck', required : false)
-    script_sources += files('gen_changelog.sh',
-    'geeqie-install-debian.sh',
-    'version.sh')
-
-    if shellcheck_exe.found()
-        foreach script : script_sources
-            script_path = '@0@'.format(script)
-            test('Shellcheck_ ' + script_path, shellcheck_exe, args: ['--norc', '--shell=sh', '--enable=add-default-case,avoid-nullary-conditions,check-unassigned-uppercase,deprecate-which,quote-safe-variables', script], timeout: 100)
-        endforeach
-        summary({'shellcheck' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
-    else
-        summary({'shellcheck' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
-    endif
-else
-    summary({'shellcheck' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
-endif
-
-# Markdownlint
-option = get_option('archive')
-if option.disabled()
-    mdl_exe = find_program('mdl', required : false)
-
-    if mdl_exe.found()
-        mdl_sources += files('CHECKLIST.md',
-        'CODING.md',
-        'DEVELOPER-NOTES.md',
-        'README.md',
-        join_paths(meson.project_source_root(), '.github', 'ISSUE_TEMPLATE.md'))
-
-        style = join_paths(meson.project_source_root(), '.mdl.rb')
-        foreach md_file : mdl_sources
-            md_path = '@0@'.format(md_file)
-            test('Mdl_check_ ' + md_path, mdl_exe, args: ['--style', style, md_file], timeout: 100)
-        endforeach
-        summary({'markdownlint' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
-    else
-        summary({'markdownlint' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
-    endif
-else
-    summary({'markdownlint' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
-endif
-
-# GtkBuilder .ui check
-option = get_option('archive')
-if option.disabled()
-    if xvfb.found()
-        gtk_builder_tool = find_program('gtk-builder-tool', required : false)
-        if gtk_builder_tool.found()
-            foreach ui_file : ui_sources
-                ui_path = '@0@'.format(ui_file)
-                test('UI Build_ ' + ui_path, xvfb, args: ['--auto-servernum', gtk_builder_tool.full_path(), 'validate', ui_file], timeout: 100)
-            endforeach
-            summary({'gtk-builder-tool' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
-        else
-            summary({'gtk-builder-tool' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
-        endif
-    else
-        summary({'gtk-builder-tool xvfb' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
-    endif
-else
-    summary({'gtk-builder-tool xvfb' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
-endif
-
 # Image checks
 option = get_option('devel')
 if option.enabled()
@@ -759,7 +706,7 @@ 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)
-        modified_file_list = run_command(git_exe, 'diff', '--name-only', check: true)
+        modified_file_list = run_command(git_exe, 'diff', 'origin/master', '--name-only', '--diff-filter=d', './src/*.cc', './src/pan-view/*.cc', './src/view-file/*.cc', check: true)
         modified_files = modified_file_list.stdout().strip().split('\n')
 
         foreach modified_file : modified_files
@@ -768,8 +715,9 @@ if running_from_git
                 path_array = modified_file_path.split('/')
                 modified_file_name = path_array[path_array.length() - 1]
                 modified_file_full_path = join_paths(meson.project_source_root(), modified_file)
+                config_file = join_paths(meson.project_source_root(), '.clang-tidy')
 
-                test('Code Correctness_ ' + modified_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', modified_file_full_path], timeout : 100)
+                test('Code Correctness_ ' + modified_file_name, clang_tidy_exe, args : ['-p', './build', '-quiet', '--config-file', config_file,  modified_file_full_path], timeout : 100)
             endif
         endforeach
 
@@ -800,22 +748,8 @@ else
     summary({'lua' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
 endif
 
-# Desktop files test
-option = get_option('desktop')
-if not option.disabled()
-    desktop_exe = find_program('desktop-file-validate', required : false)
-    if desktop_exe.found()
-        desktop_sh = find_program('desktop-file-validate.sh', dirs : scriptsdir, required : true)
-        test_desktop_dir = join_paths(meson.current_build_dir(), 'test-desktop-files.p')
-        foreach desktop_file : desktop_sources
-            desktop_path = '@0@'.format(desktop_file)
-            test('Desktop_check_ ' + desktop_path, desktop_sh, args: [test_desktop_dir, desktop_file], timeout: 100)
-        endforeach
+# 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)
 
-        summary({'Desktop files' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)
-    else
-        summary({'Desktop files' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
-    endif
-else
-    summary({'Desktop files' : ['Test runs:', false]}, section : 'Testing', bool_yn : true)
-endif
+summary({'Ancillary files' : ['Test runs:', true]}, section : 'Testing', bool_yn : true)