summaryrefslogtreecommitdiff
path: root/utils/ghc-cabal
diff options
context:
space:
mode:
authorTamar Christina <tamar@zhox.com>2017-10-25 09:30:52 +0100
committerTamar Christina <tamar@zhox.com>2017-10-25 09:30:52 +0100
commitf744261ad25942e8a747821fc468f1a21c9c705c (patch)
treecc9f3ee64c89d699452fec1910702fe2abdbdc71 /utils/ghc-cabal
parent561bdca16e2fe88d0b96fc10098955eabca81bba (diff)
downloadhaskell-f744261ad25942e8a747821fc468f1a21c9c705c.tar.gz
ghc-cabal: Inline removed function from Cabal.
Diffstat (limited to 'utils/ghc-cabal')
-rw-r--r--utils/ghc-cabal/Main.hs9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/ghc-cabal/Main.hs b/utils/ghc-cabal/Main.hs
index e445520c80..4ad1187cf1 100644
--- a/utils/ghc-cabal/Main.hs
+++ b/utils/ghc-cabal/Main.hs
@@ -15,9 +15,10 @@ import Distribution.Simple.GHC
import Distribution.Simple.Program
import Distribution.Simple.Program.HcPkg
import Distribution.Simple.Setup (ConfigFlags(configStripLibs), fromFlag, toFlag)
-import Distribution.Simple.Utils (defaultPackageDesc, writeFileAtomic, toUTF8)
+import Distribution.Simple.Utils (defaultPackageDesc, writeFileAtomic)
import Distribution.Simple.Build (writeAutogenFiles)
import Distribution.Simple.Register
+import Distribution.Utils.String (encodeStringUtf8)
import Distribution.Text
import Distribution.Types.MungedPackageId
import Distribution.Verbosity
@@ -27,6 +28,7 @@ import qualified Distribution.Simple.PackageIndex as PackageIndex
import Control.Exception (bracket)
import Control.Monad
import qualified Data.ByteString.Lazy.Char8 as BS
+import Data.Char (chr)
import Data.List
import Data.Maybe
import System.IO
@@ -456,3 +458,8 @@ generate directory distdir config_args
writeFileUtf8 f txt = withFile f WriteMode $ \hdl -> do
hSetEncoding hdl utf8
hPutStr hdl txt
+
+-- | Was removed from Cabal so inline the old definition since
+-- there isn't a 1-1 replacement for this.
+toUTF8 :: String -> String
+toUTF8 = map (chr . fromIntegral) . encodeStringUtf8