git.iko.soy/typeable/cabal2nix
on master help sign in
Fix hlint warnings.
commitdeabc697de0eadee0e322f8bd08ee73fe1dad704 authorPeter Simons <simons@cryp.to> dateTue 5 Mar 2013, 11:31 (14 years ago) parente8c6ba5
4 files changed+10−10
src/Cabal2Nix.hs+6−6 src/Cabal2Nix/License.hs+1−1 src/Distribution/NixOS/Derivation/Cabal.hs+1−1 src/Distribution/NixOS/Derivation/License.hs+2−2
src/Cabal2Nix.hs+6−6
@@ -39,12 +39,12 @@ defaultConfiguration = Configuration
3939
4040options :: [OptDescr (Configuration -> Configuration)]
4141options =
42− [ Option ['h'] ["help"] (NoArg (\o -> o { optPrintHelp = True })) "show this help text"
43− , Option [] ["sha256"] (ReqArg (\x o -> o { optSha256 = x }) "HASH") "sha256 hash of source tarball"
44− , Option ['m'] ["maintainer"] (ReqArg (\x o -> o { optMaintainer = x : optMaintainer o }) "MAINTAINER") "maintainer of this package (may be specified multiple times)"
45− , Option ['p'] ["platform"] (ReqArg (\x o -> o { optPlatform = x : optPlatform o }) "PLATFORM") "supported build platforms (may be specified multiple times)"
46− , Option [] ["no-haddock"] (NoArg (\o -> o { optHaddock = False })) "don't run Haddock when building this package"
47− , Option [] ["no-check"] (NoArg (\o -> o { optDoCheck = False })) "don't run regression test suites of this package"
42+ [ Option "h" ["help"] (NoArg (\o -> o { optPrintHelp = True })) "show this help text"
43+ , Option "" ["sha256"] (ReqArg (\x o -> o { optSha256 = x }) "HASH") "sha256 hash of source tarball"
44+ , Option "m" ["maintainer"] (ReqArg (\x o -> o { optMaintainer = x : optMaintainer o }) "MAINTAINER") "maintainer of this package (may be specified multiple times)"
45+ , Option "p" ["platform"] (ReqArg (\x o -> o { optPlatform = x : optPlatform o }) "PLATFORM") "supported build platforms (may be specified multiple times)"
46+ , Option "" ["no-haddock"] (NoArg (\o -> o { optHaddock = False })) "don't run Haddock when building this package"
47+ , Option "" ["no-check"] (NoArg (\o -> o { optDoCheck = False })) "don't run regression test suites of this package"
4848 ]
4949
5050usage :: String
src/Cabal2Nix/License.hs+1−1
@@ -10,7 +10,7 @@ fromCabalLicense (GPL (Just (Version [2] []))) = Known "self.stdenv.lib.lice
1010fromCabalLicense (GPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
1111fromCabalLicense (LGPL Nothing) = Unknown (Just "LGPL")
1212fromCabalLicense (LGPL (Just (Version [2,1] []))) = Known "self.stdenv.lib.licenses.lgpl21"
13−fromCabalLicense (LGPL (Just (Version [2] []))) = Known "self.stdenv.lib.licenses.lgpl2"
13+fromCabalLicense (LGPL (Just (Version [2] []))) = Known "self.stdenv.lib.licenses.lgpl2"
1414fromCabalLicense (LGPL (Just (Version [3] []))) = Known "self.stdenv.lib.licenses.gpl3"
1515fromCabalLicense BSD3 = Known "self.stdenv.lib.licenses.bsd3"
1616fromCabalLicense BSD4 = Known "self.stdenv.lib.licenses.bsd4"
src/Distribution/NixOS/Derivation/Cabal.hs+1−1
@@ -130,7 +130,7 @@ parseDerivation buf
130130 , cabalFlags = []
131131 , runHaddock = noHaddock /= ["true"]
132132 , jailbreak = jailBreak == ["true"]
133− , doCheck = docheck == ["true"] || docheck == []
133+ , doCheck = docheck == ["true"] || null docheck
134134 , phaseOverrides = ""
135135 , metaSection = Meta
136136 { homepage = ""
src/Distribution/NixOS/Derivation/License.hs+2−2
@@ -15,6 +15,7 @@ module Distribution.NixOS.Derivation.License ( License(..) ) where
1515
1616import Distribution.NixOS.PrettyPrinting
1717import Distribution.Text
18+import Data.Maybe
1819
1920-- | The representation for licenses used in Nix derivations. Known
2021-- licenses are Nix expressions -- such as @stdenv.lib.licenses.bsd3@
@@ -46,6 +47,5 @@ data License = Known String
4647
4748instance Text License where
4849 disp (Known x) = text x
49− disp (Unknown x) = string (maybe "unknown" id x)
50+ disp (Unknown x) = string (fromMaybe "unknown" x)
5051 parse = error "parsing Distribution.NixOS.Derivation.License is not supported yet"
51−