mirror of
https://github.com/commercialhaskell/stackage.git
synced 2026-01-11 23:08:30 +01:00
Remove old Haskell Platform code
This commit is contained in:
parent
a5d86ee1de
commit
723f34f084
@ -1,71 +0,0 @@
|
||||
module Stackage.HaskellPlatform
|
||||
( loadHaskellPlatform
|
||||
) where
|
||||
|
||||
import Control.Monad (guard)
|
||||
import Data.Char (isSpace)
|
||||
import Data.List (foldl', isInfixOf, isPrefixOf, stripPrefix)
|
||||
import Data.Maybe (mapMaybe)
|
||||
import Data.Monoid (Monoid (..))
|
||||
import Data.Set (singleton)
|
||||
import Distribution.Text (simpleParse)
|
||||
import Stackage.Types
|
||||
import System.Directory (doesFileExist)
|
||||
import System.FilePath ((</>))
|
||||
|
||||
loadHaskellPlatform :: SelectSettings -> IO (Maybe HaskellPlatform)
|
||||
loadHaskellPlatform ss = do
|
||||
e <- doesFileExist fp
|
||||
if e
|
||||
then fmap (Just . parseHP) $ readFile fp
|
||||
else do
|
||||
putStrLn "Warning: No Haskell Platform found for current GHC version"
|
||||
return Nothing
|
||||
where
|
||||
GhcMajorVersion x y = selectGhcVersion ss
|
||||
|
||||
fp = haskellPlatformDir ss </> (concat
|
||||
[ "haskell-platform-"
|
||||
, show x
|
||||
, "."
|
||||
, show y
|
||||
, ".cabal"
|
||||
])
|
||||
|
||||
data HPLine = HPLPackage PackageIdentifier
|
||||
| HPLBeginCore
|
||||
| HPLEndCore
|
||||
| HPLBeginPlatform
|
||||
| HPLEndPlatform
|
||||
deriving Show
|
||||
|
||||
toHPLine :: String -> Maybe HPLine
|
||||
toHPLine s
|
||||
| "begin core packages" `isInfixOf` s = Just HPLBeginCore
|
||||
| "end core packages" `isInfixOf` s = Just HPLEndCore
|
||||
| "begin platform packages" `isInfixOf` s = Just HPLBeginPlatform
|
||||
| "end platform packages" `isInfixOf` s = Just HPLEndPlatform
|
||||
| otherwise = do
|
||||
let s1 = dropWhile isSpace s
|
||||
guard $ not $ "--" `isPrefixOf` s1
|
||||
guard $ not $ null s1
|
||||
guard $ "==" `isInfixOf` s1
|
||||
let (package', s2) = break (== '=') s1
|
||||
package = takeWhile (not . isSpace) package'
|
||||
s3 <- stripPrefix "==" s2
|
||||
version <- simpleParse $ takeWhile (/= ',') s3
|
||||
Just $ HPLPackage $ PackageIdentifier (PackageName package) version
|
||||
|
||||
parseHP :: String -> HaskellPlatform
|
||||
parseHP =
|
||||
snd . foldl' addLine (notInBlock, mempty) . mapMaybe toHPLine . lines
|
||||
where
|
||||
notInBlock _ = mempty
|
||||
inCore x = HaskellPlatform (singleton x) mempty
|
||||
inPlatform x = HaskellPlatform mempty (singleton x)
|
||||
|
||||
addLine (fromPackage, hp) (HPLPackage vp) = (fromPackage, fromPackage vp `mappend` hp)
|
||||
addLine (_, hp) HPLBeginCore = (inCore, hp)
|
||||
addLine (_, hp) HPLEndCore = (notInBlock, hp)
|
||||
addLine (_, hp) HPLBeginPlatform = (inPlatform, hp)
|
||||
addLine (_, hp) HPLEndPlatform = (notInBlock, hp)
|
||||
@ -14,7 +14,6 @@ import Data.Version (showVersion)
|
||||
import qualified Distribution.Text
|
||||
import Distribution.Version (simplifyVersionRange, withinRange)
|
||||
import Stackage.GhcPkg
|
||||
import Stackage.HaskellPlatform
|
||||
import Stackage.LoadDatabase
|
||||
import Stackage.NarrowDatabase
|
||||
import Stackage.ServerFiles
|
||||
@ -36,25 +35,17 @@ dropExcluded bs m0 =
|
||||
getInstallInfo :: SelectSettings -> IO InstallInfo
|
||||
getInstallInfo settings = do
|
||||
putStrLn "Loading Haskell Platform"
|
||||
mhp <- loadHaskellPlatform settings
|
||||
|
||||
core <-
|
||||
case mhp of
|
||||
Just hp | not (useGlobalDatabase settings) -> return $ hpcore hp
|
||||
_ -> do
|
||||
putStrLn "Loading core packages from global database"
|
||||
getGlobalPackages $ selectGhcVersion settings
|
||||
core <- do
|
||||
putStrLn "Loading core packages from global database"
|
||||
getGlobalPackages $ selectGhcVersion settings
|
||||
underlay <- getDBPackages (selectUnderlayPackageDirs settings) (selectGhcVersion settings)
|
||||
let underlaySet = Set.map pkgName underlay
|
||||
coreMap = Map.unions
|
||||
$ map (\(PackageIdentifier k v) -> Map.singleton k v)
|
||||
$ Set.toList core
|
||||
allPackages' =
|
||||
case mhp of
|
||||
Just hp | requireHaskellPlatform settings ->
|
||||
Map.union (stablePackages settings $ requireHaskellPlatform settings)
|
||||
$ identsToRanges (hplibs hp)
|
||||
_ -> stablePackages settings $ requireHaskellPlatform settings
|
||||
stablePackages settings $ requireHaskellPlatform settings
|
||||
allPackages = dropExcluded settings allPackages'
|
||||
totalCore
|
||||
| ignoreUpgradeableCore settings =
|
||||
@ -99,10 +90,7 @@ getInstallInfo settings = do
|
||||
let ii = InstallInfo
|
||||
{ iiCore = totalCore
|
||||
, iiPackages = Map.map biToSPI final
|
||||
, iiOptionalCore = maybe
|
||||
Map.empty
|
||||
(Map.fromList . map (\(PackageIdentifier p v) -> (p, v)) . Set.toList . hplibs)
|
||||
mhp
|
||||
, iiOptionalCore = Map.empty
|
||||
, iiPackageDB = pdb
|
||||
}
|
||||
|
||||
|
||||
@ -1,113 +0,0 @@
|
||||
name: haskell-platform
|
||||
version: 2012.4.0.0
|
||||
homepage: http://haskell.org/platform
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: libraries@haskell.org
|
||||
maintainer: haskell-platform@projects.haskell.org
|
||||
category: System
|
||||
synopsis: The Haskell Platform
|
||||
description:
|
||||
The Haskell Platform (HP) is the blessed set of libraries and tools on
|
||||
which to build further Haskell libraries and applications. It is
|
||||
intended to provide a comprehensive, stable, and quality tested base for
|
||||
Haskell projects to work from.
|
||||
.
|
||||
This version specifies the following additional developer tools be
|
||||
installed, for a system to be in full compliance:
|
||||
.
|
||||
* cabal-install
|
||||
* alex
|
||||
* happy
|
||||
* haddock
|
||||
|
||||
cabal-version: >= 1.8
|
||||
build-type: Custom
|
||||
tested-with: GHC ==7.4.2
|
||||
|
||||
flag include-ghc-depends
|
||||
description: Include all the GHC provided packages in the dependencies
|
||||
default: False
|
||||
|
||||
library
|
||||
if flag(include-ghc-depends)
|
||||
build-depends:
|
||||
ghc ==7.4.2,
|
||||
|
||||
-- Core libraries: provided by every ghc installation
|
||||
-- We don't include "non-API" packages here.
|
||||
-- begin core packages
|
||||
array ==0.4.0.0,
|
||||
base ==4.5.1.0,
|
||||
bytestring ==0.9.2.1,
|
||||
Cabal ==1.14.0,
|
||||
containers ==0.4.2.1,
|
||||
deepseq ==1.3.0.0,
|
||||
directory ==1.1.0.2,
|
||||
extensible-exceptions ==0.1.1.4,
|
||||
filepath ==1.3.0.0,
|
||||
haskell2010 ==1.1.0.1,
|
||||
haskell98 ==2.0.0.1,
|
||||
hpc ==0.5.1.1,
|
||||
old-locale ==1.0.0.4,
|
||||
old-time ==1.1.0.0,
|
||||
pretty ==1.1.1.0,
|
||||
process ==1.1.0.1,
|
||||
template-haskell ==2.7.0.0,
|
||||
time ==1.4
|
||||
if !os(windows)
|
||||
build-depends:
|
||||
unix ==2.5.1.1
|
||||
-- end core packages
|
||||
else
|
||||
build-depends:
|
||||
Win32 ==2.2.2.0
|
||||
|
||||
build-depends:
|
||||
-- Libraries in addition to what GHC provides:
|
||||
-- Note: newer versions of cgi need monad-catchio.
|
||||
-- begin platform packages
|
||||
async ==2.0.1.3,
|
||||
cgi ==3001.1.7.4,
|
||||
fgl ==5.4.2.4,
|
||||
GLUT ==2.1.2.1,
|
||||
haskell-src ==1.0.1.5,
|
||||
html ==1.0.1.2,
|
||||
HTTP ==4000.2.5,
|
||||
HUnit ==1.2.5.1,
|
||||
mtl ==2.1.2,
|
||||
network ==2.3.1.0,
|
||||
OpenGL ==2.2.3.1,
|
||||
parallel ==3.2.0.3,
|
||||
parsec ==3.1.3,
|
||||
QuickCheck ==2.5.1.1,
|
||||
random ==1.0.1.1,
|
||||
regex-base ==0.93.2,
|
||||
regex-compat ==0.95.1,
|
||||
regex-posix ==0.95.2,
|
||||
split ==0.2.1.1,
|
||||
stm ==2.4,
|
||||
syb ==0.3.7,
|
||||
text ==0.11.2.3,
|
||||
transformers ==0.3.0.0,
|
||||
vector ==0.10.0.1,
|
||||
xhtml ==3000.2.1,
|
||||
zlib ==0.5.4.0,
|
||||
|
||||
-- Libraries that are needed to support the above,
|
||||
-- though are not officially part of the platform
|
||||
primitive ==0.5.0.1
|
||||
|
||||
-- Depending on programs does not work, they are not registered
|
||||
-- We list them to help distro packaging.
|
||||
build-tools:
|
||||
cabal-install ==0.14.0,
|
||||
alex ==3.0.2,
|
||||
happy ==1.18.10
|
||||
-- end platform packages
|
||||
-- hscolour ==1.19 -- ???
|
||||
-- haddock ==2.11.0 -- need to use the one shipped with ghc
|
||||
|
||||
-- N.B.: The begin/end comment annotations are used to build the source
|
||||
-- installer: Packages that are part of the core are checked at build time.
|
||||
-- Source of packages that are part of the platform are included in the tarball.
|
||||
@ -1,118 +0,0 @@
|
||||
name: haskell-platform
|
||||
version: 2013.2.0.0
|
||||
homepage: http://haskell.org/platform
|
||||
license: BSD3
|
||||
license-file: LICENSE
|
||||
author: libraries@haskell.org
|
||||
maintainer: haskell-platform@projects.haskell.org
|
||||
category: System
|
||||
synopsis: The Haskell Platform
|
||||
description:
|
||||
The Haskell Platform (HP) is the blessed set of libraries and tools on
|
||||
which to build further Haskell libraries and applications. It is
|
||||
intended to provide a comprehensive, stable, and quality tested base for
|
||||
Haskell projects to work from.
|
||||
.
|
||||
This version specifies the following additional developer tools be
|
||||
installed, for a system to be in full compliance:
|
||||
.
|
||||
* cabal-install
|
||||
* alex
|
||||
* happy
|
||||
* haddock
|
||||
|
||||
cabal-version: >= 1.8
|
||||
build-type: Custom
|
||||
tested-with: GHC ==7.6.3
|
||||
|
||||
flag include-ghc-depends
|
||||
description: Include all the GHC provided packages in the dependencies
|
||||
default: False
|
||||
|
||||
library
|
||||
if flag(include-ghc-depends)
|
||||
build-depends:
|
||||
ghc ==7.6.3,
|
||||
|
||||
-- Core libraries: provided by every ghc installation
|
||||
-- We don't include "non-API" packages here.
|
||||
-- begin core packages
|
||||
array ==0.4.0.1,
|
||||
base ==4.6.0.1,
|
||||
bytestring ==0.10.0.2,
|
||||
Cabal ==1.16.0,
|
||||
containers ==0.5.0.0,
|
||||
deepseq ==1.3.0.1,
|
||||
directory ==1.2.0.1,
|
||||
filepath ==1.3.0.1,
|
||||
haskell2010 ==1.1.1.0,
|
||||
haskell98 ==2.0.0.2,
|
||||
hpc ==0.6.0.0,
|
||||
old-locale ==1.0.0.5,
|
||||
old-time ==1.1.0.1,
|
||||
pretty ==1.1.1.0,
|
||||
process ==1.1.0.2,
|
||||
template-haskell ==2.8.0.0,
|
||||
time ==1.4.0.1
|
||||
if !os(windows)
|
||||
build-depends:
|
||||
unix ==2.6.0.1
|
||||
-- end core packages
|
||||
else
|
||||
build-depends:
|
||||
Win32 ==2.3.0.0
|
||||
|
||||
build-depends:
|
||||
-- Libraries in addition to what GHC provides:
|
||||
-- Note: newer versions of cgi need monad-catchio.
|
||||
-- begin platform packages
|
||||
async ==2.0.1.4,
|
||||
attoparsec ==0.10.4.0,
|
||||
case-insensitive ==1.0.0.1,
|
||||
cgi ==3001.1.7.5,
|
||||
fgl ==5.4.2.4,
|
||||
GLUT ==2.4.0.0,
|
||||
GLURaw ==1.3.0.0,
|
||||
haskell-src ==1.0.1.5,
|
||||
hashable ==1.1.2.5,
|
||||
html ==1.0.1.2,
|
||||
HTTP ==4000.2.8,
|
||||
HUnit ==1.2.5.2,
|
||||
mtl ==2.1.2,
|
||||
network ==2.4.1.2,
|
||||
OpenGL ==2.8.0.0,
|
||||
OpenGLRaw ==1.3.0.0,
|
||||
parallel ==3.2.0.3,
|
||||
parsec ==3.1.3,
|
||||
QuickCheck ==2.6,
|
||||
random ==1.0.1.1,
|
||||
regex-base ==0.93.2,
|
||||
regex-compat ==0.95.1,
|
||||
regex-posix ==0.95.2,
|
||||
split ==0.2.2,
|
||||
stm ==2.4.2,
|
||||
syb ==0.4.0,
|
||||
text ==0.11.3.1,
|
||||
transformers ==0.3.0.0,
|
||||
unordered-containers ==0.2.3.0,
|
||||
vector ==0.10.0.1,
|
||||
xhtml ==3000.2.1,
|
||||
zlib ==0.5.4.1,
|
||||
|
||||
-- Libraries that are needed to support the above,
|
||||
-- though are not officially part of the platform
|
||||
primitive ==0.5.0.1
|
||||
|
||||
-- Depending on programs does not work, they are not registered
|
||||
-- We list them to help distro packaging.
|
||||
build-tools:
|
||||
cabal-install ==1.16.0.2,
|
||||
alex ==3.0.5,
|
||||
happy ==1.18.10
|
||||
-- end platform packages
|
||||
-- hscolour ==1.20.3 -- ???
|
||||
-- haddock ==2.13.2 -- need to use the one shipped with ghc
|
||||
|
||||
-- N.B.: The begin/end comment annotations are used to build the source
|
||||
-- installer: Packages that are part of the core are checked at build time.
|
||||
-- Source of packages that are part of the platform are included in the tarball.
|
||||
@ -14,7 +14,6 @@ cabal-version: >=1.8
|
||||
library
|
||||
exposed-modules: Stackage.NarrowDatabase
|
||||
Stackage.LoadDatabase
|
||||
Stackage.HaskellPlatform
|
||||
Stackage.ModuleNameConflict
|
||||
Stackage.Util
|
||||
Stackage.Types
|
||||
|
||||
Loading…
Reference in New Issue
Block a user