git.iko.soy/typeable/cabal2nix
on master help sign in
Put benchmark dependencies in benchDepends
e23f51cJoe Hermaszewski
src/Distribution/Nixpkgs/Haskell/Derivation.hs+5−2
@@ -8,7 +8,7 @@ module Distribution.Nixpkgs.Haskell.Derivation
8 , extraFunctionArgs, libraryDepends, executableDepends, testDepends, configureFlags
8 , extraFunctionArgs, libraryDepends, executableDepends, testDepends, configureFlags
9 , cabalFlags, runHaddock, jailbreak, doCheck, testTarget, hyperlinkSource, enableSplitObjs
9 , cabalFlags, runHaddock, jailbreak, doCheck, testTarget, hyperlinkSource, enableSplitObjs
10 , enableLibraryProfiling, enableExecutableProfiling, phaseOverrides, editedCabalFile, metaSection
10 , enableLibraryProfiling, enableExecutableProfiling, phaseOverrides, editedCabalFile, metaSection
11− , dependencies, setupDepends
11+ , dependencies, setupDepends, benchDepends
12 )
12 )
13 where
13 where
14
14
@@ -43,6 +43,7 @@ data Derivation = MkDerivation
43 , _libraryDepends :: BuildInfo
43 , _libraryDepends :: BuildInfo
44 , _executableDepends :: BuildInfo
44 , _executableDepends :: BuildInfo
45 , _testDepends :: BuildInfo
45 , _testDepends :: BuildInfo
46+ , _benchDepends :: BuildInfo
46 , _configureFlags :: Set String
47 , _configureFlags :: Set String
47 , _cabalFlags :: FlagAssignment
48 , _cabalFlags :: FlagAssignment
48 , _runHaddock :: Bool
49 , _runHaddock :: Bool
@@ -71,6 +72,7 @@ nullDerivation = MkDerivation
71 , _libraryDepends = error "undefined Derivation.libraryDepends"
72 , _libraryDepends = error "undefined Derivation.libraryDepends"
72 , _executableDepends = error "undefined Derivation.executableDepends"
73 , _executableDepends = error "undefined Derivation.executableDepends"
73 , _testDepends = error "undefined Derivation.testDepends"
74 , _testDepends = error "undefined Derivation.testDepends"
75+ , _benchDepends = error "undefined Derivation.benchDepends"
74 , _configureFlags = error "undefined Derivation.configureFlags"
76 , _configureFlags = error "undefined Derivation.configureFlags"
75 , _cabalFlags = error "undefined Derivation.cabalFlags"
77 , _cabalFlags = error "undefined Derivation.cabalFlags"
76 , _runHaddock = error "undefined Derivation.runHaddock"
78 , _runHaddock = error "undefined Derivation.runHaddock"
@@ -88,7 +90,7 @@ nullDerivation = MkDerivation
88
90
89makeLenses ''Derivation
91makeLenses ''Derivation
90
92
91−makeLensesFor [("_setupDepends", "dependencies"), ("_libraryDepends", "dependencies"), ("_executableDepends", "dependencies"), ("_testDepends", "dependencies")] ''Derivation
93+makeLensesFor [("_setupDepends", "dependencies"), ("_libraryDepends", "dependencies"), ("_executableDepends", "dependencies"), ("_testDepends", "dependencies"), ("_benchDepends", "dependencies")] ''Derivation
92
94
93instance Package Derivation where
95instance Package Derivation where
94 packageId = view pkgid
96 packageId = view pkgid
@@ -111,6 +113,7 @@ instance Pretty Derivation where
111 , onlyIf (_libraryDepends /= mempty) $ pPrintBuildInfo "library" _libraryDepends
113 , onlyIf (_libraryDepends /= mempty) $ pPrintBuildInfo "library" _libraryDepends
112 , onlyIf (_executableDepends /= mempty) $ pPrintBuildInfo "executable" _executableDepends
114 , onlyIf (_executableDepends /= mempty) $ pPrintBuildInfo "executable" _executableDepends
113 , onlyIf (_testDepends /= mempty) $ pPrintBuildInfo "test" _testDepends
115 , onlyIf (_testDepends /= mempty) $ pPrintBuildInfo "test" _testDepends
116+ , onlyIf (_benchDepends /= mempty) $ pPrintBuildInfo "bench" _benchDepends
114 , boolattr "enableLibraryProfiling" _enableLibraryProfiling _enableLibraryProfiling
117 , boolattr "enableLibraryProfiling" _enableLibraryProfiling _enableLibraryProfiling
115 , boolattr "enableExecutableProfiling" _enableExecutableProfiling _enableExecutableProfiling
118 , boolattr "enableExecutableProfiling" _enableExecutableProfiling _enableExecutableProfiling
116 , boolattr "enableSplitObjs" (not _enableSplitObjs) _enableSplitObjs
119 , boolattr "enableSplitObjs" (not _enableSplitObjs) _enableSplitObjs
src/Distribution/Nixpkgs/Haskell/FromCabal.hs+1
@@ -63,6 +63,7 @@ fromPackageDescription haskellResolver nixpkgsResolver missingDeps flags (Packag
63 & libraryDepends .~ maybe mempty (convertBuildInfo . libBuildInfo) library
63 & libraryDepends .~ maybe mempty (convertBuildInfo . libBuildInfo) library
64 & executableDepends .~ mconcat (map (convertBuildInfo . buildInfo) executables)
64 & executableDepends .~ mconcat (map (convertBuildInfo . buildInfo) executables)
65 & testDepends .~ mconcat (map (convertBuildInfo . testBuildInfo) testSuites)
65 & testDepends .~ mconcat (map (convertBuildInfo . testBuildInfo) testSuites)
66+ & benchDepends .~ mconcat (map (convertBuildInfo . benchmarkBuildInfo) benchmarks)
66 & Nix.setupDepends .~ maybe mempty convertSetupBuildInfo setupBuildInfo
67 & Nix.setupDepends .~ maybe mempty convertSetupBuildInfo setupBuildInfo
67 & configureFlags .~ mempty
68 & configureFlags .~ mempty
68 & cabalFlags .~ flags
69 & cabalFlags .~ flags
src/Distribution/Nixpkgs/Haskell/FromCabal/Normalize.hs+1
@@ -17,6 +17,7 @@ normalize drv = drv
17 & over libraryDepends (normalizeBuildInfo (packageName drv))
17 & over libraryDepends (normalizeBuildInfo (packageName drv))
18 & over executableDepends (normalizeBuildInfo (packageName drv))
18 & over executableDepends (normalizeBuildInfo (packageName drv))
19 & over testDepends (normalizeBuildInfo (packageName drv))
19 & over testDepends (normalizeBuildInfo (packageName drv))
20+ & over benchDepends (normalizeBuildInfo (packageName drv))
20 & over metaSection normalizeMeta
21 & over metaSection normalizeMeta
21 & over cabalFlags normalizeCabalFlags
22 & over cabalFlags normalizeCabalFlags
22 & jailbreak %~ (&& (packageName drv /= PackageName "jailbreak-cabal"))
23 & jailbreak %~ (&& (packageName drv /= PackageName "jailbreak-cabal"))