meson: add runtime_dir option

Adds a runtime_dir option to the meson options, which allows the user to
specify the run directory when building. This commit also changes it so
that `/run` is set as the default run directory if building with /usr prefix.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1919
This commit is contained in:
Jan Vaclav 2024-04-15 13:48:26 +02:00
parent 94756668f9
commit e42ef92bfa
2 changed files with 10 additions and 1 deletions

View File

@ -43,10 +43,18 @@ nm_libexecdir = join_paths(nm_prefix, get_option('libexecdir'))
nm_localedir = join_paths(nm_prefix, get_option('localedir'))
nm_localstatedir = join_paths(nm_prefix, get_option('localstatedir'))
nm_mandir = join_paths(nm_prefix, get_option('mandir'))
nm_runstatedir = join_paths(nm_localstatedir, 'run')
nm_sbindir = join_paths(nm_prefix, get_option('sbindir'))
nm_sysconfdir = join_paths(nm_prefix, get_option('sysconfdir'))
nm_runstatedir = get_option('runtime_dir')
if nm_runstatedir == ''
if get_option('prefix') == '/usr'
nm_runstatedir = '/run'
else
nm_runstatedir = join_paths(nm_localstatedir, 'run')
endif
endif
nm_pkgsbindir = join_paths(nm_sbindir, nm_name)
nm_pkgconfdir = join_paths(nm_sysconfdir, nm_name)
nm_pkgdatadir = join_paths(nm_datadir, nm_name)

View File

@ -4,6 +4,7 @@ option('system_ca_path', type: 'string', value: '/etc/ssl/certs', description: '
option('udev_dir', type: 'string', value: '', description: 'Absolute path of the udev base directory. Set to \'no\' not to install the udev rule')
option('dbus_conf_dir', type: 'string', value: '', description: 'where D-Bus system.d directory is')
option('kernel_firmware_dir', type: 'string', value: '/lib/firmware', description: 'where kernel firmware directory is (default is /lib/firmware)')
option('runtime_dir', type: 'string', value: '', description: 'Directory for transient runtime state [default: LOCALSTATEDIR/run or /run]')
option('iptables', type: 'string', value: '', description: 'path to iptables')
option('nft', type: 'string', value: '', description: 'path to nft')
option('dnsmasq', type: 'string', value: '', description: 'path to dnsmasq')