git.iko.soy/typeable/cabal2nix
on master help sign in
hackage2nix: automatically disable the Haddock documentation when the package exports no modules
ea90238Peter Simons
distribution-nixpkgs/src/Distribution/Nixpkgs/Haskell/FromCabal.hs+1−1
@@ -77,7 +77,7 @@ fromPackageDescription haskellResolver nixpkgsResolver mismatchedDeps missingDep
77 & testDepends .~ mconcat (map (convertBuildInfo . testBuildInfo) testSuites)
77 & testDepends .~ mconcat (map (convertBuildInfo . testBuildInfo) testSuites)
78 & configureFlags .~ mempty
78 & configureFlags .~ mempty
79 & cabalFlags .~ flags
79 & cabalFlags .~ flags
80− & runHaddock .~ True
80+ & runHaddock .~ maybe True (not . null . exposedModules) library
81 & jailbreak .~ not (null mismatchedDeps && null missingDeps)
81 & jailbreak .~ not (null mismatchedDeps && null missingDeps)
82 & doCheck .~ True
82 & doCheck .~ True
83 & testTarget .~ mempty
83 & testTarget .~ mempty
hackage2nix/src/Main.hs+2−2
@@ -168,8 +168,8 @@ main = do
168 drv :: Derivation
168 drv :: Derivation
169 drv = fromGenericPackageDescription haskellResolver nixpkgsResolver targetPlatform (compilerInfo config) flagAssignment [] descr
169 drv = fromGenericPackageDescription haskellResolver nixpkgsResolver targetPlatform (compilerInfo config) flagAssignment [] descr
170 & src .~ DerivationSource "url" ("mirror://hackage/" ++ display pkgId ++ ".tar.gz") "" sha256
170 & src .~ DerivationSource "url" ("mirror://hackage/" ++ display pkgId ++ ".tar.gz") "" sha256
171− & Derivation.runHaddock .~ (Stackage.runHaddock spec)
171+ & Derivation.runHaddock &&~ Stackage.runHaddock spec
172− & doCheck .~ runTests spec
172+ & doCheck &&~ runTests spec
173 & metaSection.hydraPlatforms %~ (`Set.difference` Map.findWithDefault Set.empty (PackageName name) (dontDistributePackages config))
173 & metaSection.hydraPlatforms %~ (`Set.difference` Map.findWithDefault Set.empty (PackageName name) (dontDistributePackages config))
174 & metaSection.maintainers .~ Map.findWithDefault Set.empty (PackageName name) globalPackageMaintainers
174 & metaSection.maintainers .~ Map.findWithDefault Set.empty (PackageName name) globalPackageMaintainers
175 & metaSection.hydraPlatforms %~ (if isInDefaultPackageSet then id else const Set.empty)
175 & metaSection.hydraPlatforms %~ (if isInDefaultPackageSet then id else const Set.empty)