From 8c979cfa98a4c58bd8056d17cadd0d657998d189 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Sat, 9 Jan 2021 19:59:56 +0100 Subject: [PATCH] meson: Add option to disable translations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This speeds up the meson install step by half a second which, given the trivial changes required to add this option, makes it worth the effort to support this. Before: ``` ‣ Running build script... [1/418] Generating version.h with a custom command Installing /root/build/po/be.gmo to /root/dest/usr/share/locale/be/LC_MESSAGES/systemd.mo Installing /root/build/po/be@latin.gmo to /root/dest/usr/share/locale/be@latin/LC_MESSAGES/systemd.mo Installing /root/build/po/bg.gmo to /root/dest/usr/share/locale/bg/LC_MESSAGES/systemd.mo Installing /root/build/po/ca.gmo to /root/dest/usr/share/locale/ca/LC_MESSAGES/systemd.mo Installing /root/build/po/cs.gmo to /root/dest/usr/share/locale/cs/LC_MESSAGES/systemd.mo Installing /root/build/po/da.gmo to /root/dest/usr/share/locale/da/LC_MESSAGES/systemd.mo Installing /root/build/po/de.gmo to /root/dest/usr/share/locale/de/LC_MESSAGES/systemd.mo Installing /root/build/po/el.gmo to /root/dest/usr/share/locale/el/LC_MESSAGES/systemd.mo Installing /root/build/po/es.gmo to /root/dest/usr/share/locale/es/LC_MESSAGES/systemd.mo Installing /root/build/po/fr.gmo to /root/dest/usr/share/locale/fr/LC_MESSAGES/systemd.mo Installing /root/build/po/gl.gmo to /root/dest/usr/share/locale/gl/LC_MESSAGES/systemd.mo Installing /root/build/po/hr.gmo to /root/dest/usr/share/locale/hr/LC_MESSAGES/systemd.mo Installing /root/build/po/hu.gmo to /root/dest/usr/share/locale/hu/LC_MESSAGES/systemd.mo Installing /root/build/po/id.gmo to /root/dest/usr/share/locale/id/LC_MESSAGES/systemd.mo Installing /root/build/po/it.gmo to /root/dest/usr/share/locale/it/LC_MESSAGES/systemd.mo Installing /root/build/po/ja.gmo to /root/dest/usr/share/locale/ja/LC_MESSAGES/systemd.mo Installing /root/build/po/ko.gmo to /root/dest/usr/share/locale/ko/LC_MESSAGES/systemd.mo Installing /root/build/po/lt.gmo to /root/dest/usr/share/locale/lt/LC_MESSAGES/systemd.mo Installing /root/build/po/pl.gmo to /root/dest/usr/share/locale/pl/LC_MESSAGES/systemd.mo Installing /root/build/po/pt_BR.gmo to /root/dest/usr/share/locale/pt_BR/LC_MESSAGES/systemd.mo Installing /root/build/po/ro.gmo to /root/dest/usr/share/locale/ro/LC_MESSAGES/systemd.mo Installing /root/build/po/ru.gmo to /root/dest/usr/share/locale/ru/LC_MESSAGES/systemd.mo Installing /root/build/po/sk.gmo to /root/dest/usr/share/locale/sk/LC_MESSAGES/systemd.mo Installing /root/build/po/sr.gmo to /root/dest/usr/share/locale/sr/LC_MESSAGES/systemd.mo Installing /root/build/po/sv.gmo to /root/dest/usr/share/locale/sv/LC_MESSAGES/systemd.mo Installing /root/build/po/tr.gmo to /root/dest/usr/share/locale/tr/LC_MESSAGES/systemd.mo Installing /root/build/po/uk.gmo to /root/dest/usr/share/locale/uk/LC_MESSAGES/systemd.mo Installing /root/build/po/zh_CN.gmo to /root/dest/usr/share/locale/zh_CN/LC_MESSAGES/systemd.mo Installing /root/build/po/zh_TW.gmo to /root/dest/usr/share/locale/zh_TW/LC_MESSAGES/systemd.mo Installing /root/build/po/pa.gmo to /root/dest/usr/share/locale/pa/LC_MESSAGES/systemd.mo real 0m1.467s user 0m1.064s sys 0m0.392s ``` After (with translations disabled): ``` ‣ Running build script... [1/418] Generating version.h with a custom command real 0m0.925s user 0m0.622s sys 0m0.301s ``` --- meson_options.txt | 2 ++ po/meson.build | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 6e104d21c3..d1096655dc 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -161,6 +161,8 @@ option('man', type : 'combo', choices : ['auto', 'true', 'false'], option('html', type : 'combo', choices : ['auto', 'true', 'false'], value : 'false', description : 'build and install html pages') +option('translations', type : 'boolean', value : true, + description : 'build and install translations') option('certificate-root', type : 'string', value : '/etc/ssl', description : 'the prefix for TLS certificates') diff --git a/po/meson.build b/po/meson.build index 193f614f4f..139f393e33 100644 --- a/po/meson.build +++ b/po/meson.build @@ -1,6 +1,10 @@ # SPDX-License-Identifier: LGPL-2.1-or-later i18n = import('i18n') -i18n.gettext(meson.project_name(), - preset : 'glib', - data_dirs : '.') +want_translations = get_option('translations') + +if want_translations + i18n.gettext(meson.project_name(), + preset : 'glib', + data_dirs : '.') +endif