cabal can now be used to build git-annex.

This is substantially slower than using make, does not build or install
documentation, does not run the test suite, and is not particularly
recommended, but could be useful to some.
This commit is contained in:
Joey Hess 2011-06-30 14:55:03 -04:00
parent b3aaf980e4
commit 56aeeb4565
9 changed files with 96 additions and 27 deletions

View file

@ -56,12 +56,24 @@ unicodeFilePath = do
{- Pulls package version out of the changelog. -}
getVersion :: Test
getVersion = do
changelog <- readFile "debian/changelog"
changelog <- readFile "CHANGELOG"
let verline = head $ lines changelog
let version = middle (words verline !! 1)
-- Replace Version field in cabal file, so I don't have to maintain
-- the version there too.
cabal <- readFile cabalfile
writeFile tmpcabalfile $ unlines $ map (setversion version) $ lines cabal
renameFile tmpcabalfile cabalfile
return $ Config "packageversion" (StringConfig version)
where
middle s = drop 1 $ take (length s - 1) s
cabalfile = "git-annex.cabal"
tmpcabalfile = cabalfile++".tmp"
setversion version s
| "Version:" `isPrefixOf` s = "Version: " ++ version
| otherwise = s
setup :: IO ()
setup = do