about summary refs log tree commit diff
path: root/nixpkgs/pkgs/os-specific/linux/firmware/fwupd/installed-tests-path.patch
blob: ea50d88dfed645f7bc918d4f9ad8fda7bfe21260 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
diff --git a/data/installed-tests/meson.build b/data/installed-tests/meson.build
index b8ec916f0..38209b363 100644
--- a/data/installed-tests/meson.build
+++ b/data/installed-tests/meson.build
@@ -83,5 +83,5 @@ configure_file(
   output : 'fwupd-tests.conf',
   configuration : con2,
   install: true,
-  install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
+  install_dir: join_paths(get_option('installed_test_prefix'), 'etc', 'fwupd', 'remotes.d'),
 )
diff --git a/meson.build b/meson.build
index 32fe6e408..b35d741e0 100644
--- a/meson.build
+++ b/meson.build
@@ -183,8 +183,8 @@ else
   datadir = join_paths(prefix, get_option('datadir'))
   sysconfdir = join_paths(prefix, get_option('sysconfdir'))
   localstatedir = join_paths(prefix, get_option('localstatedir'))
-  installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name())
-  installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
+  installed_test_bindir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
+  installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
 endif
 mandir = join_paths(prefix, get_option('mandir'))
 localedir = join_paths(prefix, get_option('localedir'))
@@ -484,6 +484,7 @@ gnome = import('gnome')
 i18n = import('i18n')
 
 conf.set_quoted('FWUPD_PREFIX', prefix)
+conf.set_quoted('FWUPD_INSTALLED_TEST_PREFIX', get_option('installed_test_prefix'))
 conf.set_quoted('FWUPD_BINDIR', bindir)
 conf.set_quoted('FWUPD_LIBDIR', libdir)
 conf.set_quoted('FWUPD_LIBEXECDIR', libexecdir)
diff --git a/meson_options.txt b/meson_options.txt
index 0a0e2853..5f68d78b 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -25,6 +26,7 @@ option('plugin_coreboot', type : 'boolean', value : true, description : 'enable
 option('systemd', type : 'boolean', value : true, description : 'enable systemd support')
 option('systemd_root_prefix', type: 'string', value: '', description: 'Directory to base systemd’s installation directories on')
 option('elogind', type : 'boolean', value : false, description : 'enable elogind support')
+option('installed_test_prefix', type: 'string', description: 'Prefix for installed tests')
 option('tests', type : 'boolean', value : true, description : 'enable tests')
 option('tpm', type : 'boolean', value : true, description : 'enable TPM support')
 option('udevdir', type: 'string', value: '', description: 'Directory for udev rules')
diff --git a/plugins/redfish/fu-self-test.c b/plugins/redfish/fu-self-test.c
index c507fabc8..0cddc3248 100644
--- a/plugins/redfish/fu-self-test.c
+++ b/plugins/redfish/fu-self-test.c
@@ -27,7 +27,7 @@ fu_test_is_installed_test(void)
 	const gchar *builddir = g_getenv("G_TEST_BUILDDIR");
 	if (builddir == NULL)
 		return FALSE;
-	return g_str_has_prefix(builddir, FWUPD_PREFIX);
+	return g_str_has_prefix(builddir, FWUPD_INSTALLED_TEST_PREFIX);
 }
 
 static void