git.iko.soy/typeable/cabal2nix
on master help sign in
Cabal2Nix/Package.hs: store license as a string
423cf25Peter Simons
src/Cabal2Nix/Package.hs+3−3
@@ -27,7 +27,7 @@ type PkgVersion = String
27type PkgSHA256 = String
27type PkgSHA256 = String
28type PkgURL = String
28type PkgURL = String
29type PkgDescription = String
29type PkgDescription = String
30−type PkgLicense = License
30+type PkgLicense = String
31type PkgIsLib = Bool
31type PkgIsLib = Bool
32type PkgIsExe = Bool
32type PkgIsExe = Bool
33type PkgDependencies = [Dependency] -- [CondTree ConfVar [Dependency] ()]
33type PkgDependencies = [Dependency] -- [CondTree ConfVar [Dependency] ()]
@@ -78,7 +78,7 @@ showNixPkg (Pkg name ver sha256 url desc lic isLib isExe deps
78 nest 2 $ vcat [
78 nest 2 $ vcat [
79 onlyIf url $ attr "homepage" $ string url,
79 onlyIf url $ attr "homepage" $ string url,
80 onlyIf desc $ attr "description" $ string desc,
80 onlyIf desc $ attr "description" $ string desc,
81− attr "license" $ text (showLic lic),
81+ attr "license" $ text lic,
82 onlyIf platforms $
82 onlyIf platforms $
83 sep [
83 sep [
84 text "platforms" <+> equals,
84 text "platforms" <+> equals,
@@ -115,7 +115,7 @@ cabal2nix cabal sha256 platforms maintainers =
115 pkg = packageDescription cabal
115 pkg = packageDescription cabal
116 PackageName pkgname = pkgName (package pkg)
116 PackageName pkgname = pkgName (package pkg)
117 pkgver = showVersion (pkgVersion (package pkg))
117 pkgver = showVersion (pkgVersion (package pkg))
118− lic = license pkg
118+ lic = showLic (license pkg)
119 url = homepage pkg
119 url = homepage pkg
120 desc = normalizeDescription (synopsis pkg)
120 desc = normalizeDescription (synopsis pkg)
121 -- globalDeps = buildDepends pkg
121 -- globalDeps = buildDepends pkg
src/Hackage4Nix/Nix.hs+1−1
@@ -20,7 +20,7 @@ nixExpr2CabalExpr (Expr _ _ dict) =
20 sha256 = getString "sha256" dict
20 sha256 = getString "sha256" dict
21 homepage = getURL "homepage" (getDict "meta" dict)
21 homepage = getURL "homepage" (getDict "meta" dict)
22 description = getString "description" (getDict "meta" dict)
22 description = getString "description" (getDict "meta" dict)
23− license = MIT
23+ license = getString "license" (getDict "meta" dict)
24 isLib = getBool "isLibrary" dict
24 isLib = getBool "isLibrary" dict
25 isExe = getBool "isExecutable" dict
25 isExe = getBool "isExecutable" dict
26 deps = [ Dependency (PackageName dep) anyVersion | dep <- getRefList "buildDepends" dict ]
26 deps = [ Dependency (PackageName dep) anyVersion | dep <- getRefList "buildDepends" dict ]