aboutsummaryrefslogtreecommitdiff
path: root/Setup.hs
blob: c36d6e4fe1d6d0b83f47f8976501623188a85012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{- cabal setup file -}

import Distribution.Simple
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Setup
import System.Cmd
import System.FilePath

import qualified Build.Configure as Configure

main = defaultMainWithHooks simpleUserHooks
	{ preConf = configure
	, instHook = install
	}

configure _ _ = do
	Configure.run Configure.tests
	return (Nothing, [])

install pkg_descr lbi userhooks flags = do
	r <- (instHook simpleUserHooks) pkg_descr lbi userhooks flags
	_ <- rawSystem "ln" ["-sf", "git-annex", 
		bindir installDirs </> "git-annex-shell"]
	return r
	where
		installDirs = absoluteInstallDirs pkg_descr lbi $
			fromFlag (copyDest defaultCopyFlags)