anchor.diff:  
     postInstall = ''
       rm -rf $out/tests
  -  '';
  -
  -  crossAttrs = {
  -    # I've not tried any case other than i686-pc-mingw32.
  -    # -nomake tools:   it fails linking some asian language symbols
  -    # -no-svg: it fails to build on mingw64
  -    configureFlags = ''
  -      -static -release -confirm-license -opensource
  -      -no-opengl -no-phonon
  -      -no-svg
  -      -make qmake -make libs -nomake tools
  -      -nomake demos -nomake examples -nomake docs
  -    '' + optionalString hostPlatform.isMinGW " -xplatform win32-g++-4.6";
  -    patches = [];
  -    preConfigure = ''
  -      sed -i -e 's/ g++/ ${stdenv.cc.targetPrefix}g++/' \
  -        -e 's/ gcc/ ${stdenv.cc.targetPrefix}gcc/' \
  -        -e 's/ ar/ ${stdenv.cc.targetPrefix}ar/' \
  -        -e 's/ strip/ ${stdenv.cc.targetPrefix}strip/' \
  -        -e 's/ windres/ ${stdenv.cc.targetPrefix}windres/' \
  -        mkspecs/win32-g++/qmake.conf
  -    '';
  -
  -    # I don't know why it does not install qmake
  -    postInstall = ''
  -      cp bin/qmake* $out/bin
  -    '';
  -    configurePlatforms = [];
  -    dontStrip = true;
  -  } // optionalAttrs hostPlatform.isMinGW {
  -    propagatedBuildInputs = [ ];
  -  };
  +  ''
  +  # 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     = licenses.lgpl21Plus; # or gpl3
  -    maintainers = with maintainers; [ orivej lovek323 phreedom sander ];
  -    platforms   = platforms.unix;
  +    license     = lib.licenses.lgpl21Plus; # or gpl3
  +    maintainers = with lib.maintainers; [ orivej lovek323 phreedom sander ];
  +    platforms   = lib.platforms.unix;
     };
   }
  
positive.code:   NIX_CFLAGS_COMPILE =
      # with gcc7 the warnings blow the log over Hydra's limit
      [ "-Wno-expansion-to-defined" "-Wno-unused-local-typedefs" ]
      ++ optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
      ++ optionals (stdenv.isFreeBSD || stdenv.isDarwin)
        [ "-I${glib.dev}/include/glib-2.0" "-I${glib.out}/lib/glib-2.0/include" ]
      ++ optional stdenv.isDarwin "-I${libcxx}/include/c++/v1";
  
    NIX_LDFLAGS = optionalString (stdenv.isFreeBSD || stdenv.isDarwin) "-lglib-2.0";
  
    preBuild = optionalString stdenv.isDarwin ''
      # resolve "extra qualification on member" error
      sed -i 's/struct ::TabletProximityRec;/struct TabletProximityRec;/' \
        src/gui/kernel/qt_cocoa_helpers_mac_p.h
  
negative.code: , cf-private, libobjc, ApplicationServices, OpenGL, Cocoa, AGL, libcxx
  }:
  
  let
    v_maj = "4.8";
    v_min = "7";
  