nixpkgs/pkgs/by-name/fw/fwupd/add-option-for-installation-sysconfdir.patch

139 lines
4.5 KiB
Diff

diff --git a/data/bios-settings.d/meson.build b/data/bios-settings.d/meson.build
index b0ff5b106..13ac380d0 100644
--- a/data/bios-settings.d/meson.build
+++ b/data/bios-settings.d/meson.build
@@ -1,5 +1,5 @@
if build_standalone and host_machine.system() == 'linux'
install_data('README.md',
- install_dir: join_paths(sysconfdir, 'fwupd', 'bios-settings.d')
+ install_dir: join_paths(sysconfdir_install, 'fwupd', 'bios-settings.d')
)
endif
diff --git a/data/meson.build b/data/meson.build
index e13da4adf..6858c240f 100644
--- a/data/meson.build
+++ b/data/meson.build
@@ -26,7 +26,7 @@ endif
if build_standalone
install_data(['fwupd.conf'],
- install_dir: join_paths(sysconfdir, 'fwupd'),
+ install_dir: join_paths(sysconfdir_install, 'fwupd'),
install_mode: 'rw-r-----',
)
plugin_quirks += files([
diff --git a/data/pki/meson.build b/data/pki/meson.build
index 3649fecea..c3462744b 100644
--- a/data/pki/meson.build
+++ b/data/pki/meson.build
@@ -12,13 +12,13 @@ install_data([
'GPG-KEY-Linux-Foundation-Firmware',
'GPG-KEY-Linux-Vendor-Firmware-Service',
],
- install_dir: join_paths(sysconfdir, 'pki', 'fwupd')
+ install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd')
)
install_data([
'GPG-KEY-Linux-Foundation-Metadata',
'GPG-KEY-Linux-Vendor-Firmware-Service',
],
- install_dir: join_paths(sysconfdir, 'pki', 'fwupd-metadata')
+ install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
)
endif
@@ -26,11 +26,11 @@ if supported_pkcs7
install_data([
'LVFS-CA.pem',
],
- install_dir: join_paths(sysconfdir, 'pki', 'fwupd')
+ install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd')
)
install_data([
'LVFS-CA.pem',
],
- install_dir: join_paths(sysconfdir, 'pki', 'fwupd-metadata')
+ install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
)
endif
diff --git a/data/remotes.d/meson.build b/data/remotes.d/meson.build
index c20a1a05e..5354bac7f 100644
--- a/data/remotes.d/meson.build
+++ b/data/remotes.d/meson.build
@@ -15,14 +15,14 @@ if build_standalone and get_option('lvfs') != 'false'
output: 'lvfs.conf',
configuration: con3,
install: true,
- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
+ install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
)
configure_file(
input: 'lvfs-testing.conf',
output: 'lvfs-testing.conf',
configuration: con3,
install: true,
- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
+ install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
)
i18n.merge_file(
input: 'lvfs.metainfo.xml',
@@ -56,12 +56,12 @@ configure_file(
output: 'vendor.conf',
configuration: con2,
install: get_option('vendor_metadata'),
- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
+ install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
)
configure_file(
input: 'vendor-directory.conf',
output: 'vendor-directory.conf',
configuration: con2,
install: true,
- install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
+ install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
)
diff --git a/meson.build b/meson.build
index ca6ccdf92..0a3097d90 100644
--- a/meson.build
+++ b/meson.build
@@ -195,6 +195,12 @@ endif
mandir = join_paths(prefix, get_option('mandir'))
localedir = join_paths(prefix, get_option('localedir'))
+if get_option('sysconfdir_install') != ''
+ sysconfdir_install = join_paths(prefix, get_option('sysconfdir_install'))
+else
+ sysconfdir_install = sysconfdir
+endif
+
diffcmd = find_program('diff')
gio = dependency('gio-2.0', version: '>= 2.68.0')
giounix = dependency('gio-unix-2.0', version: '>= 2.68.0', required: false)
diff --git a/meson_options.txt b/meson_options.txt
index 877891126..986d0ee31 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,3 +1,8 @@
+option('sysconfdir_install',
+ type: 'string',
+ value: '',
+ description: 'sysconfdir to use during installation'
+)
option('build',
type: 'combo',
choices: [
diff --git a/plugins/uefi-capsule/meson.build b/plugins/uefi-capsule/meson.build
index eb196c21e..c9a29f680 100644
--- a/plugins/uefi-capsule/meson.build
+++ b/plugins/uefi-capsule/meson.build
@@ -20,7 +20,7 @@ if host_machine.system() == 'linux'
output: '35_fwupd',
configuration: con2,
install: true,
- install_dir: join_paths(sysconfdir, 'grub.d')
+ install_dir: join_paths(sysconfdir_install, 'grub.d')
)
elif host_machine.system() == 'freebsd'
backend_srcs += 'fu-uefi-backend-freebsd.c'