diff --git a/System/Process/Internals.hs b/System/Process/Internals.hs index 55c9597b38661bbe9c0ecfab1f3374f8b79ccddd..cb1cc9c905116fd3ba0e2aa3ce260de1dc6f9a5e 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 a42fe7a787c4e798d0976c2695cfe1ef3d4eb1f2..1bf39f29de6eb0793711c1d2577e67450d97d15a 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 }