X Tutup
Skip to content

Commit c812179

Browse files
committed
i18n: drop intltool use, use meson's merge_file directly
This didn't work during the initial conversion to meson, but should now. A sufficiently new polkit is also required, for the .its rules files. Note that https://github.com/mesonbuild/meson/blob/master/docs/markdown/i18n-module.md says that 'install' argument was added in meson 0.43.0. If this is accurate, warnigs might be generated with older mesons. Fedora has 0.43.0 across the board, but other distros probably don't, but I guess that a warning is prefereable to having to update do latest meson. The advantages are: - one less dependency (intltool) - using the generic implementation instead of our open-coded calls - we don't need to use the fake "_" prefixes in XML Replaces systemd#1609, fixes systemd#7300.
1 parent f38326f commit c812179

16 files changed

+131
-149
lines changed

README

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ REQUIREMENTS:
149149
libpython (optional)
150150
libidn2 or libidn (optional)
151151
elfutils >= 158 (optional)
152+
polkit >= 0.113-22-gc78819245f (optional)
152153
pkg-config
153154
gperf
154155
docbook-xsl (optional, required for documentation)

po/meson.build

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,4 @@
11
i18n = import('i18n')
22
i18n.gettext(meson.project_name())
33

4-
#####################################################################
5-
6-
intltool_merge = find_program('intltool-merge')
74
po_dir = meson.current_source_dir()
8-
9-
intltool_cache = join_paths(meson.current_build_dir(), 'intltool-merge-cache')
10-
intltool_command = [intltool_merge, '-x', '-u',
11-
'-c', intltool_cache,
12-
po_dir, '@INPUT@', '@OUTPUT@']

src/core/meson.build

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -197,25 +197,14 @@ policy_in = configure_file(
197197
output : 'org.freedesktop.systemd1.policy.in',
198198
configuration : substs)
199199

200-
custom_target(
200+
i18n.merge_file(
201201
'org.freedesktop.systemd1.policy',
202202
input : policy_in,
203203
output : 'org.freedesktop.systemd1.policy',
204-
command : intltool_command,
204+
po_dir : po_dir,
205205
install : install_polkit,
206206
install_dir : polkitpolicydir)
207207

208-
# TODO: this might work with meson from git, see
209-
# https://github.com/mesonbuild/meson/issues/1441#issuecomment-283585493
210-
#
211-
# i18n.merge_file(
212-
# 'org.freedesktop.systemd1.policy',
213-
# po_dir : po_dir,
214-
# input : policy_in,
215-
# output : 'org.freedesktop.systemd1.policy',
216-
# install : install_polkit,
217-
# install_dir : polkitpolicydir)
218-
219208
install_data('system.conf',
220209
'user.conf',
221210
install_dir : pkgsysconfdir)

src/core/org.freedesktop.systemd1.policy.in.in

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<vendor_url>http://www.freedesktop.org/wiki/Software/systemd</vendor_url>
1818

1919
<action id="org.freedesktop.systemd1.reply-password">
20-
<_description>Send passphrase back to system</_description>
21-
<_message>Authentication is required to send the entered passphrase back to the system.</_message>
20+
<description>Send passphrase back to system</description>
21+
<message>Authentication is required to send the entered passphrase back to the system.</message>
2222
<defaults>
2323
<allow_any>no</allow_any>
2424
<allow_inactive>no</allow_inactive>
@@ -28,8 +28,8 @@
2828
</action>
2929

3030
<action id="org.freedesktop.systemd1.manage-units">
31-
<_description>Manage system services or other units</_description>
32-
<_message>Authentication is required to manage system services or other units.</_message>
31+
<description>Manage system services or other units</description>
32+
<message>Authentication is required to manage system services or other units.</message>
3333
<defaults>
3434
<allow_any>auth_admin</allow_any>
3535
<allow_inactive>auth_admin</allow_inactive>
@@ -38,8 +38,8 @@
3838
</action>
3939

4040
<action id="org.freedesktop.systemd1.manage-unit-files">
41-
<_description>Manage system service or unit files</_description>
42-
<_message>Authentication is required to manage system service or unit files.</_message>
41+
<description>Manage system service or unit files</description>
42+
<message>Authentication is required to manage system service or unit files.</message>
4343
<defaults>
4444
<allow_any>auth_admin</allow_any>
4545
<allow_inactive>auth_admin</allow_inactive>
@@ -48,8 +48,8 @@
4848
</action>
4949

5050
<action id="org.freedesktop.systemd1.set-environment">
51-
<_description>Set or unset system and service manager environment variables</_description>
52-
<_message>Authentication is required to set or unset system and service manager environment variables.</_message>
51+
<description>Set or unset system and service manager environment variables</description>
52+
<message>Authentication is required to set or unset system and service manager environment variables.</message>
5353
<defaults>
5454
<allow_any>auth_admin</allow_any>
5555
<allow_inactive>auth_admin</allow_inactive>
@@ -58,8 +58,8 @@
5858
</action>
5959

6060
<action id="org.freedesktop.systemd1.reload-daemon">
61-
<_description>Reload the systemd state</_description>
62-
<_message>Authentication is required to reload the systemd state.</_message>
61+
<description>Reload the systemd state</description>
62+
<message>Authentication is required to reload the systemd state.</message>
6363
<defaults>
6464
<allow_any>auth_admin</allow_any>
6565
<allow_inactive>auth_admin</allow_inactive>

src/hostname/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ if conf.get('ENABLE_HOSTNAMED') == 1
44
install_data('org.freedesktop.hostname1.service',
55
install_dir : dbussystemservicedir)
66

7-
custom_target(
7+
i18n.merge_file(
88
'org.freedesktop.hostname1.policy',
99
input : 'org.freedesktop.hostname1.policy.in',
1010
output : 'org.freedesktop.hostname1.policy',
11-
command : intltool_command,
11+
po_dir : po_dir,
1212
install : install_polkit,
1313
install_dir : polkitpolicydir)
1414
endif

src/hostname/org.freedesktop.hostname1.policy.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<vendor_url>http://www.freedesktop.org/wiki/Software/systemd</vendor_url>
1818

1919
<action id="org.freedesktop.hostname1.set-hostname">
20-
<_description>Set host name</_description>
21-
<_message>Authentication is required to set the local host name.</_message>
20+
<description>Set host name</description>
21+
<message>Authentication is required to set the local host name.</message>
2222
<defaults>
2323
<allow_any>auth_admin_keep</allow_any>
2424
<allow_inactive>auth_admin_keep</allow_inactive>
@@ -27,8 +27,8 @@
2727
</action>
2828

2929
<action id="org.freedesktop.hostname1.set-static-hostname">
30-
<_description>Set static host name</_description>
31-
<_message>Authentication is required to set the statically configured local host name, as well as the pretty host name.</_message>
30+
<description>Set static host name</description>
31+
<message>Authentication is required to set the statically configured local host name, as well as the pretty host name.</message>
3232
<defaults>
3333
<allow_any>auth_admin_keep</allow_any>
3434
<allow_inactive>auth_admin_keep</allow_inactive>
@@ -38,8 +38,8 @@
3838
</action>
3939

4040
<action id="org.freedesktop.hostname1.set-machine-info">
41-
<_description>Set machine information</_description>
42-
<_message>Authentication is required to set local machine information.</_message>
41+
<description>Set machine information</description>
42+
<message>Authentication is required to set local machine information.</message>
4343
<defaults>
4444
<allow_any>auth_admin_keep</allow_any>
4545
<allow_inactive>auth_admin_keep</allow_inactive>

src/import/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ if conf.get('ENABLE_IMPORTD') == 1
5454
install_data('org.freedesktop.import1.service',
5555
install_dir : dbussystemservicedir)
5656

57-
custom_target(
57+
i18n.merge_file(
5858
'org.freedesktop.import1.policy',
5959
input : 'org.freedesktop.import1.policy.in',
6060
output : 'org.freedesktop.import1.policy',
61-
command : intltool_command,
61+
po_dir : po_dir,
6262
install : install_polkit,
6363
install_dir : polkitpolicydir)
6464

src/import/org.freedesktop.import1.policy.in

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<vendor_url>http://www.freedesktop.org/wiki/Software/systemd</vendor_url>
1818

1919
<action id="org.freedesktop.import1.import">
20-
<_description>Import a VM or container image</_description>
21-
<_message>Authentication is required to import a VM or container image</_message>
20+
<description>Import a VM or container image</description>
21+
<message>Authentication is required to import a VM or container image</message>
2222
<defaults>
2323
<allow_any>auth_admin</allow_any>
2424
<allow_inactive>auth_admin</allow_inactive>
@@ -27,8 +27,8 @@
2727
</action>
2828

2929
<action id="org.freedesktop.import1.export">
30-
<_description>Export a VM or container image</_description>
31-
<_message>Authentication is required to export a VM or container image</_message>
30+
<description>Export a VM or container image</description>
31+
<message>Authentication is required to export a VM or container image</message>
3232
<defaults>
3333
<allow_any>auth_admin</allow_any>
3434
<allow_inactive>auth_admin</allow_inactive>
@@ -37,8 +37,8 @@
3737
</action>
3838

3939
<action id="org.freedesktop.import1.pull">
40-
<_description>Download a VM or container image</_description>
41-
<_message>Authentication is required to download a VM or container image</_message>
40+
<description>Download a VM or container image</description>
41+
<message>Authentication is required to download a VM or container image</message>
4242
<defaults>
4343
<allow_any>auth_admin</allow_any>
4444
<allow_inactive>auth_admin</allow_inactive>

src/locale/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ if conf.get('ENABLE_LOCALED') == 1
1212
install_data('org.freedesktop.locale1.service',
1313
install_dir : dbussystemservicedir)
1414

15-
custom_target(
15+
i18n.merge_file(
1616
'org.freedesktop.locale1.policy',
1717
input : 'org.freedesktop.locale1.policy.in',
1818
output : 'org.freedesktop.locale1.policy',
19-
command : intltool_command,
19+
po_dir : po_dir,
2020
install : install_polkit,
2121
install_dir : polkitpolicydir)
2222
endif

src/locale/org.freedesktop.locale1.policy.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
<vendor_url>http://www.freedesktop.org/wiki/Software/systemd</vendor_url>
1818

1919
<action id="org.freedesktop.locale1.set-locale">
20-
<_description>Set system locale</_description>
21-
<_message>Authentication is required to set the system locale.</_message>
20+
<description>Set system locale</description>
21+
<message>Authentication is required to set the system locale.</message>
2222
<defaults>
2323
<allow_any>auth_admin_keep</allow_any>
2424
<allow_inactive>auth_admin_keep</allow_inactive>
@@ -28,8 +28,8 @@
2828
</action>
2929

3030
<action id="org.freedesktop.locale1.set-keyboard">
31-
<_description>Set system keyboard settings</_description>
32-
<_message>Authentication is required to set the system keyboard settings.</_message>
31+
<description>Set system keyboard settings</description>
32+
<message>Authentication is required to set the system keyboard settings.</message>
3333
<defaults>
3434
<allow_any>auth_admin_keep</allow_any>
3535
<allow_inactive>auth_admin_keep</allow_inactive>

0 commit comments

Comments
 (0)
X Tutup