anchor.diff:      runHook preSetupCompilerEnvironment
   
       echo "Build with ${ghc}."
  -    ${optionalString (hasActiveLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"}
  +    ${optionalString (isLibrary && hyperlinkSource) "export PATH=${hscolour}/bin:$PATH"}
   
       setupPackageConfDir="$TMPDIR/setup-package.conf.d"
       mkdir -p $setupPackageConfDir
  
positive.code:                      main = defaultMain
                     '';
  
    hasActiveLibrary = isLibrary && (enableStaticLibraries || enableSharedLibraries || enableLibraryProfiling || hostPlatform.isWindows);
  
    # We cannot enable -j<n> parallelism for libraries because GHC is far more
    # likely to generate a non-determistic library ID in that case. Further
    # details are at <https://github.com/peti/ghc-library-id-bug>.
    enableParallelBuilding = (versionOlder "7.8" ghc.version && !hasActiveLibrary) || versionOlder "8.0.1" ghc.version;
  
    crossCabalFlags = [
      "--with-ghc=${ghc.targetPrefix}ghc"
  
negative.code:   installPhase = ''
      runHook preInstall
  
      ${if !isLibrary then "${setupCommand} install" else ''
        ${setupCommand} copy
        local packageConfDir="$out/lib/${ghc.name}/package.conf.d"
        local packageConfFile="$packageConfDir/${pname}-${version}.conf"
  