@@ -1,34 +0,0 @@
1−-- Get an interactive shell with the right packages to load
2−-- pandoc modules.
3−
4−-- To use:
5−-- runghc Interact.hs
6−-- then,
7−-- :l Text/Pandoc.hs
8−-- (or whichever package you like)
9−
10−-- You must have first done a 'cabal configure' or 'cabal install'
11−
12−-- Note: Interact.hs doesn't work with Cabal >= 1.18. I recommend
13−-- using cabal sandboxes and the new 'cabal repl' command if you are
14−-- using a recent version.
15−
16−import System.Process
17−import Distribution.Simple.LocalBuildInfo
18−import Distribution.Package
19−import Distribution.Version
20−import Data.List (intercalate)
21−
22−main = do
23− setupConfig' <- readFile "dist/setup-config"
24− let setupConfig = read $ unlines $ drop 1 $ lines setupConfig'
25− let (Just (ComponentLocalBuildInfo { componentPackageDeps = deps })) = libraryConfig setupConfig
26− let packageSpecs = map (toPackageSpec . snd) deps
27− let args = ["-optP-include", "-optP../dist/build/autogen/cabal_macros.h","-cpp","-I../dist/build/autogen","-i../dist/build/autogen"] ++ concatMap (\p -> ["-package",p]) packageSpecs
28− print args
29− ph <- runProcess "ghci" args (Just "src") Nothing Nothing Nothing Nothing
30− waitForProcess ph
31−
32−toPackageSpec pkg = pkgN ++ "-" ++ pkgV
33− where (PackageName pkgN) = pkgName pkg
34− pkgV = intercalate "." $ map show $ versionBranch $ pkgVersion pkg