summaryrefslogtreecommitdiffstats
path: root/debian/patches/pkg-config-make-prefix-overridable-again.patch
blob: 68e50bce1019d24a310e50c666bffbf9aeffba65 (plain)
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From: Jan Tojnar <jtojnar@gmail.com>
Date: Sat, 2 Jan 2021 02:46:33 +0100
Subject: pkg-config: make prefix overridable again

While we don't support prefix being != /usr, and this is hardcoded
all over the place, variables in pkg-config file are expected
to have overridable base directory.

This is important for at least the following two use cases:

- Installing projects to non-FHS package-specific prefixes for Nix-style
  package managers. Of course, it is then their responsibility
  to ensure systemd can find the service files.
- Installing to local path for development purposes.
  This is a compromise between running a program from a build directory,
  and running it fully installed to system prefix.

You will not want to write to system prefix in either case.

For more information, see also
https://www.bassi.io/articles/2018/03/15/pkg-config-and-paths/

Fixes https://github.com/systemd/systemd/issues/18082

Partially reverts 6e65df89c348242dbd10036abc7dd5e8181cf733

(cherry picked from commit 60bce7c6d9606185114df1bdcd5ea100407688b8)
---
 src/core/systemd.pc.in | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/core/systemd.pc.in b/src/core/systemd.pc.in
index f2c0455..b5cc8f9 100644
--- a/src/core/systemd.pc.in
+++ b/src/core/systemd.pc.in
@@ -26,10 +26,10 @@ systemdsystemunitdir=${systemd_system_unit_dir}
 systemd_system_preset_dir=${rootprefix}/lib/systemd/system-preset
 systemdsystempresetdir=${systemd_system_preset_dir}
 
-systemd_user_unit_dir=/usr/lib/systemd/user
+systemd_user_unit_dir=${prefix}/lib/systemd/user
 systemduserunitdir=${systemd_user_unit_dir}
 
-systemd_user_preset_dir=/usr/lib/systemd/user-preset
+systemd_user_preset_dir=${prefix}/lib/systemd/user-preset
 systemduserpresetdir=${systemd_user_preset_dir}
 
 systemd_system_conf_dir=${sysconfdir}/systemd/system
@@ -47,7 +47,7 @@ systemduserunitpath=${systemd_user_unit_path}
 systemd_system_generator_dir=${root_prefix}/lib/systemd/system-generators
 systemdsystemgeneratordir=${systemd_system_generator_dir}
 
-systemd_user_generator_dir=/usr/lib/systemd/user-generators
+systemd_user_generator_dir=${prefix}/lib/systemd/user-generators
 systemdusergeneratordir=${systemd_user_generator_dir}
 
 systemd_system_generator_path=/run/systemd/system-generators:/etc/systemd/system-generators:/usr/local/lib/systemd/system-generators:${systemd_system_generator_dir}
@@ -62,7 +62,7 @@ systemdsleepdir=${systemd_sleep_dir}
 systemd_shutdown_dir=${root_prefix}/lib/systemd/system-shutdown
 systemdshutdowndir=${systemd_shutdown_dir}
 
-tmpfiles_dir=/usr/lib/tmpfiles.d
+tmpfiles_dir=${prefix}/lib/tmpfiles.d
 tmpfilesdir=${tmpfiles_dir}
 
 sysusers_dir=${rootprefix}/lib/sysusers.d
@@ -77,7 +77,7 @@ binfmtdir=${binfmt_dir}
 modules_load_dir=${rootprefix}/lib/modules-load.d
 modulesloaddir=${modules_load_dir}
 
-catalog_dir=/usr/lib/systemd/catalog
+catalog_dir=${prefix}/lib/systemd/catalog
 catalogdir=${catalog_dir}
 
 system_uid_max=@SYSTEM_UID_MAX@