diff options
author | Dudemanguy <random342@airmail.cc> | 2022-11-19 12:46:06 -0600 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2023-01-24 15:56:56 +0100 |
commit | 214e47854a579437069b0024350f3e3d93c2b33a (patch) | |
tree | 0bf2e2df36f83295d9a3bccf5b2226696bfe699d | |
parent | 5fb7a23d378ee8f84d35e1dbf92a54ce88069fb9 (diff) | |
download | mpv-214e47854a579437069b0024350f3e3d93c2b33a.tar.bz2 mpv-214e47854a579437069b0024350f3e3d93c2b33a.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.
-rw-r--r-- | meson.build | 2 |
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) |