Commit 71875446 authored by ijones's avatar ijones
Browse files

resolve conflicts from henning-thielemann's work. Thanks Henning!

parent d91e251d
......@@ -82,13 +82,17 @@ import Distribution.Simple.Register ( register, unregister,
regScriptLocation, unregScriptLocation
)
import Distribution.Simple.Configure(LocalBuildInfo(..), getPersistBuildConfig, maybeGetPersistBuildConfig,
import Distribution.Simple.Configure(getPersistBuildConfig, maybeGetPersistBuildConfig,
findProgram, configure, writePersistBuildConfig,
localBuildInfoFile)
import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..))
import Distribution.Simple.Install(install)
import Distribution.Simple.Utils (die, currentDir, rawSystemVerbose,
defaultPackageDesc, defaultHookedPackageDesc,
moduleToFilePath, findFile, distPref, srcPref)
moduleToFilePath, findFile,
distPref, srcPref, haddockPref)
#if mingw32_HOST_OS || mingw32_TARGET_OS
import Distribution.Simple.Utils (rawSystemPath)
#endif
......@@ -101,7 +105,7 @@ import System.Directory(removeFile, doesFileExist, doesDirectoryExist)
import Distribution.License
import Control.Monad(when, unless)
import Data.List ( intersperse, unionBy )
import Data.Maybe ( isNothing, isJust, fromJust )
import Data.Maybe ( isJust, fromJust )
import System.IO.Error (try)
import Distribution.GetOpt
......
......@@ -59,9 +59,8 @@ import Distribution.PackageDescription (
PackageDescription(..),
setupMessage, hasLibs, withLib, withExe )
import Distribution.Simple.LocalBuildInfo (
LocalBuildInfo(..), mkLibDir, mkBinDir, mkDataDir, mkProgDir)
import Distribution.Simple.Utils(smartCopySources, copyFileVerbose, mkLibName,
mkProfLibName, mkGHCiLibName, die, rawSystemVerbose)
LocalBuildInfo(..), mkLibDir, mkBinDir, mkDataDir, mkProgDir, mkHaddockDir)
import Distribution.Simple.Utils(copyFileVerbose, die, haddockPref, copyDirectoryRecursiveVerbose)
import Distribution.Compiler (CompilerFlavor(..), Compiler(..))
import Distribution.Setup (CopyFlags(..), CopyDest(..))
......@@ -74,14 +73,8 @@ import qualified Distribution.Simple.JHC as JHC
import qualified Distribution.Simple.Hugs as Hugs
import Control.Monad(when)
import Data.List(any)
import Data.Maybe(fromMaybe)
import Distribution.Compat.Directory(createDirectoryIfMissing, removeDirectoryRecursive,
findExecutable)
import Distribution.Compat.FilePath(splitFileName,joinFileName, dllExtension, exeExtension,
splitFileExt, joinFileExt)
import System.IO.Error(try)
import System.Directory(Permissions(..), getPermissions, setPermissions)
import Distribution.Compat.Directory(createDirectoryIfMissing, doesDirectoryExist)
import Distribution.Compat.FilePath(splitFileName,joinFileName)
#ifdef DEBUG
import HUnit (Test)
......@@ -115,10 +108,10 @@ install pkg_descr lbi (CopyFlags copydest verbose) = do
let binPref = mkBinDir pkg_descr lbi copydest
setupMessage ("Installing: " ++ libPref ++ " & " ++ binPref) pkg_descr
case compilerFlavor (compiler lbi) of
GHC -> do when (hasLibs pkg_descr) (installLibGHC verbose (withPrograms lbi) (withProfLib lbi) (withGHCiLib lbi) libPref buildPref pkg_descr)
installExeGHC verbose binPref buildPref pkg_descr
JHC -> do withLib pkg_descr () $ installLibJHC verbose libPref buildPref pkg_descr
withExe pkg_descr $ installExeJHC verbose binPref buildPref pkg_descr
GHC -> do when (hasLibs pkg_descr) (GHC.installLib verbose (withPrograms lbi) (withProfLib lbi) (withGHCiLib lbi) libPref buildPref pkg_descr)
GHC.installExe verbose binPref buildPref pkg_descr
JHC -> do withLib pkg_descr () $ JHC.installLib verbose libPref buildPref pkg_descr
withExe pkg_descr $ JHC.installExe verbose binPref buildPref pkg_descr
Hugs -> do
let progPref = mkProgDir pkg_descr lbi copydest
let targetProgPref = mkProgDir pkg_descr lbi NoCopyDest
......
......@@ -62,7 +62,8 @@ module Distribution.Simple.Register (
#endif
#endif
import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..), mkLibDir)
import Distribution.Simple.LocalBuildInfo (LocalBuildInfo(..), mkLibDir, mkHaddockDir,
mkIncludeDir)
import Distribution.Compiler (CompilerFlavor(..), Compiler(..))
import Distribution.Setup (RegisterFlags(..), CopyDest(..), userOverride)
import Distribution.PackageDescription (setupMessage, PackageDescription(..),
......@@ -82,7 +83,9 @@ import Distribution.Compat.Directory
(createDirectoryIfMissing,removeDirectoryRecursive,
setPermissions, getPermissions, Permissions(executable)
)
import Distribution.Compat.FilePath (joinFileName)
import Distribution.Compat.FilePath (joinFileName, joinPaths, splitFileName,
isAbsolutePath)
import System.Directory(doesFileExist, removeFile, getCurrentDirectory)
import System.IO.Error (try)
......@@ -246,8 +249,14 @@ mkInstalledPackageInfo pkg_descr lbi inplace = do
let
lib = fromJust (library pkg_descr) -- checked for Nothing earlier
bi = libBuildInfo lib
build_dir = pwd `joinFileName` buildDir lbi
libdir = mkLibDir pkg_descr lbi NoCopyDest
incdir = mkIncludeDir libdir
(absinc,relinc) = partition isAbsolutePath (includeDirs bi)
haddockDir = mkHaddockDir pkg_descr lbi NoCopyDest
haddockFile = joinPaths haddockDir (haddockName pkg_descr)
in
emptyInstalledPackageInfo{
return emptyInstalledPackageInfo{
IPI.package = package pkg_descr,
IPI.license = license pkg_descr,
IPI.copyright = copyright pkg_descr,
......
......@@ -67,6 +67,7 @@ module Distribution.Simple.Utils (
defaultHookedPackageDesc,
findHookedPackageDesc,
distPref,
haddockPref,
srcPref,
#ifdef DEBUG
hunitTests
......@@ -313,12 +314,6 @@ mkProfLibName :: FilePath -- ^file Prefix
-> String
mkProfLibName pref lib = mkLibName pref (lib++"_p")
mkGHCiLibName :: FilePath -- ^file Prefix
-> String -- ^library name.
-> String
mkGHCiLibName pref lib = pref `joinFileName` ("HS" ++ lib ++ ".o")
-- ------------------------------------------------------------
-- * Some Paths
-- ------------------------------------------------------------
......@@ -328,6 +323,9 @@ distPref = "dist"
srcPref :: FilePath
srcPref = distPref `joinFileName` "src"
haddockPref :: FilePath
haddockPref = foldl1 joinPaths [distPref, "doc", "html"]
-- ------------------------------------------------------------
-- * temporary file names
-- ------------------------------------------------------------
......
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