on master help sign in
Conditionally import setEnv on old GHC

Comment on the regex-compat dependency

commite8c6f5c037a2810e834e43f96e271aec65389000 authorNiklas Larsson <niklas@mm.st> dateSun 24 Jan 2016, 14:12 (11 years ago) parentd1144dc
2 files changed+15−1
idris.cabal+4−1 test/runtest.hs+11
idris.cabal+4−1
@@ -965,7 +965,6 @@ Library
965965 , parsers >= 0.9 && < 0.13
966966 , pretty < 1.2
967967 , process < 1.3
968− , regex-compat < 1.0
969968 , split < 0.3
970969 , text >=1.2.1.0 && < 1.3
971970 , time >= 1.4 && < 1.6
@@ -981,6 +980,10 @@ Library
981980 , safe
982981 , fsnotify < 2.2
983982 , async < 2.1
983+
984+ -- regex-compat needed for the test/runtest.hs script, which isn't built by cabal
985+ build-depends: regex-compat < 1.0
986+
984987 -- zlib >= 0.6.1 is broken with GHC < 7.10.3
985988 if impl(ghc < 7.10.3)
986989 build-depends: zlib < 0.6.1
test/runtest.hs+11
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12module Main where
23
34import Control.Monad
@@ -14,6 +15,16 @@ import System.IO
1415import System.Process
1516import Text.Regex
1617
18+-- Because GHC earlier than 7.8 lacks setEnv
19+-- Install the setenv package on Windows.
20+#if __GLASGOW_HASKELL__ < 708
21+#ifndef mingw32_HOST_OS
22+import System.Posix.Env(setEnv)
23+#else
24+import System.SetEnv(setEnv)
25+#endif
26+#endif
27+
1728data Flag = Update | Diff | ShowOutput | Quiet | Time deriving (Eq, Show, Ord)
1829
1930type Flags = S.Set Flag