depot/third_party/nixpkgs/pkgs/by-name/fw/fwupd/installed-tests-path.patch

70 lines
2.7 KiB
Diff

commit 2fa1d39bb54d448ffe59bf6a8358c01f786a1cce
Author: r-vdp <ramses@well-founded.dev>
Date: Tue Oct 15 14:49:53 2024 +0200
Add output for installed tests
diff --git a/data/tests/meson.build b/data/tests/meson.build
index a22a989f3..cbd135cfa 100644
--- a/data/tests/meson.build
+++ b/data/tests/meson.build
@@ -105,7 +105,7 @@ configure_file(
output: 'fwupd-tests.conf',
configuration: con2,
install: true,
- install_dir: join_paths(datadir, 'fwupd', 'remotes.d'),
+ install_dir: join_paths(get_option('installed_test_prefix'), 'etc', 'fwupd', 'remotes.d'),
)
if umockdev_integration_tests.allowed()
diff --git a/meson.build b/meson.build
index 5a35cfda1..40ef142f0 100644
--- a/meson.build
+++ b/meson.build
@@ -194,8 +194,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())
daemon_dir = join_paths(libexecdir, 'fwupd')
endif
mandir = join_paths(prefix, get_option('mandir'))
@@ -545,6 +545,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 e04bb37c9..b1060ddb8 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -333,6 +333,10 @@ option('systemd_syscall_filter',
value: 'true',
description: 'Enable systemd syscall filter',
)
+option('installed_test_prefix',
+ type: 'string',
+ description: 'Prefix for installed tests'
+)
option('tests',
type: 'boolean',
value: true,
diff --git a/src/tests/host-emulate/meson.build b/src/tests/host-emulate/meson.build
index 4bc02e46e..17bc2270d 100644
--- a/src/tests/host-emulate/meson.build
+++ b/src/tests/host-emulate/meson.build
@@ -9,7 +9,7 @@ if build_standalone
capture: true,
command: [gzip, '-k', '--stdout', '@INPUT@'],
install: true,
- install_dir: join_paths(datadir, 'fwupd', 'host-emulate.d'),
+ install_dir: join_paths(get_option('installed_test_prefix'), 'etc', 'fwupd', 'host-emulate.d'),
)
endforeach
endif