[gnome-settings-daemon/benzea/fix-jhbuild-detection] meson: Fix masking symlink location and detection of jhbuild




commit ef7a954cd73dd734954df5078503b10ca3e72e81
Author: Benjamin Berg <bberg redhat com>
Date:   Mon Aug 3 12:15:28 2020 +0200

    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).

 plugins/meson.build | 12 +++++++-----
 1 file 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]