git.iko.soy/typeable/cabal2nix
on master help sign in
Disable Hydra builds for packages that have an unfree license.
commitec0f902f98446d045bb4ef06ed94d5ad2d91eb70 authorPeter Simons <simons@cryp.to> dateFri 26 Jan 2018, 11:00 (9 years ago) parent0d15053
1 file changed+6−2
src/Distribution/Nixpkgs/Haskell/FromCabal.hs+6−2
src/Distribution/Nixpkgs/Haskell/FromCabal.hs+6−2
@@ -18,6 +18,7 @@ import Distribution.Nixpkgs.Haskell.FromCabal.License
1818import Distribution.Nixpkgs.Haskell.FromCabal.Name
1919import Distribution.Nixpkgs.Haskell.FromCabal.Normalize
2020import Distribution.Nixpkgs.Haskell.FromCabal.PostProcess (postProcess)
21+import qualified Distribution.Nixpkgs.License as Nix
2122import qualified Distribution.Nixpkgs.Meta as Nix
2223import Distribution.Package
2324import Distribution.PackageDescription
@@ -104,15 +105,18 @@ fromPackageDescription haskellResolver nixpkgsResolver missingDeps flags Package
104105 & metaSection .~ ( Nix.nullMeta
105106 & Nix.homepage .~ homepage
106107 & Nix.description .~ synopsis
107− & Nix.license .~ fromCabalLicense license
108+ & Nix.license .~ nixLicense
108109 & Nix.platforms .~ Nix.allKnownPlatforms
109− & Nix.hydraPlatforms .~ Nix.allKnownPlatforms
110+ & Nix.hydraPlatforms .~ (if nixLicense == Nix.Known "stdenv.lib.licenses.unfree" then Set.empty else Nix.allKnownPlatforms)
110111 & Nix.maintainers .~ mempty
111112 & Nix.broken .~ not (null missingDeps)
112113 )
113114 where
114115 xrev = maybe 0 read (lookup "x-revision" customFieldsPD)
115116
117+ nixLicense :: Nix.License
118+ nixLicense = fromCabalLicense license
119+
116120 resolveInHackage :: Identifier -> Binding
117121 resolveInHackage i | (i^.ident) `elem` [ unPackageName n | (Dependency n _) <- missingDeps ] = bindNull i
118122 | otherwise = binding # (i, path # ["self",i]) -- TODO: "self" shouldn't be hardcoded.