anchor.diff:    ] ++ crossCabalFlags);
   
     setupCompileFlags = [
  -    (optionalString (!coreSetup) "-${nativePackageDbFlag}=$packageConfDir")
  +    (optionalString (!coreSetup) "-${nativePackageDbFlag}=${
  +      if setupHaskellDepends != []
  +      then "$setupPackageConfDir"
  +      else "$packageConfDir"
  +    }")
       (optionalString (isGhcjs || isHaLVM || versionOlder "7.8" ghc.version) "-j$NIX_BUILD_CORES")
       # https://github.com/haskell/cabal/issues/2398
       (optionalString (versionOlder "7.10" ghc.version && !isHaLVM) "-threaded")
  
positive.code:     done
  
      echo setupCompileFlags: $setupCompileFlags
      ${optionalString (setupHaskellDepends != [])
         ''
         echo GHC_PACKAGE_PATH="$setupPackageConfDir:"
         GHC_PACKAGE_PATH="$setupPackageConfDir:" ''
      }${nativeGhcCommand} $setupCompileFlags --make -o Setup -odir $TMPDIR -hidir $TMPDIR $i
  
      runHook postCompileBuildDriver
    '';
  
negative.code:     # For normal components
    + ''
      for p in "''${pkgsHostHost[@]}" "''${pkgsHostTarget[@]}"; do
        ${buildPkgDb ghc.name "$packageConfDir"}
      done
    ''
    # only use the links hack if we're actually building dylibs. otherwise, the
  