build without disk-free-space on android

This commit is contained in:
Joey Hess 2016-03-08 02:45:10 -04:00
parent b095561e70
commit 6623b557ed
Failed to extract signature
2 changed files with 19 additions and 2 deletions

View file

@ -6,12 +6,15 @@
-} -}
{-# OPTIONS_GHC -fno-warn-tabs #-} {-# OPTIONS_GHC -fno-warn-tabs #-}
{-# LANGUAGE CPP #-}
module Utility.DiskFree ( module Utility.DiskFree (
getDiskFree, getDiskFree,
getDiskSize getDiskSize
) where ) where
#ifndef __ANDROID__
import System.DiskSpace import System.DiskSpace
import Utility.Applicative import Utility.Applicative
import Utility.Exception import Utility.Exception
@ -21,3 +24,15 @@ getDiskFree = catchMaybeIO . getAvailSpace
getDiskSize :: FilePath -> IO (Maybe Integer) getDiskSize :: FilePath -> IO (Maybe Integer)
getDiskSize = fmap diskTotal <$$> catchMaybeIO . getDiskUsage getDiskSize = fmap diskTotal <$$> catchMaybeIO . getDiskUsage
#else
#warning Building without disk free space checking support
getDiskFree :: FilePath -> IO (Maybe Integer)
getDiskFree _ = return Nothing
getDiskSize :: FilePath -> IO (Maybe Integer)
getDiskSize _ = return Nothing
#endif

View file

@ -111,8 +111,7 @@ Executable git-annex
esqueleto, persistent-sqlite, persistent, persistent-template, esqueleto, persistent-sqlite, persistent, persistent-template,
aeson, aeson,
feed, feed,
regex-tdfa, regex-tdfa
disk-free-space
CC-Options: -Wall CC-Options: -Wall
GHC-Options: -Wall -fno-warn-tabs GHC-Options: -Wall -fno-warn-tabs
Extensions: PackageImports Extensions: PackageImports
@ -193,6 +192,9 @@ Executable git-annex
if flag(Android) if flag(Android)
Build-Depends: data-endian Build-Depends: data-endian
CPP-Options: -D__ANDROID__ -DANDROID_SPLICES -D__NO_TH__ CPP-Options: -D__ANDROID__ -DANDROID_SPLICES -D__NO_TH__
else
Build-Depends: disk-free-space
if flag(AndroidSplice) if flag(AndroidSplice)
CPP-Options: -DANDROID_SPLICES CPP-Options: -DANDROID_SPLICES