summaryrefslogtreecommitdiff
path: root/devel/hs-git-annex/files/patch-Setup.hs
blob: e08c40a737d2e693828a009cc7ab2d8697471f24 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
--- ./Setup.hs.orig	2014-01-22 21:23:18.000000000 +0100
+++ ./Setup.hs	2014-07-10 21:52:00.000000000 +0200
@@ -19,6 +19,7 @@
 main = defaultMainWithHooks simpleUserHooks
 	{ preConf = configure
 	, postInst = myPostInst
+	, postCopy = myPostCopy
 	}
 
 configure _ _ = do
@@ -34,6 +35,15 @@
 	dest      = NoCopyDest
 	verbosity = fromFlag installVerbosity
 
+myPostCopy :: Args -> CopyFlags -> PackageDescription -> LocalBuildInfo -> IO ()
+myPostCopy _ (CopyFlags { copyVerbosity, copyDest }) pkg lbi = do
+	installGitAnnexShell dest verbosity pkg lbi
+	installManpages      dest verbosity pkg lbi
+	installDesktopFile   dest verbosity pkg lbi
+  where
+	dest      = fromFlag copyDest
+	verbosity = fromFlag copyVerbosity
+
 installGitAnnexShell :: CopyDest -> Verbosity -> PackageDescription -> LocalBuildInfo -> IO ()
 installGitAnnexShell copyDest verbosity pkg lbi =
 	rawSystemExit verbosity "ln"
@@ -50,7 +60,7 @@
 installManpages copyDest verbosity pkg lbi =
 	installOrdinaryFiles verbosity dstManDir =<< srcManpages
   where
-	dstManDir   = mandir (absoluteInstallDirs pkg lbi copyDest) </> "man1"
+	dstManDir   = prefix (absoluteInstallDirs pkg lbi copyDest) </> "man" </> "man1"
 	srcManpages = zip (repeat srcManDir)
 		<$> filterM doesFileExist manpages
 	srcManDir   = ""
@@ -60,4 +70,4 @@
 installDesktopFile copyDest verbosity pkg lbi =
 	DesktopFile.install $ dstBinDir </> "git-annex"
   where
-	dstBinDir = bindir $ absoluteInstallDirs pkg lbi copyDest
+	dstBinDir = bindir $ absoluteInstallDirs pkg lbi NoCopyDest