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 #-}
{-# LANGUAGE CPP #-}
module Utility.DiskFree (
getDiskFree,
getDiskSize
) where
#ifndef __ANDROID__
import System.DiskSpace
import Utility.Applicative
import Utility.Exception
@ -21,3 +24,15 @@ getDiskFree = catchMaybeIO . getAvailSpace
getDiskSize :: FilePath -> IO (Maybe Integer)
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,
aeson,
feed,
regex-tdfa,
disk-free-space
regex-tdfa
CC-Options: -Wall
GHC-Options: -Wall -fno-warn-tabs
Extensions: PackageImports
@ -193,6 +192,9 @@ Executable git-annex
if flag(Android)
Build-Depends: data-endian
CPP-Options: -D__ANDROID__ -DANDROID_SPLICES -D__NO_TH__
else
Build-Depends: disk-free-space
if flag(AndroidSplice)
CPP-Options: -DANDROID_SPLICES