nixpkgs/pkgs/servers/pulseaudio/add-option-for-installation-sysconfdir.patch
2024-02-11 18:30:39 +01:00

94 lines
3.0 KiB
Diff

--- a/meson.build
+++ b/meson.build
@@ -67,6 +67,11 @@ datadir = join_paths(prefix, get_option('datadir'))
localedir = join_paths(prefix, get_option('localedir'))
localstatedir = join_paths(prefix, get_option('localstatedir'))
sysconfdir = join_paths(prefix, get_option('sysconfdir'))
+if get_option('sysconfdir_install') != ''
+ sysconfdir_install = join_paths(get_option('prefix'), get_option('sysconfdir_install'))
+else
+ sysconfdir_install = sysconfdir
+endif
privlibdir = join_paths(libdir, 'pulseaudio')
if host_machine.system() == 'windows'
@@ -82,6 +87,11 @@ endif
pkgconfigdir = join_paths(libdir, 'pkgconfig')
pulselibexecdir = join_paths(libexecdir, 'pulse')
pulsesysconfdir = join_paths(sysconfdir, 'pulse')
+if get_option('sysconfdir_install') != ''
+ pulsesysconfdir_install = join_paths(get_option('prefix'), get_option('sysconfdir_install'), 'pulse')
+else
+ pulsesysconfdir_install = pulsesysconfdir
+endif
modlibexecdir = get_option('modlibexecdir')
if modlibexecdir == ''
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -72,6 +72,9 @@ option('bashcompletiondir',
option('zshcompletiondir',
type : 'string',
description : 'Directory for zsh completion scripts ["no" disables]')
+option('sysconfdir_install',
+ type: 'string', value: '',
+ description: 'sysconfdir to use during installation')
# Optional features
--- a/src/daemon/meson.build
+++ b/src/daemon/meson.build
@@ -52,7 +52,7 @@ if x11_dep.found()
output : '00-pulseaudio-x11',
configuration : conf,
install : true,
- install_dir : join_paths(sysconfdir, 'xdg', 'Xwayland-session.d'),
+ install_dir : join_paths(sysconfdir_install, 'xdg', 'Xwayland-session.d'),
)
desktop_file = i18n.merge_file(
@@ -61,7 +61,7 @@ if x11_dep.found()
po_dir : po_dir,
type : 'desktop',
install : true,
- install_dir : join_paths(sysconfdir, 'xdg', 'autostart'),
+ install_dir : join_paths(sysconfdir_install, 'xdg', 'autostart'),
)
desktop_utils = find_program('desktop-file-validate', required: false)
@@ -93,7 +93,7 @@ custom_target('daemon.conf',
command : [m4, '@INPUT@'],
build_by_default : true,
install : true,
- install_dir : pulsesysconfdir,
+ install_dir : pulsesysconfdir_install,
)
default_conf = configuration_data()
@@ -117,7 +117,7 @@ custom_target('default.pa',
command : [m4, '@INPUT@'],
build_by_default : true,
install : true,
- install_dir : pulsesysconfdir,
+ install_dir : pulsesysconfdir_install,
)
system_conf = configuration_data()
@@ -136,6 +136,6 @@ custom_target('system.pa',
command : [m4, '@INPUT@'],
build_by_default : true,
install : true,
- install_dir : pulsesysconfdir,
+ install_dir : pulsesysconfdir_install,
)
--- a/src/pulse/meson.build
+++ b/src/pulse/meson.build
@@ -134,5 +134,5 @@ client_conf_file = configure_file(
input : 'client.conf.in',
output : 'client.conf',
configuration : client_conf,
- install_dir : pulsesysconfdir,
+ install_dir : pulsesysconfdir_install,
)