Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / fw / fwupd / add-option-for-installation-sysconfdir.patch
blob062532244d3d2e0ee14d5e509bfefaad6cbfecbc
1 diff --git a/data/bios-settings.d/meson.build b/data/bios-settings.d/meson.build
2 index b0ff5b106..13ac380d0 100644
3 --- a/data/bios-settings.d/meson.build
4 +++ b/data/bios-settings.d/meson.build
5 @@ -1,5 +1,5 @@
6 if build_standalone and host_machine.system() == 'linux'
7 install_data('README.md',
8 - install_dir: join_paths(sysconfdir, 'fwupd', 'bios-settings.d')
9 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'bios-settings.d')
11 endif
12 diff --git a/data/meson.build b/data/meson.build
13 index e13da4adf..6858c240f 100644
14 --- a/data/meson.build
15 +++ b/data/meson.build
16 @@ -26,7 +26,7 @@ endif
18 if build_standalone
19 install_data(['fwupd.conf'],
20 - install_dir: join_paths(sysconfdir, 'fwupd'),
21 + install_dir: join_paths(sysconfdir_install, 'fwupd'),
22 install_mode: 'rw-r-----',
24 plugin_quirks += files([
25 diff --git a/data/pki/meson.build b/data/pki/meson.build
26 index 3649fecea..c3462744b 100644
27 --- a/data/pki/meson.build
28 +++ b/data/pki/meson.build
29 @@ -12,13 +12,13 @@ install_data([
30 'GPG-KEY-Linux-Foundation-Firmware',
31 'GPG-KEY-Linux-Vendor-Firmware-Service',
33 - install_dir: join_paths(sysconfdir, 'pki', 'fwupd')
34 + install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd')
36 install_data([
37 'GPG-KEY-Linux-Foundation-Metadata',
38 'GPG-KEY-Linux-Vendor-Firmware-Service',
40 - install_dir: join_paths(sysconfdir, 'pki', 'fwupd-metadata')
41 + install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
43 endif
45 @@ -26,11 +26,11 @@ if supported_pkcs7
46 install_data([
47 'LVFS-CA.pem',
49 - install_dir: join_paths(sysconfdir, 'pki', 'fwupd')
50 + install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd')
52 install_data([
53 'LVFS-CA.pem',
55 - install_dir: join_paths(sysconfdir, 'pki', 'fwupd-metadata')
56 + install_dir: join_paths(sysconfdir_install, 'pki', 'fwupd-metadata')
58 endif
59 diff --git a/data/remotes.d/meson.build b/data/remotes.d/meson.build
60 index c20a1a05e..5354bac7f 100644
61 --- a/data/remotes.d/meson.build
62 +++ b/data/remotes.d/meson.build
63 @@ -15,14 +15,14 @@ if build_standalone and get_option('lvfs') != 'false'
64 output: 'lvfs.conf',
65 configuration: con3,
66 install: true,
67 - install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
68 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
70 configure_file(
71 input: 'lvfs-testing.conf',
72 output: 'lvfs-testing.conf',
73 configuration: con3,
74 install: true,
75 - install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
76 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
78 i18n.merge_file(
79 input: 'lvfs.metainfo.xml',
80 @@ -56,12 +56,12 @@ configure_file(
81 output: 'vendor.conf',
82 configuration: con2,
83 install: get_option('vendor_metadata'),
84 - install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
85 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
87 configure_file(
88 input: 'vendor-directory.conf',
89 output: 'vendor-directory.conf',
90 configuration: con2,
91 install: true,
92 - install_dir: join_paths(sysconfdir, 'fwupd', 'remotes.d'),
93 + install_dir: join_paths(sysconfdir_install, 'fwupd', 'remotes.d'),
95 diff --git a/meson.build b/meson.build
96 index ca6ccdf92..0a3097d90 100644
97 --- a/meson.build
98 +++ b/meson.build
99 @@ -195,6 +195,12 @@ endif
100 mandir = join_paths(prefix, get_option('mandir'))
101 localedir = join_paths(prefix, get_option('localedir'))
103 +if get_option('sysconfdir_install') != ''
104 + sysconfdir_install = join_paths(prefix, get_option('sysconfdir_install'))
105 +else
106 + sysconfdir_install = sysconfdir
107 +endif
109 diffcmd = find_program('diff')
110 gio = dependency('gio-2.0', version: '>= 2.68.0')
111 giounix = dependency('gio-unix-2.0', version: '>= 2.68.0', required: false)
113 diff --git a/meson_options.txt b/meson_options.txt
114 index 877891126..986d0ee31 100644
115 --- a/meson_options.txt
116 +++ b/meson_options.txt
117 @@ -1,3 +1,8 @@
118 +option('sysconfdir_install',
119 + type: 'string',
120 + value: '',
121 + description: 'sysconfdir to use during installation'
123 option('build',
124 type: 'combo',
125 choices: [
126 diff --git a/plugins/uefi-capsule/meson.build b/plugins/uefi-capsule/meson.build
127 index eb196c21e..c9a29f680 100644
128 --- a/plugins/uefi-capsule/meson.build
129 +++ b/plugins/uefi-capsule/meson.build
130 @@ -20,7 +20,7 @@ if host_machine.system() == 'linux'
131 output: '35_fwupd',
132 configuration: con2,
133 install: true,
134 - install_dir: join_paths(sysconfdir, 'grub.d')
135 + install_dir: join_paths(sysconfdir_install, 'grub.d')
137 elif host_machine.system() == 'freebsd'
138 backend_srcs += 'fu-uefi-backend-freebsd.c'