switch Setup file to use postCopy hook, since cabal has stopped running postInst

See https://github.com/haskell/cabal/issues/1805

Apparently, old versions of cabal don't run copyHook, but at the moment
I don't know who would be using a cabal as old as 1.18, and it seems a lot
of complication to run both hooks. Although I think my code is idempotent,
so they could both be used if necessary.
This commit is contained in:
Joey Hess 2015-07-31 12:03:19 -04:00
parent e954b165a1
commit dace1f3162

View file

@ -23,17 +23,17 @@ main = defaultMainWithHooks simpleUserHooks
{ preConf = \_ _ -> do { preConf = \_ _ -> do
Configure.run Configure.tests Configure.run Configure.tests
return (Nothing, []) return (Nothing, [])
, postInst = myPostInst , postCopy = myPostCopy
} }
myPostInst :: Args -> InstallFlags -> PackageDescription -> LocalBuildInfo -> IO () myPostCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()
myPostInst _ (InstallFlags { installVerbosity }) pkg lbi = do myPostCopy _ (CopyFlags { copyVerbosity }) pkg lbi = do
installGitAnnexShell dest verbosity pkg lbi installGitAnnexShell dest verbosity pkg lbi
installManpages dest verbosity pkg lbi installManpages dest verbosity pkg lbi
installDesktopFile dest verbosity pkg lbi installDesktopFile dest verbosity pkg lbi
where where
dest = NoCopyDest dest = NoCopyDest
verbosity = fromFlag installVerbosity verbosity = fromFlag copyVerbosity
installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
installGitAnnexShell copyDest verbosity pkg lbi = installGitAnnexShell copyDest verbosity pkg lbi =