public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add convenience target 'install-locale-files'.
@ 2018-07-26 17:27 Carlos O'Donell
  2018-07-26 17:33 ` Joseph Myers
  0 siblings, 1 reply; 9+ messages in thread
From: Carlos O'Donell @ 2018-07-26 17:27 UTC (permalink / raw)
  To: GNU C Library, Florian Weimer

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

The convenience install target 'install-locale-files' is created
to allow distributions to install all of the SUPPORTED locales as
files instead of into the locale-archive.

You invoke the new convenience target like this:
make localedata/install-locale-files install_root=<prefix>

OK for 2.29 when it opens?

Signed-off-by: Carlos O'Donell <carlos@redhat.com>

Cheers,
Carlos.

[-- Attachment #2: 0001-Add-convenience-target-install-locale-files.patch --]
[-- Type: text/x-patch, Size: 3472 bytes --]

From fde96ec607c2720a1c3e184447f932b83c8abfdf Mon Sep 17 00:00:00 2001
From: Carlos O'Donell <carlos@redhat.com>
Date: Thu, 26 Jul 2018 10:14:55 -0400
Subject: [PATCH] Add convenience target 'install-locale-files'.

The convenience install target 'install-locale-files' is created
to allow distributions to install all of the SUPPORTED locales as
files instead of into the locale-archive.

You invoke the new convenience target like this:
make localedata/install-locale-files install_root=<prefix>
---
 ChangeLog           | 10 ++++++++++
 localedata/Makefile | 26 ++++++++++++++++++++------
 2 files changed, 30 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8b509d4a34..3606b912ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2018-07-26  Carlos O'Donell <carlos@redhat.com>
+
+	* localedata/Makefile (INSTALL-SUPPORTED-LOCALES): Remove.
+	(INSTALL-SUPPORTED-LOCALE-ARCHIVE): Define.
+	(INSTALL-SUPPORTED-LOCALE-FILES): Define.
+	(install-locales): Depend on install-locale-archive.
+	(install-locale-archive): Define.
+	(install-lcoale-files): Define.
+	(build-one-locale): Define macro.
+
 2018-07-25  Carlos O'Donell <carlos@redhat.com>
 
 	[BZ #23393]
diff --git a/localedata/Makefile b/localedata/Makefile
index 13c5423e0e..0eea396ad8 100644
--- a/localedata/Makefile
+++ b/localedata/Makefile
@@ -380,12 +380,18 @@ endif
 
 include SUPPORTED
 
-INSTALL-SUPPORTED-LOCALES=$(addprefix install-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-ARCHIVE=$(addprefix install-archive-, $(SUPPORTED-LOCALES))
+INSTALL-SUPPORTED-LOCALE-FILES=$(addprefix install-files-, $(SUPPORTED-LOCALES))
 
 # Sometimes the whole collection of locale files should be installed.
 LOCALEDEF=I18NPATH=. GCONV_PATH=$(common-objpfx)iconvdata LC_ALL=C \
 $(rtld-prefix) $(common-objpfx)locale/localedef
-install-locales: $(INSTALL-SUPPORTED-LOCALES)
+install-locales: install-locale-archive
+
+# Create and install the locale-archive file.
+install-locale-archive: $(INSTALL-SUPPORTED-LOCALE-ARCHIVE)
+# Create and install the locales individually (no archive).
+install-locale-files: $(INSTALL-SUPPORTED-LOCALE-FILES)
 
 install-locales-dir:
 	$(..)./scripts/mkinstalldirs $(inst_complocaledir)
@@ -393,11 +399,10 @@ install-locales-dir:
 # The SHIFT_JIS and SHIFT_JISX0213 character maps are not ASCII compatible,
 # therefore we have to use --no-warnings=ascii to disable the ASCII check.
 # See localedata/gen-locale.sh for the same logic.
-$(INSTALL-SUPPORTED-LOCALES): install-locales-dir
-	@locale=`echo $@ | sed -e 's/^install-//'`; \
+define build-one-locale
+	locale=`echo $@ | sed -e 's/^install-[a-z]*-//'`; \
 	charset=`echo $$locale | sed -e 's,.*/,,'`; \
 	locale=`echo $$locale | sed -e 's,/[^/]*,,'`; \
-	flags="-c"; \
 	if [ "$$charset" = 'SHIFT_JIS' ] \
 	   || [ "$$charset" = 'SHIFT_JISX0213' ]; then \
 	   flags="$$flags --no-warnings=ascii"; \
@@ -410,7 +415,16 @@ $(INSTALL-SUPPORTED-LOCALES): install-locales-dir
 	$(LOCALEDEF) $$flags --alias-file=../intl/locale.alias \
 		     -i locales/$$input -f charmaps/$$charset \
 		     $(addprefix --prefix=,$(install_root)) $$locale \
-	&& echo ' done'; \
+	&& echo ' done';
+endef
+
+$(INSTALL-SUPPORTED-LOCALE-ARCHIVE): install-locales-dir
+	@flags="-c"; \
+	$(build-one-locale)
+
+$(INSTALL-SUPPORTED-LOCALE-FILES): install-locales-dir
+	@flags="-c --no-archive"; \
+	$(build-one-locale)
 
 tst-setlocale-ENV = LC_ALL=ja_JP.EUC-JP
 tst-wctype-ENV = LC_ALL=ja_JP.EUC-JP
-- 
2.14.4


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2018-08-02 19:33 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 17:27 [PATCH] Add convenience target 'install-locale-files' Carlos O'Donell
2018-07-26 17:33 ` Joseph Myers
2018-07-26 18:03   ` [PATCHv2] " Carlos O'Donell
2018-07-26 18:36     ` Rical Jasan
2018-07-26 20:17       ` [PATCHv3] " Carlos O'Donell
2018-07-26 20:25         ` Joseph Myers
2018-07-26 20:30           ` [PATCHv4] " Carlos O'Donell
2018-07-27 20:17             ` [PATCHv5] " Carlos O'Donell
2018-08-02 19:33               ` Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).