anchor.diff:    ghcCommand' = if isGhcjs then "ghcjs" else "ghc";
     ghcCommand = "${ghc.targetPrefix}${ghcCommand'}";
   
  +  ghcNameWithPrefix = "${ghc.targetPrefix}${ghc.haskellCompilerName}";
  +
     nativeGhcCommand = "${nativeGhc.targetPrefix}ghc";
   
     buildPkgDb = ghcName: packageConfDir: ''
  
positive.code:   # pkgs* arrays defined in stdenv/setup.hs
    + ''
      for p in "''${pkgsBuildBuild[@]}" "''${pkgsBuildHost[@]}" "''${pkgsBuildTarget[@]}"; do
        ${buildPkgDb nativeGhc.name "$setupPackageConfDir"}
      done
      ${nativeGhcCommand}-pkg --${nativePackageDbFlag}="$setupPackageConfDir" recache
    ''
    # For normal components
    + ''
      for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do
        ${buildPkgDb ghc.name "$packageConfDir"}
        if [ -d "$p/include" ]; then
          configureFlags+=" --extra-include-dirs=$p/include"
        fi
  
negative.code:       # just the target specified; "install" will error here, since not all targets have been built.
      else ''
        ${setupCommand} copy ${buildTarget}
        local packageConfDir="$out/lib/${ghcNameWithPrefix}/package.conf.d"
        local packageConfFile="$packageConfDir/${pname}-${version}.conf"
        mkdir -p "$packageConfDir"
        ${setupCommand} register --gen-pkg-config=$packageConfFile
  