about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch
blob: 832ae945aa2c8db22beb9c181e5c4834784ec109 (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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
diff --git i/data/meson.build w/data/meson.build
index 6ac2a11..73f433b 100644
--- i/data/meson.build
+++ w/data/meson.build
@@ -1,6 +1,6 @@
 if get_option('enable-backend')
     conf = configuration_data()
-    conf.set('sysconfdir', sysconfdir)
+    conf.set('sysconfdir', sysconfdir_install)
 
     if get_option('demo-agent')
         conf.set('demo_agent', 'geoclue-demo-agent;')
@@ -8,7 +8,7 @@ if get_option('enable-backend')
         conf.set('demo_agent', '')
     endif
 
-    conf_dir = join_paths(sysconfdir, 'geoclue')
+    conf_dir = join_paths(sysconfdir_install, 'geoclue')
     configure_file(output: 'geoclue.conf',
                    input: 'geoclue.conf.in',
                    configuration: conf,
@@ -17,7 +17,7 @@ if get_option('enable-backend')
     conf = configuration_data()
     conf.set('libexecdir', libexecdir)
     conf.set('dbus_srv_user', get_option('dbus-srv-user'))
-    conf.set('sysconfdir', sysconfdir)
+    conf.set('sysconfdir', sysconfdir_install)
 
     confd_dir = join_paths(conf_dir, 'conf.d')
     install_emptydir(confd_dir)
@@ -37,7 +37,7 @@ if get_option('enable-backend')
     # DBus Service policy file
     dbus_service_dir = get_option('dbus-sys-dir')
     if dbus_service_dir == ''
-        dbus_service_dir = join_paths(sysconfdir, 'dbus-1', 'system.d')
+        dbus_service_dir = join_paths(sysconfdir_install, 'dbus-1', 'system.d')
     endif
     configure_file(output: 'org.freedesktop.GeoClue2.conf',
                    input: 'org.freedesktop.GeoClue2.conf.in',
diff --git i/demo/meson.build w/demo/meson.build
index 1427fbe..2623f16 100644
--- i/demo/meson.build
+++ w/demo/meson.build
@@ -54,7 +54,7 @@ if get_option('demo-agent')
                                    install_dir: desktop_dir)
 
     # Also install in the autostart directory.
-    autostart_dir = join_paths(sysconfdir, 'xdg', 'autostart')
+    autostart_dir = join_paths(sysconfdir_install, 'xdg', 'autostart')
     meson.add_install_script('install-file.py',
                              desktop_file.full_path(),
                              autostart_dir)
diff --git i/meson.build w/meson.build
index 220ae2b..dbf6458 100644
--- i/meson.build
+++ w/meson.build
@@ -12,7 +12,11 @@ gclue_api_version='2.0'
 datadir = join_paths(get_option('prefix'), get_option('datadir'))
 includedir = join_paths(get_option('prefix'), get_option('includedir'))
 libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
-sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
+if get_option('sysconfdir_install') != ''
+  sysconfdir_install = join_paths(get_option('prefix'), get_option('sysconfdir_install'))
+else
+  sysconfdir_install = get_option('sysconfdir')
+endif
 localedir = join_paths(datadir, 'locale')
 
 header_dir = 'libgeoclue-' + gclue_api_version
@@ -29,7 +33,7 @@ conf.set_quoted('PACKAGE_URL', 'https://gitlab.freedesktop.org/geoclue/geoclue/w
 conf.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/geoclue/geoclue/issues/new')
 conf.set_quoted('TEST_SRCDIR', meson.project_source_root() + '/data/')
 conf.set_quoted('LOCALEDIR', localedir)
-conf.set_quoted('SYSCONFDIR', sysconfdir)
+conf.set_quoted('SYSCONFDIR', get_option('sysconfdir'))
 conf.set_quoted('MOZILLA_API_KEY', get_option('mozilla-api-key'))
 conf.set10('GCLUE_USE_3G_SOURCE', get_option('3g-source'))
 conf.set10('GCLUE_USE_CDMA_SOURCE', get_option('cdma-source'))
diff --git i/meson_options.txt w/meson_options.txt
index 5b8c42d..945dfd5 100644
--- i/meson_options.txt
+++ w/meson_options.txt
@@ -40,6 +40,9 @@ option('systemd-system-unit-dir',
 option('dbus-srv-user',
        type: 'string', value: 'root',
        description: 'The user (existing) as which the service will run')
+option('sysconfdir_install',
+       type: 'string', value: '',
+       description: 'sysconfdir to use during installation')
 option('mozilla-api-key',
        type: 'string', value: 'geoclue',
        description: 'Your API key for Mozilla Location Service')