summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-06-27 15:12:54 +0100
committerSimon McVittie <smcv@collabora.com>2022-07-13 20:36:13 +0100
commite2f2c5dd42e193d4bddb0bda49b07bf254cff248 (patch)
tree57901dda3003f9496e9e9c7dfd98fba19dca89d9 /meson.build
parentabef7950816d423b3b65fcf36bfa0cf0e36c4ebf (diff)
downloaddbus-e2f2c5dd42e193d4bddb0bda49b07bf254cff248.tar.gz
build: Change how we create symlinks from Meson
Use install_symlink() in Meson versions that support it, or a script with similar invocation in versions that do not. This will make it straightforward to migrate to install_symlink() when we drop support for Meson versions older than 0.61.0. Based on an implementation in the game-data-packager package, which used a shell script. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build34
1 files changed, 27 insertions, 7 deletions
diff --git a/meson.build b/meson.build
index 937f6438..edd20dfa 100644
--- a/meson.build
+++ b/meson.build
@@ -42,6 +42,8 @@ data_config = configuration_data()
compile_args = []
link_args = []
+install_symlinks = []
+
###############################################################################
# Project configuration
@@ -983,13 +985,6 @@ meson.add_install_script('meson_post_install.py',
'@0@'.format(use_systemd),
)
-if use_systemd
- meson.add_install_script('meson_post_install_systemd.py',
- systemd_system_unitdir,
- systemd_user_unitdir,
- )
-endif
-
pkgconfig.generate(
libdbus,
name: 'dbus',
@@ -1016,6 +1011,31 @@ pkgconfig.generate(
}
)
+foreach symlink : install_symlinks
+ if not platform_unix
+ warning(
+ 'Not creating symbolic link @0@/@1@ -> @2@'.format(
+ symlink['install_dir'],
+ symlink['link_name'],
+ symlink['pointing_to'],
+ )
+ )
+ elif meson.version().version_compare('>=0.61.0')
+ install_symlink(
+ symlink['link_name'],
+ install_dir : symlink['install_dir'],
+ pointing_to : symlink['pointing_to'],
+ )
+ else
+ meson.add_install_script(
+ 'tools/meson-compat-install-symlink.py',
+ symlink['link_name'],
+ symlink['install_dir'],
+ symlink['pointing_to'],
+ )
+ endif
+endforeach
+
summary_dict = {
'prefix': get_option('prefix'),
'exec_prefix': get_option('prefix'),