[neon/snap-packaging/snapcraft-desktop-integration] common: disable update xdg dirs copy in change from canoical

Scarlett Moore null at kde.org
Thu Jul 2 14:44:12 BST 2026


Git commit c101198f0dd96a872e9541b3d69861b9d733376c by Scarlett Moore.
Committed on 02/07/2026 at 13:43.
Pushed by scarlettmoore into branch 'master'.

disable update xdg dirs copy in change from canoical

M  +40   -38   common/desktop-exports

https://invent.kde.org/neon/snap-packaging/snapcraft-desktop-integration/-/commit/c101198f0dd96a872e9541b3d69861b9d733376c

diff --git a/common/desktop-exports b/common/desktop-exports
index d98250b..5a96823 100644
--- a/common/desktop-exports
+++ b/common/desktop-exports
@@ -110,6 +110,9 @@ if [ "%WITH_GRAPHICS%" != "false" ]; then
     fi
   fi
 
+  # Set where to find GBM backends
+  export GBM_BACKENDS_PATH=${GBM_BACKENDS_PATH:+$GBM_BACKENDS_PATH:}${SNAP_DESKTOP_RUNTIME}/usr/lib/$ARCH/gbm
+
   # Workaround in snapd for proprietary nVidia drivers mounts the drivers in
   # /var/lib/snapd/lib/gl that needs to be in LD_LIBRARY_PATH
   # Without that OpenGL using apps do not work with the nVidia drivers.
@@ -129,21 +132,17 @@ append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libunity"
 append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/pulseaudio"
 
 # Tell Pipewire where to find its configuration and plugins
-export PIPEWIRE_CONFIG_DIR="$SNAP_DESKTOP_RUNTIME/usr/share/pipewire"
-export PIPEWIRE_MODULE_DIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/pipewire-0.3"
-export SPA_PLUGIN_DIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/spa-0.2"
+export PIPEWIRE_CONFIG_DIR=${PIPEWIRE_CONFIG_DIR:-"$SNAP_DESKTOP_RUNTIME/usr/share/pipewire"}
+export PIPEWIRE_MODULE_DIR=${PIPEWIRE_MODULE_DIR:-"$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/pipewire-0.3"}
+export SPA_PLUGIN_DIR=${SPA_PLUGIN_DIR:-"$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/spa-0.2"}
 
 # Tell GStreamer where to find its plugins
-export GST_PLUGIN_PATH="$SNAP/usr/lib/$ARCH/gstreamer-1.0"
-export GST_PLUGIN_SYSTEM_PATH="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer-1.0"
+export GST_PLUGIN_PATH=${GST_PLUGIN_PATH:-"$SNAP/usr/lib/$ARCH/gstreamer-1.0"}
+export GST_PLUGIN_SYSTEM_PATH=${GST_PLUGIN_SYSTEM_PATH:-"$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer-1.0"}
 # gst plugin scanner doesn't install in the correct path: https://github.com/ubuntu/snapcraft-desktop-helpers/issues/43
-export GST_PLUGIN_SCANNER="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"
+export GST_PLUGIN_SCANNER=${GST_PLUGIN_SCANNER:-"$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gstreamer1.0/gstreamer-1.0/gst-plugin-scanner"}
 
 # XDG Config
-# KConfig uses QStandardPaths:GenericConfigLocation to get the config dir paths
-# and checks for the kdeglobals file there for theming. The kdeglobals file is
-# stored in $SNAP_REAL_HOME/.config folder.
-prepend_dir XDG_CONFIG_DIRS "$SNAP_REAL_HOME/.config"
 prepend_dir XDG_CONFIG_DIRS "$SNAP_DESKTOP_RUNTIME/etc/xdg"
 prepend_dir XDG_CONFIG_DIRS "$SNAP/etc/xdg"
 
@@ -236,31 +235,31 @@ if [ "$needs_xdg_update" = true ] && command -v xdg-user-dirs-update >/dev/null;
   update_xdg_dirs_values
 fi
 
-# Create links for user-dirs.dirs
-if [ "$needs_xdg_links" = true ]; then
-  if [ "$HOME" != "$SNAP_REAL_HOME" ]; then
-    for ((i = 0; i < ${#XDG_SPECIAL_DIRS_PATHS[@]}; i++)); do
-      b="$(realpath "${XDG_SPECIAL_DIRS_PATHS[$i]}" --relative-to="$HOME" 2>/dev/null)"
-      if [[ -n "$b" && "$b" != "." && -e "$SNAP_REAL_HOME/$b" ]]; then
-        [ -d "$HOME/$b" ] && rmdir "$HOME/$b" 2> /dev/null
-        [ ! -e "$HOME/$b" ] && ln -s "$SNAP_REAL_HOME/$b" "$HOME/$b"
-      fi
-    done
-  fi
-else
-  # If we aren't creating new links, check if we have content saved in old locations and move it
-  for ((i = 0; i < ${#XDG_SPECIAL_DIRS[@]}; i++)); do
-    old="${XDG_SPECIAL_DIRS_INITIAL_PATHS[$i]}"
-    new="${XDG_SPECIAL_DIRS_PATHS[$i]}"
-    if [ -L "$old" ] && [ -d "$new" ] && [ "$(readlink "$old" 2>/dev/null)" != "$new" ] &&
-         (is_subpath "$old" "$SNAP_USER_DATA" || is_subpath "$old" "$SNAP_USER_COMMON"); then
-      mv -vn "$old"/* "$new"/ 2>/dev/null
-    elif [ -d "$old" ] && [ -d "$new" ] && [ "$old" != "$new" ] &&
-         (is_subpath "$old" "$SNAP_USER_DATA" || is_subpath "$old" "$SNAP_USER_COMMON"); then
-      mv -vn "$old"/* "$new"/ 2>/dev/null
-    fi
-  done
-fi
+# # Create links for user-dirs.dirs
+# if [ "$needs_xdg_links" = true ]; then
+#   if [ "$HOME" != "$SNAP_REAL_HOME" ]; then
+#     for ((i = 0; i < ${#XDG_SPECIAL_DIRS_PATHS[@]}; i++)); do
+#       b="$(realpath "${XDG_SPECIAL_DIRS_PATHS[$i]}" --relative-to="$HOME" 2>/dev/null)"
+#       if [[ -n "$b" && "$b" != "." && -e "$SNAP_REAL_HOME/$b" ]]; then
+#         [ -d "$HOME/$b" ] && rmdir "$HOME/$b" 2> /dev/null
+#         [ ! -e "$HOME/$b" ] && ln -s "$SNAP_REAL_HOME/$b" "$HOME/$b"
+#       fi
+#     done
+#   fi
+# else
+#   # If we aren't creating new links, check if we have content saved in old locations and move it
+#   for ((i = 0; i < ${#XDG_SPECIAL_DIRS[@]}; i++)); do
+#     old="${XDG_SPECIAL_DIRS_INITIAL_PATHS[$i]}"
+#     new="${XDG_SPECIAL_DIRS_PATHS[$i]}"
+#     if [ -L "$old" ] && [ -d "$new" ] && [ "$(readlink "$old" 2>/dev/null)" != "$new" ] &&
+#          (is_subpath "$old" "$SNAP_USER_DATA" || is_subpath "$old" "$SNAP_USER_COMMON"); then
+#       mv -vn "$old"/* "$new"/ 2>/dev/null
+#     elif [ -d "$old" ] && [ -d "$new" ] && [ "$old" != "$new" ] &&
+#          (is_subpath "$old" "$SNAP_USER_DATA" || is_subpath "$old" "$SNAP_USER_COMMON"); then
+#       mv -vn "$old"/* "$new"/ 2>/dev/null
+#     fi
+#   done
+# fi
 
 # If detect wayland server socket, then set environment so applications prefer
 # wayland, and setup compat symlink (until we use user mounts. Remember,
@@ -437,8 +436,8 @@ append_dir LD_LIBRARY_PATH "$SNAP/testability/$ARCH"
 append_dir LD_LIBRARY_PATH "$SNAP/testability/$ARCH/mesa"
 
 # Gdk-pixbuf loaders
-export GDK_PIXBUF_MODULE_FILE="$XDG_CACHE_HOME/gdk-pixbuf-loaders.cache"
-export GDK_PIXBUF_MODULEDIR="$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders"
+export GDK_PIXBUF_MODULE_FILE=${GDK_PIXBUF_MODULE_FILE:-"$XDG_CACHE_HOME/gdk-pixbuf-loaders.cache"}
+export GDK_PIXBUF_MODULEDIR=${GDK_PIXBUF_MODULEDIR:-"$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders"}
 if [ "$needs_update" = true ] || [ ! -f "$GDK_PIXBUF_MODULE_FILE" ]; then
   rm -f "$GDK_PIXBUF_MODULE_FILE"
   if [ -f "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" ]; then
@@ -475,7 +474,7 @@ fi
 
 # GTK theme and behavior modifier
 # Those can impact the theme engine used by Qt as well
-gtk_configs=(gtk-4.0/settings.ini gtk-4.0/gtk.css gtk-4.0/bookmarks gtk-4.0/colors.css gtk-3.0/settings.ini gtk-3.0/gtk.css gtk-3.0/bookmarks gtk-3.0/colors.css gtk-2.0/gtkfilechooser.ini)
+gtk_configs=(gtk-3.0/settings.ini gtk-3.0/gtk.css gtk-3.0/bookmarks gtk-2.0/gtkfilechooser.ini)
 for f in "${gtk_configs[@]}"; do
   dest="$XDG_CONFIG_HOME/$f"
   if [ ! -L "$dest" ]; then
@@ -502,3 +501,6 @@ export LIBTHAI_DICTDIR="$SNAP_DESKTOP_RUNTIME/usr/share/libthai/"
 # is in the default place, but not if it is snapped in the gnome-sdk/gnome-runtime snap.
 
 append_dir LD_LIBRARY_PATH "$SNAP_DESKTOP_RUNTIME/usr/lib/$ARCH/libproxy"
+
+# GLib gio-launch-desktop, used by g_app_info_launch
+export GIO_LAUNCH_DESKTOP=${GIO_LAUNCH_DESKTOP:-"$SNAP_DESKTOP_RUNTIME/usr/libexec/gio-launch-desktop"}


More information about the Neon-commits mailing list