X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=utils%2Fghc-cabal%2Fghc-cabal.hs;h=24b25b144a567f2f6067d65d889db4650f41c1e2;hb=8bf9fcc6529cac5fd4699909757b8e094118e5e4;hp=c19217e5e073496b1c3abdaa59c07e258fd1525e;hpb=71dcc642edcfc3bfeef2619d66183cc08ae90a43;p=ghc-hetmet.git diff --git a/utils/ghc-cabal/ghc-cabal.hs b/utils/ghc-cabal/ghc-cabal.hs index c19217e..24b25b1 100644 --- a/utils/ghc-cabal/ghc-cabal.hs +++ b/utils/ghc-cabal/ghc-cabal.hs @@ -14,6 +14,7 @@ import Distribution.Simple.Utils (defaultPackageDesc, withTempFile) import Distribution.Simple.Build (writeAutogenFiles) import Distribution.Simple.Register (writeInstalledConfig) import Distribution.Simple.PackageIndex +import Distribution.System import Distribution.Text import Distribution.Verbosity import qualified Distribution.InstalledPackageInfo as Installed @@ -108,13 +109,12 @@ doInstall ghcpkg ghcpkgconf directory distDir myDestDir myPrefix myLibdir myDocd defaultMainWithHooksArgs hooks ("register" : "--builddir" : distDir : args) where hooks = userHooks { - copyHook = modHook (copyHook userHooks), + copyHook = noGhcPrimHook (modHook (copyHook userHooks)), regHook = modHook (regHook userHooks) } - modHook f pd lbi us flags - = let - pd' + noGhcPrimHook f pd lbi us flags + = let pd' | packageName pd == PackageName "ghc-prim" = case library pd of Just lib -> @@ -125,7 +125,9 @@ doInstall ghcpkg ghcpkgconf directory distDir myDestDir myPrefix myLibdir myDocd Nothing -> error "Expected a library, but none found" | otherwise = pd - idts = installDirTemplates lbi + in f pd' lbi us flags + modHook f pd lbi us flags + = let idts = installDirTemplates lbi idts' = idts { prefix = toPathTemplate myPrefix, libdir = toPathTemplate myLibdir, libsubdir = toPathTemplate "$pkgid", @@ -146,7 +148,7 @@ doInstall ghcpkg ghcpkgconf directory distDir myDestDir myPrefix myLibdir myDocd installDirTemplates = idts', withPrograms = progs' } - in f pd' lbi' us flags + in f pd lbi' us flags generate :: [String] -> FilePath -> FilePath -> IO () generate config_args distdir directory @@ -170,7 +172,8 @@ generate config_args distdir directory -- Sigh, haskeline proper uses stuff in Setup.hs to handle whether -- or not -liconv is used. We don't use Setup.hs, so we replicate -- what it does here. We should do this better somehow. - when (display (pkgName (package pd0)) == "haskeline") $ + when ((display (pkgName (package pd0)) == "haskeline") && + (buildOS /= Windows)) $ case library pd0 of Nothing -> fail "Can't happen: No haskeline library" Just lib -> do @@ -179,7 +182,7 @@ generate config_args distdir directory maybeSetLibiconv verbosity (libBuildInfo lib) lbi hooked_bi <- - if (buildType pd0 == Just Configure) + if (buildType pd0 == Just Configure) || (buildType pd0 == Just Custom) then do maybe_infoFile <- defaultHookedPackageDesc case maybe_infoFile of