+ not_found_in_package pkg files
+ | build_tag /= ""
+ = let
+ build = if build_tag == "p" then "profiling"
+ else "\"" ++ build_tag ++ "\""
+ in
+ ptext (sLit "Perhaps you haven't installed the ") <> text build <>
+ ptext (sLit " libraries for package ") <> quotes (ppr pkg) <> char '?' $$
+ tried_these files
+
+ | otherwise
+ = ptext (sLit "There are files missing in the ") <> quotes (ppr pkg) <>
+ ptext (sLit " package,") $$
+ ptext (sLit "try running 'ghc-pkg check'.") $$
+ tried_these files
+
+ tried_these files
+ | null files = empty
+ | verbosity dflags < 3 =
+ ptext (sLit "Use -v to see a list of the files searched for.")
+ | otherwise =
+ hang (ptext (sLit "locations searched:")) 2 $ vcat (map text files)
+
+ pkg_hidden pkg =
+ ptext (sLit "It is a member of the hidden package") <+> quotes (ppr pkg)
+ <> dot $$ cabal_pkg_hidden_hint pkg
+ cabal_pkg_hidden_hint pkg
+ | dopt Opt_BuildingCabalPackage dflags
+ = case simpleParse (packageIdString pkg) of
+ Just pid ->
+ ptext (sLit "Perhaps you need to add") <+>
+ quotes (text (display (pkgName pid))) <+>
+ ptext (sLit "to the build-depends in your .cabal file.")
+ Nothing -> empty
+ | otherwise = empty
+
+ mod_hidden pkg =
+ ptext (sLit "it is a hidden module in the package") <+> quotes (ppr pkg)