git.iko.soy/typeable/pandoc
on master help sign in
Added 'utf8' configuration flag to pandoc.cabal.

This makes it possible to compile pandoc without utf8, using '-f-utf8' at configuration time. Utf-8 support is still the default. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1373 788f1e2b-df1e-0410-8736-df70ead52e1b

commited4b00399778204bc589135e005620c40c988258 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateSun 3 Aug 2008, 08:43 (18 years ago) parentb63d1c5
3 files changed+25−9
Main.hs+8−4 Text/Pandoc/ODT.hs+8−4 pandoc.cabal+9−1
Main.hs+8−4
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-
23Copyright (C) 2006-8 John MacFarlane <jgm@berkeley.edu>
34
@@ -37,12 +38,15 @@ import System.Environment ( getArgs, getProgName, getEnvironment )
3738import System.Exit ( exitWith, ExitCode (..) )
3839import System.FilePath ( takeExtension, takeDirectory )
3940import System.Console.GetOpt
40−import Prelude hiding ( putStrLn, writeFile, readFile, getContents )
41−import System.IO ( stdout, stderr )
42−import System.IO.UTF8
4341import Data.Maybe ( fromMaybe )
4442import Data.Char ( toLower )
45−import Control.Monad ( (>>=) )
43+import Prelude hiding ( putStrLn, writeFile, readFile, getContents )
44+#ifdef UTF_8
45+import System.IO.UTF8
46+import System.IO ( stdout, stderr )
47+#else
48+import System.IO
49+#endif
4650
4751copyrightMessage :: String
4852copyrightMessage = "\nCopyright (C) 2006-7 John MacFarlane\n" ++
Text/Pandoc/ODT.hs+8−4
@@ -1,4 +1,4 @@
1−{-# LANGUAGE TemplateHaskell #-}
1+{-# LANGUAGE TemplateHaskell, CPP #-}
22{-
33Copyright (C) 2008 John MacFarlane <jgm@berkeley.edu>
44
@@ -32,9 +32,6 @@ module Text.Pandoc.ODT ( saveOpenDocumentAsODT ) where
3232import Text.Pandoc.TH ( binaryContentsOf )
3333import Data.Maybe ( fromJust )
3434import Data.List ( partition, intersperse )
35−import Prelude hiding ( writeFile, readFile, getContents )
36−import System.IO.UTF8
37−import System.IO ( stderr )
3835import System.Directory
3936import System.FilePath ( (</>), takeDirectory, takeFileName, splitDirectories )
4037import System.Process ( runProcess, waitForProcess )
@@ -45,6 +42,13 @@ import Text.Pandoc.Shared ( withTempDir )
4542import Network.URI ( isURI )
4643import qualified Data.ByteString as B ( writeFile, pack )
4744import Data.ByteString.Internal ( c2w )
45+import Prelude hiding ( writeFile, readFile )
46+#ifdef UTF_8
47+import System.IO.UTF8
48+import System.IO ( stderr )
49+#else
50+import System.IO
51+#endif
4852
4953-- | Produce an ODT file from OpenDocument XML.
5054saveOpenDocumentAsODT :: FilePath -- ^ Pathname of ODT file to be produced.
pandoc.cabal+9−1
@@ -64,6 +64,9 @@ Flag executable
6464Flag library
6565 Description: Build the pandoc library.
6666 Default: True
67+Flag utf8
68+ Description: Compile in support for UTF-8 input and output.
69+ Default: True
6770
6871Library
6972 if flag(splitBase)
@@ -73,7 +76,10 @@ Library
7376 if flag(highlighting)
7477 Build-depends: highlighting-kate
7578 cpp-options: -DHIGHLIGHTING
76− Build-Depends: parsec < 3, xhtml, mtl, network, filepath, process, directory, utf8-string,
79+ if flag(utf8)
80+ Build-depends: utf8-string
81+ cpp-options: -DUTF_8
82+ Build-Depends: parsec < 3, xhtml, mtl, network, filepath, process, directory,
7783 template-haskell, bytestring
7884 Hs-Source-Dirs: .
7985 Exposed-Modules: Text.Pandoc,
@@ -125,6 +131,8 @@ Executable pandoc
125131 Ghc-Options: -O2 -Wall -threaded
126132 Ghc-Prof-Options: -auto-all
127133
134+ if flag(utf8)
135+ cpp-options: -DUTF_8
128136 if flag(executable)
129137 Buildable: True
130138 else