got hdevtools working on the git-annex source tree

This commit is contained in:
Joey Hess 2013-03-12 05:48:41 -04:00
parent 3e0370017f
commit ccb7e5cfa4
5 changed files with 40 additions and 12 deletions

View file

@ -133,7 +133,9 @@ import Assistant.Threads.Merger
import Assistant.Threads.TransferWatcher
import Assistant.Threads.Transferrer
import Assistant.Threads.SanityChecker
#ifdef WITH_CLIBS
import Assistant.Threads.MountWatcher
#endif
import Assistant.Threads.NetWatcher
import Assistant.Threads.TransferScanner
import Assistant.Threads.TransferPoller
@ -219,7 +221,9 @@ startDaemon assistant foreground startbrowser = do
, assist $ daemonStatusThread
, assist $ sanityCheckerDailyThread
, assist $ sanityCheckerHourlyThread
#ifdef WITH_CLIBS
, assist $ mountWatcherThread
#endif
, assist $ netWatcherThread
, assist $ netWatcherFallbackThread
, assist $ transferScannerThread

View file

@ -21,7 +21,9 @@ import qualified Git.Command
import qualified Annex
import Locations.UserConfig
import Utility.FreeDesktop
#ifdef WITH_CLIBS
import Utility.Mounts
#endif
import Utility.DiskFree
import Utility.DataUnits
import Utility.Network
@ -236,6 +238,7 @@ getEnableDirectoryR uuid = page "Enable a repository" (Just Configuration) $ do
{- List of removable drives. -}
driveList :: IO [RemovableDrive]
#ifdef WITH_CLIBS
driveList = mapM (gen . mnt_dir) =<< filter sane <$> getMounts
where
gen dir = RemovableDrive
@ -254,6 +257,9 @@ driveList = mapM (gen . mnt_dir) =<< filter sane <$> getMounts
| dir == "/run/shm" = False
| dir == "/run/lock" = False
| otherwise = True
#else
driveList = return []
#endif
{- Bootstraps from first run mode to a fully running assistant in a
- repository, by running the postFirstRun callback, which returns the

View file

@ -13,17 +13,6 @@ endif
build: $(all)
# We bypass cabal, and only run the main ghc --make command for a
# fast development built. Note: Does not rebuild C libraries.
fast: dist/caballog
@$$(grep 'ghc --make' dist/caballog | head -n 1)
@ln -sf dist/build/git-annex/git-annex git-annex
@$(MAKE) tags >/dev/null 2>&1
dist/caballog: git-annex.cabal
$(CABAL) configure -f"-Production" -O0
$(CABAL) build -v2 | tee $@
Build/SysConfig.hs: configure.hs Build/TestConfig.hs Build/Configure.hs
$(CABAL) configure
@ -167,4 +156,23 @@ androidapp:
$(MAKE) android
$(MAKE) -C standalone/android
# We bypass cabal, and only run the main ghc --make command for a
# fast development built. Note: Does not rebuild C libraries.
fast: dist/caballog
@$$(grep 'ghc --make' dist/caballog | head -n 1)
@ln -sf dist/build/git-annex/git-annex git-annex
@$(MAKE) tags >/dev/null 2>&1
dist/caballog: git-annex.cabal
$(CABAL) configure -f"-Production" -O0
$(CABAL) build -v2 | tee $@
# Hardcoded command line to make hdevtools start up and work.
# You will need some memory. It's worth it.
# Note: Don't include WebDAV or Webapp. TH use bloats memory > 500 mb!
# TODO should be possible to derive this from caballog.
hdevtools:
hdevtools --stop-server || true
hdevtools check git-annex.hs -g -cpp -g -i -g -idist/build/git-annex/git-annex-tmp -g -i. -g -idist/build/autogen -g -Idist/build/autogen -g -Idist/build/git-annex/git-annex-tmp -g -IUtility -g -DWITH_TESTSUITE -g -DWITH_S3 -g -DWITH_ASSISTANT -g -DWITH_INOTIFY -g -DWITH_DBUS -g -DWITH_PAIRING -g -DWITH_XMPP -g -optP-include -g -optPdist/build/autogen/cabal_macros.h -g -odir -g dist/build/git-annex/git-annex-tmp -g -hidir -g dist/build/git-annex/git-annex-tmp -g -stubdir -g dist/build/git-annex/git-annex-tmp -g -threaded -g -Wall -g -XHaskell98
.PHONY: git-annex tags

View file

@ -5,7 +5,7 @@
- Licensed under the GNU GPL version 3 or higher.
-}
{-# LANGUAGE ForeignFunctionInterface #-}
{-# LANGUAGE ForeignFunctionInterface, CPP #-}
module Utility.DiskFree ( getDiskFree ) where
@ -15,6 +15,8 @@ import Foreign.C.Types
import Foreign.C.String
import Foreign.C.Error
#ifdef WITH_CLIBS
foreign import ccall safe "libdiskfree.h diskfree" c_diskfree
:: CString -> IO CULLong
@ -27,3 +29,10 @@ getDiskFree path = withFilePath path $ \c_path -> do
)
where
safeErrno (Errno v) = v == 0
#else
getDiskFree :: FilePath -> IO (Maybe Integer)
getDiskFree _ = return Nothing
#endif

View file

@ -77,6 +77,7 @@ Executable git-annex
C-Sources: Utility/libdiskfree.c Utility/libmounts.c
CC-Options: -Wall
GHC-Options: -threaded -Wall
CPP-Options: -DWITH_CLIBS
if flag(Production)
GHC-Options: -O2