Commit a86d55c6 authored by Sam Thursfield's avatar Sam Thursfield

meson: Fix warnings from extractor during functional-tests

In order to run tracker-extract without installing it, we set the
TRACKER_EXTRACT_RULES_DIR path to point to the src/tracker-extract
directory.

This is problematic because that directory contains lots of stuff
that isn't .rule files and also contains .rule files for extractors
which might not be enabled. The result being pointless warnings
during the tests like this:

    ** (tracker-extract:29193): WARNING **: 16:18:11.703: Could not load module '/home/sam/src/tracker-miners/build/tests/functional-tests/../../src/tracker-extract/libextract-libav.so': /home/sam/src/tracker-miners/build/tests/functional-tests/../../src/tracker-extract/libextract-libav.so: cannot open shared object file: No such file or directory

Using Meson it's fairly straightforward to create a separate
directory in the build tree to contain these files, which fixes
the warnings.

The same thing could be implemented for Autotools, but it doesn't
affect the actual functionality of the tests so I haven't spent time
on it myself.
parent 8db07938
......@@ -375,6 +375,8 @@ tracker_extract_rules_dir = join_paths(get_option('prefix'), get_option('datadir
tracker_miner_services_dir = join_paths(get_option('prefix'), get_option('datadir'), 'tracker/miners')
tracker_writeback_modules_dir = join_paths(get_option('prefix'), get_option('libdir'), 'tracker-miners-@0@/writeback-modules'.format(tracker_api_version))
tracker_uninstalled_extract_rules_dir = join_paths(meson.current_build_dir(), 'src', 'tracker-extract')
gsettings_schema_dir = join_paths(get_option('prefix'), get_option('datadir'), 'glib-2.0', 'schemas')
vapi_dir = join_paths(get_option('prefix'), get_option('datadir'), 'vala', 'vapi')
......
......@@ -5,35 +5,35 @@
# This might be nicer if Meson supported dictionary types.
modules = [
['extract-bmp', 'tracker-extract-bmp.c', '10-bmp.rule', [tracker_miners_common_dep]],
['extract-bmp', 'tracker-extract-bmp.c', ['10-bmp.rule'], [tracker_miners_common_dep]],
['extract-dummy', 'tracker-extract-dummy.c', ['10-comics.rule', '10-ebooks.rule'], [tracker_miners_common_dep]]
]
if get_option('abiword')
modules += [['extract-abw', 'tracker-extract-abw.c', '10-abw.rule', [tracker_miners_common_dep]]]
modules += [['extract-abw', 'tracker-extract-abw.c', ['10-abw.rule'], [tracker_miners_common_dep]]]
endif
if get_option('dvi')
modules += [['extract-dvi', 'tracker-extract-dvi.c', '10-dvi.rule', [tracker_miners_common_dep]]]
modules += [['extract-dvi', 'tracker-extract-dvi.c', ['10-dvi.rule'], [tracker_miners_common_dep]]]
endif
if libgsf.found()
modules += [['extract-epub', 'tracker-extract-epub.c', '10-epub.rule', [libgsf, tracker_miners_common_dep]]]
modules += [['extract-msoffice', 'tracker-extract-msoffice.c', '10-msoffice.rule', [libgsf, tracker_miners_common_dep]]]
modules += [['extract-msoffice-xml', 'tracker-extract-msoffice-xml.c', '11-msoffice-xml.rule', [libgsf, tracker_miners_common_dep]]]
modules += [['extract-oasis', 'tracker-extract-oasis.c', '10-oasis.rule', [libgsf, tracker_miners_common_dep]]]
modules += [['extract-epub', 'tracker-extract-epub.c', ['10-epub.rule'], [libgsf, tracker_miners_common_dep]]]
modules += [['extract-msoffice', 'tracker-extract-msoffice.c', ['10-msoffice.rule'], [libgsf, tracker_miners_common_dep]]]
modules += [['extract-msoffice-xml', 'tracker-extract-msoffice-xml.c', ['11-msoffice-xml.rule'], [libgsf, tracker_miners_common_dep]]]
modules += [['extract-oasis', 'tracker-extract-oasis.c', ['10-oasis.rule'], [libgsf, tracker_miners_common_dep]]]
endif
if flac.found()
modules += [['extract-flac', 'tracker-extract-flac.c', '10-flac.rule', [flac, tracker_miners_common_dep]]]
modules += [['extract-flac', 'tracker-extract-flac.c', ['10-flac.rule'], [flac, tracker_miners_common_dep]]]
endif
if gexiv2.found()
modules += [['extract-raw', 'tracker-extract-raw.c', '10-raw.rule', [gexiv2, tracker_miners_common_dep]]]
modules += [['extract-raw', 'tracker-extract-raw.c', ['10-raw.rule'], [gexiv2, tracker_miners_common_dep]]]
endif
if libgif.found()
modules += [['extract-gif', 'tracker-extract-gif.c', '10-gif.rule', [libgif, tracker_miners_common_dep]]]
modules += [['extract-gif', 'tracker-extract-gif.c', ['10-gif.rule'], [libgif, tracker_miners_common_dep]]]
endif
if generic_media_handler_name == 'gstreamer'
......@@ -52,45 +52,45 @@ if generic_media_handler_name == 'gstreamer'
endif
if libxml2.found()
modules += [['extract-html', 'tracker-extract-html.c', '10-html.rule', [libxml2]]]
modules += [['extract-html', 'tracker-extract-html.c', ['10-html.rule'], [libxml2]]]
endif
if libjpeg.found()
modules += [['extract-jpeg', 'tracker-extract-jpeg.c', '10-jpeg.rule', [libjpeg, tracker_miners_common_dep]]]
modules += [['extract-jpeg', 'tracker-extract-jpeg.c', ['10-jpeg.rule'], [libjpeg, tracker_miners_common_dep]]]
endif
if generic_media_handler_name == 'libav'
rules = ['90-libav-audio-generic.rule', '90-libav-video-generic.rule']
rules = ['90-libav-audio-generic.rule', ['90-libav-video-generic.rule']]
dependencies = [avcodec, avformat, avutil, tracker_miners_common_dep]
modules += [['extract-libav', 'tracker-extract-libav.c', rules, dependencies]]
endif
if get_option('icon')
modules += [['extract-icon', 'tracker-extract-icon.c', '10-ico.rule', []]]
modules += [['extract-icon', 'tracker-extract-icon.c', ['10-ico.rule'], []]]
endif
if libosinfo.found()
modules += [['extract-iso', 'tracker-extract-iso.c', '11-iso.rule', [libosinfo]]]
modules += [['extract-iso', 'tracker-extract-iso.c', ['11-iso.rule'], [libosinfo]]]
endif
if get_option('mp3')
modules += [['extract-mp3', 'tracker-extract-mp3.c', '10-mp3.rule', [tracker_miners_common_dep]]]
modules += [['extract-mp3', 'tracker-extract-mp3.c', ['10-mp3.rule'], [tracker_miners_common_dep]]]
endif
if poppler.found()
modules += [['extract-pdf', 'tracker-extract-pdf.c', '10-pdf.rule', [poppler, tracker_miners_common_dep]]]
modules += [['extract-pdf', 'tracker-extract-pdf.c', ['10-pdf.rule'], [poppler, tracker_miners_common_dep]]]
endif
if totem_plparser.found()
modules += [['extract-playlist', 'tracker-extract-playlist.c', '15-playlist.rule', [totem_plparser]]]
modules += [['extract-playlist', 'tracker-extract-playlist.c', ['15-playlist.rule'], [totem_plparser]]]
endif
if libpng.found()
modules += [['extract-png', 'tracker-extract-png.c', '10-png.rule', [libpng, tracker_miners_common_dep]]]
modules += [['extract-png', 'tracker-extract-png.c', ['10-png.rule'], [libpng, tracker_miners_common_dep]]]
endif
if get_option('ps')
modules += [['extract-ps', 'tracker-extract-ps.c', '10-ps.rule', [tracker_miners_common_dep]]]
modules += [['extract-ps', 'tracker-extract-ps.c', ['10-ps.rule'], [tracker_miners_common_dep]]]
endif
if get_option('text')
......@@ -98,26 +98,26 @@ if get_option('text')
endif
if libtiff.found()
modules += [['extract-tiff', 'tracker-extract-tiff.c', '10-tiff.rule', [libtiff, tracker_miners_common_dep]]]
modules += [['extract-tiff', 'tracker-extract-tiff.c', ['10-tiff.rule'], [libtiff, tracker_miners_common_dep]]]
endif
if libvorbis.found()
modules += [['extract-vorbis', 'tracker-extract-vorbis.c', '10-vorbis.rule', [libvorbis, tracker_miners_common_dep]]]
modules += [['extract-vorbis', 'tracker-extract-vorbis.c', ['10-vorbis.rule'], [libvorbis, tracker_miners_common_dep]]]
endif
if exempi.found()
modules += [['extract-xmp', 'tracker-extract-xmp.c', '10-xmp.rule', []]]
modules += [['extract-xmp', 'tracker-extract-xmp.c', ['10-xmp.rule'], []]]
endif
if libgxps.found()
modules += [['extract-xps', 'tracker-extract-xps.c', '10-xps.rule', [libgxps, tracker_miners_common_dep]]]
modules += [['extract-xps', 'tracker-extract-xps.c', ['10-xps.rule'], [libgxps, tracker_miners_common_dep]]]
endif
foreach module : modules
name = module[0]
sources = module[1]
rule = module[2]
rules = module[2]
dependencies = module[3]
shared_module(name, sources,
......@@ -127,7 +127,16 @@ foreach module : modules
install: true,
install_dir: tracker_extract_modules_dir)
install_data(rule, install_dir: tracker_extract_rules_dir)
install_data(rules, install_dir: tracker_extract_rules_dir)
# Populate tracker_uninstalled_extract_rules_dir with the enabled .rule files.
foreach rule: rules
empty_conf = configuration_data()
configure_file(
input: rule,
output: rule,
configuration: empty_conf)
endforeach
endforeach
tracker_extract_priority_dbus = gnome.gdbus_codegen(
......
......@@ -60,14 +60,13 @@ endif
config_json_full_path = join_paths(meson.current_build_dir(), 'configuration.json')
dconf_profile_full_path = join_paths(meson.current_source_dir(), 'trackertest')
tracker_extractors_dir = join_paths(meson.current_build_dir(), '..', '..', 'src', 'tracker-extract')
tracker_extractor_rules_dir = join_paths(meson.current_source_dir(), '..', '..', 'src', 'tracker-extract')
test_env = environment()
test_env.set('DCONF_PROFILE', dconf_profile_full_path)
test_env.set('TRACKER_DB_ONTOLOGIES_DIR', tracker_uninstalled_nepomuk_ontologies_dir)
test_env.set('TRACKER_EXTRACTORS_DIR', tracker_extractors_dir)
test_env.set('TRACKER_EXTRACTOR_RULES_DIR', tracker_extractor_rules_dir)
test_env.set('TRACKER_EXTRACTOR_RULES_DIR', tracker_uninstalled_extract_rules_dir)
test_env.set('TRACKER_LANGUAGE_STOP_WORDS_DIR', tracker_uninstalled_stop_words_dir)
test_env.set('TRACKER_FUNCTIONAL_TEST_BUILD_DIR', meson.build_root())
test_env.set('TRACKER_FUNCTIONAL_TEST_CONFIG', config_json_full_path)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment