git.iko.soy/typeable/cabal2nix
on master help sign in
Add support for the 'hyperlinkSource' attribute.
commitbd127ca14730a8acbf77d7bb201526e451365920 authorPeter Simons <simons@cryp.to> dateThu 10 Jul 2014, 12:02 (12 years ago) parent62d532a
5 files changed+13−2
cabal2nix.cabal+3−1 src/Cabal2Nix/Generate.hs+1 src/Distribution/NixOS/Derivation/Cabal.hs+4 src/cabal2nix.hs+4−1 src/hackage4nix.hs+1
cabal2nix.cabal+3−1
@@ -21,8 +21,10 @@ Description:
2121 > --sha256=HASH sha256 hash of source tarball
2222 > -m MAINTAINER --maintainer=MAINTAINER maintainer of this package (may be specified multiple times)
2323 > -p PLATFORM --platform=PLATFORM supported build platforms (may be specified multiple times)
24− > --no-check don't run regression test suites of this package
2524 > --jailbreak don't honor version restrictions on build inputs
25+ > --no-haddock don't run Haddock when building this package
26+ > --no-check don't run regression test suites of this package
27+ > --no-hyperlink-source don't add pretty-printed source code to the documentation
2628 >
2729 > Recognized URI schemes:
2830 >
src/Cabal2Nix/Generate.hs+1
@@ -32,6 +32,7 @@ cabal2nix cabal = normalize $ postProcess MkDerivation
3232 , jailbreak = False
3333 , doCheck = True
3434 , testTarget = ""
35+ , hyperlinkSource = True
3536 , phaseOverrides = ""
3637 , metaSection = Meta
3738 { homepage = Cabal.homepage descr
src/Distribution/NixOS/Derivation/Cabal.hs+4
@@ -58,6 +58,7 @@ data Derivation = MkDerivation
5858 , jailbreak :: Bool
5959 , doCheck :: Bool
6060 , testTarget :: String
61+ , hyperlinkSource :: Bool
6162 , phaseOverrides :: String
6263 , metaSection :: Meta
6364 }
@@ -90,6 +91,7 @@ renderDerivation deriv = funargs (map text ("cabal" : inputs)) $$ vcat
9091 , boolattr "jailbreak" (jailbreak deriv) (jailbreak deriv)
9192 , boolattr "doCheck" (not (doCheck deriv)) (doCheck deriv)
9293 , onlyIf (testTarget deriv) $ attr "testTarget" $ string (testTarget deriv)
94+ , boolattr "hyperlinkSource" (not (hyperlinkSource deriv)) (hyperlinkSource deriv)
9395 , onlyIf (phaseOverrides deriv) $ vcat ((map text . lines) (phaseOverrides deriv))
9496 , disp (metaSection deriv)
9597 ]
@@ -119,6 +121,7 @@ parseDerivation buf
119121 , noHaddock <- buf `regsubmatch` "noHaddock *= *(true|false) *;"
120122 , jailBreak <- buf `regsubmatch` "jailbreak *= *(true|false) *;"
121123 , docheck <- buf `regsubmatch` "doCheck *= *(true|false) *;"
124+ , hyperlSrc <- buf `regsubmatch` "hyperlinkSource *= *(true|false) *;"
122125 = Just MkDerivation
123126 { pname = name
124127 , version = vers
@@ -137,6 +140,7 @@ parseDerivation buf
137140 , jailbreak = jailBreak == ["true"]
138141 , doCheck = docheck == ["true"] || null docheck
139142 , testTarget = ""
143+ , hyperlinkSource = hyperlSrc == ["true"] || null hyperlSrc
140144 , phaseOverrides = ""
141145 , metaSection = Meta
142146 { homepage = ""
src/cabal2nix.hs+4−1
@@ -24,6 +24,7 @@ data Configuration = Configuration
2424 , optHaddock :: Bool
2525 , optDoCheck :: Bool
2626 , optJailbreak :: Bool
27+ , optHyperlinkSource :: Bool
2728 }
2829 deriving (Show)
2930
@@ -37,6 +38,7 @@ defaultConfiguration = Configuration
3738 , optHaddock = True
3839 , optDoCheck = True
3940 , optJailbreak = False
41+ , optHyperlinkSource = True
4042 }
4143
4244options :: [OptDescr (Configuration -> Configuration)]
@@ -45,9 +47,10 @@ options =
4547 , Option "" ["sha256"] (ReqArg (\x o -> o { optSha256 = Just x }) "HASH") "sha256 hash of source tarball"
4648 , Option "m" ["maintainer"] (ReqArg (\x o -> o { optMaintainer = x : optMaintainer o }) "MAINTAINER") "maintainer of this package (may be specified multiple times)"
4749 , Option "p" ["platform"] (ReqArg (\x o -> o { optPlatform = x : optPlatform o }) "PLATFORM") "supported build platforms (may be specified multiple times)"
50+ , Option "" ["jailbreak"] (NoArg (\o -> o { optJailbreak = True })) "don't honor version restrictions on build inputs"
4851 , Option "" ["no-haddock"] (NoArg (\o -> o { optHaddock = False })) "don't run Haddock when building this package"
4952 , Option "" ["no-check"] (NoArg (\o -> o { optDoCheck = False })) "don't run regression test suites of this package"
50− , Option "" ["jailbreak"] (NoArg (\o -> o { optJailbreak = True })) "don't honor version restrictions on build inputs"
53+ , Option "" ["no-hyperlink-source"] (NoArg (\o -> o { optHyperlinkSource = False })) "don't add pretty-printed source code to the documentation"
5154 ]
5255
5356usage :: String
src/hackage4nix.hs+1
@@ -120,6 +120,7 @@ updateNixPkgs paths = do
120120 , runHaddock = runHaddock deriv
121121 , doCheck = doCheck deriv
122122 , jailbreak = jailbreak deriv
123+ , hyperlinkSource = hyperlinkSource deriv
123124 }
124125 meta = metaSection deriv'
125126 plats' = if null plats then platforms meta else plats