On Debian, libdir is commonly something like 'lib/x86_64-linux-gnu'.
The result of get_option('libdir') is normalized to a prefix-relative
path by meson, so we can just append it to rootprefixdir.
Fixes https://github.com/systemd/systemd/issues/23648.
rootlibdir = get_option('rootlibdir')
if rootlibdir == ''
- rootlibdir = rootprefixdir / libdir.split('/')[-1]
+ # This will be a relative path if libdir is in prefix.
+ rootlibdir = get_option('libdir')
+endif
+if not rootlibdir.startswith('/')
+ # If we have a relative path, add rootprefixdir to the front.
+ rootlibdir = rootprefixdir / rootlibdir
endif
rootpkglibdir = rootlibdir / 'systemd'