@@ -15,17 +15,18 @@ import Distribution.NixOS.Derivation.Cabal
16cabal2nix :: Cabal.GenericPackageDescription -> Derivation
16cabal2nix :: Cabal.GenericPackageDescription -> Derivation
17cabal2nix cabal = normalize $ postProcess $ MkDerivation
17cabal2nix cabal = normalize $ postProcess $ MkDerivation
18− { pname = let Cabal.PackageName x = Cabal.pkgName pkg in x
18+ { pname = let Cabal.PackageName x = Cabal.pkgName pkg in x
19− , version = Cabal.pkgVersion pkg
19+ , version = Cabal.pkgVersion pkg
20− , sha256 = "cabal2nix left the she256 field undefined"
20+ , sha256 = "cabal2nix left the she256 field undefined"
21− , isLibrary = isJust (Cabal.library tpkg)
21+ , isLibrary = isJust (Cabal.library tpkg)
22− , isExecutable = not (null (Cabal.executables tpkg))
22+ , isExecutable = not (null (Cabal.executables tpkg))
23− , buildDepends = map unDep deps
23+ , buildDepends = map unDep deps
24− , buildTools = map unDep tools
24+ , buildTools = map unDep tools
25− , extraLibs = libs
25+ , extraLibs = libs
26− , pkgConfDeps = pcs
26+ , pkgConfDeps = pcs
27+ , configureFlags = pkgConfigureFlags pkg
27− , runHaddock = True
28+ , runHaddock = True
28− , metaSection = Meta
29+ , metaSection = Meta
29 { homepage = Cabal.homepage descr
30 { homepage = Cabal.homepage descr
30 , description = Cabal.synopsis descr
31 , description = Cabal.synopsis descr
31 , license = fromCabalLicense (Cabal.license descr)
32 , license = fromCabalLicense (Cabal.license descr)
@@ -34,8 +35,8 @@ cabal2nix cabal = normalize $ postProcess $ MkDerivation
37− descr = Cabal.packageDescription cabal
38+ descr = Cabal.packageDescription cabal
38− pkg = Cabal.package descr
39+ pkg = Cabal.package descr
39 deps = Cabal.buildDepends tpkg
40 deps = Cabal.buildDepends tpkg
40 libDeps = map Cabal.libBuildInfo (maybeToList (Cabal.library tpkg))
41 libDeps = map Cabal.libBuildInfo (maybeToList (Cabal.library tpkg))
41 exeDeps = map Cabal.buildInfo (Cabal.executables tpkg)
42 exeDeps = map Cabal.buildInfo (Cabal.executables tpkg)
@@ -43,7 +44,7 @@ cabal2nix cabal = normalize $ postProcess $ MkDerivation
43 libs = concatMap Cabal.extraLibs (libDeps ++ exeDeps)
44 libs = concatMap Cabal.extraLibs (libDeps ++ exeDeps)
44 pcs = map unDep (concatMap Cabal.pkgconfigDepends (libDeps ++ exeDeps))
45 pcs = map unDep (concatMap Cabal.pkgconfigDepends (libDeps ++ exeDeps))
45 Right (tpkg, _) = finalizePackageDescription
46 Right (tpkg, _) = finalizePackageDescription
46− (configureFlags pkg)
47+ (fst (pkgConfigureFlags pkg))
47 (const True)
48 (const True)
48 (Platform I386 Linux) -- shouldn't be hardcoded
49 (Platform I386 Linux) -- shouldn't be hardcoded
49 (CompilerId GHC (Version [7,0,4] [])) -- dito
50 (CompilerId GHC (Version [7,0,4] [])) -- dito