)
endif
+install_emptydirs += [
+ get_option('datadir') / 'dbus-1' / 'session.d',
+ get_option('datadir') / 'dbus-1' / 'services',
+]
+
+if platform_unix
+ install_emptydirs += [
+ get_option('localstatedir') / 'run' / 'dbus',
+ get_option('datadir') / 'dbus-1' / 'system.d',
+ get_option('datadir') / 'dbus-1' / 'system-services',
+ ]
+endif
+
if use_systemd
install_symlinks += [
{
compile_args = []
link_args = []
+install_emptydirs = []
install_symlinks = []
###############################################################################
subdir('cmake')
meson.add_install_script('meson_post_install.py',
- '@0@'.format(platform_unix),
'@0@'.format(relocation),
- '@0@'.format(use_systemd),
)
pkgconfig.generate(
}
)
+if meson.version().version_compare('>=0.60.0')
+ foreach dir : install_emptydirs
+ install_emptydir(dir)
+ endforeach
+else
+ meson.add_install_script(
+ 'tools/meson-compat-install-emptydirs.py',
+ ':'.join(install_emptydirs),
+ )
+endif
+
foreach symlink : install_symlinks
if not platform_unix
warning(
# Define paths here
abs_libdir = destdir_prefix / get_option('libdir')
-dbus_data_dir = destdir_prefix / get_option('datadir') / 'dbus-1'
-platform_unix = sys.argv[1].lower() == 'true'
-relocation = sys.argv[2].lower() == 'true'
-
-def post_install_data():
- (dbus_data_dir / 'session.d').mkdir(parents=True, exist_ok=True)
- (dbus_data_dir / 'services').mkdir(parents=True, exist_ok=True)
- (dbus_data_dir / 'session.d').mkdir(parents=True, exist_ok=True)
-
- localstatedir = Path(get_option('localstatedir'))
- if destdir:
- localstatedir = destdir / localstatedir.relative_to(localstatedir.anchor)
- if platform_unix:
- (localstatedir / 'run' / 'dbus').mkdir(parents=True, exist_ok=True)
- (dbus_data_dir / 'system.d').mkdir(parents=True, exist_ok=True)
- (dbus_data_dir / 'system-services').mkdir(parents=True, exist_ok=True)
+relocation = sys.argv[1].lower() == 'true'
def post_install_relocation():
# Edit pkg-config file to replace the prefix
if __name__ == "__main__":
- post_install_data()
post_install_relocation()
post_install_exe()
EXTRA_DIST += build-timestamp.py
EXTRA_DIST += meson.build
+EXTRA_DIST += meson-compat-install-emptydirs.py
EXTRA_DIST += meson-compat-install-symlink.py
--- /dev/null
+#!/usr/bin/env python3
+# Copyright 2022 Collabora Ltd.
+# SPDX-License-Identifier: MIT
+
+# Compatibility shim for installing empty directories with Meson < 0.60
+
+import os
+import sys
+from pathlib import Path
+
+for d in sys.argv[1].split(':'):
+ if os.path.isabs(d) and 'DESTDIR' in os.environ:
+ p = Path(d)
+ d = p.relative_to(p.anchor)
+ dest = os.path.join(os.environ['DESTDIR'], d)
+ else:
+ dest = os.path.join(os.environ['MESON_INSTALL_DESTDIR_PREFIX'], d)
+
+ os.makedirs(dest, mode=0o755, exist_ok=True)