Commit fc0a8d02 authored by ijones's avatar ijones
Browse files

fixed ghc-pkg versioned depends bug

Fixed bug for ghc < 6.3 where call to ghc-pkg during configure step
was unconditional.  Now only call ghc-pkg to get versioned
dependencies if >= 6.3. revived buildDepToDep as setDepByVersion,
which sets the exact version number if supplied by the package
description in any case where we can't query the HC-pkg system.

minor fix to withHooks test for hugs
parent 34a7fc39
......@@ -73,7 +73,7 @@ import Distribution.PackageDescription(
PackageDescription(..), Library(..),
BuildInfo(..), Executable(..), setupMessage)
import Distribution.Simple.Utils (die, withTempFile,maybeExit)
import Distribution.Version (Version(..), Dependency(..),
import Distribution.Version (Version(..), Dependency(..), VersionRange(ThisVersion),
parseVersion, showVersion, withinRange,
......@@ -167,11 +167,10 @@ configure pkg_descr cfg
reportProgram "hsc2hs" hsc2hs
reportProgram "cpphs" cpphs
-- FIXME: currently only GHC has hc-pkg
dep_pkgs <- if f' == GHC then do
dep_pkgs <- if f' == GHC && ver >= Version [6,3] [] then do
ipkgs <- getInstalledPackages comp (configUser cfg)
mapM (configDependency ipkgs) (buildDepends pkg_descr)
else return [PackageIdentifier pname (Version [] []) |
Dependency pname _ <- buildDepends pkg_descr]
else return $ map setDepByVersion (buildDepends pkg_descr)
return LocalBuildInfo{prefix=pref, compiler=comp,
buildDir="dist" `joinFileName` "build",
......@@ -180,6 +179,17 @@ configure pkg_descr cfg
withHsc2hs=hsc2hs, withCpphs=cpphs
-- |Converts build dependencies to a versioned dependency. only sets
-- version information for exact versioned dependencies.
setDepByVersion :: Dependency -> PackageIdentifier
-- if they specify the exact version, use that:
setDepByVersion (Dependency s (ThisVersion v)) = PackageIdentifier s v
-- otherwise, just set it to empty
setDepByVersion (Dependency s _) = PackageIdentifier s (Version [] [])
-- |Return the explicit path if given, otherwise look for the program
-- name in the path.
......@@ -9,10 +9,6 @@
unpreprocessed and the preprocessed sources in the source tarball?
** Better way to find 'tar'; is there a library? what does darcs do?
* buildDepToDep in Configure doesn't set version dependency
* Write tests for hugs
* Write semantic checker for package description file. start w/
sanity checker. give error if buildInfo field given when no
exposed or hidden modules for a library.
......@@ -279,7 +279,7 @@ tests currDir comp compConf = [
,TestLabel ("package withHooks: "++compIdent) $ TestCase $
do setCurrentDirectory $ (testdir `joinFileName` "withHooks")
assertCmd ("./setup configure --prefix=,tmp --woohoo " ++ compFlag)
assertCmd' compCmd ("configure --prefix=,tmp --woohoo " ++ compFlag)
"configure returned error code"
Supports Markdown
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