anchor.diff:    '' + optionalString stdenv.isLinux ''
       mkdir -p $drivers/lib
   
  -    # move gallium-related stuff to $drivers, so $out doesn't depend on LLVM
  -    mv -t $drivers/lib       \
  -      $out/lib/libxatracker* \
  -      $out/lib/libvulkan_*
  -
  -    # Move other drivers to a separate output
  -    mv $out/lib/lib*_mesa* $drivers/lib
  -
  -    # move libOSMesa to $osmesa, as it's relatively big
  -    mkdir -p $osmesa/lib
  -    mv -t $osmesa/lib/ $out/lib/libOSMesa*
  +    if [ -n "$(shopt -s nullglob; echo "$out/lib/libxatracker"*)" -o -n "$(shopt -s nullglob; echo "$out/lib/libvulkan_"*)" ]; then
  +      # move gallium-related stuff to $drivers, so $out doesn't depend on LLVM
  +      mv -t $drivers/lib       \
  +        $out/lib/libxatracker* \
  +        $out/lib/libvulkan_*
  +    fi
  +
  +    if [ -n "$(shopt -s nullglob; echo "$out"/lib/lib*_mesa*)" ]; then
  +      # Move other drivers to a separate output
  +      mv $out/lib/lib*_mesa* $drivers/lib
  +    fi
   
       # move vendor files
       mv $out/share/ $drivers/
  
positive.code: , eglPlatforms ? [ "x11" "surfaceless" ] ++ lib.optionals stdenv.isLinux [ "wayland" "drm" ]
  , OpenGL, Xplugin
  , withValgrind ? stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32, valgrind-light
  }:
  
  /** Packaging design:
  
negative.code: 
      # Update search path used by pkg-config
      for pc in $dev/lib/pkgconfig/{d3d,dri,xatracker}.pc; do
        if [ -f "$pc" ]; then
          substituteInPlace "$pc" --replace $out $drivers
        fi
      done
  
      # add RPATH so the drivers can find the moved libgallium and libdricore9
  