Commit b92ced4e authored by Sam Thursfield's avatar Sam Thursfield

Compile gschemas in the build directory, for use by tests

Allow running tests without the need to install the gsettings schemas.
This commit moves all the gschemas in the data directory and compiles
them in the build directory. Tests that require gschemas need to be
launched with the proper GSETTINGS_SCHEMA_DIR env variable.

Based on tracker.git commit c33c080c20dae1e60982, by Andrea Azzarone.
parent a48645d4
schemas = [
'org.freedesktop.Tracker.Extract.gschema.xml',
'org.freedesktop.Tracker.Miner.Files.gschema.xml',
'org.freedesktop.Tracker.Writeback.gschema.xml',
]
foreach schema : schemas
schemas = configure_file(
input: schema,
output: schema,
copy: true,
install: true,
install_dir: gsettings_schema_dir)
endforeach
tracker_miners_settings_enums = custom_target('tracker-miners-common-settings-enums',
input: '../src/libtracker-miners-common/tracker-enums.h',
output: 'org.freedesktop.TrackerMiners.enums.xml',
command: [glib_mkenums,
'--comments', '<!-- @comment@ -->',
'--fhead', '<schemalist>',
'--vhead', '<@type@ id="org.freedesktop.TrackerMiners.@EnumName@">',
'--vprod', ' <value nick="@valuenick@" value="@valuenum@"/>',
'--vtail', ' </@type@>',
'--ftail', '</schemalist>', '@INPUT@'],
capture: true,
install: true,
install_dir: gsettings_schema_dir)
# for unit tests
custom_target('tracker-miners-compile-schemas',
output: 'gschemas.compiled',
command: [find_program('glib-compile-schemas'), meson.current_build_dir()],
build_by_default: true,
depends: tracker_miners_settings_enums)
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2011, Nokia <ivan.frade@nokia.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
-->
<schemalist>
<schema id="org.freedesktop.Tracker.Extract" path="/org/freedesktop/tracker/extract/" gettext-domain="tracker-miners">
<key name="verbosity" enum="org.freedesktop.TrackerMiners.TrackerVerbosity">
<default>'errors'</default>
<summary>Log verbosity</summary>
<description>Log verbosity.</description>
</key>
<key name="sched-idle" enum="org.freedesktop.TrackerMiners.TrackerSchedIdle">
<default>'first-index'</default>
<summary>Scheduler priority when idle</summary>
<description>
The scheduler is the kernel component that decides which
runnable application will be executed by the CPU next. Each
application has an associated scheduling policy and priority.
</description>
</key>
<key name="max-bytes" type="i">
<summary>Max bytes to extract</summary>
<description>Maximum number of UTF-8 bytes to extract.</description>
<range min="0" max="10485760"/>
<default>1048576</default>
</key>
<key name="max-media-art-width" type="i">
<summary>Max media art width</summary>
<description>Maximum width in pixels for any media art extracted. Anything bigger is resized. Set to -1 to disable saving media art from files. Setting to 0 sets no limit on the media art width.</description>
<range min="-1" max="2048"/>
<default>0</default>
</key>
<key name="wait-for-miner-fs" type="b">
<summary>Wait for FS miner to be done before extracting</summary>
<description>When true, tracker-extract will wait for tracker-miner-fs to be done crawling before extracting meta-data. This option is useful on constrained environment where it is important to list files as fast as possible and can wait to get meta-data later.</description>
<default>false</default>
</key>
</schema>
</schemalist>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2011, Nokia <ivan.frade@nokia.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
-->
<schemalist>
<schema id="org.freedesktop.Tracker.Miner.Files" path="/org/freedesktop/tracker/miner/files/" gettext-domain="tracker-miners">
<key name="verbosity" enum="org.freedesktop.TrackerMiners.TrackerVerbosity">
<default>'errors'</default>
<summary>Log verbosity</summary>
<description>Log verbosity.</description>
</key>
<key name="initial-sleep" type="i">
<summary>Initial sleep</summary>
<description>Initial sleep time, in seconds.</description>
<range min="0" max="1000"/>
<default>15</default>
</key>
<key name="sched-idle" enum="org.freedesktop.TrackerMiners.TrackerSchedIdle">
<default>'first-index'</default>
<summary>Scheduler priority when idle</summary>
<description>
The scheduler is the kernel component that decides which
runnable application will be executed by the CPU next. Each
application has an associated scheduling policy and priority.
</description>
</key>
<key name="throttle" type="i">
<summary>Throttle</summary>
<description>Indexing speed, the higher the slower.</description>
<range min="0" max="20"/>
<default>0</default>
</key>
<key name="low-disk-space-limit" type="i">
<summary>Low disk space limit</summary>
<description>Disk space threshold in percent at which to pause indexing, or -1 to disable.</description>
<range min="-1" max="100"/>
<default>-1</default>
</key>
<key name="crawling-interval" type="i">
<summary>Crawling interval</summary>
<description>
Interval in days to check whether the filesystem is up to date in the database.
0 forces crawling anytime, -1 forces it only after unclean shutdowns, and -2
disables it entirely.
</description>
<range min="-2" max="365"/>
<default>-1</default>
</key>
<key name="removable-days-threshold" type="i">
<summary>Removable devices’ data permanence threshold</summary>
<description>
Threshold in days after which files from removables devices
will be removed from database if not mounted. 0 means never,
maximum is 365.
</description>
<range min="0" max="365"/>
<default>3</default>
</key>
<key name="enable-monitors" type="b">
<summary>Enable monitors</summary>
<description>Set to false to completely disable any file monitoring</description>
<default>true</default>
</key>
<key name="enable-writeback" type="b">
<summary>Enable writeback</summary>
<description>Set to false to completely disable any file writeback</description>
<default>true</default>
</key>
<key name="index-removable-devices" type="b">
<summary>Index removable devices</summary>
<description>Set to true to enable indexing mounted directories for removable devices.</description>
<default>false</default>
</key>
<key name="index-optical-discs" type="b">
<summary>Index optical discs</summary>
<description>
Set to true to enable indexing CDs, DVDs, and generally optical media
(if removable devices are not indexed, optical discs won’t be either)
</description>
<default>false</default>
</key>
<key name="index-on-battery" type="b">
<summary>Index when running on battery</summary>
<description>Set to true to index while running on battery</description>
<default>true</default>
</key>
<key name="index-on-battery-first-time" type="b">
<summary>Perform initial indexing when running on battery</summary>
<description>Set to true to index while running on battery for the first time only</description>
<default>true</default>
</key>
<key name="index-recursive-directories" type="as">
<summary>Directories to index recursively</summary>
<description>
List of directories to index recursively, Special values include:
&amp;DESKTOP, &amp;DOCUMENTS, &amp;DOWNLOAD, &amp;MUSIC, &amp;PICTURES,
&amp;PUBLIC_SHARE, &amp;TEMPLATES, &amp;VIDEOS.
See /etc/xdg/user-dirs.defaults and $HOME/.config/user-dirs.default
</description>
<default>[ '&amp;DESKTOP', '&amp;DOCUMENTS', '&amp;DOWNLOAD', '&amp;MUSIC', '&amp;PICTURES', '&amp;VIDEOS' ]</default>
</key>
<key name="index-single-directories" type="as">
<summary>Directories to index non-recursively</summary>
<description>
List of directories to index without inspecting subfolders, Special values include:
&amp;DESKTOP, &amp;DOCUMENTS, &amp;DOWNLOAD, &amp;MUSIC, &amp;PICTURES,
&amp;PUBLIC_SHARE, &amp;TEMPLATES, &amp;VIDEOS.
See /etc/xdg/user-dirs.defaults and $HOME/.config/user-dirs.default
</description>
<default>[ '$HOME' ]</default>
</key>
<key name="ignored-files" type="as">
<summary>Ignored files</summary>
<description>List of file patterns to avoid</description>
<default>[ '*~', '*.o', '*.la', '*.lo' , '*.loT', '*.in', '*.csproj', '*.m4', '*.rej', '*.gmo', '*.orig', '*.pc', '*.omf', '*.aux', '*.tmp', '*.vmdk', '*.vm*', '*.nvram', '*.part', '*.rcore', '*.lzo', 'autom4te', 'conftest', 'confstat', 'Makefile', 'SCCS', 'ltmain.sh', 'libtool', 'config.status', 'confdefs.h', 'configure', '#*#', '~$*.doc?', '~$*.dot?', '~$*.xls?', '~$*.xlt?', '~$*.xlam', '~$*.ppt?', '~$*.pot?', '~$*.ppam', '~$*.ppsm', '~$*.ppsx', '~$*.vsd?', '~$*.vss?', '~$*.vst?', 'mimeapps.list', 'mimeinfo.cache', '*.directory' ]</default>
</key>
<key name="ignored-directories" type="as">
<summary>Ignored directories</summary>
<description>List of directories to avoid</description>
<default>[ 'po', 'CVS', 'core-dumps', 'lost+found' ]</default>
</key>
<key name="ignored-directories-with-content" type="as">
<summary>Ignored directories with content</summary>
<description>Avoid any directory containing a file blacklisted here</description>
<default>[ '.trackerignore', '.git', '.hg' ]</default>
</key>
</schema>
</schemalist>
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (C) 2011, Nokia <ivan.frade@nokia.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
-->
<schemalist>
<schema id="org.freedesktop.Tracker.Writeback" path="/org/freedesktop/tracker/writeback/" gettext-domain="tracker-miners">
<key name="verbosity" enum="org.freedesktop.TrackerMiners.TrackerVerbosity">
<default>'errors'</default>
<summary>Log verbosity</summary>
<description>Log verbosity.</description>
</key>
</schema>
</schemalist>
......@@ -386,6 +386,7 @@ vapi_dir = join_paths(get_option('prefix'), get_option('datadir'), 'vala', 'vapi
glib_mkenums = find_program('glib-mkenums')
subdir('src')
subdir('data')
if get_option('docs')
subdir('docs')
......
......@@ -58,9 +58,6 @@ desktop_file = custom_target('tracker-miner-fs-desktop-file',
install: true,
install_dir: join_paths(get_option('sysconfdir'), 'xdg/autostart'))
install_data('org.freedesktop.Tracker.Miner.Files.gschema.xml',
install_dir: gsettings_schema_dir)
  • But org.freedesktop.Tracker.Miner.Files.gschema.xml in this directory still exists? Should gschema files in src/ be removed, and POTFILES.in pointed to the the new files under data/?

  • Yes! Thanks for the pointer. It looks like I messed up the rebase of this branch.

    Does !47 (merged) fix the issue?

    Edited by Sam Thursfield
Please register or sign in to reply
if install_systemd_user_services
configure_file(
input: 'tracker-miner-fs.service.in',
......
......@@ -198,9 +198,6 @@ desktop_file = custom_target('tracker-extract-desktop-file',
install: true,
install_dir: join_paths(get_option('sysconfdir'), 'xdg/autostart'))
install_data('org.freedesktop.Tracker.Extract.gschema.xml',
install_dir: gsettings_schema_dir)
if install_systemd_user_services
configure_file(
input: 'tracker-extract.service.in',
......
......@@ -56,9 +56,6 @@ dbus_service_file = configure_file(
install: true,
install_dir: dbus_services_dir)
install_data('org.freedesktop.Tracker.Writeback.gschema.xml',
install_dir: gsettings_schema_dir)
if install_systemd_user_services
configure_file(
input: 'tracker-writeback.service.in',
......
......@@ -63,6 +63,7 @@ tracker_extractors_dir = join_paths(meson.current_build_dir(), '..', '..', 'src'
test_env = environment()
test_env.set('DCONF_PROFILE', dconf_profile_full_path)
test_env.set('GSETTINGS_SCHEMA_DIR', join_paths(meson.build_root(), 'data'))
test_env.set('TRACKER_DB_ONTOLOGIES_DIR', tracker_uninstalled_nepomuk_ontologies_dir)
test_env.set('TRACKER_EXTRACTORS_DIR', tracker_extractors_dir)
......
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