git.iko.soy/typeable/cabal2nix
on master help sign in
The platform values are lists already. Duh!
commitc108759bdf32a0291e6d9c4ed182f105a89e42a3 authorPeter Simons <simons@cryp.to> dateSun 7 Aug 2011, 13:12 (15 years ago) parent959b4d4
2 files changed+5−4
src/Cabal2Nix.hs+3−1 src/Cabal2Nix/Package.hs+2−3
src/Cabal2Nix.hs+3−1
@@ -84,7 +84,9 @@ main = bracket (return ()) (\() -> hFlush stdout >> hFlush stderr) $ \() -> do
8484 hash = [ h | SHA256 h <- opts ]
8585 maintainers = [ m | Maintainer m <- opts ]
8686 platforms' = [ p | Platform p <- opts ]
87− platforms = if null platforms' && not (null maintainers) then [ "haskellPlatforms" ] else []
87+ platforms
88+ | null platforms' = if not (null maintainers) then ["haskellPlatforms"] else []
89+ | otherwise = platforms'
8890
8991 when (length uri /= 1) (cmdlineError "*** exactly one URI must be specified")
9092 when (length hash > 1) (cmdlineError "*** the --sha256 option may be specified only once")
src/Cabal2Nix/Package.hs+2−3
@@ -62,9 +62,8 @@ showNixPkg (Pkg name ver sha256 url desc lic deps libs platforms maintainers) =
6262 attr "license" $ text (showLic lic),
6363 onlyIf platforms $
6464 sep [
65− text "platforms" <+> equals <+> lbrack,
66− nest 2 $ fsep $ map text platforms,
67− rbrack <> semi
65+ text "platforms" <+> equals,
66+ nest 2 ((fsep $ punctuate (text " ++") $ map text platforms)) <> semi
6867 ],
6968 onlyIf maintainers $
7069 sep [