git.iko.soy/typeable/cabal2nix
on master help sign in
Cabal2Nix/Package.hs: store license as a string

This makes it easier for the Nix parser to re-use that data type, because it doesn't have to convert the Nix representation into the one from Cabal.

commit423cf25c88e206ff2a437a5fea74263a6c9b114e authorPeter Simons <simons@cryp.to> dateFri 12 Aug 2011, 11:37 (15 years ago) parent1ff74fc
2 files changed+4−4
src/Cabal2Nix/Package.hs+3−3 src/Hackage4Nix/Nix.hs+1−1
src/Cabal2Nix/Package.hs+3−3
@@ -27,7 +27,7 @@ type PkgVersion = String
2727type PkgSHA256 = String
2828type PkgURL = String
2929type PkgDescription = String
30−type PkgLicense = License
30+type PkgLicense = String
3131type PkgIsLib = Bool
3232type PkgIsExe = Bool
3333type PkgDependencies = [Dependency] -- [CondTree ConfVar [Dependency] ()]
@@ -78,7 +78,7 @@ showNixPkg (Pkg name ver sha256 url desc lic isLib isExe deps
7878 nest 2 $ vcat [
7979 onlyIf url $ attr "homepage" $ string url,
8080 onlyIf desc $ attr "description" $ string desc,
81− attr "license" $ text (showLic lic),
81+ attr "license" $ text lic,
8282 onlyIf platforms $
8383 sep [
8484 text "platforms" <+> equals,
@@ -115,7 +115,7 @@ cabal2nix cabal sha256 platforms maintainers =
115115 pkg = packageDescription cabal
116116 PackageName pkgname = pkgName (package pkg)
117117 pkgver = showVersion (pkgVersion (package pkg))
118− lic = license pkg
118+ lic = showLic (license pkg)
119119 url = homepage pkg
120120 desc = normalizeDescription (synopsis pkg)
121121 -- globalDeps = buildDepends pkg
src/Hackage4Nix/Nix.hs+1−1
@@ -20,7 +20,7 @@ nixExpr2CabalExpr (Expr _ _ dict) =
2020 sha256 = getString "sha256" dict
2121 homepage = getURL "homepage" (getDict "meta" dict)
2222 description = getString "description" (getDict "meta" dict)
23− license = MIT
23+ license = getString "license" (getDict "meta" dict)
2424 isLib = getBool "isLibrary" dict
2525 isExe = getBool "isExecutable" dict
2626 deps = [ Dependency (PackageName dep) anyVersion | dep <- getRefList "buildDepends" dict ]