From 0d4c1f9dffd76695bd9678966fa2c44b4bb8b16b Mon Sep 17 00:00:00 2001
From: Simon Marlow <marlowsd@gmail.com>
Date: Thu, 23 Oct 2008 14:37:37 +0000
Subject: [PATCH] Make this compile with ghc-6.8.3; update version to 1.0.1.1

---
 System/Process/Internals.hs |  6 +++++-
 process.cabal               | 19 +++++++++++++++++--
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/System/Process/Internals.hs b/System/Process/Internals.hs
index 55c9597b..cb1cc9c9 100644
--- a/System/Process/Internals.hs
+++ b/System/Process/Internals.hs
@@ -58,7 +58,7 @@ import Data.IORef
 import System.IO 	( Handle )
 import System.Exit	( ExitCode )
 import Control.Concurrent
-import Control.Exception.Base ( catchJust, handle )
+import Control.Exception
 import Foreign.C
 import Foreign
 
@@ -494,7 +494,11 @@ findCommandInterpreter = do
 withFilePathException :: FilePath -> IO a -> IO a
 withFilePathException fpath act = handle mapEx act
   where
+#ifdef base_4
     mapEx (IOError h iot fun str _) = ioError (IOError h iot fun str (Just fpath))
+#else
+    mapEx (IOException (IOError h iot fun str _)) = ioError (IOError h iot fun str (Just fpath))
+#endif
 
 #if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
 withCEnvironment :: [(String,String)] -> (Ptr CString  -> IO a) -> IO a
diff --git a/process.cabal b/process.cabal
index a42fe7a7..1bf39f29 100644
--- a/process.cabal
+++ b/process.cabal
@@ -1,5 +1,5 @@
 name:         process
-version:      1.0.1.0
+version:      1.0.1.1
 license:      BSD3
 license-file: LICENSE
 maintainer:   libraries@haskell.org
@@ -17,6 +17,8 @@ extra-tmp-files:
 build-type:    Configure
 cabal-version: >=1.2
 
+flag base4
+
 Library {
   if impl(nhc98) {
     exposed-modules: System.Cmd
@@ -38,6 +40,19 @@ Library {
     if !os(windows)
         build-depends: unix
   }
-  build-depends: base, directory, filepath
+
+  if (flag(base4)) {
+     build-depends: base >= 4 && < 3
+     ghc-options: -Dbase4
+     -- later, we can use the new MIN_VERSION_base() stuff that
+     -- arrived in Cabal-1.6.
+  } else {
+     build-depends: base >= 3 && < 4
+     ghc-options: -Dbase3
+  }
+
+  build-depends: directory >= 1.0 && < 1.1,
+                 filepath  >= 1.1 && < 1.2
+
   extensions: CPP
 }
-- 
GitLab