diff options
author | Joey Hess <joeyh@joeyh.name> | 2015-08-09 10:30:35 -0400 |
---|---|---|
committer | Joey Hess <joeyh@joeyh.name> | 2015-08-09 10:30:35 -0400 |
commit | 0d7216141da3ecbac842e0673025a4a1d0236ad2 (patch) | |
tree | d2ba82a2bdcb467b9a575b8fef93ea2dc1920df9 /Setup.hs | |
parent | 7f5c0ad73ccfe0922c3bee977c4ab885eee3f070 (diff) |
Improve Setup.hs file so that cabal copy --destdir works. Thanks, Magnus_Therning.
Diffstat (limited to 'Setup.hs')
-rw-r--r-- | Setup.hs | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -27,13 +27,13 @@ main = defaultMainWithHooks simpleUserHooks } myPostCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO () -myPostCopy _ (CopyFlags { copyVerbosity }) pkg lbi = do +myPostCopy _ flags pkg lbi = do installGitAnnexShell dest verbosity pkg lbi installManpages dest verbosity pkg lbi installDesktopFile dest verbosity pkg lbi where - dest = NoCopyDest - verbosity = fromFlag copyVerbosity + dest = fromFlag $ copyDest flags + verbosity = fromFlag $ copyVerbosity flags installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () installGitAnnexShell copyDest verbosity pkg lbi = @@ -62,7 +62,9 @@ installManpages copyDest verbosity pkg lbi = srcManDir = "man" installDesktopFile :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () -installDesktopFile copyDest _verbosity pkg lbi = - DesktopFile.install $ dstBinDir </> "git-annex" +installDesktopFile copyDest _verbosity pkg lbi + | progfile copyDest == progfile NoCopyDest = + DesktopFile.install (progfile copyDest) + | otherwise = return () where - dstBinDir = bindir $ absoluteInstallDirs pkg lbi copyDest + progfile cd = bindir (absoluteInstallDirs pkg lbi cd) </> "git-annex" |