anchor.diff:        "find_program('${buildPackages.pkg-config.targetPrefix}pkg-config')"
     '';
   
  -  outputs = [ "out" "dev" "drivers" "osmesa" ];
  +  outputs = [ "out" "dev" "drivers" ] ++ lib.optional enableOSMesa "osmesa";
   
     # TODO: Figure out how to enable opencl without having a runtime dependency on clang
     mesonFlags = [
  
positive.code: 
      # Update search path used by pkg-config
      for pc in $dev/lib/pkgconfig/{d3d,dri,xatracker}.pc; do
        substituteInPlace "$pc" --replace $out $drivers
      done
  
      # add RPATH so the drivers can find the moved libgallium and libdricore9
  
negative.code:   '' + optionalString stdenv.isLinux ''
      mkdir -p $drivers/lib
  
      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/
  