git.iko.soy/typeable/cabal2nix
on master help sign in
Change extraFunctionArgs attribute to contain Bindings rather than strings.
commite7acdcc6a8e1e4eba05abdd761ff3d2d11cc973c authorPeter Simons <simons@cryp.to> dateSat 16 Jul 2016, 14:32 (10 years ago) parent77d704d
2 files changed+4−3
cabal2nix/Main.hs+2−1 src/Distribution/Nixpkgs/Haskell/Derivation.hs+2−2
cabal2nix/Main.hs+2−1
@@ -7,6 +7,7 @@ import Control.Exception ( bracket )
77import Control.Lens
88import Data.Maybe ( fromMaybe )
99import qualified Data.Set as Set
10+import Data.String
1011import qualified Distribution.Compat.ReadP as P
1112import Distribution.Compiler
1213import Distribution.Nixpkgs.Fetch
@@ -130,7 +131,7 @@ main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do
130131 & metaSection.maintainers .~ Set.fromList (map (review ident) optMaintainer)
131132-- & metaSection.platforms .~ Set.fromList optPlatform
132133 & doCheck &&~ optDoCheck
133− & extraFunctionArgs %~ Set.union (Set.fromList ("stdenv":map (review ident) optExtraArgs))
134+ & extraFunctionArgs %~ Set.union (Set.fromList ("inherit stdenv":map (fromString . ("inherit " ++)) optExtraArgs))
134135
135136 shell :: Doc
136137 shell = vcat
src/Distribution/Nixpkgs/Haskell/Derivation.hs+2−2
@@ -38,7 +38,7 @@ data Derivation = MkDerivation
3838 , _src :: DerivationSource
3939 , _isLibrary :: Bool
4040 , _isExecutable :: Bool
41− , _extraFunctionArgs :: Set Identifier
41+ , _extraFunctionArgs :: Set Binding
4242 , _setupDepends :: BuildInfo
4343 , _libraryDepends :: BuildInfo
4444 , _executableDepends :: BuildInfo
@@ -126,7 +126,7 @@ instance Pretty Derivation where
126126 ]
127127 where
128128 inputs :: Set String
129− inputs = Set.unions [ Set.map (view ident) _extraFunctionArgs
129+ inputs = Set.unions [ Set.map (view (localName . ident)) _extraFunctionArgs
130130 , setOf (dependencies . each . folded . localName . ident) drv
131131 , Set.fromList ["fetch" ++ derivKind _src | derivKind _src /= "" && not isHackagePackage]
132132 ]