summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDudemanguy <random342@airmail.cc>2022-11-19 12:46:06 -0600
committerDudemanguy <random342@airmail.cc>2022-11-19 13:10:24 -0600
commitf10b24e3c5c76756544830f2a9ef192f55a7dcdb (patch)
treef353e2df8c88c21b27c76d7cd54a2566e47e9e84 /meson.build
parent8327ac3e6d1686dd753b0ee23f135ebaa13af1b6 (diff)
downloadmpv-f10b24e3c5c76756544830f2a9ef192f55a7dcdb.tar.bz2
mpv-f10b24e3c5c76756544830f2a9ef192f55a7dcdb.tar.xz
meson: prepend MPV_CONFDIR path with prefix
Meson uses the sysconfdir option for setting the global config directory. This conveniently defaults to /etc if the prefix is set to /usr which is nice for linux distros. BSDs tend to use /usr/local which causes this value to become 'etc' by default which is not an absolute path so you would need to set something like -Dsysconfdir=/usr/local/etc as well in the configuration step. It turns out we can have our cake and eat it too by just joining the paths of prefix and sysconfdir together. In the case where -Dprefix=/usr, this still results in /etc/mpv as the path since the path joining logic just drops the leading '/usr/'. For the /usr/local case, it ends up as /usr/local/etc/mpv as expected. This fixes #10882.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build2
1 files changed, 1 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index af4a6bcd97..14b9616f92 100644
--- a/meson.build
+++ b/meson.build
@@ -1624,7 +1624,7 @@ sys.stdout.write(features)
'''
feature_str = run_command(python, '-c', feature_sort, feature_keys, check: true).stdout()
conf_data.set_quoted('FULLCONFIG', feature_str)
-conf_data.set_quoted('MPV_CONFDIR', join_paths(get_option('sysconfdir'), 'mpv'))
+conf_data.set_quoted('MPV_CONFDIR', join_paths(get_option('prefix'), get_option('sysconfdir'), 'mpv'))
configure_file(output : 'config.h', configuration : conf_data)
message('List of enabled features: ' + feature_str)