build without disk-free-space on android
This commit is contained in:
parent
b095561e70
commit
6623b557ed
2 changed files with 19 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue