git.iko.soy/typeable/cabal2nix
on master help sign in
Remove cartel cruft.
commitd89134fca36b4a30414f6aca3bdb14096f5a2191 authorPeter Simons <simons@cryp.to> dateSun 30 Aug 2015, 00:30 (11 years ago) parent1adef77
13 files changed+391−221
.ghci−5 .gitignore−3 .travis.yml+6−10 GNUmakefile+14−12 cabal2nix.cabal+191 src/cabal2nix.hs → cabal2nix/Main.hs+3−2 generate-cabal-file.hs−139 src/hackage2nix.hs → hackage2nix/Main.hs+2−2 package.yaml+91 release.nix+19−15 test/Main.hs+65 test/spec.hs−32 update-nixpkgs.sh−1
.ghcideleted−5
@@ -1,5 +0,0 @@
1−-- generate-cabal-file.hs needs the cartel library, but the Cabal file
2−-- doesn't mention that library anywhere, so we need to add it manually
3−-- to make haskell-mode's interactive-mode feature happy.
4−
5−:set -package cartel
.gitignore−3
@@ -3,10 +3,7 @@
33/Setup
44/Setup.hi
55/Setup.o
6−/cabal2nix.cabal
76/dist/*
8−/src/Internal/Version.hs
9−/test/doctest.hs
107
118# vim tmp files
129
.travis.yml+6−10
@@ -1,8 +1,5 @@
11# .travis.yml
22
3−git:
4− depth: 50000
5−
63env:
74 - CABALVER=1.22 GHCVER=7.10.2
85
@@ -16,15 +13,14 @@ install:
1613 - cabal --version
1714 - echo "$(ghc --version) [$(ghc --print-project-git-commit-id 2> /dev/null || echo '?')]"
1815 - travis_retry cabal update
19− - cabal sandbox init
20− - cabal install -j cartel mtl
21− - cabal exec runhaskell generate-cabal-file.hs >cabal2nix.cabal
22− - cabal sandbox delete
2316 - cabal install -j --only-dependencies --enable-tests
2417
2518script:
26− - cabal configure -v --enable-tests --ghc-option=-Wall --ghc-option=-Werror
27− - cabal build -j
28− - cabal test -j
2919 - cabal check
20+ - cabal configure
3021 - cabal sdist
22+ - tar xf dist/cabal2nix-*.tar.gz
23+ - cd cabal2nix-*
24+ - cabal configure -v --enable-tests --ghc-option=-Wall --ghc-option=-Werror --ghc-option=-j
25+ - cabal build -j
26+ - cabal test -j
GNUmakefile+14−12
@@ -1,31 +1,33 @@
11# GNUmakefile
22
3−.PHONY: all configure re-configure build check haddock hlint clean
3+.PHONY: all configure build check haddock hlint clean packunused
44
55all:: check
66
77configure:: cabal2nix.cabal
88 @cabal -v0 configure --ghc-option=-j --enable-tests
99
10−re-configure::
11− @rm -f cabal2nix.cabal
12− @$(MAKE) configure
13−
1410build:: configure
1511 @cabal build -j
1612
17−haddock:: build
18− @cabal haddock --hyperlink-source
19−
2013check:: haddock
2114 @cabal test -j
2215
16+haddock:: build
17+ @cabal haddock --hyperlink-source
18+
2319hlint::
2420 hlint src
2521
22+packunused::
23+ @cabal clean
24+ @find . -name "*.imports" -exec rm {} +
25+ @cabal configure -O0 --disable-library-profiling
26+ @cabal build --ghc-option=-ddump-minimal-imports
27+ @packunused
28+
2629clean::
27− @rm -rf cabal2nix.cabal dist src/Internal/Version.hs test/doctest.hs TAGS
30+ @rm -rf dist TAGS
2831
29−cabal2nix.cabal: generate-cabal-file.hs
30− runhaskell "$<" >"$@"
31− @cabal check
32+cabal2nix.cabal : package.yaml
33+ @hpack >/dev/null
cabal2nix.cabalnew file+191
@@ -0,0 +1,191 @@
1+-- This file has been generated from package.yaml by hpack version 0.5.4.
2+--
3+-- see: https://github.com/sol/hpack
4+
5+name: cabal2nix
6+version: 2015.8.29
7+description: Convert Cabal files into Nix build instructions.
8+category: Distribution
9+homepage: https://github.com/nixos/cabal2nix#readme
10+bug-reports: https://github.com/nixos/cabal2nix/issues
11+cabal-version: >= 1.10
12+license: BSD3
13+license-file: LICENSE
14+build-type: Simple
15+maintainer: Peter Simons <simons@cryp.to>
16+synopsis: Convert Cabal files into Nix build instructions.
17+
18+source-repository head
19+ type: git
20+ location: https://github.com/nixos/cabal2nix
21+
22+library
23+ hs-source-dirs:
24+ src
25+ ghc-options: -Wall
26+ build-depends:
27+ base < 5
28+ , Cabal >= 1.22.2
29+ , SHA
30+ , aeson
31+ , ansi-wl-pprint
32+ , base < 5
33+ , bytestring
34+ , containers
35+ , data-default
36+ , deepseq
37+ , deepseq-generics
38+ , directory
39+ , doctest
40+ , filepath
41+ , hackage-db
42+ , hspec
43+ , lens
44+ , monad-par
45+ , monad-par-extras
46+ , mtl
47+ , optparse-applicative
48+ , pretty >= 1.1.2
49+ , process
50+ , regex-posix
51+ , split
52+ , transformers
53+ , utf8-string
54+ exposed-modules:
55+ Distribution.Nixpkgs.Fetch
56+ Distribution.Nixpkgs.Haskell
57+ Distribution.Nixpkgs.Haskell.BuildInfo
58+ Distribution.Nixpkgs.Haskell.Constraint
59+ Distribution.Nixpkgs.Haskell.Derivation
60+ Distribution.Nixpkgs.Haskell.FromCabal
61+ Distribution.Nixpkgs.Haskell.FromCabal.Configuration
62+ Distribution.Nixpkgs.Haskell.FromCabal.Configuration.GHC7102
63+ Distribution.Nixpkgs.Haskell.FromCabal.Configuration.Maintainers
64+ Distribution.Nixpkgs.Haskell.FromCabal.Flags
65+ Distribution.Nixpkgs.Haskell.FromCabal.License
66+ Distribution.Nixpkgs.Haskell.FromCabal.Name
67+ Distribution.Nixpkgs.Haskell.FromCabal.Normalize
68+ Distribution.Nixpkgs.Haskell.FromCabal.PostProcess
69+ Distribution.Nixpkgs.Haskell.Hackage
70+ Distribution.Nixpkgs.Haskell.HackageGit
71+ Distribution.Nixpkgs.Haskell.OrphanInstances
72+ Distribution.Nixpkgs.License
73+ Distribution.Nixpkgs.Meta
74+ Distribution.Nixpkgs.PackageMap
75+ Internal.HaskellPackage
76+ Internal.Lens
77+ Internal.PrettyPrinting
78+ Language.Nix
79+ Language.Nix.Binding
80+ Language.Nix.Identifier
81+ Language.Nix.Path
82+ default-language: Haskell2010
83+
84+executable hackage2nix
85+ main-is: Main.hs
86+ hs-source-dirs:
87+ hackage2nix
88+ ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N
89+ build-depends:
90+ base < 5
91+ , Cabal >= 1.22.2
92+ , SHA
93+ , aeson
94+ , ansi-wl-pprint
95+ , base < 5
96+ , bytestring
97+ , containers
98+ , data-default
99+ , deepseq
100+ , deepseq-generics
101+ , directory
102+ , doctest
103+ , filepath
104+ , hackage-db
105+ , hspec
106+ , lens
107+ , monad-par
108+ , monad-par-extras
109+ , mtl
110+ , optparse-applicative
111+ , pretty >= 1.1.2
112+ , process
113+ , regex-posix
114+ , split
115+ , transformers
116+ , utf8-string
117+ , cabal2nix
118+ default-language: Haskell2010
119+
120+executable cabal2nix
121+ main-is: Main.hs
122+ hs-source-dirs:
123+ cabal2nix
124+ ghc-options: -Wall
125+ build-depends:
126+ base < 5
127+ , Cabal >= 1.22.2
128+ , SHA
129+ , aeson
130+ , ansi-wl-pprint
131+ , base < 5
132+ , bytestring
133+ , containers
134+ , data-default
135+ , deepseq
136+ , deepseq-generics
137+ , directory
138+ , doctest
139+ , filepath
140+ , hackage-db
141+ , hspec
142+ , lens
143+ , monad-par
144+ , monad-par-extras
145+ , mtl
146+ , optparse-applicative
147+ , pretty >= 1.1.2
148+ , process
149+ , regex-posix
150+ , split
151+ , transformers
152+ , utf8-string
153+ , cabal2nix
154+ default-language: Haskell2010
155+
156+test-suite spec
157+ type: exitcode-stdio-1.0
158+ main-is: Main.hs
159+ hs-source-dirs:
160+ test
161+ ghc-options: -Wall
162+ build-depends:
163+ base < 5
164+ , Cabal >= 1.22.2
165+ , SHA
166+ , aeson
167+ , ansi-wl-pprint
168+ , base < 5
169+ , bytestring
170+ , containers
171+ , data-default
172+ , deepseq
173+ , deepseq-generics
174+ , directory
175+ , doctest
176+ , filepath
177+ , hackage-db
178+ , hspec
179+ , lens
180+ , monad-par
181+ , monad-par-extras
182+ , mtl
183+ , optparse-applicative
184+ , pretty >= 1.1.2
185+ , process
186+ , regex-posix
187+ , split
188+ , transformers
189+ , utf8-string
190+ , cabal2nix
191+ default-language: Haskell2010
src/cabal2nix.hs → cabal2nix/Main.hsrenamed+3−2
@@ -13,9 +13,10 @@ import Distribution.Nixpkgs.Haskell.FromCabal.Configuration.GHC7102
1313import Distribution.Nixpkgs.Meta
1414import Distribution.PackageDescription ( FlagName(..), FlagAssignment )
1515import Distribution.Simple.Utils ( lowercase )
16+import Distribution.Text ( display )
1617import Internal.HaskellPackage
1718import Internal.Lens
18−import Internal.Version
19+import Paths_cabal2nix
1920import Internal.PrettyPrinting hiding ( (<>) )
2021import Language.Nix
2122import Options.Applicative
@@ -63,7 +64,7 @@ options = Options
6364pinfo :: ParserInfo Options
6465pinfo = info
6566 ( helper
66− <*> infoOption ("cabal2nix " ++ version) (long "version" <> help "Show version number")
67+ <*> infoOption ("cabal2nix " ++ display version) (long "version" <> help "Show version number")
6768 <*> options
6869 )
6970 ( fullDesc
generate-cabal-file.hsdeleted−139
@@ -1,139 +0,0 @@
1−module Main ( main ) where
2−
3−import Cartel
4−import Control.Monad.Trans ( liftIO )
5−import System.Process ( readProcess )
6−import Data.List ( intercalate )
7−import System.Environment ( getArgs )
8−
9−getVersion :: IO Version
10−getVersion = do
11− v <- readProcess "git" ["log", "-1", "--format=%ci"] ""
12− let [y4,y3,y2,y1,'-',m2,m1,'-',d2,d1] = head (words v)
13− return (read ('[':y4:y3:y2:y1:m2:m1:d2:d1:"]"))
14−
15−getGitVersion :: IO String
16−getGitVersion = do
17− [v] <- fmap lines (readProcess "git" ["describe", "--dirty"] "")
18− return v
19−
20−getAuthors :: IO [NonEmptyString]
21−getAuthors = do
22− buf <- readProcess "sh" ["-c", "git log --pretty=short | git shortlog --numbered --summary"] ""
23− return [ unwords (tail (words l)) | l <- lines buf, not (null l) ]
24−
25−properties :: Betsy IO Properties
26−properties = do
27− v <- liftIO getVersion
28− as <- liftIO getAuthors
29− return $ blank
30− { name = "cabal2nix"
31− , version = v
32− , buildType = Just simple
33− , category = "Distribution"
34− , maintainer = "Peter Simons <simons@cryp.to>"
35− , synopsis = "Convert Cabal files into Nix build instructions."
36− , description = [ "Convert Cabal files into Nix build instructions." ]
37− , license = Just bsd3
38− , licenseFile = "LICENSE"
39− , copyright = "Copyright (c) 2011-2015 by Peter Simons et al"
40− , author = intercalate ", " as
41− , stability = "Experimental"
42− , cabalVersion = Just (1,10)
43− , homepage = "http://github.com/NixOS/cabal2nix/"
44− , bugReports = "http://github.com/NixOS/cabal2nix/issues"
45− , extraSourceFiles = ["README.md"]
46− , testedWith = [(ghc, eq [7,10,2])]
47− }
48−
49−commonBuildOptions :: HasBuildInfo a => [a]
50−commonBuildOptions = hsSourceDirs ["src"] : haskell2010 : commonOptions
51−
52−commonOptions :: HasBuildInfo a => [a]
53−commonOptions = commonGhcOptions : commonBuildDepends
54−
55−commonGhcOptions :: HasBuildInfo a => a
56−commonGhcOptions = ghcOptions ["-Wall"]
57−
58−commonBuildDepends :: HasBuildInfo a => [a]
59−commonBuildDepends =
60− [ buildDepends
61− [ package "base" (lt [5])
62− , unconstrained "aeson"
63− , unconstrained "ansi-wl-pprint"
64− , unconstrained "bytestring"
65− , package "Cabal" (gtEq [1,22,2])
66− , unconstrained "containers"
67− , unconstrained "data-default"
68− , unconstrained "deepseq-generics"
69− , unconstrained "directory"
70− , unconstrained "filepath"
71− , unconstrained "hackage-db"
72− , unconstrained "lens"
73− , unconstrained "monad-par"
74− , unconstrained "monad-par-extras"
75− , unconstrained "mtl"
76− , unconstrained "optparse-applicative"
77− , package "pretty" (gtEq [1,1,2])
78− , unconstrained "process"
79− , unconstrained "pretty-show"
80− , unconstrained "regex-posix"
81− , unconstrained "SHA"
82− , unconstrained "split"
83− , unconstrained "transformers"
84− , unconstrained "utf8-string"
85− ]
86− ]
87−
88−commonTestOptions :: HasBuildInfo a => [a]
89−commonTestOptions = buildDepends
90− [ unconstrained "deepseq"
91− , unconstrained "doctest"
92− , unconstrained "hspec"
93− , unconstrained "QuickCheck"
94− ] : commonBuildOptions
95−
96−mkExecutable :: NonEmptyString -> [ExecutableField] -> Section
97−mkExecutable exe opt = executable exe $ mainIs (exe++".hs") : opt ++ commonBuildOptions
98−
99−mkTest :: NonEmptyString -> [TestSuiteField] -> Section
100−mkTest test opt = testSuite test $ exitcodeFields (test++".hs") ++ opt ++ hsSourceDirs ["test"] : commonTestOptions
101−
102−main :: IO ()
103−main = do
104− args <- getArgs
105− let releaseMode = "--release" `elem` args
106− defaultMainWithHeader (const (return "")) $ do
107− liftIO $ do ('v':gv) <- getGitVersion
108− writeFile "src/Internal/Version.hs" $
109− "module Internal.Version where\n\
110− \version :: String\n\
111− \version = " ++ show gv ++ "\n"
112− libraryModules <- modules "src"
113− liftIO $ writeFile "test/doctest.hs" (mkDoctest libraryModules)
114− props <- properties
115− return ( props
116− , exposedModules libraryModules : commonBuildOptions
117− , [ githubHead "NixOS" "cabal2nix"
118− , mkExecutable "cabal2nix" []
119− , mkExecutable "hackage2nix" [ buildable (not releaseMode)
120− , ghcOptions ["-threaded", "-rtsopts", "-with-rtsopts=-N"]
121− ]
122− , mkTest "spec" []
123− , mkTest "doctest" []
124− ]
125− )
126−
127−mkDoctest :: [NonEmptyString] -> String
128−mkDoctest libraryModules =
129− let paths = [ "src/" ++ map toPath l ++ ".hs" | l <- libraryModules ]
130− toPath '.' = '/'
131− toPath c = c
132− in
133− "module Main ( main ) where\n\
134− \import Test.DocTest\n\
135− \main :: IO ()\n\
136− \main = do\n\
137− \ doctest $ [\"-isrc\", \"-optP-include\", \"-optPdist/build/autogen/cabal_macros.h\"] ++ " ++ show paths ++ "\n\
138− \ doctest [\"-isrc\", \"-optP-include\", \"-optPdist/build/autogen/cabal_macros.h\", \"src/cabal2nix.hs\"]\n\
139− \ doctest [\"-isrc\", \"-optP-include\", \"-optPdist/build/autogen/cabal_macros.h\", \"src/hackage2nix.hs\"]\n"
src/hackage2nix.hs → hackage2nix/Main.hsrenamed+2−2
@@ -31,7 +31,7 @@ import Distribution.Package
3131import Distribution.Version
3232import Internal.Lens
3333import Internal.PrettyPrinting hiding ( attr, (<>) )
34−import Internal.Version
34+import Paths_cabal2nix
3535import Language.Nix
3636import Options.Applicative
3737import System.FilePath
@@ -67,7 +67,7 @@ options = Options
6767pinfo :: ParserInfo Options
6868pinfo = info
6969 ( helper
70− <*> infoOption ("hackage2nix " ++ version) (long "version" <> help "Show version number")
70+ <*> infoOption ("hackage2nix " ++ display version) (long "version" <> help "Show version number")
7171 <*> options
7272 )
7373 ( fullDesc
package.yamlnew file+91
@@ -0,0 +1,91 @@
1+name: cabal2nix
2+version: 2015.8.29
3+synopsis: Convert Cabal files into Nix build instructions.
4+description: Convert Cabal files into Nix build instructions.
5+maintainer: Peter Simons <simons@cryp.to>
6+license: BSD3
7+github: nixos/cabal2nix
8+category: Distribution
9+
10+ghc-options: -Wall
11+
12+dependencies:
13+ - base < 5
14+ - Cabal >= 1.22.2
15+ - SHA
16+ - aeson
17+ - ansi-wl-pprint
18+ - base < 5
19+ - bytestring
20+ - containers
21+ - data-default
22+ - deepseq
23+ - deepseq-generics
24+ - directory
25+ - doctest
26+ - filepath
27+ - hackage-db
28+ - hspec
29+ - lens
30+ - monad-par
31+ - monad-par-extras
32+ - mtl
33+ - optparse-applicative
34+ - pretty >= 1.1.2
35+ - process
36+ - regex-posix
37+ - split
38+ - transformers
39+ - utf8-string
40+
41+library:
42+ source-dirs: src
43+ exposed-modules:
44+ - Distribution.Nixpkgs.Fetch
45+ - Distribution.Nixpkgs.Haskell
46+ - Distribution.Nixpkgs.Haskell.BuildInfo
47+ - Distribution.Nixpkgs.Haskell.Constraint
48+ - Distribution.Nixpkgs.Haskell.Derivation
49+ - Distribution.Nixpkgs.Haskell.FromCabal
50+ - Distribution.Nixpkgs.Haskell.FromCabal.Configuration
51+ - Distribution.Nixpkgs.Haskell.FromCabal.Configuration.GHC7102
52+ - Distribution.Nixpkgs.Haskell.FromCabal.Configuration.Maintainers
53+ - Distribution.Nixpkgs.Haskell.FromCabal.Flags
54+ - Distribution.Nixpkgs.Haskell.FromCabal.License
55+ - Distribution.Nixpkgs.Haskell.FromCabal.Name
56+ - Distribution.Nixpkgs.Haskell.FromCabal.Normalize
57+ - Distribution.Nixpkgs.Haskell.FromCabal.PostProcess
58+ - Distribution.Nixpkgs.Haskell.Hackage
59+ - Distribution.Nixpkgs.Haskell.HackageGit
60+ - Distribution.Nixpkgs.Haskell.OrphanInstances
61+ - Distribution.Nixpkgs.License
62+ - Distribution.Nixpkgs.Meta
63+ - Distribution.Nixpkgs.PackageMap
64+ - Internal.HaskellPackage
65+ - Internal.Lens
66+ - Internal.PrettyPrinting
67+ - Language.Nix
68+ - Language.Nix.Binding
69+ - Language.Nix.Identifier
70+ - Language.Nix.Path
71+
72+executables:
73+ cabal2nix:
74+ main: Main.hs
75+ source-dirs: cabal2nix
76+ dependencies: cabal2nix
77+
78+ hackage2nix:
79+ main: Main.hs
80+ source-dirs: hackage2nix
81+ dependencies: cabal2nix
82+ ghc-options:
83+ - -threaded
84+ - -rtsopts
85+ - -with-rtsopts=-N
86+
87+tests:
88+ spec:
89+ main: Main.hs
90+ source-dirs: test
91+ dependencies: cabal2nix
release.nix+19−15
@@ -13,29 +13,33 @@ in
1313 cabal2nix = genAttrs supportedCompilers (ghcVer: genAttrs supportedPlatforms (system:
1414 let
1515 pkgs = import <nixpkgs> { inherit system; };
16− haskellPackages = pkgs.lib.getAttrFromPath ["haskell-ng" "packages" ghcVer] pkgs;
16+ haskellPackages = pkgs.lib.getAttrFromPath ["haskell" "packages" ghcVer] pkgs;
1717 in
1818 haskellPackages.mkDerivation {
1919 pname = "cabal2nix";
2020 version = cabal2nixSrc.gitTag;
2121 src = cabal2nixSrc;
22− isLibrary = false;
22+ isLibrary = true;
2323 isExecutable = true;
24− preConfigure = "runhaskell $setupCompileFlags generate-cabal-file.hs >cabal2nix.cabal";
25− buildTools = with haskellPackages; [ cartel pkgs.git ];
26− buildDepends = with haskellPackages; [
27− aeson base bytestring Cabal containers deepseq deepseq-generics
28− directory filepath hackage-db monad-par monad-par-extras mtl pretty
29− process QuickCheck regex-posix SHA split transformers
30− utf8-string lens optparse-applicative data-default pretty-show
24+ libraryHaskellDepends = with haskellPackages; [
25+ aeson ansi-wl-pprint base bytestring Cabal containers data-default
26+ deepseq deepseq-generics directory doctest filepath hackage-db
27+ hspec lens monad-par monad-par-extras mtl optparse-applicative
28+ pretty process regex-posix SHA split transformers utf8-string
3129 ];
32− testDepends = with haskellPackages; [
33− aeson base bytestring Cabal containers deepseq deepseq-generics
34− directory doctest filepath hackage-db hspec monad-par
35− monad-par-extras mtl pretty process QuickCheck pretty-show
36− regex-posix SHA split transformers utf8-string data-default
30+ executableHaskellDepends = with haskellPackages; [
31+ aeson ansi-wl-pprint base bytestring Cabal containers data-default
32+ deepseq deepseq-generics directory doctest filepath hackage-db
33+ hspec lens monad-par monad-par-extras mtl optparse-applicative
34+ pretty process regex-posix SHA split transformers utf8-string
3735 ];
38− homepage = "http://github.com/NixOS/cabal2nix";
36+ testHaskellDepends = with haskellPackages; [
37+ aeson ansi-wl-pprint base bytestring Cabal containers data-default
38+ deepseq deepseq-generics directory doctest filepath hackage-db
39+ hspec lens monad-par monad-par-extras mtl optparse-applicative
40+ pretty process regex-posix SHA split transformers utf8-string
41+ ];
42+ homepage = "https://github.com/nixos/cabal2nix#readme";
3943 description = "Convert Cabal files into Nix build instructions";
4044 license = pkgs.stdenv.lib.licenses.bsd3;
4145 maintainers = [ pkgs.stdenv.lib.maintainers.simons ];
test/Main.hsnew file+65
@@ -0,0 +1,65 @@
1+module Main ( main ) where
2+
3+import Control.DeepSeq
4+import Control.Exception
5+import qualified Data.Map as Map
6+import qualified Data.Set as Set
7+import Distribution.Nixpkgs.Haskell.FromCabal.Configuration.GHC7102
8+import Distribution.Nixpkgs.License
9+import Distribution.Nixpkgs.Meta
10+import Internal.Lens
11+import Test.Hspec
12+import Test.DocTest
13+
14+main :: IO ()
15+main = do
16+ doctest [ "-isrc", "-optP-include", "-optPdist/build/autogen/cabal_macros.h"
17+ , "src/Distribution/Nixpkgs/Fetch.hs"
18+ , "src/Distribution/Nixpkgs/Haskell.hs"
19+ , "src/Distribution/Nixpkgs/Haskell/BuildInfo.hs"
20+ , "src/Distribution/Nixpkgs/Haskell/Constraint.hs"
21+ , "src/Distribution/Nixpkgs/Haskell/Derivation.hs"
22+ , "src/Distribution/Nixpkgs/Haskell/FromCabal.hs"
23+ , "src/Distribution/Nixpkgs/Haskell/FromCabal/Configuration.hs"
24+ , "src/Distribution/Nixpkgs/Haskell/FromCabal/Configuration/GHC7102.hs"
25+ , "src/Distribution/Nixpkgs/Haskell/FromCabal/Configuration/Maintainers.hs"
26+ , "src/Distribution/Nixpkgs/Haskell/FromCabal/Flags.hs"
27+ , "src/Distribution/Nixpkgs/Haskell/FromCabal/License.hs"
28+ , "src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs"
29+ , "src/Distribution/Nixpkgs/Haskell/FromCabal/Normalize.hs"
30+ , "src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs"
31+ , "src/Distribution/Nixpkgs/Haskell/Hackage.hs"
32+ , "src/Distribution/Nixpkgs/Haskell/HackageGit.hs"
33+ , "src/Distribution/Nixpkgs/Haskell/OrphanInstances.hs"
34+ , "src/Distribution/Nixpkgs/License.hs"
35+ , "src/Distribution/Nixpkgs/Meta.hs"
36+ , "src/Distribution/Nixpkgs/PackageMap.hs"
37+ , "src/Internal/HaskellPackage.hs"
38+ , "src/Internal/Lens.hs"
39+ , "src/Internal/PrettyPrinting.hs"
40+ , "src/Language/Nix.hs"
41+ , "src/Language/Nix/Binding.hs"
42+ , "src/Language/Nix/Identifier.hs"
43+ , "src/Language/Nix/Path.hs"
44+ ]
45+ doctest ["-isrc", "-optP-include", "-optPdist/build/autogen/cabal_macros.h", "cabal2nix/Main.hs"]
46+ doctest ["-isrc", "-optP-include", "-optPdist/build/autogen/cabal_macros.h", "hackage2nix/Main.hs"]
47+
48+ hspec $ do
49+ describe "DeepSeq instances work properly for" $ do
50+ it "License" $ mapM_ hitsBottom [Known undefined, Unknown (Just undefined)]
51+ it "Meta" $ do mapM_ hitsBottom
52+ [ def & homepage .~ undefined
53+ , def & description .~ undefined
54+ , def & license .~ undefined
55+ , def & platforms .~ undefined
56+ , def & maintainers .~ undefined
57+ , def & broken .~ undefined
58+ ]
59+
60+ describe "Configuration records are consistent" $
61+ it "No maintained package is marked as \"dont-distribute\"" $
62+ Map.keysSet (packageMaintainers ghc7102) `Set.intersection` (dontDistributePackages ghc7102) `shouldSatisfy` Set.null
63+
64+hitsBottom :: NFData a => a -> Expectation
65+hitsBottom x = evaluate (rnf x) `shouldThrow` anyErrorCall
test/spec.hsdeleted−32
@@ -1,32 +0,0 @@
1−module Main ( main ) where
2−
3−import Control.DeepSeq
4−import Control.Exception
5−import qualified Data.Map as Map
6−import qualified Data.Set as Set
7−import Distribution.Nixpkgs.Haskell.FromCabal.Configuration.GHC7102
8−import Distribution.Nixpkgs.License
9−import Distribution.Nixpkgs.Meta
10−import Internal.Lens
11−import Test.Hspec
12−
13−main :: IO ()
14−main = do
15− hspec $ do
16− describe "DeepSeq instances work properly for" $ do
17− it "License" $ mapM_ hitsBottom [Known undefined, Unknown (Just undefined)]
18− it "Meta" $ do mapM_ hitsBottom
19− [ def & homepage .~ undefined
20− , def & description .~ undefined
21− , def & license .~ undefined
22− , def & platforms .~ undefined
23− , def & maintainers .~ undefined
24− , def & broken .~ undefined
25− ]
26−
27− describe "Configuration records are consistent" $
28− it "No maintained package is marked as \"dont-distribute\"" $
29− Map.keysSet (packageMaintainers ghc7102) `Set.intersection` (dontDistributePackages ghc7102) `shouldSatisfy` Set.null
30−
31−hitsBottom :: NFData a => a -> Expectation
32−hitsBottom x = evaluate (rnf x) `shouldThrow` anyErrorCall
update-nixpkgs.sh−1
@@ -36,7 +36,6 @@ gzip -k "$TAR"
3636hackage=$(git rev-parse --verify HEAD)
3737cd ..
3838
39−rm -f cabal2nix
4039make --quiet configure
4140cabal run -v0 -j hackage2nix >hackage-packages.nix
4241