@@ -0,0 +1,48 @@
1+module Stackage.Config where
2+
3+import qualified Data.Map as Map
4+import Stackage.Types
5+import Control.Monad.Trans.Writer (execWriter, tell)
6+import Data.Set (singleton, fromList)
7+import Control.Monad (when, unless)
8+import Distribution.System (OS (..), buildOS)
9+import Distribution.Version (anyVersion)
10+import Distribution.Text (simpleParse)
11+
12+-- | Packages which are shipped with GHC but are not included in the
13+-- Haskell Platform list of core packages.
14+extraCore :: Set PackageName
15+extraCore = singleton $ PackageName "binary"
16+
17+-- | Test suites which are expected to fail for some reason. The test suite
18+-- will still be run and logs kept, but a failure will not indicate an
19+-- error in our package combination.
20+expectedFailures :: Set PackageName
21+expectedFailures = fromList $ map PackageName
22+ [ -- Requires an old version of WAI and Warp for tests
23+ "HTTP"
24+ -- Requires a special hspec-meta which is not yet available from
25+ -- Hackage.
26+ , "hspec"
27+ ]
28+
29+-- | List of packages for our stable Hackage. All dependencies will be
30+-- included as well. Please indicate who will be maintaining the package
31+-- via comments.
32+stablePackages :: Map PackageName VersionRange
33+stablePackages = execWriter $ do
34+ -- Michael Snoyman michael@snoyman.com
35+ addRange "yesod" "< 1.4"
36+ add "yesod-newsfeed"
37+ add "yesod-sitemap"
38+ add "yesod-static"
39+ -- A few transient deps not otherwise picked up
40+ add "cipher-aes"
41+ when (buildOS == Linux) $ add "hinotify"
42+ unless (buildOS == Windows) $ add "unix-time"
43+ where
44+ add = flip addRange "-any"
45+ addRange package range =
46+ case simpleParse range of
47+ Nothing -> error $ "Invalid range " ++ show range ++ " for " ++ package
48+ Just range' -> tell $ Map.singleton (PackageName package) range'