git.iko.soy/typeable/cabal2nix
on master help sign in
Cabal2Nix/Package.hs: store the package version as an ordinary string

We don't need the abstract data type from Cabal.

commit11fb101a229373d37704b3b9e62df44c825dd081 authorPeter Simons <simons@cryp.to> dateTue 9 Aug 2011, 14:36 (15 years ago) parentc8acd19
1 file changed+4−3
src/Cabal2Nix/Package.hs+4−3
src/Cabal2Nix/Package.hs+4−3
@@ -15,6 +15,7 @@ import Distribution.PackageDescription.Configuration
1515import Distribution.System
1616import Distribution.Version
1717import Text.PrettyPrint
18+import Data.Version ( showVersion )
1819
1920import Cabal2Nix.License
2021import Cabal2Nix.Name
@@ -22,7 +23,7 @@ import Cabal2Nix.CorePackages
2223import Cabal2Nix.Pretty
2324
2425type PkgName = String
25−type PkgVersion = [Int]
26+type PkgVersion = String
2627type PkgSHA256 = String
2728type PkgURL = String
2829type PkgDescription = String
@@ -64,7 +65,7 @@ showNixPkg (Pkg name ver sha256 url desc lic isLib isExe deps
6465 colon <+> lbrace,
6566 nest 2 $ vcat [
6667 attr "pname" $ string name,
67− attr "version" $ version ver,
68+ attr "version" $ string ver,
6869 attr "sha256" $ string sha256,
6970 boolattr "isLibrary" (not isLib || isExe) isLib,
7071 boolattr "isExecutable" (not isLib || isExe) isExe,
@@ -113,7 +114,7 @@ cabal2nix cabal sha256 platforms maintainers =
113114 where
114115 pkg = packageDescription cabal
115116 PackageName pkgname = pkgName (package pkg)
116− pkgver = versionBranch (pkgVersion (package pkg))
117+ pkgver = showVersion (pkgVersion (package pkg))
117118 lic = license pkg
118119 url = homepage pkg
119120 desc = synopsis pkg