git.iko.soy/typeable/cabal2nix
on master help sign in
Extended the list of core packages.
commit45d21850c6f5bc4aee3dfe46f1e1fb80bd431b3b authorAndres Loeh <mail@andres-loeh.de> dateSat 6 Aug 2011, 20:55 (15 years ago) parent323dd7a
1 file changed+31−2
src/Cabal2Nix/Package.hs+31−2
src/Cabal2Nix/Package.hs+31−2
@@ -2,7 +2,6 @@ module Cabal2Nix.Package where
22
33import Data.List
44import Data.Maybe
5−
65import Distribution.Package
76import Distribution.PackageDescription
87import Distribution.Version
@@ -50,9 +49,39 @@ toNix (Pkg name ver sha256 url desc lic deps libs) =
5049 pkgDeps :: [String]
5150 pkgDeps = filter (/="cabal") $ nub $ sort $ map toNixName $
5251 libs ++ [ n | dep <- deps, Dependency (PackageName n) _ <- condTreeConstraints dep
53− , n `notElem` ["base","containers"]
52+ , n `notElem` corePackages
5453 ]
5554
55+-- | List of packages shipped with ghc and therefore at the moment not in
56+-- nixpkgs. This should probably be configurable at first. Later, it might
57+-- be good to actually include them as dependencies, but set them to null
58+-- if GHC provides them (as different GHC versions vary).
59+corePackages :: [String]
60+corePackages = [
61+ "array",
62+ "base",
63+ "bytestring",
64+ "Cabal",
65+ "containers",
66+ "directory",
67+ "extensible-exceptions",
68+ "filepath",
69+ "ghc-prim",
70+ "haskell2010",
71+ "haskell98",
72+ "hpc",
73+ "old-locale",
74+ "old-time",
75+ "pretty",
76+ "process",
77+ "random",
78+ "template-haskell",
79+ "time",
80+ "unix"
81+ ]
82+
83+
84+
5685cabal2nix :: GenericPackageDescription -> PkgSHA256 -> Pkg
5786cabal2nix cabal sha256 = Pkg pkgname pkgver sha256 url desc lic (map simplify libDeps ++ map simplify exeDeps) (libs++libs')
5887 where