Commit 9ab102e6 authored by ijones's avatar ijones
Browse files

Switched Cabal to new Setup.description file

- this caused a problem since the parser doesn't accpet HUnit-1.0 as a
  package name.  That broke make-install.

  - The almost-correct behavior was to fix the version within Configure
    if they specify an exact version dependency.

    - But the question is, why have I encoded the version into the name
      string for ghc-pkg?  Shouldn't I remove this?  Was it to simulate
        version dependencies since ghc-pkg doesn't do this yet?

	- Anyway,  make install works now.
parent e5e5bca9
......@@ -58,7 +58,7 @@ import Distribution.Package(PackageDescription(..), emptyPackageDescription,
import Distribution.Simple.Utils (die, setupMessage,
findBinary, splitFilenameDir)
import Distribution.Package ( PackageIdentifier )
import Distribution.Version (Version(..))
import Distribution.Version (Version(..), VersionRange(..))
import System.IO hiding (catch)
import System.Directory
......@@ -129,6 +129,12 @@ configure pkg_descr (maybe_hc_flavor, maybe_hc_path, maybe_prefix)
-- |Converts build dependencies to real dependencies. FIX: doesn't
-- set any version information.
buildDepToDep :: Dependency -> PackageIdentifier
-- if they specify the exact version, use that:
buildDepToDep (Dependency s (ThisVersion v)) = PackageIdentifier s v
-- otherwise, calculate it from the installed module. FIX: not
-- implemented because HC-PKG doesn't yet do this.
buildDepToDep (Dependency s _) = PackageIdentifier s (Version [] [])
system_default_prefix :: PackageDescription -> String
......
......@@ -29,6 +29,7 @@ clean:
-rm -f Distribution/*.{o,hi} Distribution/Simple/*.{o,hi}
-rm -f library-infrastructure--darcs.tar.gz
-rm -rf setup *.{o,hi} moduleTest dist installed-pkg-config
-rm -f hunit-stamp hunitInstall-stamp
remove:
-ghc-pkg $(GHCPKGFLAGS) -r Cabal-0.1
......
PackageDescription {package = PackageIdentifier {pkgName = "Cabal",
pkgVersion = Version {versionBranch = [0,1],
versionTags = []}},
license = AllRightsReserved,
copyright = "",
maintainer = "",
stability = "",
buildDepends = [Dependency "haskell-src" AnyVersion,
Dependency "HUnit-1.0" AnyVersion],
allModules = ["Distribution.Package","Distribution.Version",
"Distribution.Misc","Distribution.Setup",
"Distribution.InstalledPackageInfo",
"Distribution.Make","Distribution.Simple",
"Distribution.Simple.Build",
"Distribution.Simple.Install","Distribution.Simple.SrcDist",
"Distribution.Simple.Configure","Distribution.Simple.Utils",
"Distribution.Simple.Register",
"Distribution.Simple.GHCPackageConfig",
"Distribution.GetOpt"],
mainModules = [],
cSources = [],
hsSourceDir = ".",
exposedModules = [],
extensions = [],
extraLibs = [],
includeDirs = [],
includes = [],
options = []
}
Name: Cabal
Version: 0.1
License: AllRightsReserved
build-depends: haskell-src, HUnit==1.0
Modules: Distribution.Package, Distribution.Version,
Distribution.Misc, Distribution.Setup,
Distribution.InstalledPackageInfo,
Distribution.Make, Distribution.Simple,
Distribution.Simple.Build,
Distribution.Simple.Install, Distribution.Simple.SrcDist,
Distribution.Simple.Configure, Distribution.Simple.Utils,
Distribution.Simple.Register,
Distribution.Simple.GHCPackageConfig,
Distribution.GetOpt
......@@ -4,29 +4,5 @@
> import Distribution.Simple
> pkg_descr = emptyPackageDescription {
> package = PackageIdentifier "Cabal" (Version [0,1] []),
> allModules = ["Distribution.Package",
> "Distribution.Version",
> "Distribution.Misc",
> "Distribution.Setup",
> "Distribution.InstalledPackageInfo",
> "Distribution.Make",
>
> "Distribution.Simple",
> "Distribution.Simple.Build",
> "Distribution.Simple.Install",
> "Distribution.Simple.SrcDist",
> "Distribution.Simple.Configure",
> "Distribution.Simple.Utils",
> "Distribution.Simple.Register",
> "Distribution.Simple.GHCPackageConfig",
> "Distribution.GetOpt"],
>
> buildDepends = [Dependency "haskell-src" AnyVersion,
> Dependency "HUnit-1.0" AnyVersion
> ]
> }
> main :: IO ()
> main = defaultMain
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