git.iko.soy/typeable/cabal2nix
on master help sign in
Add support for the meta.broken attribute.
commit04c9e093cfb2514e5c30b181dd6c97de790b2617 authorPeter Simons <simons@cryp.to> dateTue 16 Dec 2014, 21:52 (12 years ago) parentac9172d
3 files changed+5−1
src/Cabal2Nix/Generate.hs+1 src/Distribution/NixOS/Derivation/Cabal.hs+1 src/Distribution/NixOS/Derivation/Meta.hs+3−1
src/Cabal2Nix/Generate.hs+1
@@ -43,6 +43,7 @@ cabal2nix cabal = normalize $ postProcess MkDerivation
4343 , platforms = []
4444 , hydraPlatforms = []
4545 , maintainers = []
46+ , broken = False
4647 }
4748 }
4849 where
src/Distribution/NixOS/Derivation/Cabal.hs+1
@@ -193,6 +193,7 @@ parseDerivation buf
193193 , maintainers = if null maint then [] else concatMap words (tail maint)
194194 , platforms = concatMap words (map (map (\c -> if c == '+' then ' ' else c)) plats)
195195 , hydraPlatforms = concatMap words (map (map (\c -> if c == '+' then ' ' else c)) hplats)
196+ , broken = False
196197 }
197198 }
198199 | otherwise = Nothing
src/Distribution/NixOS/Derivation/Meta.hs+3−1
@@ -49,6 +49,7 @@ data Meta = Meta
4949 , platforms :: [String] -- ^ list of supported platforms (from @pkgs\/lib\/platforms.nix@)
5050 , hydraPlatforms :: [String] -- ^ list of platforms built by Hydra (from @pkgs\/lib\/platforms.nix@)
5151 , maintainers :: [String] -- ^ list of maintainers from @pkgs\/lib\/maintainers.nix@
52+ , broken :: Bool -- ^ set to @true@ if the build is known to fail
5253 }
5354 deriving (Show, Eq, Ord)
5455
@@ -57,7 +58,7 @@ instance Text Meta where
5758 parse = error "parsing Distribution.NixOS.Derivation.Cabal.Meta is not supported yet"
5859
5960instance NFData Meta where
60− rnf (Meta a b c d e f) = a `deepseq` b `deepseq` c `deepseq` d `deepseq` e `deepseq` f `deepseq` ()
61+ rnf (Meta a b c d e f g) = a `deepseq` b `deepseq` c `deepseq` d `deepseq` e `deepseq` f `deepseq` g `deepseq` ()
6162
6263renderMeta :: Meta -> Doc
6364renderMeta meta = vcat
@@ -69,6 +70,7 @@ renderMeta meta = vcat
6970 , onlyIf (not (null (hydraPlatforms meta))) $ sep
7071 [ text "hydraPlatforms" <+> equals, renderPlatformList (hydraPlatforms meta) ]
7172 , listattr "maintainers" (text "with self.stdenv.lib.maintainers;") (maintainers meta)
73+ , boolattr "broken" (broken meta) (broken meta)
7274 ]
7375
7476renderPlatformList :: [String] -> Doc