can now build Android targeted binary

Various things that don't work on Android are just ifdefed out.

* the webapp (needs template haskell for arm)
* --include and --exclude globbing (needs libpcre, which is not ported;
  probably I'll make it use the pure haskell glob library instead)
* annex.diskreserve checking (missing sys/statvfs.h)
* timestamp preservation support (yawn)
* S3
* WebDAV
* XMPP

The resulting 17mb binary has been tested on Android, and it is able to,
at least, print its usage message.
This commit is contained in:
Joey Hess 2013-02-10 15:48:38 -04:00
parent f202d997f4
commit 43b4b7d43a
7 changed files with 64 additions and 6 deletions

View file

@ -5,13 +5,17 @@
- Licensed under the GNU GPL version 3 or higher.
-}
{-# LANGUAGE CPP #-}
module Limit where
import Text.Regex.PCRE.Light.Char8
import System.Path.WildMatch
import Data.Time.Clock.POSIX
import qualified Data.Set as S
import qualified Data.Map as M
#ifndef WITH_ANDROID
import Text.Regex.PCRE.Light.Char8
import System.Path.WildMatch
#endif
import Common.Annex
import qualified Annex
@ -81,11 +85,15 @@ limitExclude :: MkLimit
limitExclude glob = Right $ const $ return . not . matchglob glob
matchglob :: String -> Annex.FileInfo -> Bool
#ifdef WITH_ANDROID
matchglob _ _ = error "glob matching not supported"
#else
matchglob glob (Annex.FileInfo { Annex.matchFile = f }) =
isJust $ match cregex f []
where
cregex = compile regex []
regex = '^':wildToRegex glob
#endif
{- Adds a limit to skip files not believed to be present
- in a specfied repository. -}