Bug 1362617 - Generalize MOZ_CHROME_MULTILOCALE to work for browser as well. r=gps,ted
authorZibi Braniecki <zbraniecki@mozilla.com>
Tue, 30 May 2017 10:30:26 +0200
changeset 370037 55070d5d1a59c5620a4b272040d241538910b78b
parent 370036 b08d3ba207d5be19bed364f181ee23f3c71b644b
child 370038 4f240a4f635b71a641d45cd2c4d891600954edf3
push id32212
push userkwierso@gmail.com
push dateSat, 22 Jul 2017 00:51:16 +0000
treeherdermozilla-central@a8bb5530a092 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps, ted
bugs1362617
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1362617 - Generalize MOZ_CHROME_MULTILOCALE to work for browser as well. r=gps,ted In order to get Firefox to work with multiple built-in languages, we want to bundle the same file in desktop as we do in fennec - res/multilocale.json MozReview-Commit-ID: BY1cMYd0q8Q
browser/base/content/test/static/browser_all_files_referenced.js
browser/installer/Makefile.in
browser/installer/package-manifest.in
mobile/android/installer/Makefile.in
mobile/android/installer/package-manifest.in
toolkit/locales/Makefile.in
--- a/browser/base/content/test/static/browser_all_files_referenced.js
+++ b/browser/base/content/test/static/browser_all_files_referenced.js
@@ -94,16 +94,19 @@ var whitelist = [
   // layout/mathml/nsMathMLChar.cpp
   {file: "resource://gre/res/fonts/mathfontSTIXGeneral.properties"},
   {file: "resource://gre/res/fonts/mathfontUnicode.properties"},
 
   // toolkit/components/places/ColorAnalyzer_worker.js
   {file: "resource://gre/modules/ClusterLib.js"},
   {file: "resource://gre/modules/ColorConversion.js"},
 
+  // List of built-in locales. See bug 1362617 for details.
+  {file: "resource://gre/res/multilocale.json"},
+
   // The l10n build system can't package string files only for some platforms.
   {file: "resource://gre/chrome/en-US/locale/en-US/global-platform/mac/accessible.properties",
    platforms: ["linux", "win"]},
   {file: "resource://gre/chrome/en-US/locale/en-US/global-platform/mac/intl.properties",
    platforms: ["linux", "win"]},
   {file: "resource://gre/chrome/en-US/locale/en-US/global-platform/mac/platformKeys.properties",
    platforms: ["linux", "win"]},
   {file: "resource://gre/chrome/en-US/locale/en-US/global-platform/unix/accessible.properties",
--- a/browser/installer/Makefile.in
+++ b/browser/installer/Makefile.in
@@ -7,16 +7,18 @@ DIST_SUBDIR := browser
 
 include $(topsrcdir)/config/rules.mk
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
 MOZ_PKG_MANIFEST = $(srcdir)/package-manifest.in
 MOZ_PKG_DUPEFLAGS = -f $(srcdir)/allowed-dupes.mn
 
+DEFINES += -DPKG_LOCALE_MANIFEST=$(topobjdir)/toolkit/locales/locale-manifest.in
+
 # Some files have been already bundled with xulrunner
 ifndef MOZ_MULET
 MOZ_PKG_FATAL_WARNINGS = 1
 else
 DEFINES += -DMOZ_MULET
 endif
 
 # When packaging an artifact build not all xpt files expected by the
--- a/browser/installer/package-manifest.in
+++ b/browser/installer/package-manifest.in
@@ -42,18 +42,16 @@
 @RESPATH@/firefox.icns
 @RESPATH@/document.icns
 @RESPATH@/@LPROJ_ROOT@.lproj/*
 #endif
 
 [@AB_CD@]
 @RESPATH@/browser/chrome/@AB_CD@@JAREXT@
 @RESPATH@/browser/chrome/@AB_CD@.manifest
-@RESPATH@/chrome/@AB_CD@@JAREXT@
-@RESPATH@/chrome/@AB_CD@.manifest
 @RESPATH@/dictionaries/*
 #if defined(XP_WIN) || defined(XP_LINUX)
 @RESPATH@/fonts/*
 #endif
 @RESPATH@/hyphenation/*
 @RESPATH@/browser/@PREF_DIR@/firefox-l10n.js
 #ifdef HAVE_MAKENSISU
 @BINPATH@/uninstall/helper.exe
@@ -832,8 +830,12 @@ bin/libfreebl_32int64_3.so
 @RESPATH@/fix_stack_using_bpsyms.py
 #ifdef XP_MACOSX
 @RESPATH@/fix_macosx_stack.py
 #endif
 #ifdef XP_LINUX
 @RESPATH@/fix_linux_stack.py
 #endif
 #endif
+
+#ifdef PKG_LOCALE_MANIFEST
+#include @PKG_LOCALE_MANIFEST@
+#endif
--- a/mobile/android/installer/Makefile.in
+++ b/mobile/android/installer/Makefile.in
@@ -14,21 +14,17 @@ endif
 
 include $(topsrcdir)/config/rules.mk
 
 MOZ_PKG_REMOVALS = $(srcdir)/removed-files.in
 
 MOZ_PKG_MANIFEST = $(srcdir)/package-manifest.in
 MOZ_PKG_DUPEFLAGS = -f $(srcdir)/allowed-dupes.mn
 
-ifdef MOZ_CHROME_MULTILOCALE
-MOZ_PKG_MANIFEST_DEPS = locale-manifest.in
-
-DEFINES += -DPKG_LOCALE_MANIFEST=$(CURDIR)/locale-manifest.in
-endif
+DEFINES += -DPKG_LOCALE_MANIFEST=$(topobjdir)/toolkit/locales/locale-manifest.in
 
 DEFINES += \
   -DMOZ_APP_NAME=$(MOZ_APP_NAME) \
   -DPREF_DIR=$(PREF_DIR) \
   -DJAREXT= \
   -DMOZ_CHILD_PROCESS_NAME=$(MOZ_CHILD_PROCESS_NAME) \
   -DMOZ_CHILD_PROCESS_NAME_PIE=$(MOZ_CHILD_PROCESS_NAME_PIE) \
   -DANDROID_CPU_ARCH=$(ANDROID_CPU_ARCH) \
@@ -79,27 +75,8 @@ else
 # Every other platform just winds up in dist/bin
 BINPATH = bin
 endif
 DEFINES += -DBINPATH=$(BINPATH)
 
 ifdef ENABLE_MARIONETTE
 DEFINES += -DENABLE_MARIONETTE=1
 endif
-
-
-ifdef MOZ_CHROME_MULTILOCALE
-# When MOZ_CHROME_MULTILOCALE is defined, we write multilocale.json like:
-# {"locales": ["en-US", "de", "ar", ...]}
-locale-manifest.in: $(GLOBAL_DEPS) FORCE
-	printf '\n[multilocale]\n' > $@
-	printf '@BINPATH@/res/multilocale.json\n' >> $@
-	for LOCALE in en-US $(MOZ_CHROME_MULTILOCALE) ;\
-	do \
-	  printf '$(BINPATH)/chrome/'"$$LOCALE"'$(JAREXT)\n' >> $@; \
-	  printf '$(BINPATH)/chrome/'"$$LOCALE"'.manifest\n' >> $@; \
-	done
-	COMMA=,
-	echo '{"locales": [$(foreach l,$(MOZ_CHROME_MULTILOCALE),"$(l)"$(COMMA)) "en-US"]}' \
-	  > $(FINAL_TARGET)/res/multilocale.json
-
-GARBAGE += locale-manifest.in
-endif
--- a/mobile/android/installer/package-manifest.in
+++ b/mobile/android/installer/package-manifest.in
@@ -10,18 +10,16 @@
 ; - in front of a file specifies it to be removed from the destination
 ; * wildcard support to recursively copy the entire directory
 ; ; file comment
 ;
 
 #filter substitution
 
 [@AB_CD@]
-@BINPATH@/chrome/@AB_CD@@JAREXT@
-@BINPATH@/chrome/@AB_CD@.manifest
 @BINPATH@/@PREF_DIR@/mobile-l10n.js
 @BINPATH@/update.locale
 #ifdef MOZ_UPDATER
 @BINPATH@/updater.ini
 #endif
 @BINPATH@/dictionaries/*
 @BINPATH@/hyphenation/*
 
--- a/toolkit/locales/Makefile.in
+++ b/toolkit/locales/Makefile.in
@@ -33,8 +33,35 @@ libs:: update.locale
 ifdef MOZ_CRASHREPORTER
 libs:: crashreporter.ini
 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/crashreporter.app/Contents/Resources
 else
 	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
 endif
 endif
+
+libs:: locale-manifest.in
+
+MOZ_CHROME_MULTILOCALE?=en-US
+
+# Firefox uses @RESPATH@.
+# Fennec uses @BINPATH@ and doesn't have the @RESPATH@ variable defined.
+ifeq ($(MOZ_BUILD_APP),mobile/android)
+BASE_PATH:=@BINPATH@
+else
+BASE_PATH:=@RESPATH@
+endif
+
+locale-manifest.in: $(GLOBAL_DEPS) FORCE
+	printf '\n[multilocale]\n' > $@
+	printf '$(BASE_PATH)/res/multilocale.json\n' >> $@
+	for LOCALE in $(MOZ_CHROME_MULTILOCALE) ;\
+	do \
+	  printf '$(BASE_PATH)/chrome/'"$$LOCALE"'@JAREXT@\n' >> $@; \
+	  printf '$(BASE_PATH)/chrome/'"$$LOCALE"'.manifest\n' >> $@; \
+	done
+	COMMA=,
+	#XXX: It would be nice to not duplicate en-US here, but makefile makes it hard.
+	echo '{"locales": [$(foreach l,$(MOZ_CHROME_MULTILOCALE),"$(l)"$(COMMA)) "en-US"]}' \
+	  > $(DIST)/bin/res/multilocale.json
+
+GARBAGE += locale-manifest.in