gnu: Add kafs-client
[jackhill/guix/guix.git] / gnu / packages / patches / ganeti-haskell-pythondir.patch
1 This patch allows the Haskell daemons to locate Python libraries
2 installed to a non-standard pythondir. It is necessary because Guix
3 does not use versionedsharedir (see related patch that disables it).
4
5 diff --git a/Makefile.am b/Makefile.am
6 --- a/Makefile.am
7 +++ b/Makefile.am
8 @@ -83,6 +83,7 @@ myexeclibdir = $(pkglibdir)
9 bindir = $(versiondir)/$(BINDIR)
10 sbindir = $(versiondir)$(SBINDIR)
11 mandir = $(versionedsharedir)/root$(MANDIR)
12 +pythondir = $(versionedsharedir)
13 pkgpythondir = $(versionedsharedir)/ganeti
14 pkgpython_rpc_stubdir = $(versionedsharedir)/ganeti/rpc/stub
15 gntpythondir = $(versionedsharedir)
16 @@ -2386,6 +2387,7 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \
17 -DPKGLIBDIR="$(libdir)/ganeti" \
18 -DSHAREDIR="$(prefix)/share/ganeti" \
19 -DVERSIONEDSHAREDIR="$(versionedsharedir)" \
20 + -DPYTHONDIR="$(pythondir)" \
21 -DDRBD_BARRIERS="$(DRBD_BARRIERS)" \
22 -DDRBD_NO_META_FLUSH="$(DRBD_NO_META_FLUSH)" \
23 -DSYSLOG_USAGE="$(SYSLOG_USAGE)" \
24 diff --git a/src/AutoConf.hs.in b/src/AutoConf.hs.in
25 --- a/src/AutoConf.hs.in
26 +++ b/src/AutoConf.hs.in
27 @@ -157,6 +157,9 @@ sharedir = "SHAREDIR"
28 versionedsharedir :: String
29 versionedsharedir = "VERSIONEDSHAREDIR"
30
31 +pythondir :: String
32 +pythondir = "PYTHONDIR"
33 +
34 drbdBarriers :: String
35 drbdBarriers = "DRBD_BARRIERS"
36
37 diff --git a/src/Ganeti/Path.hs b/src/Ganeti/Path.hs
38 --- a/src/Ganeti/Path.hs
39 +++ b/src/Ganeti/Path.hs
40 @@ -188,5 +188,5 @@ getInstReasonFilename instName = instanceReasonDir `pjoin` instName
41
42 -- | The path to the Python executable for starting jobs.
43 jqueueExecutorPy :: IO FilePath
44 -jqueueExecutorPy = return $ versionedsharedir
45 - </> "ganeti" </> "jqueue" </> "exec.py"
46 +jqueueExecutorPy = return $ pythondir
47 + </> "ganeti" </> "jqueue" </> "exec.py"
48 diff --git a/src/Ganeti/Query/Exec.hs b/src/Ganeti/Query/Exec.hs
49 --- a/src/Ganeti/Query/Exec.hs
50 +++ b/src/Ganeti/Query/Exec.hs
51 @@ -99,12 +99,12 @@ spawnJobProcess jid = withErrorLogAt CRITICAL (show jid) $
52 do
53 use_debug <- isDebugMode
54 env_ <- (M.toList . M.insert "GNT_DEBUG" (if use_debug then "1" else "0")
55 - . M.insert "PYTHONPATH" AC.versionedsharedir
56 + . M.insert "PYTHONPATH" AC.pythondir
57 . M.fromList)
58 `liftM` getEnvironment
59 execPy <- P.jqueueExecutorPy
60 logDebug $ "Executing " ++ AC.pythonPath ++ " " ++ execPy
61 - ++ " with PYTHONPATH=" ++ AC.versionedsharedir
62 + ++ " with PYTHONPATH=" ++ AC.pythondir
63
64 (master, child) <- pipeClient connectConfig
65 let (rh, wh) = clientToHandle child
66