@@ -0,0 +1,94 @@
1+diff --git a/gdata/tests/meson.build b/gdata/tests/meson.build
2+index 52154e7a..1a44d1d8 100644
3+--- a/gdata/tests/meson.build
4++++ b/gdata/tests/meson.build
5+@@ -1,5 +1,12 @@
6+-tests_execdir = gdata_libexecdir / 'installed-tests' / gdata_name
7+-tests_metadir = gdata_datadir / 'installed-tests' / gdata_name
8++tests_bindir = get_option('installed_test_bindir') / 'installed-tests' / gdata_name
9++if tests_bindir == ''
10++ test_bindir = gdata_libexecdir / 'installed-tests' / gdata_name
11++endif
12++
13++tests_datadir = get_option('installed_test_datadir') / 'installed-tests' / gdata_name
14++if tests_datadir == ''
15++ tests_datadir = gdata_datadir / 'installed-tests' / gdata_name
16++endif
17+
18+ tests_sources = files(
19+ 'common.c',
20+@@ -48,7 +55,7 @@ foreach test_name, extra_args: tests
21+ dependencies: common_deps + extra_args.get('dependencies', []),
22+ sources: tests_sources,
23+ install: install_tests,
24+- install_dir: tests_execdir,
25++ install_dir: tests_bindir,
26+ )
27+
28+ test(
29+@@ -63,7 +70,7 @@ if install_tests
30+ foreach test_name, extra_args: tests
31+ tests_conf = {
32+ 'TEST_TYPE': 'session',
33+- 'TEST_ABS_PATH': gdata_prefix / tests_execdir / test_name,
34++ 'TEST_ABS_PATH': tests_bindir / test_name,
35+ }
36+
37+ configure_file (
38+@@ -71,13 +78,13 @@ if install_tests
39+ output: test_name + '.test',
40+ configuration: tests_conf,
41+ install: true,
42+- install_dir: tests_metadir,
43++ install_dir: tests_datadir,
44+ )
45+ endforeach
46+
47+ install_subdir(
48+ 'traces',
49+- install_dir: tests_execdir,
50++ install_dir: tests_bindir,
51+ )
52+
53+ test_data = [
54+@@ -96,6 +103,6 @@ if install_tests
55+
56+ install_data(
57+ test_data,
58+- install_dir: tests_execdir,
59++ install_dir: tests_bindir,
60+ )
61+ endif
62+diff --git a/meson.build b/meson.build
63+index 7d2f5254..bed3e189 100644
64+--- a/meson.build
65++++ b/meson.build
66+@@ -20,9 +20,9 @@ gdata_api_version_minor = 0
67+
68+ # Define the install directories
69+ gdata_prefix = get_option('prefix')
70+-gdata_datadir = get_option('datadir')
71+-gdata_libexecdir = get_option('libexecdir')
72+-gdata_includedir = get_option('includedir')
73++gdata_datadir = gdata_prefix / get_option('datadir')
74++gdata_libexecdir = gdata_prefix / get_option('libexecdir')
75++gdata_includedir = gdata_prefix / get_option('includedir')
76+
77+ gdata_include_subdir = gdata_name / 'gdata'
78+
79+diff --git a/meson_options.txt b/meson_options.txt
80+index 25cc6b55..6fc2cfa3 100644
81+--- a/meson_options.txt
82++++ b/meson_options.txt
83+@@ -43,3 +43,11 @@ option('vapi',
84+ type: 'boolean',
85+ value: true,
86+ description: 'Enable creation of vapi files')
87++
88++option('installed_test_datadir', type: 'string',
89++ value: '',
90++ description: 'Installation directory for data files in tests')
91++
92++option('installed_test_bindir', type: 'string',
93++ value: '',
94++ description: 'Installation directory for binary files in tests')