anchor.diff:      sed "s,$out\(/lib/\(libdricore[0-9\.]*\|libgallium\).la\),$drivers\1,g" \
         -i $drivers/lib/*.la $drivers/lib/*/*.la
   
  +    sed "/^libdir=/s,$out,$osmesa," -i \
  +      $osmesa/lib/libOSMesa*.la
  +
     '' + /* work around bug #529, but maybe $drivers should also be patchelf-ed */ ''
  -    find $drivers/ -type f -executable -print0 | xargs -0 strip -S || true
  +    find $drivers/ $osmesa/ -type f -executable -print0 | xargs -0 strip -S || true
   
     '' + /* add RPATH so the drivers can find the moved libgallium and libdricore9 */ ''
       for lib in $drivers/lib/*.so* $drivers/lib/*/*.so*; do
  
positive.code:     "--enable-xa" # used in vmware driver
      "--enable-gles1" "--enable-gles2"
      "--enable-vdpau"
  
      "--with-dri-drivers=i965,r200,radeon"
      ("--with-gallium-drivers=i915,nouveau,r300,r600,svga,swrast"
  
negative.code:   #doCheck = true; # https://bugs.freedesktop.org/show_bug.cgi?id=67672
    # TODO: best fix this before merging >=9.2 to master
  
    # move gallium-related stuff to $drivers, so $out doesn't depend on LLVM;
    #   also move libOSMesa to $osmesa, as it's relatively big
    # ToDo: probably not all .la files are completely fixed, but it shouldn't matter
    postInstall = with stdenv.lib; ''
      mv -t "$drivers/lib/" \
    '' + optionalString enableExtraFeatures ''
        `#$out/lib/libXvMC*` \
        $out/lib/gbm $out/lib/libgbm* \
        $out/lib/gallium-pipe \
    '' + ''
  