forked from idris-lang/Idris-dev
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Get cabal to check library after install
- Loading branch information
Edwin Brady
committed
Dec 15, 2011
1 parent
6d01c6b
commit ec7c1b8
Showing
4 changed files
with
49 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Distribution.Simple | ||
import Distribution.Simple.InstallDirs as I | ||
import Distribution.Simple.LocalBuildInfo as L | ||
import Distribution.PackageDescription | ||
|
||
import System.Exit | ||
import System.Process | ||
|
||
-- After Idris is built, we need to check and install the prelude and other libs | ||
|
||
system' cmd = do | ||
exit <- system cmd | ||
case exit of | ||
ExitSuccess -> return () | ||
ExitFailure _ -> exitWith exit | ||
|
||
postCleanLib args flags desc _ | ||
= system' "make -C lib clean" | ||
|
||
addPrefix pfx var c = "export " ++ var ++ "=" ++ show pfx ++ "/" ++ c ++ ":$" ++ var | ||
|
||
postInstLib args flags desc local | ||
= do let pkg = localPkgDescr local | ||
let penv = packageTemplateEnv (package pkg) | ||
let dirs = substituteInstallDirTemplates penv (installDirTemplates local) | ||
let idir = fromPathTemplate (datadir dirs) ++ "/" ++ | ||
fromPathTemplate (datasubdir dirs) | ||
system' $ "make -C lib install TARGET=" ++ idir | ||
|
||
main = defaultMainWithHooks (simpleUserHooks { postInst = postInstLib, | ||
postClean = postCleanLib }) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters