anchor.diff:  , cf-private, libobjc, ApplicationServices, OpenGL, Cocoa, AGL, libcxx
   }:
   
  -with stdenv.lib;
  -
   let
     v_maj = "4.8";
     v_min = "7";
  
positive.code:     substituteInPlace configure --replace /bin/pwd pwd
      substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
      sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i config.tests/*/*.test -i mkspecs/*/*.conf
    '' + stdenv.lib.optionalString stdenv.isDarwin ''
      # remove impure reference to /usr/lib/libstdc++.6.dylib
      # there might be more references, but this is the only one I could find
      substituteInPlace tools/macdeployqt/tests/tst_deployment_mac.cpp \
        --replace /usr/lib/libstdc++.6.dylib "${stdenv.cc}/lib/libstdc++.6.dylib"
    '' + stdenv.lib.optionalString stdenv.cc.isClang ''
      substituteInPlace src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp \
        --replace 'optionalHeight > 0' 'optionalHeight != NULL'
  
  
negative.code: 
    postInstall = ''
      rm -rf $out/tests
    ''
    # I don't know why it does not install qmake
    + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
      cp bin/qmake* $out/bin
    '';
  
    dontStrip = if stdenv.hostPlatform == stdenv.buildPlatform then null else true;
  
    meta = {
      homepage    = http://qt-project.org/;
      description = "A cross-platform application framework for C++";
      license     = lib.licenses.lgpl21Plus; # or gpl3
      maintainers = with lib.maintainers; [ orivej lovek323 phreedom sander ];
      platforms   = lib.platforms.unix;
    };
  }
  