Commit e275a162 authored by Ben Gamari's avatar Ben Gamari 🐢 Committed by Ben Gamari
Browse files

Program.Find: Fix on Win32

ee0ed0b9 added another codepath to
Distribution.Simple.Program.Find for Win32 platforms however did not add
correct imports or a dependency on the Win32 library. Fix this.
parent 4e33454f
...@@ -168,6 +168,10 @@ library ...@@ -168,6 +168,10 @@ library
build-depends: build-depends:
unix >= 2.5 && < 2.8 unix >= 2.5 && < 2.8
if os(windows)
build-depends:
Win32 >= 2.2 && < 2.4
ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs ghc-options: -Wall -fno-ignore-asserts -fwarn-tabs
exposed-modules: exposed-modules:
......
...@@ -49,7 +49,7 @@ import Data.List ...@@ -49,7 +49,7 @@ import Data.List
import Distribution.Compat.Binary import Distribution.Compat.Binary
import GHC.Generics import GHC.Generics
#if defined(mingw32_HOST_OS) #if defined(mingw32_HOST_OS)
import qualified System.Win32 import qualified System.Win32 as Win32
#endif #endif
-- | A search path to use when locating executables. This is analogous -- | A search path to use when locating executables. This is analogous
...@@ -158,8 +158,8 @@ programSearchPathAsPATHVar searchpath = do ...@@ -158,8 +158,8 @@ programSearchPathAsPATHVar searchpath = do
getSystemSearchPath :: IO [FilePath] getSystemSearchPath :: IO [FilePath]
getSystemSearchPath = fmap nub $ do getSystemSearchPath = fmap nub $ do
#if defined(mingw32_HOST_OS) #if defined(mingw32_HOST_OS)
processdir <- liftM takeDirectory (Win32.getModuleFileName Win32.nullHANDLE) processdir <- takeDirectory `fmap` Win32.getModuleFileName Win32.nullHANDLE
currentdir <- getCurrentDirectory currentdir <- Win32.getCurrentDirectory
systemdir <- Win32.getSystemDirectory systemdir <- Win32.getSystemDirectory
windowsdir <- Win32.getWindowsDirectory windowsdir <- Win32.getWindowsDirectory
pathdirs <- FilePath.getSearchPath pathdirs <- FilePath.getSearchPath
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment