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