From 626697b459669d934da6339117f6f4abfce16f38 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 14 Apr 2012 14:22:33 -0400 Subject: [PATCH] cabal file now autodetects whether S3 support is available. --- Locations.hs | 2 +- Makefile | 2 +- Remote/List.hs | 4 ++++ debian/changelog | 1 + git-annex.cabal | 10 +++++++++- 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Locations.hs b/Locations.hs index d263f3d2ac..67abf2166a 100644 --- a/Locations.hs +++ b/Locations.hs @@ -124,7 +124,7 @@ gitAnnexBadDir r = addTrailingPathSeparator $ gitAnnexDir r "bad" gitAnnexBadLocation :: Key -> Git.Repo -> FilePath gitAnnexBadLocation key r = gitAnnexBadDir r keyFile key -{- .git/annex/*unused is used to number possibly unused keys -} +{- .git/annex/foounused is used to number possibly unused keys -} gitAnnexUnusedLog :: FilePath -> Git.Repo -> FilePath gitAnnexUnusedLog prefix r = gitAnnexDir r (prefix ++ "unused") diff --git a/Makefile b/Makefile index eb30a3833c..87aa8c0767 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ PREFIX=/usr IGNORE=-ignore-package monads-fd -BASEFLAGS=-Wall $(IGNORE) -outputdir tmp -IUtility +BASEFLAGS=-Wall $(IGNORE) -outputdir tmp -IUtility -cpp -DWITH_S3 GHCFLAGS=-O2 $(BASEFLAGS) ifdef PROFILE diff --git a/Remote/List.hs b/Remote/List.hs index 57dfa43ebf..c09341fb53 100644 --- a/Remote/List.hs +++ b/Remote/List.hs @@ -18,7 +18,9 @@ import Config import Remote.Helper.Hooks import qualified Remote.Git +#ifdef WITH_S3 import qualified Remote.S3 +#endif import qualified Remote.Bup import qualified Remote.Directory import qualified Remote.Rsync @@ -28,7 +30,9 @@ import qualified Remote.Hook remoteTypes :: [RemoteType] remoteTypes = [ Remote.Git.remote +#ifdef WITH_S3 , Remote.S3.remote +#endif , Remote.Bup.remote , Remote.Directory.remote , Remote.Rsync.remote diff --git a/debian/changelog b/debian/changelog index 73b4f31b08..7b9fcde3fc 100644 --- a/debian/changelog +++ b/debian/changelog @@ -9,6 +9,7 @@ git-annex (3.20120407) UNRELEASED; urgency=low dependency on the haskell edit-distance library. * Renamed diskfree.c to avoid OSX case insensativity bug. * cabal now installs git-annex-shell as a symlink to git-annex. + * cabal file now autodetects whether S3 support is available. -- Joey Hess Sun, 08 Apr 2012 12:23:42 -0400 diff --git a/git-annex.cabal b/git-annex.cabal index 6b1ebb42e6..58370daf4b 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -26,15 +26,23 @@ Description: etc that are associated with annexed files but that benefit from full revision control. +Flag S3 + Description: Enable S3 support + Executable git-annex Main-Is: git-annex.hs Build-Depends: MissingH, hslogger, directory, filepath, unix, containers, utf8-string, network, mtl, bytestring, old-locale, time, - pcre-light, extensible-exceptions, dataenc, SHA, process, hS3, json, HTTP, + pcre-light, extensible-exceptions, dataenc, SHA, process, json, HTTP, base >= 4.5, base < 5, monad-control, transformers-base, lifted-base, IfElse, text, QuickCheck >= 2.1, bloomfilter, edit-distance Other-Modules: Utility.Touch C-Sources: Utility/libdiskfree.c + Extensions: CPP + + if flag(S3) + Build-Depends: hS3 + CPP-Options: -DWITH_S3 Test-Suite test Type: exitcode-stdio-1.0