2import Distribution.Simple
3import Distribution.Simple.InstallDirs as I
4import Distribution.Simple.LocalBuildInfo as L
5import qualified Distribution.Simple.Setup as S
6import qualified Distribution.Simple.Program as P
7import Distribution.PackageDescription
10import System.FilePath ((</>))
13-- After Idris is built, we need to check and install the prelude and other libs
15make verbosity = P.runProgramInvocation verbosity . P.simpleProgramInvocation "make"
18-- make on mingw32 exepects unix style separators
19idrisCmd local = "../dist/build/idris/idris"
21idrisCmd local = ".." </> buildDir local </> "idris" </> "idris"
25 = make verbosity [ "-C", "lib", "clean" ]
27installStdLib pkg local verbosity copy
28 = do let dirs = L.absoluteInstallDirs pkg local copy
29 let idir = datadir dirs
30 let icmd = idrisCmd local
31 putStrLn $ "Installing libraries in " ++ idir
33 [ "-C", "lib", "install"
37 let idirRts = idir </> "rts"
38 putStrLn $ "Installing run time system in " ++ idirRts
40 [ "-C", "rts", "install"
41 , "TARGET=" ++ idirRts
45-- This is a hack. I don't know how to tell cabal that a data file needs
46-- installing but shouldn't be in the distribution. And it won't make the
47-- distribution if it's not there, so instead I just delete
48-- the file after configure.
50removeLibIdris local verbosity
51 = do let icmd = idrisCmd local
53 [ "-C", "rts", "clean"
57checkStdLib local verbosity
58 = do let icmd = idrisCmd local
59 putStrLn $ "Building libraries..."
61 [ "-C", "lib", "check"
65 [ "-C", "rts", "check"
69-- Install libraries during both copy and install
70-- See http://hackage.haskell.org/trac/hackage/ticket/718
71main = defaultMainWithHooks $ simpleUserHooks
72 { postCopy = \ _ flags pkg lbi -> do
73 installStdLib pkg lbi (S.fromFlag $ S.copyVerbosity flags)
74 (S.fromFlag $ S.copyDest flags)
75 , postInst = \ _ flags pkg lbi -> do
76 installStdLib pkg lbi (S.fromFlag $ S.installVerbosity flags)
78 , postConf = \ _ flags _ lbi -> do
79 removeLibIdris lbi (S.fromFlag $ S.configVerbosity flags)
80 , postClean = \ _ flags _ _ -> do
81 cleanStdLib (S.fromFlag $ S.cleanVerbosity flags)
82 , postBuild = \ _ flags _ lbi -> do
83 checkStdLib lbi (S.fromFlag $ S.buildVerbosity flags)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list