Commit df8ed61d authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Portability fixes to allow building with ghc-6.4 and ghc-6.6

parent bd4e1621
......@@ -14,11 +14,8 @@ module Hackage.List
( list -- :: ConfigFlags -> [UnresolvedDependency] -> IO ()
) where
import Text.Regex
import Data.Maybe (isJust)
import Data.List (nubBy, sortBy, groupBy, intersperse)
import Data.List (nubBy, sortBy, groupBy, intersperse, isPrefixOf, tails)
import Data.Char as Char (toLower)
import Data.Ord (comparing)
import Distribution.Package
import Distribution.PackageDescription
import Distribution.Version (showVersion)
......@@ -59,3 +56,9 @@ showPkgVersions pkgs =
pkg = last pkgs
versions = map (showVersion . pkgVersion . package) pkgs
padTo n s = s ++ (replicate (n - length s) ' ')
comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering
comparing p x y = compare (p x) (p y)
isInfixOf :: String -> String -> Bool
isInfixOf needle haystack = any (isPrefixOf needle) (tails haystack)
......@@ -20,6 +20,8 @@ flag old-base
description: Old, monolithic base
default: False
flag bytestring-in-base
Executable cabal
Main-Is: Main.hs
Ghc-Options: -Wall
......@@ -38,11 +40,15 @@ Executable cabal
Hackage.Update
Hackage.Utils
build-depends: network, regex-compat, Cabal>=1.2,
zlib >= 0.3, HTTP >= 3000.0 && < 3000.1, filepath >= 1.0
build-depends: Cabal >= 1.2, filepath >= 1.0, network,
zlib >= 0.3, HTTP >= 3000.0 && < 3000.1
if flag(old-base)
build-depends: base < 3
else
build-depends: base >= 3, process, directory, pretty
if flag(old-base) {
build-depends: base == 2.0 || == 2.1.1
} else {
build-depends: base >= 2.1, process, directory, pretty, bytestring >= 0.9
}
if flag(bytestring-in-base)
build-depends: base >= 2.0 && < 2.2
else
build-depends: base < 2.0 || >= 3.0, bytestring >= 0.9
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment