1import Distribution.Simple
2import Distribution.Simple.InstallDirs as I
3import Distribution.Simple.LocalBuildInfo as L
4import qualified Distribution.Simple.Setup as S
5import qualified Distribution.Simple.Program as P
6import Distribution.PackageDescription
9import System.FilePath ((</>))
12-- After Idris is built, we need to check and install the prelude and other libs
14make verbosity = P.runProgramInvocation verbosity . P.simpleProgramInvocation "make"
17 = make verbosity [ "-C", "lib", "clean" ]
19installStdLib pkg local verbosity copy
20 = do let dirs = L.absoluteInstallDirs pkg local copy
21 let idir = datadir dirs
22 let icmd = ".." </> buildDir local </> "idris" </> "idris"
23 putStrLn $ "Installing libraries in " ++ idir
25 [ "-C", "lib", "install"
29 putStrLn $ "Installing run time system in " ++ idir ++ "/rts"
31 [ "-C", "rts", "install"
32 , "TARGET=" ++ idir ++ "/rts"
36-- This is a hack. I don't know how to tell cabal that a data file needs
37-- installing but shouldn't be in the distribution. And it won't make the
38-- distribution if it's not there, so instead I just delete
39-- the file after configure.
41removeLibIdris local verbosity
42 = do let icmd = ".." </> buildDir local </> "idris" </> "idris"
44 [ "-C", "rts", "clean"
48checkStdLib local verbosity
49 = do let icmd = ".." </> buildDir local </> "idris" </> "idris"
50 putStrLn $ "Building libraries..."
52 [ "-C", "lib", "check"
56 [ "-C", "rts", "check"
60-- Install libraries during both copy and install
61-- See http://hackage.haskell.org/trac/hackage/ticket/718
62main = defaultMainWithHooks $ simpleUserHooks
63 { postCopy = \ _ flags pkg lbi -> do
64 installStdLib pkg lbi (S.fromFlag $ S.copyVerbosity flags)
65 (S.fromFlag $ S.copyDest flags)
66 , postInst = \ _ flags pkg lbi -> do
67 installStdLib pkg lbi (S.fromFlag $ S.installVerbosity flags)
69 , postConf = \ _ flags _ lbi -> do
70 removeLibIdris lbi (S.fromFlag $ S.configVerbosity flags)
71 , postClean = \ _ flags _ _ -> do
72 cleanStdLib (S.fromFlag $ S.cleanVerbosity flags)
73 , postBuild = \ _ flags _ lbi -> do
74 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