add-nls-symlinks-for-solaris.patch
text/x-diff
Filename: add-nls-symlinks-for-solaris.patch
Type: text/x-diff
Part: 0
Message:
Re: Solaris versus our NLS files
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/nls-global.mk | 15 | 1 |
diff --git a/src/nls-global.mk b/src/nls-global.mk
index 73a6db10a1d..b33e25ad9a4 100644
--- a/src/nls-global.mk
+++ b/src/nls-global.mk
@@ -123,8 +123,22 @@ ifneq (,$(LANGUAGES))
done
endif
+# On Solaris, we must make locale-named symlinks for each language directory,
+# else Sun's gettext implementation won't find the messages. But we only
+# bother for UTF-8 locales, since our .mo files are in UTF-8 and Sun's gettext
+# can't do transcoding. (With Sun's sh, the final "exit 0" is required to
+# prevent failure in case of the last grep invocation finding nothing.)
installdirs-po:
- $(if $(LANGUAGES),$(MKDIR_P) $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES),:)
+ifneq (,$(LANGUAGES))
+ $(MKDIR_P) $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES)
+ifeq ($(PORTNAME), solaris)
+ cd '$(DESTDIR)$(localedir)' && for lang in $(LANGUAGES); do \
+ for locale in `locale -a | grep "^$${lang}_.*UTF-8"`; do \
+ rm -f "$$locale" && $(LN_S) $$lang "$$locale" || exit 1; \
+ done ; \
+ done ; exit 0
+endif
+endif
uninstall-po:
$(if $(LANGUAGES),rm -f $(foreach lang, $(LANGUAGES), '$(DESTDIR)$(localedir)'/$(lang)/LC_MESSAGES/$(CATALOG_NAME)$(SO_MAJOR_VERSION)-$(MAJORVERSION).mo),:)