diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2019-09-17 14:22:44 +0200 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2019-09-24 21:11:19 +0200 |
commit | 7eb6f3c80c00402b00395eadd003ea583d16bca6 (patch) | |
tree | 4af94e2324f9fbaacfbcdd49477410bd51d8496d /utils | |
parent | 4a7d50e51910ecbe6b291253e233161519e885a7 (diff) | |
download | tracker-7eb6f3c80c00402b00395eadd003ea583d16bca6.tar.gz |
meson: Add options to define whether to install and where test utils
Since commit 8ae99192 we provide tracker test utils python modules.
These are installed by default in tracker internal libdir, and as per meson
default this is an arch-dependent path, while the test utils aren't.
So in some distributions, not to provide such files in multiple packages for
each architecture, we'd need to install those files somewhere else that is
not arch-dependent.
Unfortunately meson doesn't provide such path by default (which ideally
would be /usr/lib/tracker-${abi-version}), and I think isn't correct either
to install such files into the datadir, so in order to make this path
customizable and at the same time to make it possible to locate, provide
meson options and build a pkg config file for it, providing the python path
variable that should be used.
Diffstat (limited to 'utils')
-rw-r--r-- | utils/trackertestutils/meson.build | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/utils/trackertestutils/meson.build b/utils/trackertestutils/meson.build index e8ab94c72..78c6fa59d 100644 --- a/utils/trackertestutils/meson.build +++ b/utils/trackertestutils/meson.build @@ -1,3 +1,5 @@ +pkg = import('pkgconfig') + sources = [ '__init__.py', 'dbusdaemon.py', @@ -7,5 +9,22 @@ sources = [ 'psutil_mini.py', ] -install_data(sources, - install_dir: join_paths(tracker_internal_libs_dir, 'trackertestutils')) +if get_option('test_utils') + testutils_dir = get_option('test_utils_dir') + + if testutils_dir == '' + arch_independent_libdir = \ + get_option('prefix') / 'lib' / 'tracker-' + tracker_api_version + testutils_dir = join_paths(arch_independent_libdir, 'trackertestutils') + endif + + install_data(sources, install_dir: testutils_dir) + + pkg.generate( + name: 'tracker-testutils-' + tracker_api_version, + description: 'tracker test utilities', + variables: [ + 'python_path=' + testutils_dir + ] + ) +endif |