From f72e3b58e8edd9d81c982ec9e9c54fbc0ba94dcd Mon Sep 17 00:00:00 2001
From: Jesse Rosenthal <jrosenthal@jhu.edu>
Date: Thu, 1 Sep 2016 06:28:55 -0400
Subject: [PATCH] Remove directory compat

directory 1.1 depends on base 4.5 (ghc 7.4) which we are no longer
supporting. So we don't have to use a compatibility layer for it.
---
 pandoc.cabal                        |  3 +--
 src/Text/Pandoc/Compat/Directory.hs | 21 ---------------------
 src/Text/Pandoc/Readers/Txt2Tags.hs |  2 +-
 3 files changed, 2 insertions(+), 24 deletions(-)
 delete mode 100644 src/Text/Pandoc/Compat/Directory.hs

diff --git a/pandoc.cabal b/pandoc.cabal
index 6d891e625..049ce1191 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -416,7 +416,6 @@ Library
                    Text.Pandoc.Highlighting,
                    Text.Pandoc.Compat.Time,
                    Text.Pandoc.Compat.TagSoupEntity,
-                   Text.Pandoc.Compat.Directory,
                    Paths_pandoc
 
   Buildable:       True
@@ -425,7 +424,7 @@ Executable pandoc
   Build-Depends: pandoc,
                  pandoc-types >= 1.16 && < 1.17,
                  base >= 4.2 && <5,
-                 directory >= 1 && < 1.3,
+                 directory >= 1.2 && < 1.3,
                  filepath >= 1.1 && < 1.5,
                  text >= 0.11 && < 1.3,
                  bytestring >= 0.9 && < 0.11,
diff --git a/src/Text/Pandoc/Compat/Directory.hs b/src/Text/Pandoc/Compat/Directory.hs
deleted file mode 100644
index 61dd5c525..000000000
--- a/src/Text/Pandoc/Compat/Directory.hs
+++ /dev/null
@@ -1,21 +0,0 @@
-{-# LANGUAGE CPP #-}
-module Text.Pandoc.Compat.Directory ( getModificationTime )
-       where
-
-#if MIN_VERSION_directory(1,2,0)
-import System.Directory
-
-
-#else
-import qualified System.Directory as S
-import Data.Time.Clock (UTCTime)
-import Data.Time.Clock.POSIX
-import System.Time
-
-getModificationTime :: FilePath -> IO UTCTime
-getModificationTime fp = convert `fmap` S.getModificationTime fp
-    where
-      convert (TOD x _) = posixSecondsToUTCTime (realToFrac x)
-
-#endif
-
diff --git a/src/Text/Pandoc/Readers/Txt2Tags.hs b/src/Text/Pandoc/Readers/Txt2Tags.hs
index 6fef73f71..0aafc83c7 100644
--- a/src/Text/Pandoc/Readers/Txt2Tags.hs
+++ b/src/Text/Pandoc/Readers/Txt2Tags.hs
@@ -49,7 +49,7 @@ import Control.Monad.Reader (Reader, runReader, asks)
 import Text.Pandoc.Error
 
 import Data.Time.LocalTime (getZonedTime)
-import Text.Pandoc.Compat.Directory(getModificationTime)
+import System.Directory(getModificationTime)
 import Data.Time.Format (formatTime)
 import Text.Pandoc.Compat.Time (defaultTimeLocale)
 import System.IO.Error (catchIOError)