build/meson: honor prefix for udev_dir and don't use pkg-config
When building with `mesond -Dprefix=/tmp/nm`, then we would expect that udev files are installed there (wouldn't we?). The user can already explicitly set "-Dudev_dir=", or even disable installing the files with "-Dudev_dir=no". Note that meson be default pre-populates `get_option("prefix")`, so there is always something set. So we cannot just act on whether the user set a prefix. It seems to default to /usr/local. Note that package builds from Fedora spec file pass "-Dprefix=/usr". I think we should honor the prefix. However, then it seems wrong to also honor pkg-config at the same time. In particular, because `pkg-config --variable=udevdir udev` gives /usr/lib/udev. That means, if we would just prepend the default prefix "/usr" or "/usr/local" to "/usr/lib/udev" we get the wrong result. Note that we already to the same for autotools.
This commit is contained in:
14
meson.build
14
meson.build
@@ -353,10 +353,15 @@ if enable_introspection
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
udev_udevdir = get_option('udev_dir')
|
udev_udevdir = get_option('udev_dir')
|
||||||
install_udevdir = (udev_udevdir != 'no')
|
if udev_udevdir == 'no'
|
||||||
|
install_udevdir = false
|
||||||
if install_udevdir and udev_udevdir == ''
|
udev_udevdir = ''
|
||||||
udev_udevdir = dependency('udev').get_pkgconfig_variable('udevdir')
|
else
|
||||||
|
install_udevdir = true
|
||||||
|
if (udev_udevdir == '' or udev_udevdir == 'yes')
|
||||||
|
udev_udevdir = join_paths(nm_prefix, 'lib/udev')
|
||||||
|
endif
|
||||||
|
assert(udev_udevdir.startswith('/'), 'udev_dir must be an absolute path, but is ' + udev_udevdir)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
systemd_systemdsystemunitdir = get_option('systemdsystemunitdir')
|
systemd_systemdsystemunitdir = get_option('systemdsystemunitdir')
|
||||||
@@ -1013,6 +1018,7 @@ output = '\nSystem paths:\n'
|
|||||||
output += ' prefix: ' + nm_prefix + '\n'
|
output += ' prefix: ' + nm_prefix + '\n'
|
||||||
output += ' exec_prefix: ' + nm_prefix + '\n'
|
output += ' exec_prefix: ' + nm_prefix + '\n'
|
||||||
output += ' systemdunitdir: ' + systemd_systemdsystemunitdir + '\n'
|
output += ' systemdunitdir: ' + systemd_systemdsystemunitdir + '\n'
|
||||||
|
output += ' udev_dir: ' + (install_udevdir ? udev_udevdir : '(none)') + '\n'
|
||||||
output += ' nmbinary: ' + nm_pkgsbindir + '\n'
|
output += ' nmbinary: ' + nm_pkgsbindir + '\n'
|
||||||
output += ' nmconfdir: ' + nm_pkgconfdir + '\n'
|
output += ' nmconfdir: ' + nm_pkgconfdir + '\n'
|
||||||
output += ' nmlibdir: ' + nm_pkglibdir + '\n'
|
output += ' nmlibdir: ' + nm_pkglibdir + '\n'
|
||||||
|
Reference in New Issue
Block a user