From c81217920effddc93fb780cf8f9eb699d6fe1319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 13 Nov 2017 13:30:39 +0100 Subject: [PATCH] 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 #1609, fixes #7300. --- README | 1 + po/meson.build | 8 -- src/core/meson.build | 15 +- .../org.freedesktop.systemd1.policy.in.in | 20 +-- src/hostname/meson.build | 4 +- .../org.freedesktop.hostname1.policy.in | 12 +- src/import/meson.build | 4 +- src/import/org.freedesktop.import1.policy.in | 12 +- src/locale/meson.build | 4 +- src/locale/org.freedesktop.locale1.policy.in | 8 +- src/login/meson.build | 4 +- src/login/org.freedesktop.login1.policy.in | 128 +++++++++--------- src/machine/meson.build | 4 +- .../org.freedesktop.machine1.policy.in | 32 ++--- src/timedate/meson.build | 4 +- .../org.freedesktop.timedate1.policy.in | 20 +-- 16 files changed, 131 insertions(+), 149 deletions(-) diff --git a/README b/README index e36a1f9fa1..f73524df1d 100644 --- a/README +++ b/README @@ -149,6 +149,7 @@ REQUIREMENTS: libpython (optional) libidn2 or libidn (optional) elfutils >= 158 (optional) + polkit >= 0.113-22-gc78819245f (optional) pkg-config gperf docbook-xsl (optional, required for documentation) diff --git a/po/meson.build b/po/meson.build index f89291bfc4..c4654be5ff 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,12 +1,4 @@ i18n = import('i18n') i18n.gettext(meson.project_name()) -##################################################################### - -intltool_merge = find_program('intltool-merge') po_dir = meson.current_source_dir() - -intltool_cache = join_paths(meson.current_build_dir(), 'intltool-merge-cache') -intltool_command = [intltool_merge, '-x', '-u', - '-c', intltool_cache, - po_dir, '@INPUT@', '@OUTPUT@'] diff --git a/src/core/meson.build b/src/core/meson.build index 4355f9ca6d..d364c5a284 100644 --- a/src/core/meson.build +++ b/src/core/meson.build @@ -197,25 +197,14 @@ policy_in = configure_file( output : 'org.freedesktop.systemd1.policy.in', configuration : substs) -custom_target( +i18n.merge_file( 'org.freedesktop.systemd1.policy', input : policy_in, output : 'org.freedesktop.systemd1.policy', - command : intltool_command, + po_dir : po_dir, install : install_polkit, install_dir : polkitpolicydir) -# TODO: this might work with meson from git, see -# https://github.com/mesonbuild/meson/issues/1441#issuecomment-283585493 -# -# i18n.merge_file( -# 'org.freedesktop.systemd1.policy', -# po_dir : po_dir, -# input : policy_in, -# output : 'org.freedesktop.systemd1.policy', -# install : install_polkit, -# install_dir : polkitpolicydir) - install_data('system.conf', 'user.conf', install_dir : pkgsysconfdir) diff --git a/src/core/org.freedesktop.systemd1.policy.in.in b/src/core/org.freedesktop.systemd1.policy.in.in index cc39a9e1c3..9f9263762e 100644 --- a/src/core/org.freedesktop.systemd1.policy.in.in +++ b/src/core/org.freedesktop.systemd1.policy.in.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - <_description>Send passphrase back to system - <_message>Authentication is required to send the entered passphrase back to the system. + Send passphrase back to system + Authentication is required to send the entered passphrase back to the system. no no @@ -28,8 +28,8 @@ - <_description>Manage system services or other units - <_message>Authentication is required to manage system services or other units. + Manage system services or other units + Authentication is required to manage system services or other units. auth_admin auth_admin @@ -38,8 +38,8 @@ - <_description>Manage system service or unit files - <_message>Authentication is required to manage system service or unit files. + Manage system service or unit files + Authentication is required to manage system service or unit files. auth_admin auth_admin @@ -48,8 +48,8 @@ - <_description>Set or unset system and service manager environment variables - <_message>Authentication is required to set or unset system and service manager environment variables. + Set or unset system and service manager environment variables + Authentication is required to set or unset system and service manager environment variables. auth_admin auth_admin @@ -58,8 +58,8 @@ - <_description>Reload the systemd state - <_message>Authentication is required to reload the systemd state. + Reload the systemd state + Authentication is required to reload the systemd state. auth_admin auth_admin diff --git a/src/hostname/meson.build b/src/hostname/meson.build index 834300ae6e..b4db5afb1f 100644 --- a/src/hostname/meson.build +++ b/src/hostname/meson.build @@ -4,11 +4,11 @@ if conf.get('ENABLE_HOSTNAMED') == 1 install_data('org.freedesktop.hostname1.service', install_dir : dbussystemservicedir) - custom_target( + i18n.merge_file( 'org.freedesktop.hostname1.policy', input : 'org.freedesktop.hostname1.policy.in', output : 'org.freedesktop.hostname1.policy', - command : intltool_command, + po_dir : po_dir, install : install_polkit, install_dir : polkitpolicydir) endif diff --git a/src/hostname/org.freedesktop.hostname1.policy.in b/src/hostname/org.freedesktop.hostname1.policy.in index c32c1d4fda..cf61c15619 100644 --- a/src/hostname/org.freedesktop.hostname1.policy.in +++ b/src/hostname/org.freedesktop.hostname1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - <_description>Set host name - <_message>Authentication is required to set the local host name. + Set host name + Authentication is required to set the local host name. auth_admin_keep auth_admin_keep @@ -27,8 +27,8 @@ - <_description>Set static host name - <_message>Authentication is required to set the statically configured local host name, as well as the pretty host name. + Set static host name + Authentication is required to set the statically configured local host name, as well as the pretty host name. auth_admin_keep auth_admin_keep @@ -38,8 +38,8 @@ - <_description>Set machine information - <_message>Authentication is required to set local machine information. + Set machine information + Authentication is required to set local machine information. auth_admin_keep auth_admin_keep diff --git a/src/import/meson.build b/src/import/meson.build index e3a0da65d2..9ace20f50d 100644 --- a/src/import/meson.build +++ b/src/import/meson.build @@ -54,11 +54,11 @@ if conf.get('ENABLE_IMPORTD') == 1 install_data('org.freedesktop.import1.service', install_dir : dbussystemservicedir) - custom_target( + i18n.merge_file( 'org.freedesktop.import1.policy', input : 'org.freedesktop.import1.policy.in', output : 'org.freedesktop.import1.policy', - command : intltool_command, + po_dir : po_dir, install : install_polkit, install_dir : polkitpolicydir) diff --git a/src/import/org.freedesktop.import1.policy.in b/src/import/org.freedesktop.import1.policy.in index 85924ed743..39167b06bc 100644 --- a/src/import/org.freedesktop.import1.policy.in +++ b/src/import/org.freedesktop.import1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - <_description>Import a VM or container image - <_message>Authentication is required to import a VM or container image + Import a VM or container image + Authentication is required to import a VM or container image auth_admin auth_admin @@ -27,8 +27,8 @@ - <_description>Export a VM or container image - <_message>Authentication is required to export a VM or container image + Export a VM or container image + Authentication is required to export a VM or container image auth_admin auth_admin @@ -37,8 +37,8 @@ - <_description>Download a VM or container image - <_message>Authentication is required to download a VM or container image + Download a VM or container image + Authentication is required to download a VM or container image auth_admin auth_admin diff --git a/src/locale/meson.build b/src/locale/meson.build index e9de6089f3..a0411fb1a6 100644 --- a/src/locale/meson.build +++ b/src/locale/meson.build @@ -12,11 +12,11 @@ if conf.get('ENABLE_LOCALED') == 1 install_data('org.freedesktop.locale1.service', install_dir : dbussystemservicedir) - custom_target( + i18n.merge_file( 'org.freedesktop.locale1.policy', input : 'org.freedesktop.locale1.policy.in', output : 'org.freedesktop.locale1.policy', - command : intltool_command, + po_dir : po_dir, install : install_polkit, install_dir : polkitpolicydir) endif diff --git a/src/locale/org.freedesktop.locale1.policy.in b/src/locale/org.freedesktop.locale1.policy.in index df63845e9b..575a1ffaaf 100644 --- a/src/locale/org.freedesktop.locale1.policy.in +++ b/src/locale/org.freedesktop.locale1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - <_description>Set system locale - <_message>Authentication is required to set the system locale. + Set system locale + Authentication is required to set the system locale. auth_admin_keep auth_admin_keep @@ -28,8 +28,8 @@ - <_description>Set system keyboard settings - <_message>Authentication is required to set the system keyboard settings. + Set system keyboard settings + Authentication is required to set the system keyboard settings. auth_admin_keep auth_admin_keep diff --git a/src/login/meson.build b/src/login/meson.build index d0723f134f..339c5d73ca 100644 --- a/src/login/meson.build +++ b/src/login/meson.build @@ -71,11 +71,11 @@ if conf.get('ENABLE_LOGIND') == 1 install_data('org.freedesktop.login1.service', install_dir : dbussystemservicedir) - custom_target( + i18n.merge_file( 'org.freedesktop.login1.policy', input : 'org.freedesktop.login1.policy.in', output : 'org.freedesktop.login1.policy', - command : intltool_command, + po_dir : po_dir, install : install_polkit, install_dir : polkitpolicydir) diff --git a/src/login/org.freedesktop.login1.policy.in b/src/login/org.freedesktop.login1.policy.in index 3e8a9bbe3f..17bae02f5e 100644 --- a/src/login/org.freedesktop.login1.policy.in +++ b/src/login/org.freedesktop.login1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - <_description>Allow applications to inhibit system shutdown - <_message>Authentication is required for an application to inhibit system shutdown. + Allow applications to inhibit system shutdown + Authentication is required for an application to inhibit system shutdown. no yes @@ -28,8 +28,8 @@ - <_description>Allow applications to delay system shutdown - <_message>Authentication is required for an application to delay system shutdown. + Allow applications to delay system shutdown + Authentication is required for an application to delay system shutdown. yes yes @@ -39,8 +39,8 @@ - <_description>Allow applications to inhibit system sleep - <_message>Authentication is required for an application to inhibit system sleep. + Allow applications to inhibit system sleep + Authentication is required for an application to inhibit system sleep. no yes @@ -50,8 +50,8 @@ - <_description>Allow applications to delay system sleep - <_message>Authentication is required for an application to delay system sleep. + Allow applications to delay system sleep + Authentication is required for an application to delay system sleep. yes yes @@ -60,8 +60,8 @@ - <_description>Allow applications to inhibit automatic system suspend - <_message>Authentication is required for an application to inhibit automatic system suspend. + Allow applications to inhibit automatic system suspend + Authentication is required for an application to inhibit automatic system suspend. yes yes @@ -70,8 +70,8 @@ - <_description>Allow applications to inhibit system handling of the power key - <_message>Authentication is required for an application to inhibit system handling of the power key. + Allow applications to inhibit system handling of the power key + Authentication is required for an application to inhibit system handling of the power key. no yes @@ -81,8 +81,8 @@ - <_description>Allow applications to inhibit system handling of the suspend key - <_message>Authentication is required for an application to inhibit system handling of the suspend key. + Allow applications to inhibit system handling of the suspend key + Authentication is required for an application to inhibit system handling of the suspend key. no yes @@ -92,8 +92,8 @@ - <_description>Allow applications to inhibit system handling of the hibernate key - <_message>Authentication is required for an application to inhibit system handling of the hibernate key. + Allow applications to inhibit system handling of the hibernate key + Authentication is required for an application to inhibit system handling of the hibernate key. no yes @@ -102,8 +102,8 @@ - <_description>Allow applications to inhibit system handling of the lid switch - <_message>Authentication is required for an application to inhibit system handling of the lid switch. + Allow applications to inhibit system handling of the lid switch + Authentication is required for an application to inhibit system handling of the lid switch. no yes @@ -112,8 +112,8 @@ - <_description>Allow non-logged-in user to run programs - <_message>Explicit request is required to run programs as a non-logged-in user. + Allow non-logged-in user to run programs + Explicit request is required to run programs as a non-logged-in user. yes yes @@ -122,8 +122,8 @@ - <_description>Allow non-logged-in users to run programs - <_message>Authentication is required to run programs as a non-logged-in user. + Allow non-logged-in users to run programs + Authentication is required to run programs as a non-logged-in user. auth_admin_keep auth_admin_keep @@ -132,8 +132,8 @@ - <_description>Allow attaching devices to seats - <_message>Authentication is required for attaching a device to a seat. + Allow attaching devices to seats + Authentication is required for attaching a device to a seat. auth_admin_keep auth_admin_keep @@ -143,8 +143,8 @@ - <_description>Flush device to seat attachments - <_message>Authentication is required for resetting how devices are attached to seats. + Flush device to seat attachments + Authentication is required for resetting how devices are attached to seats. auth_admin_keep auth_admin_keep @@ -153,8 +153,8 @@ - <_description>Power off the system - <_message>Authentication is required for powering off the system. + Power off the system + Authentication is required for powering off the system. auth_admin_keep auth_admin_keep @@ -164,8 +164,8 @@ - <_description>Power off the system while other users are logged in - <_message>Authentication is required for powering off the system while other users are logged in. + Power off the system while other users are logged in + Authentication is required for powering off the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -175,8 +175,8 @@ - <_description>Power off the system while an application asked to inhibit it - <_message>Authentication is required for powering off the system while an application asked to inhibit it. + Power off the system while an application asked to inhibit it + Authentication is required for powering off the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -186,8 +186,8 @@ - <_description>Reboot the system - <_message>Authentication is required for rebooting the system. + Reboot the system + Authentication is required for rebooting the system. auth_admin_keep auth_admin_keep @@ -197,8 +197,8 @@ - <_description>Reboot the system while other users are logged in - <_message>Authentication is required for rebooting the system while other users are logged in. + Reboot the system while other users are logged in + Authentication is required for rebooting the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -208,8 +208,8 @@ - <_description>Reboot the system while an application asked to inhibit it - <_message>Authentication is required for rebooting the system while an application asked to inhibit it. + Reboot the system while an application asked to inhibit it + Authentication is required for rebooting the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -219,8 +219,8 @@ - <_description>Halt the system - <_message>Authentication is required for halting the system. + Halt the system + Authentication is required for halting the system. auth_admin_keep auth_admin_keep @@ -230,8 +230,8 @@ - <_description>Halt the system while other users are logged in - <_message>Authentication is required for halting the system while other users are logged in. + Halt the system while other users are logged in + Authentication is required for halting the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -241,8 +241,8 @@ - <_description>Halt the system while an application asked to inhibit it - <_message>Authentication is required for halting the system while an application asked to inhibit it. + Halt the system while an application asked to inhibit it + Authentication is required for halting the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -252,8 +252,8 @@ - <_description>Suspend the system - <_message>Authentication is required for suspending the system. + Suspend the system + Authentication is required for suspending the system. auth_admin_keep auth_admin_keep @@ -262,8 +262,8 @@ - <_description>Suspend the system while other users are logged in - <_message>Authentication is required for suspending the system while other users are logged in. + Suspend the system while other users are logged in + Authentication is required for suspending the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -273,8 +273,8 @@ - <_description>Suspend the system while an application asked to inhibit it - <_message>Authentication is required for suspending the system while an application asked to inhibit it. + Suspend the system while an application asked to inhibit it + Authentication is required for suspending the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -284,8 +284,8 @@ - <_description>Hibernate the system - <_message>Authentication is required for hibernating the system. + Hibernate the system + Authentication is required for hibernating the system. auth_admin_keep auth_admin_keep @@ -294,8 +294,8 @@ - <_description>Hibernate the system while other users are logged in - <_message>Authentication is required for hibernating the system while other users are logged in. + Hibernate the system while other users are logged in + Authentication is required for hibernating the system while other users are logged in. auth_admin_keep auth_admin_keep @@ -305,8 +305,8 @@ - <_description>Hibernate the system while an application asked to inhibit it - <_message>Authentication is required for hibernating the system while an application asked to inhibit it. + Hibernate the system while an application asked to inhibit it + Authentication is required for hibernating the system while an application asked to inhibit it. auth_admin_keep auth_admin_keep @@ -316,8 +316,8 @@ - <_description>Manage active sessions, users and seats - <_message>Authentication is required for managing active sessions, users and seats. + Manage active sessions, users and seats + Authentication is required for managing active sessions, users and seats. auth_admin_keep auth_admin_keep @@ -326,8 +326,8 @@ - <_description>Lock or unlock active sessions - <_message>Authentication is required to lock or unlock active sessions. + Lock or unlock active sessions + Authentication is required to lock or unlock active sessions. auth_admin_keep auth_admin_keep @@ -336,8 +336,8 @@ - <_description>Allow indication to the firmware to boot to setup interface - <_message>Authentication is required to indicate to the firmware to boot to setup interface. + Allow indication to the firmware to boot to setup interface + Authentication is required to indicate to the firmware to boot to setup interface. auth_admin_keep auth_admin_keep @@ -346,8 +346,8 @@ - <_description>Set a wall message - <_message>Authentication is required to set a wall message + Set a wall message + Authentication is required to set a wall message auth_admin_keep auth_admin_keep diff --git a/src/machine/meson.build b/src/machine/meson.build index 693503da53..bdf64ac3d2 100644 --- a/src/machine/meson.build +++ b/src/machine/meson.build @@ -27,11 +27,11 @@ if conf.get('ENABLE_MACHINED') == 1 install_data('org.freedesktop.machine1.service', install_dir : dbussystemservicedir) - custom_target( + i18n.merge_file( 'org.freedesktop.machine1.policy', input : 'org.freedesktop.machine1.policy.in', output : 'org.freedesktop.machine1.policy', - command : intltool_command, + po_dir : po_dir, install : install_polkit, install_dir : polkitpolicydir) endif diff --git a/src/machine/org.freedesktop.machine1.policy.in b/src/machine/org.freedesktop.machine1.policy.in index 69f78a5c25..b266b564b0 100644 --- a/src/machine/org.freedesktop.machine1.policy.in +++ b/src/machine/org.freedesktop.machine1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - <_description>Log into a local container - <_message>Authentication is required to log into a local container. + Log into a local container + Authentication is required to log into a local container. auth_admin auth_admin @@ -27,8 +27,8 @@ - <_description>Log into the local host - <_message>Authentication is required to log into the local host. + Log into the local host + Authentication is required to log into the local host. auth_admin auth_admin @@ -37,8 +37,8 @@ - <_description>Acquire a shell in a local container - <_message>Authentication is required to acquire a shell in a local container. + Acquire a shell in a local container + Authentication is required to acquire a shell in a local container. auth_admin auth_admin @@ -48,8 +48,8 @@ - <_description>Acquire a shell on the local host - <_message>Authentication is required to acquire a shell on the local host. + Acquire a shell on the local host + Authentication is required to acquire a shell on the local host. auth_admin auth_admin @@ -59,8 +59,8 @@ - <_description>Acquire a pseudo TTY in a local container - <_message>Authentication is required to acquire a pseudo TTY in a local container. + Acquire a pseudo TTY in a local container + Authentication is required to acquire a pseudo TTY in a local container. auth_admin auth_admin @@ -69,8 +69,8 @@ - <_description>Acquire a pseudo TTY on the local host - <_message>Authentication is required to acquire a pseudo TTY on the local host. + Acquire a pseudo TTY on the local host + Authentication is required to acquire a pseudo TTY on the local host. auth_admin auth_admin @@ -79,8 +79,8 @@ - <_description>Manage local virtual machines and containers - <_message>Authentication is required to manage local virtual machines and containers. + Manage local virtual machines and containers + Authentication is required to manage local virtual machines and containers. auth_admin auth_admin @@ -90,8 +90,8 @@ - <_description>Manage local virtual machine and container images - <_message>Authentication is required to manage local virtual machine and container images. + Manage local virtual machine and container images + Authentication is required to manage local virtual machine and container images. auth_admin auth_admin diff --git a/src/timedate/meson.build b/src/timedate/meson.build index ce92a6be69..188cdcac7d 100644 --- a/src/timedate/meson.build +++ b/src/timedate/meson.build @@ -4,11 +4,11 @@ if conf.get('ENABLE_TIMEDATED') == 1 install_data('org.freedesktop.timedate1.service', install_dir : dbussystemservicedir) - custom_target( + i18n.merge_file( 'org.freedesktop.timedate1.policy', input : 'org.freedesktop.timedate1.policy.in', output : 'org.freedesktop.timedate1.policy', - command : intltool_command, + po_dir : po_dir, install : install_polkit, install_dir : polkitpolicydir) endif diff --git a/src/timedate/org.freedesktop.timedate1.policy.in b/src/timedate/org.freedesktop.timedate1.policy.in index aa30b70831..c706050985 100644 --- a/src/timedate/org.freedesktop.timedate1.policy.in +++ b/src/timedate/org.freedesktop.timedate1.policy.in @@ -17,8 +17,8 @@ http://www.freedesktop.org/wiki/Software/systemd - <_description>Set system time - <_message>Authentication is required to set the system time. + Set system time + Authentication is required to set the system time. auth_admin_keep auth_admin_keep @@ -28,8 +28,8 @@ - <_description>Set system timezone - <_message>Authentication is required to set the system timezone. + Set system timezone + Authentication is required to set the system timezone. auth_admin_keep auth_admin_keep @@ -38,9 +38,9 @@ - <_description>Set RTC to local timezone or UTC - <_message>Authentication is required to control whether - the RTC stores the local or UTC time. + Set RTC to local timezone or UTC + Authentication is required to control whether + the RTC stores the local or UTC time. auth_admin_keep auth_admin_keep @@ -49,9 +49,9 @@ - <_description>Turn network time synchronization on or off - <_message>Authentication is required to control whether - network time synchronization shall be enabled. + Turn network time synchronization on or off + Authentication is required to control whether + network time synchronization shall be enabled. auth_admin_keep auth_admin_keep