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 = do make verbosity [ "-C", "lib", "clean", "IDRIS=idris" ]
29 make verbosity [ "-C", "effects", "clean", "IDRIS=idris" ]
31installStdLib pkg local verbosity copy
32 = do let dirs = L.absoluteInstallDirs pkg local copy
33 let idir = datadir dirs
34 let icmd = idrisCmd local
35 putStrLn $ "Installing libraries in " ++ idir
37 [ "-C", "lib", "install"
42 [ "-C", "effects", "install"
46 let idirRts = idir </> "rts"
47 putStrLn $ "Installing run time system in " ++ idirRts
49 [ "-C", "rts", "install"
50 , "TARGET=" ++ idirRts
54-- This is a hack. I don't know how to tell cabal that a data file needs
55-- installing but shouldn't be in the distribution. And it won't make the
56-- distribution if it's not there, so instead I just delete
57-- the file after configure.
59removeLibIdris local verbosity
60 = do let icmd = idrisCmd local
62 [ "-C", "rts", "clean"
66checkStdLib local verbosity
67 = do let icmd = idrisCmd local
68 putStrLn $ "Building libraries..."
70 [ "-C", "lib", "check"
74 [ "-C", "effects", "check"
78 [ "-C", "rts", "check"
82-- Install libraries during both copy and install
83-- See http://hackage.haskell.org/trac/hackage/ticket/718
84main = defaultMainWithHooks $ simpleUserHooks
85 { postCopy = \ _ flags pkg lbi -> do
86 installStdLib pkg lbi (S.fromFlag $ S.copyVerbosity flags)
87 (S.fromFlag $ S.copyDest flags)
88 , postInst = \ _ flags pkg lbi -> do
89 installStdLib pkg lbi (S.fromFlag $ S.installVerbosity flags)
91 , postConf = \ _ flags _ lbi -> do
92 removeLibIdris lbi (S.fromFlag $ S.configVerbosity flags)
93 , postClean = \ _ flags _ _ -> do
94 cleanStdLib (S.fromFlag $ S.cleanVerbosity flags)
95 , postBuild = \ _ flags _ lbi -> do
96 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