Improve Setup.hs file so that cabal copy --destdir works. Thanks, Magnus_Therning.

This commit is contained in:
Joey Hess 2015-08-09 10:30:35 -04:00
parent b0bc141a97
commit 8167f6fb40
3 changed files with 20 additions and 6 deletions

View file

@ -27,13 +27,13 @@ main = defaultMainWithHooks simpleUserHooks
} }
myPostCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO () myPostCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()
myPostCopy _ (CopyFlags { copyVerbosity }) pkg lbi = do myPostCopy _ flags 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 = fromFlag $ copyDest flags
verbosity = fromFlag copyVerbosity verbosity = fromFlag $ copyVerbosity flags
installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
installGitAnnexShell copyDest verbosity pkg lbi = installGitAnnexShell copyDest verbosity pkg lbi =
@ -62,7 +62,9 @@ installManpages copyDest verbosity pkg lbi =
srcManDir = "man" srcManDir = "man"
installDesktopFile :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO () installDesktopFile :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
installDesktopFile copyDest _verbosity pkg lbi = installDesktopFile copyDest _verbosity pkg lbi
DesktopFile.install $ dstBinDir </> "git-annex" | progfile copyDest == progfile NoCopyDest =
DesktopFile.install (progfile copyDest)
| otherwise = return ()
where where
dstBinDir = bindir $ absoluteInstallDirs pkg lbi copyDest progfile cd = bindir (absoluteInstallDirs pkg lbi cd) </> "git-annex"

2
debian/changelog vendored
View file

@ -32,6 +32,8 @@ git-annex (5.20150732) UNRELEASED; urgency=medium
readonly mode. readonly mode.
* Added support for SHA3 hashed keys (in 8 varieties), when git-annex is * Added support for SHA3 hashed keys (in 8 varieties), when git-annex is
built using the cryptonite library. built using the cryptonite library.
* Improve Setup.hs file so that cabal copy --destdir works.
Thanks, Magnus_Therning.
-- Joey Hess <id@joeyh.name> Fri, 31 Jul 2015 12:31:39 -0400 -- Joey Hess <id@joeyh.name> Fri, 31 Jul 2015 12:31:39 -0400

View file

@ -44,3 +44,13 @@ Index: habs/git-annex/src/git-annex-5.20150731/Setup.hs
~~~ ~~~
As you see I commented out installation of desktop files completely for the moment. I don't really need them, and they require larger changes to be correct. As you see I commented out installation of desktop files completely for the moment. I don't really need them, and they require larger changes to be correct.
> So, by "fails", you mean it installs to ~/.cabal instead of the speficied
> location.
>
> And, the issue with the desktop file installation is that it's not inside
> ~/.cabal at all.
>
> I've applied your patch, thanks. And dealt with the desktop file by
> making it not install it anywhere, unless it's installing to the regular
> ~/.cabal location. [[done]] --[[Joey]]