diff options
author | progandy <code@progandy> | 2018-11-23 23:14:59 +0100 |
---|---|---|
committer | progandy <code@progandy> | 2018-11-23 23:30:46 +0100 |
commit | c4bbd0d3c62e95a2adf7de032db76fa674d95760 (patch) | |
tree | 2832a8f4624edda9b547ef64493eb64310865e39 /meson.build | |
parent | Merge pull request #3158 from emersion/get-outputs-focused (diff) | |
download | sway-c4bbd0d3c62e95a2adf7de032db76fa674d95760.tar.gz sway-c4bbd0d3c62e95a2adf7de032db76fa674d95760.tar.zst sway-c4bbd0d3c62e95a2adf7de032db76fa674d95760.zip |
Meson: Fix SYSCONFDIR definition.
SYSCONFDIR was set to the wrong path if prefix is not '/usr' and
sysconfdir is an absolute path. Use join_paths() to fix it.
Also remove the special case for prefix '/usr'. In that case Meson
already sets sysconfdir to the absolute path '/etc', so just using
join_paths() will return the correct value.
join_paths('/usr/local', 'etc') => '/usr/local/etc'
join_paths('/usr/local', '/etc') => '/etc'
join_paths('/usr', '/etc') => '/etc'
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/meson.build b/meson.build index bb60bc89..810a657e 100644 --- a/meson.build +++ b/meson.build | |||
@@ -108,13 +108,7 @@ if scdoc.found() | |||
108 | endforeach | 108 | endforeach |
109 | endif | 109 | endif |
110 | 110 | ||
111 | # If prefix is '/usr', sysconfdir will be explicitly set to '/etc' by Meson to | 111 | add_project_arguments('-DSYSCONFDIR="/@0@"'.format(join_paths(prefix, sysconfdir)), language : 'c') |
112 | # enforce FHS compliance, so we should look for configs there as well. | ||
113 | if prefix == '/usr' | ||
114 | add_project_arguments('-DSYSCONFDIR="/@0@"'.format(sysconfdir), language : 'c') | ||
115 | else | ||
116 | add_project_arguments('-DSYSCONFDIR="/@0@/@1@"'.format(prefix, sysconfdir), language : 'c') | ||
117 | endif | ||
118 | 112 | ||
119 | version = get_option('sway-version') | 113 | version = get_option('sway-version') |
120 | if version != '' | 114 | if version != '' |
@@ -159,14 +153,7 @@ subdir('swaylock') | |||
159 | config = configuration_data() | 153 | config = configuration_data() |
160 | config.set('datadir', join_paths(prefix, datadir)) | 154 | config.set('datadir', join_paths(prefix, datadir)) |
161 | config.set('prefix', prefix) | 155 | config.set('prefix', prefix) |
162 | 156 | config.set('sysconfdir', join_paths(prefix, sysconfdir)) | |
163 | # If prefix is '/usr', sysconfdir will be explicitly set to '/etc' by Meson to | ||
164 | # enforce FHS compliance, so we should look for configs there as well. | ||
165 | if prefix == '/usr' | ||
166 | config.set('sysconfdir', sysconfdir) | ||
167 | else | ||
168 | config.set('sysconfdir', join_paths(prefix, sysconfdir)) | ||
169 | endif | ||
170 | 157 | ||
171 | configure_file( | 158 | configure_file( |
172 | configuration: config, | 159 | configuration: config, |