diff options
author | Jan Vaclav <jvaclav@redhat.com> | 2024-04-15 13:48:26 +0200 |
---|---|---|
committer | Jan Vaclav <jvaclav@redhat.com> | 2024-04-15 15:03:35 +0200 |
commit | e42ef92bfacf6104196c4bc393a686a041e5911a (patch) | |
tree | 0bf74cc7a3ad6fea20c60c5caad3d2d8d45b7ad3 | |
parent | 94756668f959cc0c7024fcaf2cfd122a7e3d6ab3 (diff) |
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
-rw-r--r-- | meson.build | 10 | ||||
-rw-r--r-- | meson_options.txt | 1 |
2 files changed, 10 insertions, 1 deletions
diff --git a/meson.build b/meson.build index a7d5ea9ea3..4356c95a19 100644 --- a/meson.build +++ b/meson.build @@ -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) diff --git a/meson_options.txt b/meson_options.txt index 92439ac539..75cf183d71 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -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') |