git.iko.soy/typeable/cabal2nix
on master help sign in
Add support for the meta.broken attribute.
04c9e09Peter Simons
src/Cabal2Nix/Generate.hs+1
@@ -43,6 +43,7 @@ cabal2nix cabal = normalize $ postProcess MkDerivation
43 , platforms = []
43 , platforms = []
44 , hydraPlatforms = []
44 , hydraPlatforms = []
45 , maintainers = []
45 , maintainers = []
46+ , broken = False
46 }
47 }
47 }
48 }
48 where
49 where
src/Distribution/NixOS/Derivation/Cabal.hs+1
@@ -193,6 +193,7 @@ parseDerivation buf
193 , maintainers = if null maint then [] else concatMap words (tail maint)
193 , maintainers = if null maint then [] else concatMap words (tail maint)
194 , platforms = concatMap words (map (map (\c -> if c == '+' then ' ' else c)) plats)
194 , platforms = concatMap words (map (map (\c -> if c == '+' then ' ' else c)) plats)
195 , hydraPlatforms = concatMap words (map (map (\c -> if c == '+' then ' ' else c)) hplats)
195 , hydraPlatforms = concatMap words (map (map (\c -> if c == '+' then ' ' else c)) hplats)
196+ , broken = False
196 }
197 }
197 }
198 }
198 | otherwise = Nothing
199 | otherwise = Nothing
src/Distribution/NixOS/Derivation/Meta.hs+3−1
@@ -49,6 +49,7 @@ data Meta = Meta
49 , platforms :: [String] -- ^ list of supported platforms (from @pkgs\/lib\/platforms.nix@)
49 , platforms :: [String] -- ^ list of supported platforms (from @pkgs\/lib\/platforms.nix@)
50 , hydraPlatforms :: [String] -- ^ list of platforms built by Hydra (from @pkgs\/lib\/platforms.nix@)
50 , hydraPlatforms :: [String] -- ^ list of platforms built by Hydra (from @pkgs\/lib\/platforms.nix@)
51 , maintainers :: [String] -- ^ list of maintainers from @pkgs\/lib\/maintainers.nix@
51 , maintainers :: [String] -- ^ list of maintainers from @pkgs\/lib\/maintainers.nix@
52+ , broken :: Bool -- ^ set to @true@ if the build is known to fail
52 }
53 }
53 deriving (Show, Eq, Ord)
54 deriving (Show, Eq, Ord)
54
55
@@ -57,7 +58,7 @@ instance Text Meta where
57 parse = error "parsing Distribution.NixOS.Derivation.Cabal.Meta is not supported yet"
58 parse = error "parsing Distribution.NixOS.Derivation.Cabal.Meta is not supported yet"
58
59
59instance NFData Meta where
60instance 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` ()
61
62
62renderMeta :: Meta -> Doc
63renderMeta :: Meta -> Doc
63renderMeta meta = vcat
64renderMeta meta = vcat
@@ -69,6 +70,7 @@ renderMeta meta = vcat
69 , onlyIf (not (null (hydraPlatforms meta))) $ sep
70 , onlyIf (not (null (hydraPlatforms meta))) $ sep
70 [ text "hydraPlatforms" <+> equals, renderPlatformList (hydraPlatforms meta) ]
71 [ text "hydraPlatforms" <+> equals, renderPlatformList (hydraPlatforms meta) ]
71 , listattr "maintainers" (text "with self.stdenv.lib.maintainers;") (maintainers meta)
72 , listattr "maintainers" (text "with self.stdenv.lib.maintainers;") (maintainers meta)
73+ , boolattr "broken" (broken meta) (broken meta)
72 ]
74 ]
73
75
74renderPlatformList :: [String] -> Doc
76renderPlatformList :: [String] -> Doc