diff options
author | Benjamin Berg <bberg@redhat.com> | 2020-08-03 12:15:28 +0200 |
---|---|---|
committer | Benjamin Berg <bberg@redhat.com> | 2020-08-03 12:15:28 +0200 |
commit | ef7a954cd73dd734954df5078503b10ca3e72e81 (patch) | |
tree | c158ab7097c7112d5fdf0ee6ac9d3f8632d16f10 | |
parent | 0d93fef0cb3dc19b43e54d4fdbb978f8ce687a2e (diff) | |
download | gnome-settings-daemon-ef7a954cd73dd734954df5078503b10ca3e72e81.tar.gz |
meson: Fix masking symlink location and detection of jhbuild
The symlinks need to be installed into DESTDIR, use a shell to do this
correctly. Also, doing this on debug builds is not very helpful,
instead, do it by testing whether we are installing into the same prefix
that systemd is coming from.
This assumes that we will run using the same systemd instance as we are
picking up the pkgconfig file from, but that seems like a reasonable
assumption (i.e. it is unlikely anyone has systemd in their prefix and
doesn't bother to set things up correctly).
-rw-r--r-- | plugins/meson.build | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/plugins/meson.build b/plugins/meson.build index 3f8000eb..e8f2c4cd 100644 --- a/plugins/meson.build +++ b/plugins/meson.build @@ -165,13 +165,15 @@ foreach plugin: all_plugins install_dir: systemd_userunitdir ) - # Wipe out old target names in non-release builds; this saves a lot - # of pain when running a new g-s-d inside jhbuild on an old host + # Wipe out old target names if our prefix differes from the + # systemd one, i.e. we are probably in a virtual environment and + # may be picking up old units from a system installation. + # This saves a lot of pain when running a new g-s-d inside + # jhbuild on an old host. # TODO: Should be deleted once we can assume developers have 3.38 # installed on their machines. - # FIXME: find a better way to detect jhbuild - if get_option('buildtype') in ['debug', 'debugoptimized'] - meson.add_install_script('ln', '-vfs', '/dev/null', systemd_userunitdir / 'gsd-@0@.target'.format(plugin_name)) + if gsd_prefix != systemd_dep.get_pkgconfig_variable('prefix') + meson.add_install_script('sh', '-c', 'ln -vfs /dev/null "${DESTDIR:-}$1"', 'sh', systemd_userunitdir / 'gsd-@0@.target'.format(plugin_name)) endif foreach target: gates_all |