Commit 4a594280 authored by Duncan Coutts's avatar Duncan Coutts
Browse files

Undo a simplification in the type of absoluteInstallDirs

Existing Setup scripts use it so we can't change it. Fixes #563.
parent acb4d219
...@@ -128,7 +128,7 @@ generate pkg_descr lbi = ...@@ -128,7 +128,7 @@ generate pkg_descr lbi =
libdir = flat_libdir, libdir = flat_libdir,
datadir = flat_datadir, datadir = flat_datadir,
libexecdir = flat_libexecdir libexecdir = flat_libexecdir
} = absoluteInstallDirs (packageId pkg_descr) lbi NoCopyDest } = absoluteInstallDirs pkg_descr lbi NoCopyDest
InstallDirs { InstallDirs {
bindir = flat_bindirrel, bindir = flat_bindirrel,
libdir = flat_libdirrel, libdir = flat_libdirrel,
......
...@@ -476,7 +476,7 @@ configure (pkg_descr0, pbi) cfg ...@@ -476,7 +476,7 @@ configure (pkg_descr0, pbi) cfg
progSuffix = fromFlag $ configProgSuffix cfg progSuffix = fromFlag $ configProgSuffix cfg
} }
let dirs = absoluteInstallDirs (packageId pkg_descr) lbi NoCopyDest let dirs = absoluteInstallDirs pkg_descr lbi NoCopyDest
relative = prefixRelativeInstallDirs (packageId pkg_descr) lbi relative = prefixRelativeInstallDirs (packageId pkg_descr) lbi
unless (isAbsolute (prefix dirs)) $ die $ unless (isAbsolute (prefix dirs)) $ die $
......
...@@ -96,7 +96,7 @@ install pkg_descr lbi flags = do ...@@ -96,7 +96,7 @@ install pkg_descr lbi flags = do
htmldir = htmlPref, htmldir = htmlPref,
haddockdir = interfacePref, haddockdir = interfacePref,
includedir = incPref}) includedir = incPref})
= absoluteInstallDirs (packageId pkg_descr) lbi copydest = absoluteInstallDirs pkg_descr lbi copydest
--TODO: decide if we need the user to be able to control the libdir --TODO: decide if we need the user to be able to control the libdir
-- for shared libs independently of the one for static libs. If so -- for shared libs independently of the one for static libs. If so
...@@ -159,7 +159,7 @@ install pkg_descr lbi flags = do ...@@ -159,7 +159,7 @@ install pkg_descr lbi flags = do
JHC -> do withLib pkg_descr $ JHC.installLib verbosity libPref buildPref pkg_descr JHC -> do withLib pkg_descr $ JHC.installLib verbosity libPref buildPref pkg_descr
withExe pkg_descr $ JHC.installExe verbosity binPref buildPref (progPrefixPref, progSuffixPref) pkg_descr withExe pkg_descr $ JHC.installExe verbosity binPref buildPref (progPrefixPref, progSuffixPref) pkg_descr
Hugs -> do Hugs -> do
let targetProgPref = progdir (absoluteInstallDirs (packageId pkg_descr) lbi NoCopyDest) let targetProgPref = progdir (absoluteInstallDirs pkg_descr lbi NoCopyDest)
let scratchPref = scratchDir lbi let scratchPref = scratchDir lbi
Hugs.install verbosity libPref progPref binPref targetProgPref scratchPref (progPrefixPref, progSuffixPref) pkg_descr Hugs.install verbosity libPref progPref binPref targetProgPref scratchPref (progPrefixPref, progSuffixPref) pkg_descr
NHC -> do withLib pkg_descr $ NHC.installLib verbosity libPref buildPref (packageId pkg_descr) NHC -> do withLib pkg_descr $ NHC.installLib verbosity libPref buildPref (packageId pkg_descr)
......
...@@ -162,11 +162,11 @@ isInternalPackage pkg_descr pkgid = packageId pkg_descr == pkgid ...@@ -162,11 +162,11 @@ isInternalPackage pkg_descr pkgid = packageId pkg_descr == pkgid
-- Wrappers for a couple functions from InstallDirs -- Wrappers for a couple functions from InstallDirs
-- |See 'InstallDirs.absoluteInstallDirs' -- |See 'InstallDirs.absoluteInstallDirs'
absoluteInstallDirs :: PackageId -> LocalBuildInfo -> CopyDest absoluteInstallDirs :: PackageDescription -> LocalBuildInfo -> CopyDest
-> InstallDirs FilePath -> InstallDirs FilePath
absoluteInstallDirs pkgid lbi copydest = absoluteInstallDirs pkg lbi copydest =
InstallDirs.absoluteInstallDirs InstallDirs.absoluteInstallDirs
pkgid (packageId pkg)
(compilerId (compiler lbi)) (compilerId (compiler lbi))
copydest copydest
(installDirTemplates lbi) (installDirTemplates lbi)
......
...@@ -225,7 +225,7 @@ registerPackageHugs verbosity pkg lib lbi clbi distPref inplace _packageDb = do ...@@ -225,7 +225,7 @@ registerPackageHugs verbosity pkg lib lbi clbi distPref inplace _packageDb = do
when inplace $ die "--inplace is not supported with Hugs" when inplace $ die "--inplace is not supported with Hugs"
installedPkgInfo <- generateRegistrationInfo installedPkgInfo <- generateRegistrationInfo
pkg lib lbi clbi inplace distPref pkg lib lbi clbi inplace distPref
let installDirs = absoluteInstallDirs (packageId pkg) lbi NoCopyDest let installDirs = absoluteInstallDirs pkg lbi NoCopyDest
createDirectoryIfMissingVerbose verbosity True (libdir installDirs) createDirectoryIfMissingVerbose verbosity True (libdir installDirs)
writeFileAtomic (libdir installDirs </> "package.conf") writeFileAtomic (libdir installDirs </> "package.conf")
(showInstalledPackageInfo installedPkgInfo ++ "\n") (showInstalledPackageInfo installedPkgInfo ++ "\n")
...@@ -333,7 +333,7 @@ inplaceInstalledPackageInfo inplaceDir distPref pkg lib lbi clbi = ...@@ -333,7 +333,7 @@ inplaceInstalledPackageInfo inplaceDir distPref pkg lib lbi clbi =
where where
adjustReativeIncludeDirs = map (inplaceDir </>) adjustReativeIncludeDirs = map (inplaceDir </>)
installDirs = installDirs =
(absoluteInstallDirs (packageId pkg) lbi NoCopyDest) { (absoluteInstallDirs pkg lbi NoCopyDest) {
libdir = inplaceDir </> buildDir lbi, libdir = inplaceDir </> buildDir lbi,
datadir = inplaceDir, datadir = inplaceDir,
datasubdir = distPref, datasubdir = distPref,
...@@ -364,7 +364,7 @@ absoluteInstalledPackageInfo pkg lib lbi clbi = ...@@ -364,7 +364,7 @@ absoluteInstalledPackageInfo pkg lib lbi clbi =
| null (installIncludes bi) = [] | null (installIncludes bi) = []
| otherwise = [includedir installDirs] | otherwise = [includedir installDirs]
bi = libBuildInfo lib bi = libBuildInfo lib
installDirs = absoluteInstallDirs (packageId pkg) lbi NoCopyDest installDirs = absoluteInstallDirs pkg lbi NoCopyDest
-- ----------------------------------------------------------------------------- -- -----------------------------------------------------------------------------
...@@ -377,7 +377,7 @@ unregister pkg lbi regFlags = do ...@@ -377,7 +377,7 @@ unregister pkg lbi regFlags = do
verbosity = fromFlag (regVerbosity regFlags) verbosity = fromFlag (regVerbosity regFlags)
packageDb = fromFlagOrDefault (registrationPackageDB (withPackageDB lbi)) packageDb = fromFlagOrDefault (registrationPackageDB (withPackageDB lbi))
(regPackageDB regFlags) (regPackageDB regFlags)
installDirs = absoluteInstallDirs pkgid lbi NoCopyDest installDirs = absoluteInstallDirs pkg lbi NoCopyDest
setupMessage verbosity "Unregistering" pkgid setupMessage verbosity "Unregistering" pkgid
case compilerFlavor (compiler lbi) of case compilerFlavor (compiler lbi) of
GHC -> GHC ->
......
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