aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2015-04-03 02:02:44 +0200
committerDaniel Gröber <dxld@darkboxed.org>2015-04-03 02:02:44 +0200
commitb4f8e009213e88e148da497c66453bc3760cc59c (patch)
tree0cdd7f4fef601b691b3b01ce9001d444fe8d2e11
parentb1e488bbb31140ee175405416076d10a0403bd67 (diff)
Fix ghc 7.4
-rw-r--r--.travis.yml2
-rw-r--r--Distribution/Helper.hs5
-rw-r--r--cabal-helper.cabal3
3 files changed, 10 insertions, 0 deletions
diff --git a/.travis.yml b/.travis.yml
index 35d74d1..1448588 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,6 +9,8 @@ install:
- echo $PATH
- which cabal
- cabal install -j --only-dependencies --enable-tests
+ - if [ -n "$(ghc --version | awk '{ print $8 }' | sed -n '/^7.4/p')" ]; then cabal install Cabal --constraint "Cabal == 1.16.*"; fi
+
script:
- touch ChangeLog # Create ChangeLog if we're not on the release branch
diff --git a/Distribution/Helper.hs b/Distribution/Helper.hs
index b06ffe4..1a4bc37 100644
--- a/Distribution/Helper.hs
+++ b/Distribution/Helper.hs
@@ -57,6 +57,7 @@ import Control.Monad.IO.Class
import Control.Monad.State.Strict
import Control.Monad.Reader
import Control.Exception as E
+import Data.Char
import Data.Monoid
import Data.List
import Data.Default
@@ -211,6 +212,10 @@ buildPlatform :: IO String
buildPlatform = do
exe <- findLibexecExe "cabal-helper-wrapper"
dropWhileEnd isSpace <$> readProcess exe ["print-build-platform"] ""
+ where
+ -- dropWhileEnd is not provided prior to base 4.5.0.0.
+ dropWhileEnd :: (a -> Bool) -> [a] -> [a]
+ dropWhileEnd p = foldr (\x xs -> if p x && null xs then [] else x : xs) []
-- | This exception is thrown by all 'runQuery' functions if the internal
-- wrapper executable cannot be found. You may catch this and present the user
diff --git a/cabal-helper.cabal b/cabal-helper.cabal
index 1fbaa63..887a16d 100644
--- a/cabal-helper.cabal
+++ b/cabal-helper.cabal
@@ -21,6 +21,9 @@ description:
Furthermore the wrapper supports one special case namely reading a state
file for Cabal itself. This is needed as Cabal compiles it's Setup.hs using
itself and not using any version of Cabal installed in any package database.
+ .
+ @cabal-helper@ can compile with @Cabal >= 1.14@ but requires @Cabal >= 1.16@
+ at runtime.
license: AGPL-3
license-file: LICENSE