anchor.diff:        "https://launchpad.net/mesa/trunk/${version}/+download/mesa-${version}.tar.xz"
       ];
       allowHashOutput = false;  # Provided by upstream directly
  -    sha256 = "40e148812388ec7c6d7b6657d5a16e2e8dabba8b97ddfceea5197947647bdfb4";
  +    sha256 = "bab24fb79f78c876073527f515ed871fc9c81d816f66c8a0b051d8d653896389";
     };
   
     nativeBuildInputs = [
       autoreconfHook
       bison
  -    file
       flex
  +    gettext
       intltool
  -    python2
  +    python2Packages.python
       python2Packages.Mako
       xorg.makedepend
     ];
  
positive.code: 
  stdenv.mkDerivation rec {
    name = "mesa-noglu-${version}";
    version = "11.2.2";
  
    src =  fetchurl {
      urls = [
  
negative.code: 
    postPatch = ''
      patchShebangs .
    '' + /* Set runtime driver search path */ ''
      sed -i src/egl/main/egldriver.c \
        -e 's,_EGL_DRIVER_SEARCH_DIR,"${driverSearchPath}",'
    '' + /* Substitute the path to udev */ ''
      grep -q '@udev@' src/loader/loader.c
      sed -i src/loader/loader.c \
        -e 's,@udev@,${systemd_lib},g'
    '' + /* Upstream incorrectly specifies PYTHONPATH explicitly, overriding
            the build environments PYTHONPATH */ ''
      sed -e 's,PYTHONPATH=,PYTHONPATH=$(PYTHONPATH):,g' \
        -i src/mesa/drivers/dri/i965/Makefile.am \
        -i src/gallium/drivers/freedreno/Makefile.am
    '';
  
    configureFlags = [
      "--sysconfdir=/etc"
      "--localstatedir=/var"
      "--enable-largefile"
      # TODO: Power 8 support
      "--disable-pwr8-inst"
      # slight performance degradation, enable only for grsec
      (enFlag "glx-rts" grsecEnabled null)
      "--disable-debug"
      "--disable-profile"
      (enFlag "libglvnd" (libglvnd != null) null)
      "--disable-mangling"
      (enFlag "texture-float" enableTextureFloats null)
      "--enable-asm"
      # TODO: selinux support
      "--disable-selinux"
      "--enable-opengl"
      "--enable-gles1"
  