git.iko.soy/typeable/cabal2nix
on master help sign in
Put benchmark dependencies in benchDepends
commite23f51cdb27202a99c4555873efbdb255f4b04a3 authorJoe Hermaszewski <git@monoid.al> dateMon 27 Feb 2017, 11:35 (10 years ago) parentf83834c
3 files changed+7−2
src/Distribution/Nixpkgs/Haskell/Derivation.hs+5−2 src/Distribution/Nixpkgs/Haskell/FromCabal.hs+1 src/Distribution/Nixpkgs/Haskell/FromCabal/Normalize.hs+1
src/Distribution/Nixpkgs/Haskell/Derivation.hs+5−2
@@ -8,7 +8,7 @@ module Distribution.Nixpkgs.Haskell.Derivation
88 , extraFunctionArgs, libraryDepends, executableDepends, testDepends, configureFlags
99 , cabalFlags, runHaddock, jailbreak, doCheck, testTarget, hyperlinkSource, enableSplitObjs
1010 , enableLibraryProfiling, enableExecutableProfiling, phaseOverrides, editedCabalFile, metaSection
11− , dependencies, setupDepends
11+ , dependencies, setupDepends, benchDepends
1212 )
1313 where
1414
@@ -43,6 +43,7 @@ data Derivation = MkDerivation
4343 , _libraryDepends :: BuildInfo
4444 , _executableDepends :: BuildInfo
4545 , _testDepends :: BuildInfo
46+ , _benchDepends :: BuildInfo
4647 , _configureFlags :: Set String
4748 , _cabalFlags :: FlagAssignment
4849 , _runHaddock :: Bool
@@ -71,6 +72,7 @@ nullDerivation = MkDerivation
7172 , _libraryDepends = error "undefined Derivation.libraryDepends"
7273 , _executableDepends = error "undefined Derivation.executableDepends"
7374 , _testDepends = error "undefined Derivation.testDepends"
75+ , _benchDepends = error "undefined Derivation.benchDepends"
7476 , _configureFlags = error "undefined Derivation.configureFlags"
7577 , _cabalFlags = error "undefined Derivation.cabalFlags"
7678 , _runHaddock = error "undefined Derivation.runHaddock"
@@ -88,7 +90,7 @@ nullDerivation = MkDerivation
8890
8991makeLenses ''Derivation
9092
91−makeLensesFor [("_setupDepends", "dependencies"), ("_libraryDepends", "dependencies"), ("_executableDepends", "dependencies"), ("_testDepends", "dependencies")] ''Derivation
93+makeLensesFor [("_setupDepends", "dependencies"), ("_libraryDepends", "dependencies"), ("_executableDepends", "dependencies"), ("_testDepends", "dependencies"), ("_benchDepends", "dependencies")] ''Derivation
9294
9395instance Package Derivation where
9496 packageId = view pkgid
@@ -111,6 +113,7 @@ instance Pretty Derivation where
111113 , onlyIf (_libraryDepends /= mempty) $ pPrintBuildInfo "library" _libraryDepends
112114 , onlyIf (_executableDepends /= mempty) $ pPrintBuildInfo "executable" _executableDepends
113115 , onlyIf (_testDepends /= mempty) $ pPrintBuildInfo "test" _testDepends
116+ , onlyIf (_benchDepends /= mempty) $ pPrintBuildInfo "bench" _benchDepends
114117 , boolattr "enableLibraryProfiling" _enableLibraryProfiling _enableLibraryProfiling
115118 , boolattr "enableExecutableProfiling" _enableExecutableProfiling _enableExecutableProfiling
116119 , boolattr "enableSplitObjs" (not _enableSplitObjs) _enableSplitObjs
src/Distribution/Nixpkgs/Haskell/FromCabal.hs+1
@@ -63,6 +63,7 @@ fromPackageDescription haskellResolver nixpkgsResolver missingDeps flags (Packag
6363 & libraryDepends .~ maybe mempty (convertBuildInfo . libBuildInfo) library
6464 & executableDepends .~ mconcat (map (convertBuildInfo . buildInfo) executables)
6565 & testDepends .~ mconcat (map (convertBuildInfo . testBuildInfo) testSuites)
66+ & benchDepends .~ mconcat (map (convertBuildInfo . benchmarkBuildInfo) benchmarks)
6667 & Nix.setupDepends .~ maybe mempty convertSetupBuildInfo setupBuildInfo
6768 & configureFlags .~ mempty
6869 & cabalFlags .~ flags
src/Distribution/Nixpkgs/Haskell/FromCabal/Normalize.hs+1
@@ -17,6 +17,7 @@ normalize drv = drv
1717 & over libraryDepends (normalizeBuildInfo (packageName drv))
1818 & over executableDepends (normalizeBuildInfo (packageName drv))
1919 & over testDepends (normalizeBuildInfo (packageName drv))
20+ & over benchDepends (normalizeBuildInfo (packageName drv))
2021 & over metaSection normalizeMeta
2122 & over cabalFlags normalizeCabalFlags
2223 & jailbreak %~ (&& (packageName drv /= PackageName "jailbreak-cabal"))