@@ -52,7 +52,7 @@ hooks =
5252 , ("GlomeVec", set (libraryDepends . pkgconfig . contains (bind "self.llvmPackages.llvm")) True)
5353 , ("goatee-gtk", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os /= OtherOS "darwin")))
5454 , ("gtk3", gtk3Hook)
55− , ("haddock", set phaseOverrides "preCheck = \"unset GHC_PACKAGE_PATH\";")
55+ , ("haddock", haddockHook) -- https://github.com/haskell/haddock/issues/511
5656 , ("hakyll", set (testDepends . tool . contains (pkg "utillinux")) True) -- test suite depends on "rev"
5757 , ("hfsevents", over (metaSection . platforms) (Set.filter (\(Platform _ os) -> os == OtherOS "darwin")))
5858 , ("HFuse", set phaseOverrides hfusePreConfigure)
@@ -118,6 +118,12 @@ gtk3Hook :: Derivation -> Derivation -- https://github.com/NixOS/cabal2nix/is
118118gtk3Hook = set (libraryDepends . pkgconfig . contains (pkg "gtk3")) True
119119 . over (libraryDepends . pkgconfig) (Set.filter (\b -> view localName b /= "gtk3"))
120120
121+haddockHook :: Derivation -> Derivation
122+haddockHook = set doCheck False
123+ . set phaseOverrides "preCheck = \"unset GHC_PACKAGE_PATH\";"
124+ . over (dependencies . haskell) (Set.filter (\b -> view localName b /= "haddock-test"))
125+ . set (metaSection . broken) False
126+
121127gitAnnexHook :: Derivation -> Derivation
122128gitAnnexHook = set phaseOverrides gitAnnexOverrides
123129 . over (executableDepends . system) (Set.union buildInputs)
@@ -232,8 +238,6 @@ postProcess' deriv@(MkDerivation {..})
232238 | pname == "GLUT" = deriv { extraLibs = Set.fromList ["glut","libSM","libICE","libXmu","libXi","mesa"] `Set.union` extraLibs }
233239 | pname == "gtkglext" = deriv { pkgConfDeps = Set.insert "pangox_compat" pkgConfDeps }
234240 | pname == "gtk2hs-buildtools"= deriv { buildDepends = Set.insert "hashtables" buildDepends }
235− | pname == "haddock" && version < Version [2,14] []
236− = deriv { buildTools = Set.insert "alex" (Set.insert "happy" buildTools) }
237241 | pname == "happy" = deriv { buildTools = Set.insert "perl" buildTools }
238242 | pname == "haskeline" = deriv { buildDepends = Set.insert "utf8-string" buildDepends }
239243 | pname == "haskell-src" = deriv { buildTools = Set.insert "happy" buildTools }
@@ -334,9 +338,6 @@ sloanePostInstall = unlines
334338 , "'';"
335339 ]
336340
337−haddockPreCheck :: String
338−haddockPreCheck = "preCheck = \"unset GHC_PACKAGE_PATH\";"
339−
340341ghcParserPatchPhase :: String
341342ghcParserPatchPhase = unlines
342343 [ "patchPhase = ''"