aboutsummaryrefslogtreecommitdiff
path: root/CabalHelper
diff options
context:
space:
mode:
Diffstat (limited to 'CabalHelper')
-rw-r--r--CabalHelper/Compiletime/Compat/Environment.hs6
-rw-r--r--CabalHelper/Compiletime/Data.hs3
2 files changed, 8 insertions, 1 deletions
diff --git a/CabalHelper/Compiletime/Compat/Environment.hs b/CabalHelper/Compiletime/Compat/Environment.hs
new file mode 100644
index 0000000..15cf05a
--- /dev/null
+++ b/CabalHelper/Compiletime/Compat/Environment.hs
@@ -0,0 +1,6 @@
+module CabalHelper.Compiletime.Compat.Environment where
+
+import System.Environment
+
+lookupEnv :: String -> IO (Maybe String)
+lookupEnv var = lookup var <$> getEnvironment
diff --git a/CabalHelper/Compiletime/Data.hs b/CabalHelper/Compiletime/Data.hs
index 288094e..9539ef3 100644
--- a/CabalHelper/Compiletime/Data.hs
+++ b/CabalHelper/Compiletime/Data.hs
@@ -27,11 +27,12 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.UTF8 as UTF8
import Language.Haskell.TH
import System.Directory
-import System.Environment.Extra
import System.FilePath
import System.IO.Temp
import Prelude
+import CabalHelper.Compiletime.Compat.Environment
+
withSystemTempDirectoryEnv :: String -> (FilePath -> IO b) -> IO b
withSystemTempDirectoryEnv tpl f = do
m <- liftIO $ lookupEnv "CABAL_HELPER_KEEP_SOURCEDIR"