Use system over callCommand to allow linking on ghc 7.6.3.
This commit is contained in:
parent
f754363733
commit
d473fb8867
15
Setup.hs
15
Setup.hs
|
@ -8,21 +8,13 @@ import Distribution.Simple (
|
||||||
simpleUserHooks )
|
simpleUserHooks )
|
||||||
import Distribution.Simple.Setup ( SDistFlags )
|
import Distribution.Simple.Setup ( SDistFlags )
|
||||||
|
|
||||||
-- | This requires the process package from,
|
import System.Process ( system )
|
||||||
--
|
|
||||||
-- https://hackage.haskell.org/package/process
|
|
||||||
--
|
|
||||||
import System.Process ( callCommand )
|
|
||||||
|
|
||||||
|
|
||||||
-- | This will use almost the default implementation, except we switch
|
|
||||||
-- out the default pre-sdist hook with our own, 'myPreSDist'.
|
|
||||||
--
|
|
||||||
main = defaultMainWithHooks myHooks
|
main = defaultMainWithHooks myHooks
|
||||||
where
|
where
|
||||||
myHooks = simpleUserHooks { preSDist = myPreSDist }
|
myHooks = simpleUserHooks { preSDist = myPreSDist }
|
||||||
|
|
||||||
|
|
||||||
-- | This hook will be executed before e.g. @cabal sdist@. It runs
|
-- | This hook will be executed before e.g. @cabal sdist@. It runs
|
||||||
-- pandoc to create the man page from shellcheck.1.md. If the pandoc
|
-- pandoc to create the man page from shellcheck.1.md. If the pandoc
|
||||||
-- command is not found, this will fail with an error message:
|
-- command is not found, this will fail with an error message:
|
||||||
|
@ -35,9 +27,10 @@ main = defaultMainWithHooks myHooks
|
||||||
--
|
--
|
||||||
myPreSDist :: Args -> SDistFlags -> IO HookedBuildInfo
|
myPreSDist :: Args -> SDistFlags -> IO HookedBuildInfo
|
||||||
myPreSDist _ _ = do
|
myPreSDist _ _ = do
|
||||||
putStrLn "Building the man page..."
|
putStrLn "Building the man page (shellcheck.1) with pandoc..."
|
||||||
putStrLn pandoc_cmd
|
putStrLn pandoc_cmd
|
||||||
callCommand pandoc_cmd
|
result <- system pandoc_cmd
|
||||||
|
putStrLn $ "pandoc exited with " ++ show result
|
||||||
return emptyHookedBuildInfo
|
return emptyHookedBuildInfo
|
||||||
where
|
where
|
||||||
pandoc_cmd = "pandoc -s -t man shellcheck.1.md -o shellcheck.1"
|
pandoc_cmd = "pandoc -s -t man shellcheck.1.md -o shellcheck.1"
|
||||||
|
|
|
@ -44,7 +44,9 @@ library
|
||||||
mtl >= 2.2.1,
|
mtl >= 2.2.1,
|
||||||
parsec,
|
parsec,
|
||||||
regex-tdfa,
|
regex-tdfa,
|
||||||
QuickCheck >= 2.7.4
|
QuickCheck >= 2.7.4,
|
||||||
|
-- When cabal supports it, move this to setup-depends:
|
||||||
|
process
|
||||||
exposed-modules:
|
exposed-modules:
|
||||||
ShellCheck.AST
|
ShellCheck.AST
|
||||||
ShellCheck.ASTLib
|
ShellCheck.ASTLib
|
||||||
|
@ -87,7 +89,6 @@ test-suite test-shellcheck
|
||||||
mtl >= 2.2.1,
|
mtl >= 2.2.1,
|
||||||
parsec,
|
parsec,
|
||||||
regex-tdfa,
|
regex-tdfa,
|
||||||
QuickCheck >= 2.7.4,
|
QuickCheck >= 2.7.4
|
||||||
process >= 1.2.0.0
|
|
||||||
main-is: test/shellcheck.hs
|
main-is: test/shellcheck.hs
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue