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 ((</>), splitDirectories)
11import qualified System.FilePath.Posix as Px
14-- After Idris is built, we need to check and install the prelude and other libs
16make verbosity = P.runProgramInvocation verbosity . P.simpleProgramInvocation "make"
19-- make on mingw32 exepects unix style separators
21idrisCmd local = Px.joinPath $ splitDirectories $
22 ".." <//> buildDir local <//> "idris" <//> "idris"
24idrisCmd local = ".." </> buildDir local </> "idris" </> "idris"
28 = make verbosity [ "-C", "lib", "clean" ]
30installStdLib pkg local verbosity copy
31 = do let dirs = L.absoluteInstallDirs pkg local copy
32 let idir = datadir dirs
33 let icmd = idrisCmd local
34 putStrLn $ "Installing libraries in " ++ idir
36 [ "-C", "lib", "install"
40 let idirRts = idir </> "rts"
41 putStrLn $ "Installing run time system in " ++ idirRts
43 [ "-C", "rts", "install"
44 , "TARGET=" ++ idirRts
48-- This is a hack. I don't know how to tell cabal that a data file needs
49-- installing but shouldn't be in the distribution. And it won't make the
50-- distribution if it's not there, so instead I just delete
51-- the file after configure.
53removeLibIdris local verbosity
54 = do let icmd = idrisCmd local
56 [ "-C", "rts", "clean"
60checkStdLib local verbosity
61 = do let icmd = idrisCmd local
62 putStrLn $ "Building libraries..."
64 [ "-C", "lib", "check"
68 [ "-C", "rts", "check"
72-- Install libraries during both copy and install
73-- See http://hackage.haskell.org/trac/hackage/ticket/718
74main = defaultMainWithHooks $ simpleUserHooks
75 { postCopy = \ _ flags pkg lbi -> do
76 installStdLib pkg lbi (S.fromFlag $ S.copyVerbosity flags)
77 (S.fromFlag $ S.copyDest flags)
78 , postInst = \ _ flags pkg lbi -> do
79 installStdLib pkg lbi (S.fromFlag $ S.installVerbosity flags)
81 , postConf = \ _ flags _ lbi -> do
82 removeLibIdris lbi (S.fromFlag $ S.configVerbosity flags)
83 , postClean = \ _ flags _ _ -> do
84 cleanStdLib (S.fromFlag $ S.cleanVerbosity flags)
85 , postBuild = \ _ flags _ lbi -> do
86 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