diff --git a/Setup.hs b/Setup.hs index 61770a6..b51e092 100644 --- a/Setup.hs +++ b/Setup.hs @@ -2,7 +2,7 @@ import Control.Monad (void, when) import Distribution.Simple import Distribution.Simple.Setup (BuildFlags, fromFlagOrDefault, buildDistPref) import Distribution.PackageDescription (HookedBuildInfo, emptyHookedBuildInfo) -import System.Cmd (system) +import System.Process (system) import System.Directory (doesFileExist, createDirectoryIfMissing) import System.FilePath (()) @@ -15,15 +15,17 @@ maybeRunC2HS :: Args -> BuildFlags -> IO HookedBuildInfo maybeRunC2HS _args flags = do chiExists <- doesFileExist chiFile when (not chiExists) $ do - let c2hs_args = "--output-dir=" ++ buildDir ++ - " --include=" ++ buildDir ++ - " --cppopts=-Iinclude --cppopts=-U__BLOCKS__" + let c2hs_args = ["c2hs", + "--output-dir=" ++ buildDir, + "--include=" ++ buildDir, + "--cppopts=-Iinclude --cppopts=-U__BLOCKS__", + chsFile] createDirectoryIfMissing True internalDir - void $ system $ "c2hs " ++ c2hs_args ++ chsFile + void $ system $ unwords c2hs_args return emptyHookedBuildInfo where distDir = fromFlagOrDefault "dist" (buildDistPref flags) buildDir = distDir "build" internalDir = buildDir "Foreign/OpenCL/Bindings/Internal" chiFile = internalDir "Types.chi" - chsFile = internalDir "Types.chs" + chsFile = "Foreign/OpenCL/Bindings/Internal/Types.chs" diff --git a/hopencl.cabal b/hopencl.cabal index af7dfc4..2f81a76 100644 --- a/hopencl.cabal +++ b/hopencl.cabal @@ -33,7 +33,7 @@ License-file: LICENSE Author: Martin Dybdal Maintainer: Martin Dybdal Copyright: Copyright (c) 2011. Martin Dybdal, HIPERFIT research center, University of Copenhagen - + Tested-with: GHC == 7.0.3 Build-type: Custom Cabal-version: >= 1.10 @@ -118,3 +118,6 @@ Test-suite unit Source-repository head type: git location: http://github.com/HIPERFIT/hopencl + +Custom-setup + setup-depends: Cabal, base, filepath, directory, process