Cabal 1.4.0.1 → 1.4.0.2
raw patch · 13 files changed
+118/−36 lines, 13 files
Files
- Cabal.cabal +2/−2
- Distribution/Simple.hs +3/−1
- Distribution/Simple/Build.hs +6/−6
- Distribution/Simple/Configure.hs +4/−2
- Distribution/Simple/GHC.hs +25/−8
- Distribution/Simple/Haddock.hs +1/−1
- Distribution/Simple/NHC.hs +1/−1
- Distribution/Simple/PreProcess.hs +27/−6
- Distribution/Simple/Register.hs +9/−3
- Distribution/Simple/Setup.hs +2/−2
- Distribution/Simple/SrcDist.hs +14/−1
- README +12/−3
- changelog +12/−0
Cabal.cabal view
@@ -1,5 +1,5 @@ Name: Cabal-Version: 1.4.0.1+Version: 1.4.0.2 Copyright: 2003-2006, Isaac Jones 2005-2008, Duncan Coutts License: BSD3@@ -44,7 +44,7 @@ Build-Depends: filepath >= 1 && < 1.2 GHC-Options: -Wall- CPP-Options: "-DCABAL_VERSION=1,4,0,1"+ CPP-Options: "-DCABAL_VERSION=1,4,0,2" nhc98-Options: -K4M Exposed-Modules:
Distribution/Simple.hs view
@@ -245,8 +245,10 @@ buildAction hooks flags args = do let distPref = fromFlag $ buildDistPref flags lbi <- getBuildConfigIfUpToDate distPref- let progs = foldr (uncurry userSpecifyArgs)+ let progs = foldl userSpecifyArgs' (withPrograms lbi) (buildProgramArgs flags)+ where userSpecifyArgs' conf (prog, args') =+ userSpecifyArgs prog args' conf hookedAction preBuild buildHook postBuild (return lbi { withPrograms = progs }) hooks flags args
Distribution/Simple/Build.hs view
@@ -164,8 +164,7 @@ | isHugs = "import System.Environment\n" | otherwise = "import Foreign\n"++- "import Foreign.C\n"++- "import Data.Maybe\n"+ "import Foreign.C\n" header = pragmas++@@ -202,6 +201,7 @@ " dir <- getDataDir\n"++ " return (dir ++ "++path_sep++" ++ name)\n" | otherwise =+ "\nprefix, bindirrel :: FilePath" ++ "\nprefix = " ++ show flat_prefix ++ "\nbindirrel = " ++ show (fromJust flat_bindirrel) ++ "\n\n"++@@ -325,15 +325,15 @@ "splitFileName p = (reverse (path2++drive), reverse fname)\n"++ " where\n"++ " (path,drive) = case p of\n"++- " (c:':':p) -> (reverse p,[':',c])\n"++- " _ -> (reverse p,\"\")\n"+++ " (c:':':p') -> (reverse p',[':',c])\n"+++ " _ -> (reverse p ,\"\")\n"++ " (fname,path1) = break isPathSeparator path\n"++ " path2 = case path1 of\n"++ " [] -> \".\"\n"++ " [_] -> path1 -- don't remove the trailing slash if \n"++ " -- there is only one character\n"++- " (c:path) | isPathSeparator c -> path\n"++- " _ -> path1\n"+++ " (c:path') | isPathSeparator c -> path'\n"+++ " _ -> path1\n"++ "\n"++ "pathSeparator :: Char\n"++ (case buildOS of
Distribution/Simple/Configure.hs view
@@ -269,9 +269,11 @@ createDirectoryIfMissingVerbose (lessVerbose verbosity) True distPref let programsConfig = - flip (foldr (uncurry userSpecifyArgs)) (configProgramArgs cfg)- . flip (foldr (uncurry userSpecifyPath)) (configProgramPaths cfg)+ flip (foldl userSpecifyArgs') (configProgramArgs cfg)+ . flip (foldl userSpecifyPath') (configProgramPaths cfg) $ configPrograms cfg+ userSpecifyArgs' conf (prog, args) = userSpecifyArgs prog args conf+ userSpecifyPath' conf (prog, path) = userSpecifyPath prog path conf userInstall = fromFlag (configUserInstall cfg) defaultPackageDB | userInstall = UserPackageDB | otherwise = GlobalPackageDB
Distribution/Simple/GHC.hs view
@@ -593,6 +593,11 @@ ghcOptions :: LocalBuildInfo -> BuildInfo -> FilePath -> [String] ghcOptions lbi bi odir = ["-hide-all-packages"]+ ++ (case withPackageDB lbi of+ GlobalPackageDB -> ["-no-user-package-conf"]+ UserPackageDB -> []+ SpecificPackageDB db -> ["-no-user-package-conf"+ ,"-package-conf", db]) ++ (if splitObjs lbi then ["-split-objs"] else []) ++ ["-i"] ++ ["-i" ++ odir]@@ -625,7 +630,7 @@ in (odir, ghcCcOptions lbi bi odir- ++ (if verbosity > deafening then ["-v"] else [])+ ++ (if verbosity >= deafening then ["-v"] else []) ++ ["-c",filename]) @@ -722,9 +727,19 @@ stripExe :: Verbosity -> LocalBuildInfo -> FilePath -> FilePath -> IO () stripExe verbosity lbi name path = when (stripExes lbi) $ case lookupProgram stripProgram (withPrograms lbi) of- Just strip -> rawSystemProgram verbosity strip [path]- Nothing -> warn verbosity $ "Unable to strip executable '" ++ name+ Just strip -> rawSystemProgram verbosity strip args+ Nothing -> unless (buildOS == Windows) $+ -- Don't bother warning on windows, we don't expect them to+ -- have the strip program anyway.+ warn verbosity $ "Unable to strip executable '" ++ name ++ "' (missing the 'strip' program)"+ where+ args = path : case buildOS of+ OSX -> ["-x"] -- By default, stripping the ghc binary on at least+ -- some OS X installations causes:+ -- HSbase-3.0.o: unknown symbol `_environ'"+ -- The -x flag fixes that.+ _ -> [] -- |Install for ghc, .hi, .a and, if --with-ghci given, .o installLib :: Verbosity -- ^verbosity@@ -734,7 +749,7 @@ -> FilePath -- ^Build location -> PackageDescription -> IO () installLib verbosity lbi targetDir dynlibTargetDir builtDir- pkg@PackageDescription{library=Just _} = do+ pkg@PackageDescription{library=Just lib} = do -- copy .hi files over: let copyModuleFiles ext = smartCopySources verbosity [builtDir] targetDir (libModules pkg) [ext]@@ -760,10 +775,12 @@ pkgid = packageId pkg copy src dst n = copyFileVerbose verbosity (src </> n) (dst </> n) - ifVanilla = when (withVanillaLib lbi)- ifProf = when (withProfLib lbi)- ifGHCi = when (withGHCiLib lbi)- ifShared = when (withSharedLib lbi)+ hasLib = not $ null (libModules pkg)+ && null (cSources (libBuildInfo lib))+ ifVanilla = when (hasLib && withVanillaLib lbi)+ ifProf = when (hasLib && withProfLib lbi)+ ifGHCi = when (hasLib && withGHCiLib lbi)+ ifShared = when (hasLib && withSharedLib lbi) installLib _ _ _ _ _ PackageDescription{library=Nothing} = die $ "Internal Error. installLibGHC called with no library."
Distribution/Simple/Haddock.hs view
@@ -154,7 +154,7 @@ let cssFileFlag = case flagToMaybe $ haddockCss flags of Nothing -> [] Just cssFile -> ["--css=" ++ cssFile]- let verboseFlags = if verbosity > deafening then ["--verbose"] else []+ let verboseFlags = if verbosity >= deafening then ["--verbose"] else [] when (hsColour && not have_src_hyperlink_flags) $ die "haddock --hyperlink-source requires Haddock version 0.8 or later" let linkToHscolour = if hsColour
Distribution/Simple/NHC.hs view
@@ -153,7 +153,7 @@ -- build any C sources unless (null (cSources bi)) $ do info verbosity "Building C Sources..."- let commonCcArgs = (if verbosity > deafening then ["-v"] else [])+ let commonCcArgs = (if verbosity >= deafening then ["-v"] else []) ++ ["-I" ++ dir | dir <- includeDirs bi] ++ [opt | opt <- ccOptions bi] ++ (if withOptimization lbi then ["-O2"] else [])
Distribution/Simple/PreProcess.hs view
@@ -67,7 +67,7 @@ import Distribution.Simple.BuildPaths (autogenModulesDir) import Distribution.Simple.Utils ( createDirectoryIfMissingVerbose, readUTF8File, writeUTF8File- , die, setupMessage, intercalate+ , die, setupMessage, intercalate, copyFileVerbose , findFileWithExtension, findFileWithExtension', dotToSep ) import Distribution.Simple.Program (Program(..), ConfiguredProgram(..), lookupProgram, programPath,@@ -78,14 +78,14 @@ import Distribution.Version (Version(..)) import Distribution.Verbosity import Distribution.Text- ( display )+ ( display, simpleParse ) import Control.Monad (when, unless, join) import Data.Maybe (fromMaybe)-import System.Directory (getModificationTime)+import System.Directory (getModificationTime, doesFileExist) import System.Info (os, arch) import System.FilePath (splitExtension, dropExtensions, (</>), (<.>),- takeDirectory, normalise)+ takeDirectory, normalise, replaceExtension) -- |The interface to a preprocessor, which may be implemented using an -- external program, but need not be. The arguments are the name of@@ -345,6 +345,14 @@ let Just ghcProg = lookupProgram ghcProgram (withPrograms lbi) in [ "--cc=" ++ programPath ghcProg , "--ld=" ++ programPath ghcProg ]+ ++ -- Don't magically link in haskell98, rts and base+ -- This is particularly important during the GHC build+ -- itself, as they might not exist yet+ ( case (programVersion ghcProg, simpleParse "6.9") of+ (Just v1, Just v2)+ | v1 >= v2 -> [ "--lflag=-no-auto-link-packages" ]+ _ -> []+ ) ++ [ "--cflag=-optc" ++ opt | opt <- ccOptions bi ++ cppOptions bi ] ++ [ "--cflag=" ++ opt | pkg <- packageDeps lbi@@ -421,8 +429,21 @@ PreProcessor { platformIndependent = False, runPreProcessor = mkSimplePreProcessor $ \inFile outFile verbosity ->- rawSystemProgramConf verbosity prog (withPrograms lbi)- (args ++ ["-o", outFile, inFile])+ do rawSystemProgramConf verbosity prog (withPrograms lbi)+ (args ++ ["-o", outFile, inFile])+ -- XXX This is a nasty hack. GHC requires that hs-boot files+ -- be in the same place as the hs files, so if we put the hs+ -- file in dist/... then we need to copy the hs-boot file+ -- there too. This should probably be done another way, e.g.+ -- by preprocessing all files, with and "id" preprocessor if+ -- nothing else, so the hs-boot files automatically get copied+ -- into the right place.+ -- Possibly we should also be looking for .lhs-boot files, but+ -- I think that preprocessors only produce .hs files.+ let inBoot = replaceExtension inFile "hs-boot"+ outBoot = replaceExtension outFile "hs-boot"+ exists <- doesFileExist inBoot+ when exists $ copyFileVerbose verbosity inBoot outBoot } -- |Convenience function; get the suffixes of these preprocessors.
Distribution/Simple/Register.hs view
@@ -243,6 +243,9 @@ libraryDir | inplace = build_dir | otherwise = libdir installDirs+ hasModules = not $ null (exposedModules lib)+ && null (otherModules bi)+ hasLibrary = hasModules || not (null (cSources bi)) in return emptyInstalledPackageInfo{ IPI.package = packageId pkg_descr,@@ -258,9 +261,12 @@ IPI.exposed = True, IPI.exposedModules = exposedModules lib, IPI.hiddenModules = otherModules bi,- IPI.importDirs = [libraryDir],- IPI.libraryDirs = libraryDir : extraLibDirs bi,- IPI.hsLibraries = ["HS" ++ display (packageId pkg_descr)],+ IPI.importDirs = [ libraryDir | hasModules ],+ IPI.libraryDirs = if hasLibrary+ then libraryDir : extraLibDirs bi+ else extraLibDirs bi,+ IPI.hsLibraries = ["HS" ++ display (packageId pkg_descr)+ | hasLibrary ], IPI.extraLibraries = extraLibs bi, IPI.includeDirs = absinc ++ if inplace then map (pwd </>) relinc
Distribution/Simple/Setup.hs view
@@ -558,7 +558,7 @@ configPackageDB = combine configPackageDB, configGHCiLib = combine configGHCiLib, configSplitObjs = combine configSplitObjs,- configStripExes = combine configSplitObjs,+ configStripExes = combine configStripExes, configExtraLibDirs = combine configExtraLibDirs, configConstraints = combine configConstraints, configExtraIncludeDirs = combine configExtraIncludeDirs,@@ -905,7 +905,7 @@ where name = "hscolour" shortDesc = "Generate HsColour colourised code, in HTML format."- longDesc = Just (\_ -> "Requires hscolour.")+ longDesc = Just (\_ -> "Requires hscolour.\n") options _ = [optionVerbosity hscolourVerbosity (\v flags -> flags { hscolourVerbosity = v }) ,optionDistPref hscolourDistPref (\d flags -> flags { hscolourDistPref = d })
Distribution/Simple/SrcDist.hs view
@@ -117,11 +117,14 @@ withTempDirectory verbosity tmpDir $ do setupMessage verbosity "Building source dist for" (packageId pkg)+ date <- toCalendarTime =<< getClockTime+ let pkg' | snapshot = snapshotPackage date pkg+ | otherwise = pkg if snapshot then getClockTime >>= toCalendarTime >>= prepareSnapshotTree verbosity pkg mb_lbi distPref tmpDir pps else prepareTree verbosity pkg mb_lbi distPref tmpDir pps- targzFile <- createArchive verbosity pkg mb_lbi tmpDir targetPref+ targzFile <- createArchive verbosity pkg' mb_lbi tmpDir targetPref notice verbosity $ "Source tarball created: " ++ targzFile where@@ -237,6 +240,16 @@ | "version:" `isPrefixOf` map toLower line = "version: " ++ display version | otherwise = line++-- | Modifies a 'PackageDescription' by appending a snapshot number+-- corresponding to the given date.+--+snapshotPackage :: CalendarTime -> PackageDescription -> PackageDescription+snapshotPackage date pkg =+ pkg {+ package = pkgid { pkgVersion = snapshotVersion date (pkgVersion pkgid) }+ }+ where pkgid = packageId pkg -- | Modifies a 'Version' by appending a snapshot number corresponding -- to the given date.
README view
@@ -1,21 +1,30 @@ [Cabal home page](http://www.haskell.org/cabal/) +Installation instructions for the Cabal library+=============================================== +If you also want the `cabal` command line program then you need+the `cabal-install` package in addition to this library.++ Installing as a user (no root or administer access)-===================================================+--------------------------------------------------- ghc --make Setup ./Setup configure --user ./Setup build ./Setup install -This will install into `$HOME/.cabal/` or the equivalent on Windows.+Note the use of the `--user` flag at the configure step.++This will install into `$HOME/.cabal/` on unix and into+`$Documents and Settings\$User\Application Data\cabal\` on Windows If you want to install elsewhere use the `--prefix=` flag at the configure step. Installing as root / Administrator-==================================+---------------------------------- ghc --make Setup ./Setup configure
changelog view
@@ -2,6 +2,18 @@ 1.5.x (current development version) +1.4.0.2 Duncan Coutts <duncan@haskell.org> August 2008+ * Fix executable stripping default+ * Fix striping exes on OSX that export dynamic symbols (like ghc)+ * Correct the order of arguments given by --prog-options=+ * Fix corner case with overlapping user and global packages+ * Fix for modules that use pre-processing and .hs-boot files+ * Clarify some points in the user guide and readme text+ * Fix verbosity flags passed to sub-command like haddock+ * Fix sdist --snapshot+ * Allow meta-packages that contain no modules or C code+ * Make the generated Paths module -Wall clean on Windows+ 1.4.0.1 Duncan Coutts <duncan@haskell.org> June 2008 * Fix a bug which caused '.' to always be in the sources search path * Haddock-2.2 and later do now support the --hoogle flag