mirror of https://github.com/mpv-player/mpv
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.
This commit is contained in:
parent
5fb7a23d37
commit
214e47854a
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue