git.iko.soy/typeable/cabal2nix
on master help sign in
Filter libm and libstc++. Closes #11. Closes #12.
commit027f4537a26301dd6b6998a7bb20be810380f3a4 authorAndres Loeh <mail@andres-loeh.de> dateMon 8 Aug 2011, 14:07 (15 years ago) parentbd3a53c
2 files changed+23−21
src/Cabal2Nix/Name.hs+22−20 src/Cabal2Nix/Package.hs+1−1
src/Cabal2Nix/Name.hs+22−20
@@ -15,23 +15,25 @@ toNixName name = f name
1515-- TODO: This should probably be configurable. We also need to consider the
1616-- possibility of name clashes with Haskell libraries. I have included
1717-- identity mappings to incicate that I have verified their correctness.
18−libNixName :: String -> String
19−libNixName "adns" = "adns"
20−libNixName "cairo" = "cairo"
21−libNixName "cairo-pdf" = "cairo"
22−libNixName "cairo-ps" = "cairo"
23−libNixName "cairo-svg" = "cairo"
24−libNixName "crypto" = "openssl"
25−libNixName "gnome-keyring" = "gnome_keyring"
26−libNixName "gnome-keyring-1" = "gnome_keyring"
27−libNixName "idn" = "idn"
28−libNixName "libidn" = "idn"
29−libNixName "libzip" = "libzip"
30−libNixName "pcre" = "pcre"
31−libNixName "pq" = "postgresql"
32−libNixName "sndfile" = "libsndfile"
33−libNixName "sqlite3" = "sqlite"
34−libNixName "xft" = "libXft"
35−libNixName "X11" = "libX11"
36−libNixName "z" = "zlib"
37−libNixName x = x
18+libNixName :: String -> [String]
19+libNixName "adns" = return "adns"
20+libNixName "cairo" = return "cairo"
21+libNixName "cairo-pdf" = return "cairo"
22+libNixName "cairo-ps" = return "cairo"
23+libNixName "cairo-svg" = return "cairo"
24+libNixName "crypto" = return "openssl"
25+libNixName "gnome-keyring" = return "gnome_keyring"
26+libNixName "gnome-keyring-1" = return "gnome_keyring"
27+libNixName "idn" = return "idn"
28+libNixName "libidn" = return "idn"
29+libNixName "libzip" = return "libzip"
30+libNixName "m" = [] -- in stdenv
31+libNixName "pcre" = return "pcre"
32+libNixName "pq" = return "postgresql"
33+libNixName "sndfile" = return "libsndfile"
34+libNixName "sqlite3" = return "sqlite"
35+libNixName "stdc++" = [] -- in stdenv
36+libNixName "xft" = return "libXft"
37+libNixName "X11" = return "libX11"
38+libNixName "z" = return "zlib"
39+libNixName x = return x
src/Cabal2Nix/Package.hs+1−1
@@ -101,7 +101,7 @@ showNixPkg (Pkg name ver sha256 url desc lic deps tools libs platforms maintaine
101101 onlyIf p d = if not (null p) then d else empty
102102 showVer = hcat (punctuate (text ".") (map int ver))
103103 pkgDeps :: [String]
104− pkgDeps = (nub $ sort $ map libNixName libs) ++
104+ pkgDeps = (nub $ sort $ concatMap libNixName libs) ++
105105 (nub $ sort $ map toNixName $
106106 filter (`notElem` (name : corePackages)) $ map unDep deps)
107107 pkgBuildTools :: [String]