on master help sign in
Remove old Haskell Platform code
commit723f34f0849b329c3c8e2736a0326f0ab3b82efd authorMichael Snoyman <michael@snoyman.com> dateTue 19 Aug 2014, 07:38 (12 years ago) parenta5d86ee
5 files changed+6−321
Stackage/HaskellPlatform.hs−71 Stackage/InstallInfo.hs+6−18 hp/haskell-platform-7.4.cabal−113 hp/haskell-platform-7.6.cabal−118 stackage.cabal−1
Stackage/HaskellPlatform.hsdeleted−71
@@ -1,71 +0,0 @@
1−module Stackage.HaskellPlatform
2− ( loadHaskellPlatform
3− ) where
4−
5−import Control.Monad (guard)
6−import Data.Char (isSpace)
7−import Data.List (foldl', isInfixOf, isPrefixOf, stripPrefix)
8−import Data.Maybe (mapMaybe)
9−import Data.Monoid (Monoid (..))
10−import Data.Set (singleton)
11−import Distribution.Text (simpleParse)
12−import Stackage.Types
13−import System.Directory (doesFileExist)
14−import System.FilePath ((</>))
15−
16−loadHaskellPlatform :: SelectSettings -> IO (Maybe HaskellPlatform)
17−loadHaskellPlatform ss = do
18− e <- doesFileExist fp
19− if e
20− then fmap (Just . parseHP) $ readFile fp
21− else do
22− putStrLn "Warning: No Haskell Platform found for current GHC version"
23− return Nothing
24− where
25− GhcMajorVersion x y = selectGhcVersion ss
26−
27− fp = haskellPlatformDir ss </> (concat
28− [ "haskell-platform-"
29− , show x
30− , "."
31− , show y
32− , ".cabal"
33− ])
34−
35−data HPLine = HPLPackage PackageIdentifier
36− | HPLBeginCore
37− | HPLEndCore
38− | HPLBeginPlatform
39− | HPLEndPlatform
40− deriving Show
41−
42−toHPLine :: String -> Maybe HPLine
43−toHPLine s
44− | "begin core packages" `isInfixOf` s = Just HPLBeginCore
45− | "end core packages" `isInfixOf` s = Just HPLEndCore
46− | "begin platform packages" `isInfixOf` s = Just HPLBeginPlatform
47− | "end platform packages" `isInfixOf` s = Just HPLEndPlatform
48− | otherwise = do
49− let s1 = dropWhile isSpace s
50− guard $ not $ "--" `isPrefixOf` s1
51− guard $ not $ null s1
52− guard $ "==" `isInfixOf` s1
53− let (package', s2) = break (== '=') s1
54− package = takeWhile (not . isSpace) package'
55− s3 <- stripPrefix "==" s2
56− version <- simpleParse $ takeWhile (/= ',') s3
57− Just $ HPLPackage $ PackageIdentifier (PackageName package) version
58−
59−parseHP :: String -> HaskellPlatform
60−parseHP =
61− snd . foldl' addLine (notInBlock, mempty) . mapMaybe toHPLine . lines
62− where
63− notInBlock _ = mempty
64− inCore x = HaskellPlatform (singleton x) mempty
65− inPlatform x = HaskellPlatform mempty (singleton x)
66−
67− addLine (fromPackage, hp) (HPLPackage vp) = (fromPackage, fromPackage vp `mappend` hp)
68− addLine (_, hp) HPLBeginCore = (inCore, hp)
69− addLine (_, hp) HPLEndCore = (notInBlock, hp)
70− addLine (_, hp) HPLBeginPlatform = (inPlatform, hp)
71− addLine (_, hp) HPLEndPlatform = (notInBlock, hp)
Stackage/InstallInfo.hs+6−18
@@ -14,7 +14,6 @@ import Data.Version (showVersion)
1414import qualified Distribution.Text
1515import Distribution.Version (simplifyVersionRange, withinRange)
1616import Stackage.GhcPkg
17−import Stackage.HaskellPlatform
1817import Stackage.LoadDatabase
1918import Stackage.NarrowDatabase
2019import Stackage.ServerFiles
@@ -36,25 +35,17 @@ dropExcluded bs m0 =
3635getInstallInfo :: SelectSettings -> IO InstallInfo
3736getInstallInfo settings = do
3837 putStrLn "Loading Haskell Platform"
39− mhp <- loadHaskellPlatform settings
40−
41− core <-
42− case mhp of
43− Just hp | not (useGlobalDatabase settings) -> return $ hpcore hp
44− _ -> do
45− putStrLn "Loading core packages from global database"
46− getGlobalPackages $ selectGhcVersion settings
38+
39+ core <- do
40+ putStrLn "Loading core packages from global database"
41+ getGlobalPackages $ selectGhcVersion settings
4742 underlay <- getDBPackages (selectUnderlayPackageDirs settings) (selectGhcVersion settings)
4843 let underlaySet = Set.map pkgName underlay
4944 coreMap = Map.unions
5045 $ map (\(PackageIdentifier k v) -> Map.singleton k v)
5146 $ Set.toList core
5247 allPackages' =
53− case mhp of
54− Just hp | requireHaskellPlatform settings ->
55− Map.union (stablePackages settings $ requireHaskellPlatform settings)
56− $ identsToRanges (hplibs hp)
57− _ -> stablePackages settings $ requireHaskellPlatform settings
48+ stablePackages settings $ requireHaskellPlatform settings
5849 allPackages = dropExcluded settings allPackages'
5950 totalCore
6051 | ignoreUpgradeableCore settings =
@@ -99,10 +90,7 @@ getInstallInfo settings = do
9990 let ii = InstallInfo
10091 { iiCore = totalCore
10192 , iiPackages = Map.map biToSPI final
102− , iiOptionalCore = maybe
103− Map.empty
104− (Map.fromList . map (\(PackageIdentifier p v) -> (p, v)) . Set.toList . hplibs)
105− mhp
93+ , iiOptionalCore = Map.empty
10694 , iiPackageDB = pdb
10795 }
10896
hp/haskell-platform-7.4.cabaldeleted−113
@@ -1,113 +0,0 @@
1−name: haskell-platform
2−version: 2012.4.0.0
3−homepage: http://haskell.org/platform
4−license: BSD3
5−license-file: LICENSE
6−author: libraries@haskell.org
7−maintainer: haskell-platform@projects.haskell.org
8−category: System
9−synopsis: The Haskell Platform
10−description:
11− The Haskell Platform (HP) is the blessed set of libraries and tools on
12− which to build further Haskell libraries and applications. It is
13− intended to provide a comprehensive, stable, and quality tested base for
14− Haskell projects to work from.
15− .
16− This version specifies the following additional developer tools be
17− installed, for a system to be in full compliance:
18− .
19− * cabal-install
20− * alex
21− * happy
22− * haddock
23−
24−cabal-version: >= 1.8
25−build-type: Custom
26−tested-with: GHC ==7.4.2
27−
28−flag include-ghc-depends
29− description: Include all the GHC provided packages in the dependencies
30− default: False
31−
32−library
33− if flag(include-ghc-depends)
34− build-depends:
35− ghc ==7.4.2,
36−
37− -- Core libraries: provided by every ghc installation
38− -- We don't include "non-API" packages here.
39− -- begin core packages
40− array ==0.4.0.0,
41− base ==4.5.1.0,
42− bytestring ==0.9.2.1,
43− Cabal ==1.14.0,
44− containers ==0.4.2.1,
45− deepseq ==1.3.0.0,
46− directory ==1.1.0.2,
47− extensible-exceptions ==0.1.1.4,
48− filepath ==1.3.0.0,
49− haskell2010 ==1.1.0.1,
50− haskell98 ==2.0.0.1,
51− hpc ==0.5.1.1,
52− old-locale ==1.0.0.4,
53− old-time ==1.1.0.0,
54− pretty ==1.1.1.0,
55− process ==1.1.0.1,
56− template-haskell ==2.7.0.0,
57− time ==1.4
58− if !os(windows)
59− build-depends:
60− unix ==2.5.1.1
61− -- end core packages
62− else
63− build-depends:
64− Win32 ==2.2.2.0
65−
66− build-depends:
67− -- Libraries in addition to what GHC provides:
68− -- Note: newer versions of cgi need monad-catchio.
69− -- begin platform packages
70− async ==2.0.1.3,
71− cgi ==3001.1.7.4,
72− fgl ==5.4.2.4,
73− GLUT ==2.1.2.1,
74− haskell-src ==1.0.1.5,
75− html ==1.0.1.2,
76− HTTP ==4000.2.5,
77− HUnit ==1.2.5.1,
78− mtl ==2.1.2,
79− network ==2.3.1.0,
80− OpenGL ==2.2.3.1,
81− parallel ==3.2.0.3,
82− parsec ==3.1.3,
83− QuickCheck ==2.5.1.1,
84− random ==1.0.1.1,
85− regex-base ==0.93.2,
86− regex-compat ==0.95.1,
87− regex-posix ==0.95.2,
88− split ==0.2.1.1,
89− stm ==2.4,
90− syb ==0.3.7,
91− text ==0.11.2.3,
92− transformers ==0.3.0.0,
93− vector ==0.10.0.1,
94− xhtml ==3000.2.1,
95− zlib ==0.5.4.0,
96−
97− -- Libraries that are needed to support the above,
98− -- though are not officially part of the platform
99− primitive ==0.5.0.1
100−
101− -- Depending on programs does not work, they are not registered
102− -- We list them to help distro packaging.
103− build-tools:
104− cabal-install ==0.14.0,
105− alex ==3.0.2,
106− happy ==1.18.10
107− -- end platform packages
108− -- hscolour ==1.19 -- ???
109− -- haddock ==2.11.0 -- need to use the one shipped with ghc
110−
111−-- N.B.: The begin/end comment annotations are used to build the source
112−-- installer: Packages that are part of the core are checked at build time.
113−-- Source of packages that are part of the platform are included in the tarball.
hp/haskell-platform-7.6.cabaldeleted−118
@@ -1,118 +0,0 @@
1−name: haskell-platform
2−version: 2013.2.0.0
3−homepage: http://haskell.org/platform
4−license: BSD3
5−license-file: LICENSE
6−author: libraries@haskell.org
7−maintainer: haskell-platform@projects.haskell.org
8−category: System
9−synopsis: The Haskell Platform
10−description:
11− The Haskell Platform (HP) is the blessed set of libraries and tools on
12− which to build further Haskell libraries and applications. It is
13− intended to provide a comprehensive, stable, and quality tested base for
14− Haskell projects to work from.
15− .
16− This version specifies the following additional developer tools be
17− installed, for a system to be in full compliance:
18− .
19− * cabal-install
20− * alex
21− * happy
22− * haddock
23−
24−cabal-version: >= 1.8
25−build-type: Custom
26−tested-with: GHC ==7.6.3
27−
28−flag include-ghc-depends
29− description: Include all the GHC provided packages in the dependencies
30− default: False
31−
32−library
33− if flag(include-ghc-depends)
34− build-depends:
35− ghc ==7.6.3,
36−
37− -- Core libraries: provided by every ghc installation
38− -- We don't include "non-API" packages here.
39− -- begin core packages
40− array ==0.4.0.1,
41− base ==4.6.0.1,
42− bytestring ==0.10.0.2,
43− Cabal ==1.16.0,
44− containers ==0.5.0.0,
45− deepseq ==1.3.0.1,
46− directory ==1.2.0.1,
47− filepath ==1.3.0.1,
48− haskell2010 ==1.1.1.0,
49− haskell98 ==2.0.0.2,
50− hpc ==0.6.0.0,
51− old-locale ==1.0.0.5,
52− old-time ==1.1.0.1,
53− pretty ==1.1.1.0,
54− process ==1.1.0.2,
55− template-haskell ==2.8.0.0,
56− time ==1.4.0.1
57− if !os(windows)
58− build-depends:
59− unix ==2.6.0.1
60− -- end core packages
61− else
62− build-depends:
63− Win32 ==2.3.0.0
64−
65− build-depends:
66− -- Libraries in addition to what GHC provides:
67− -- Note: newer versions of cgi need monad-catchio.
68− -- begin platform packages
69− async ==2.0.1.4,
70− attoparsec ==0.10.4.0,
71− case-insensitive ==1.0.0.1,
72− cgi ==3001.1.7.5,
73− fgl ==5.4.2.4,
74− GLUT ==2.4.0.0,
75− GLURaw ==1.3.0.0,
76− haskell-src ==1.0.1.5,
77− hashable ==1.1.2.5,
78− html ==1.0.1.2,
79− HTTP ==4000.2.8,
80− HUnit ==1.2.5.2,
81− mtl ==2.1.2,
82− network ==2.4.1.2,
83− OpenGL ==2.8.0.0,
84− OpenGLRaw ==1.3.0.0,
85− parallel ==3.2.0.3,
86− parsec ==3.1.3,
87− QuickCheck ==2.6,
88− random ==1.0.1.1,
89− regex-base ==0.93.2,
90− regex-compat ==0.95.1,
91− regex-posix ==0.95.2,
92− split ==0.2.2,
93− stm ==2.4.2,
94− syb ==0.4.0,
95− text ==0.11.3.1,
96− transformers ==0.3.0.0,
97− unordered-containers ==0.2.3.0,
98− vector ==0.10.0.1,
99− xhtml ==3000.2.1,
100− zlib ==0.5.4.1,
101−
102− -- Libraries that are needed to support the above,
103− -- though are not officially part of the platform
104− primitive ==0.5.0.1
105−
106− -- Depending on programs does not work, they are not registered
107− -- We list them to help distro packaging.
108− build-tools:
109− cabal-install ==1.16.0.2,
110− alex ==3.0.5,
111− happy ==1.18.10
112− -- end platform packages
113− -- hscolour ==1.20.3 -- ???
114− -- haddock ==2.13.2 -- need to use the one shipped with ghc
115−
116−-- N.B.: The begin/end comment annotations are used to build the source
117−-- installer: Packages that are part of the core are checked at build time.
118−-- Source of packages that are part of the platform are included in the tarball.
stackage.cabal−1
@@ -14,7 +14,6 @@ cabal-version: >=1.8
1414library
1515 exposed-modules: Stackage.NarrowDatabase
1616 Stackage.LoadDatabase
17− Stackage.HaskellPlatform
1817 Stackage.ModuleNameConflict
1918 Stackage.Util
2019 Stackage.Types