[jhbuild/wip/carlosg/xcursor-path] env: Set fallback paths on XCURSOR_PATH



commit 022a338f0fad8b023784266602039134233fe50e
Author: Carlos Garnacho <carlosg gnome org>
Date:   Fri Nov 22 13:00:19 2019 +0100

    env: Set fallback paths on XCURSOR_PATH
    
    As libXcursor works, the XCURSOR_PATH environment variable overrides
    any default lookup paths. This makes the jhbuild prefix the only
    lookup path then, triggering X cursor lookup errors after `jhbuild
    build mutter`, as adwaita-icon-theme is not part of its build chain.
    
    Users might also have a non-default cursor theme, making the issue
    even harder to spot and fix. It makes sense to add the default lookup
    paths in the jhbuild environment, so all this works out of the box.

 jhbuild/environment.py | 11 +++++++++++
 1 file changed, 11 insertions(+)
---
diff --git a/jhbuild/environment.py b/jhbuild/environment.py
index 85b5d9db..9b96bdad 100644
--- a/jhbuild/environment.py
+++ b/jhbuild/environment.py
@@ -211,6 +211,17 @@ def setup_env(prefix):
     addpath('XDG_CONFIG_DIRS', xdgconfigdir)
 
     # XCURSOR_PATH
+    if not os.environ.get('XCURSOR_PATH'):
+        # The XCURSOR_PATH envvar overrides the default paths,
+        # so include them here.
+        xcursorpath = [ os.path.join(os.environ['HOME'], '.local', 'share', 'icons'),
+                        os.path.join(os.environ['HOME'], '.icons'),
+                        '/usr/share/icons',
+                        '/usr/share/pixmaps',
+                        '/usr/X11R6/lib/X11/icons' ]
+        for xcursorpathdir in xcursorpath:
+            addpath('XCURSOR_PATH', xcursorpathdir, prepend=False)
+
     xcursordir = os.path.join(prefix, 'share', 'icons')
     addpath('XCURSOR_PATH', xcursordir)
 


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