All of lore.kernel.org
 help / color / mirror / Atom feed
From: aduskett at gmail.com <aduskett@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v2 01/13] package/gettext-gnu: add msgfmt wrapper
Date: Fri, 24 Jul 2020 16:25:49 -0700	[thread overview]
Message-ID: <20200724232601.2441272-2-aduskett@gmail.com> (raw)
In-Reply-To: <20200724232601.2441272-1-aduskett@gmail.com>

From: Adam Duskett <Aduskett@gmail.com>

The msgfmt provided by gettext-gnu uses a default GETTEXTDATADIR path of
/usr/share/gettext, causing problems with msgfmt, particularly if the host
does not have gettext development packages installed, or if the host has a
different version of gettext. Install a wrapper that sets the GETTEXTDATADIR
to ${TARGET_DIR}/usr/share/gettext/ to ensure that any package using the
msgfmt utility uses the proper GETTEXTDATADIR path.

This wrapper is not needed for gettext-tiny, as their implimentation of msgfmt
is written completely from scratch and does not use the GETTEXTDATADIR
variable.

Signed-off-by: Adam Duskett <Aduskett@gmail.com>
---
 package/gettext-gnu/gettext-gnu.mk | 13 +++++++++++++
 package/gettext-gnu/msgfmt         |  3 +++
 2 files changed, 16 insertions(+)
 create mode 100644 package/gettext-gnu/msgfmt

diff --git a/package/gettext-gnu/gettext-gnu.mk b/package/gettext-gnu/gettext-gnu.mk
index ee7e97baf7..0b25203b5c 100644
--- a/package/gettext-gnu/gettext-gnu.mk
+++ b/package/gettext-gnu/gettext-gnu.mk
@@ -87,6 +87,19 @@ define HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION
 endef
 HOST_GETTEXT_GNU_POST_INSTALL_HOOKS += HOST_GETTEXT_GNU_GETTEXTIZE_CONFIRMATION
 
+# The msgfmt provided by gettext-gnu uses a default GETTEXTDATADIR path of
+# /usr/share/gettext, causing problems with msgfmt, particularly if the host
+# does not have gettext development packages installed, or if the host has a
+# different version of gettext. Install a wrapper that sets the GETTEXTDATADIR
+# to ${TARGET_DIR}/usr/share/gettext/ to ensure that any package using the
+# msgfmt utility uses the proper GETTEXTDATADIR path.
+define GETTEXT_GNU_INSTALL_MSGFMT_WRAPPER
+	mv $(HOST_DIR)/bin/msgfmt $(HOST_DIR)/bin/msgfmt.real
+	$(INSTALL) -D -m 755 \
+			$(GETTEXT_GNU_PKGDIR)/msgfmt $(HOST_DIR)/bin/msgfmt
+endef
+HOST_GETTEXT_GNU_POST_INSTALL_HOOKS += GETTEXT_GNU_INSTALL_MSGFMT_WRAPPER
+
 # autoreconf expects gettextize to install ABOUT-NLS, but it only gets
 # installed by gettext-runtime which we don't build/install for the
 # host, so do it manually
diff --git a/package/gettext-gnu/msgfmt b/package/gettext-gnu/msgfmt
new file mode 100644
index 0000000000..06f1a523da
--- /dev/null
+++ b/package/gettext-gnu/msgfmt
@@ -0,0 +1,3 @@
+#!/usr/bin/env bash
+
+GETTEXTDATADIR="${TARGET_DIR}/usr/share/gettext/" ${HOST_DIR}/bin/msgfmt.real "${@}"
-- 
2.26.2

  reply	other threads:[~2020-07-24 23:25 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-24 23:25 [Buildroot] [PATCH v2 00/13] package/udisks: bump version to 2.9.0 aduskett at gmail.com
2020-07-24 23:25 ` aduskett at gmail.com [this message]
2020-07-24 23:25 ` [Buildroot] [PATCH v2 02/13] package/libblockdev: new package aduskett at gmail.com
2020-07-24 23:25 ` [Buildroot] [PATCH v2 03/13] package/libbytesize: " aduskett at gmail.com
2020-07-24 23:25 ` [Buildroot] [PATCH v2 04/13] package/libblockdev: add support for crypto plugin aduskett at gmail.com
2020-07-24 23:25 ` [Buildroot] [PATCH v2 05/13] package/libblockdev: add support for fs plugin aduskett at gmail.com
2020-07-24 23:25 ` [Buildroot] [PATCH v2 06/13] package/libblockdev: add support for loop plugin aduskett at gmail.com
2020-07-24 23:25 ` [Buildroot] [PATCH v2 07/13] package/libblockdev: add support for lvm plugin aduskett at gmail.com
2020-07-25  8:40   ` Thomas Petazzoni
2020-07-24 23:25 ` [Buildroot] [PATCH v2 08/13] package/libblockdev: add support for mdraid plugin aduskett at gmail.com
2020-07-24 23:25 ` [Buildroot] [PATCH v2 09/13] package/libblockdev: add support for part plugin aduskett at gmail.com
2020-07-24 23:25 ` [Buildroot] [PATCH v2 10/13] package/libblockdev: add support for swap plugin aduskett at gmail.com
2020-07-25  8:42   ` Thomas Petazzoni
2020-07-24 23:25 ` [Buildroot] [PATCH v2 11/13] package/udisks/Config.in: alphabatize package selection aduskett at gmail.com
2020-07-24 23:26 ` [Buildroot] [PATCH v2 12/13] package/udisks/udisks.mk: alphabatize dependencies aduskett at gmail.com
2020-07-24 23:26 ` [Buildroot] [PATCH v2 13/13] package/udisks: bump version to 2.9.0 aduskett at gmail.com

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200724232601.2441272-2-aduskett@gmail.com \
    --to=aduskett@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.