Yes. Take a look at postInst and its associated types / operations.
Distribution.Simple.UserHooks
Here is a quick example, you can hoogle related operations to find out more. It executes various .sh scripts, copy files, etc. AFTER assembly cabal. absoluteInstallDirs tells you where cabal puts other files, should you need it.
Hope this helps!
import Distribution.Simple import Distribution.Simple.LocalBuildInfo import System.Process import System.Exit main = defaultMainWithHooks fixpointHooks fixpointHooks = simpleUserHooks { postInst = buildAndCopyFixpoint } buildAndCopyFixpoint _ _ pkg lbi = do putStrLn $ "Post Install: " ++ show binDir -- , libDir) executeShellCommand "./configure" executeShellCommand "./build.sh" executeShellCommand $ "chmod a+x external/fixpoint/fixpoint.native " executeShellCommand $ "cp external/fixpoint/fixpoint.native " ++ binDir executeShellCommand $ "cp external/z3/lib/libz3.* " ++ binDir where allDirs = absoluteInstallDirs pkg lbi NoCopyDest binDir = bindir allDirs ++ "/" executeShellCommand cmd = putStrLn ("EXEC: " ++ cmd) >> system cmd >>= check where check (ExitSuccess) = return () check (ExitFailure n) = error $ "cmd: " ++ cmd ++ " failure code " ++ show n fixpointHooks = simpleUserHooks { postInst = buildAndCopyFixpoint }
source share