aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gröber <dxld@darkboxed.org>2015-06-09 00:03:46 +0200
committerDaniel Gröber <dxld@darkboxed.org>2015-06-09 00:03:46 +0200
commitf69f35bc4af49b3a25ed6407375c03f5b7569432 (patch)
tree6b9ed825f80e3409d4f1415ca32531d59394a1f4
parent15e1b373dfa628786465044294b30ca02593bd41 (diff)
Don't rely on the locale at build time
-rw-r--r--CabalHelper/Data.hs8
-rw-r--r--cabal-helper.cabal1
2 files changed, 6 insertions, 3 deletions
diff --git a/CabalHelper/Data.hs b/CabalHelper/Data.hs
index 06539c7..2ab6ea5 100644
--- a/CabalHelper/Data.hs
+++ b/CabalHelper/Data.hs
@@ -20,6 +20,8 @@ module CabalHelper.Data where
import Control.Monad
import Data.Functor
+import qualified Data.ByteString as BS
+import qualified Data.ByteString.UTF8 as UTF8
import Language.Haskell.TH
import System.FilePath
import System.Directory
@@ -34,7 +36,7 @@ withHelperSources action = withSystemTempDirectory "caba-helper" $ \dir -> do
sourceFiles :: [(FilePath, String)]
sourceFiles =
- [ ("Main.hs", $(LitE . StringL <$> runIO (readFile "CabalHelper/Main.hs")))
- , ("Common.hs", $(LitE . StringL <$> runIO (readFile "CabalHelper/Common.hs")))
- , ("Types.hs", $(LitE . StringL <$> runIO (readFile "CabalHelper/Types.hs")))
+ [ ("Main.hs", $(LitE . StringL <$> runIO (UTF8.toString <$> BS.readFile "CabalHelper/Main.hs")))
+ , ("Common.hs", $(LitE . StringL <$> runIO (UTF8.toString <$> BS.readFile "CabalHelper/Common.hs")))
+ , ("Types.hs", $(LitE . StringL <$> runIO (UTF8.toString <$> BS.readFile "CabalHelper/Types.hs")))
]
diff --git a/cabal-helper.cabal b/cabal-helper.cabal
index af68fc0..3b1133e 100644
--- a/cabal-helper.cabal
+++ b/cabal-helper.cabal
@@ -73,6 +73,7 @@ Executable cabal-helper-wrapper
, transformers
, template-haskell
, temporary
+ , utf8-string
Test-Suite spec