Bug 1405407 - part 3 Port
Bug 1370506 for l10n building to SeaMonkey. r=IanN
--- a/suite/installer/windows/Makefile.in
+++ b/suite/installer/windows/Makefile.in
@@ -23,39 +23,50 @@ BRANDING_FILES = \
$(NULL)
ifdef MOZ_UPDATER
DEFINES += -DMOZ_UPDATER=1
endif
include $(moztopsrcdir)/config/config.mk
+ifdef IS_LANGUAGE_REPACK
+PPL_LOCALE_ARGS = \
+ --l10n-dir=$(REAL_LOCALE_MERGEDIR)/suite/installer/windows \
+ --l10n-dir=$(call EXPAND_LOCALE_SRCDIR,suite/locales)/installer/windows \
+ --l10n-dir=$(commtopsrcdir)/suite/locales/en-US/installer/windows \
+ $(NULL)
+else
+PPL_LOCALE_ARGS=$(call EXPAND_LOCALE_SRCDIR,suite/locales)/installer/windows
+endif
+
+
OVERRIDE_DEFAULT_GOAL := installer
installer::
$(MAKE) -C .. installer-stage
$(MAKE) $(CONFIG_DIR)/setup.exe
# For building the uninstaller during the application build so it can be
# included for mar file generation.
uninstaller::
$(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(moztopsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(moztopsrcdir) \
- $(call EXPAND_LOCALE_SRCDIR,suite/locales)/installer/windows $(AB_CD) $(CONFIG_DIR)
+ $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
$(CONFIG_DIR)/setup.exe::
$(RM) -r $(CONFIG_DIR) && mkdir $(CONFIG_DIR)
$(INSTALL) $(addprefix $(srcdir)/,$(INSTALLER_FILES)) $(CONFIG_DIR)
$(INSTALL) $(addprefix $(DIST)/branding/,$(BRANDING_FILES)) $(CONFIG_DIR)
$(PYTHON) $(moztopsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--convert-utf8-utf16le $(commtopsrcdir)/suite/installer/license.txt $(CONFIG_DIR)/license.txt
$(call py_action,preprocessor,-Fsubstitution $(DEFINES) $(ACDEFINES) \
$(srcdir)/nsis/defines.nsi.in -o $(CONFIG_DIR)/defines.nsi)
$(PYTHON) $(moztopsrcdir)/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py \
--preprocess-locale $(moztopsrcdir) \
- $(call EXPAND_LOCALE_SRCDIR,suite/locales)/installer/windows $(AB_CD) $(CONFIG_DIR)
+ $(PPL_LOCALE_ARGS) $(AB_CD) $(CONFIG_DIR)
include $(moztopsrcdir)/config/rules.mk
include $(moztopsrcdir)/toolkit/mozapps/installer/windows/nsis/makensis.mk
--- a/suite/locales/Makefile.in
+++ b/suite/locales/Makefile.in
@@ -21,16 +21,21 @@ PWD := $(CURDIR)
# These are defaulted to be compatible with the files the wget-en-US target
# pulls. You may override them if you provide your own files.
ZIP_IN ?= $(ABS_DIST)/$(PACKAGE)
WIN32_INSTALLER_IN ?= $(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
RETRIEVE_WINDOWS_INSTALLER = 1
MOZ_LANGPACK_EID=langpack-$(AB_CD)@seamonkey.mozilla.org
+# For Nightly, we know where to get the builds from to do local repacks
+ifdef NIGHTLY_BUILD
+export EN_US_BINARY_URL ?= https://archive.mozilla.org/pub/seamonkey/nightly/latest-comm-central-trunk
+endif
+
L10N_PREF_JS_EXPORTS = $(call MERGE_FILE,suite-l10n.js)
L10N_PREF_JS_EXPORTS_PATH = $(FINAL_TARGET)/$(PREF_DIR)
L10N_PREF_JS_EXPORTS_FLAGS = $(PREF_PPFLAGS) --silence-missing-directive-warnings
PP_TARGETS += L10N_PREF_JS_EXPORTS
ifeq ($(MOZ_WIDGET_TOOLKIT),cocoa)
MOZ_PKG_MAC_DSSTORE=$(ABS_DIST)/branding/dsstore
MOZ_PKG_MAC_BACKGROUND=$(ABS_DIST)/branding/background.png
@@ -63,16 +68,21 @@ SEARCH_PLUGINS_PATH := $(FINAL_TARGET)/s
.PHONY: searchplugins
SEARCH_PLUGINS_TARGET := libs searchplugins
SEARCH_PLUGINS := $(foreach plugin,$(addsuffix .xml,$(SEARCH_PLUGINS_NAMES)),$(or $(wildcard $(call MERGE_FILE,searchplugins/$(plugin))),$(info Missing searchplugin: $(plugin))))
# Some locale-specific search plugins may have preprocessor directives, but the
# default en-US ones do not.
SEARCH_PLUGINS_FLAGS := --silence-missing-directive-warnings
PP_TARGETS += SEARCH_PLUGINS
+# Required for l10n.mk - defines a list of app sub dirs that should
+# be included in langpack xpis.
+# Currently not set in SeaMonkey.
+DIST_SUBDIRS = $(DIST_SUBDIR)
+
include $(moztopsrcdir)/config/rules.mk
include $(moztopsrcdir)/toolkit/locales/l10n.mk
$(DIST)/branding:
$(NSINSTALL) -D $@
PROFILE_CHROME = userChrome-example.css userContent-example.css
@@ -109,121 +119,124 @@ PANELS_XTRA_FILE = $(call MERGE_FILE,pro
libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
libs:: $(FINAL_TARGET)/defaults/profile/panels.rdf ;
libs:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile/chrome
# Extend l10n.mk clobber-% target for our localised extensions
+ifdef MOZ_IRC
clobber-%:
-ifdef MOZ_IRC
$(RM) -rf $(DIST)/xpi-stage/chatzilla-$* $(DIST)/xpi-stage/chatzilla-*.$*.xpi
endif
+libs-%: AB_CD=$*
libs-%:
+# merge if we're not en-US. Conditional function because
+# we need the current value of AB_CD.
+ $(if $(filter en-US,$(AB_CD)),, @$(MAKE) merge-$*)
+ifdef MOZ_CALENDAR
+ $(if $(filter en-US,$(AB_CD)),, @$(MAKE) -C ../../calendar/lightning merge-$*)
+endif
$(NSINSTALL) -D $(DIST)/install
@$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*
@$(MAKE) -C $(DEPTH)/services/sync/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../../editor/ui/locales AB_CD=$* XPI_NAME=locale-$*
ifdef MOZ_IRC
@$(MAKE) -C $(DEPTH)/extensions/irc/locales libs-$*
endif
@$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C $(DEPTH)/devtools/client/locales AB_CD=$* XPI_NAME=locale-$*
+ @$(MAKE) -C $(DEPTH)/devtools/shim/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/pref
repackage-win32-installer: WIN32_INSTALLER_OUT=$(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
-repackage-win32-installer: $(call ESCAPE_WILDCARD,$(WIN32_INSTALLER_IN)) $(SUBMAKEFILES)
+repackage-win32-installer: $(call ESCAPE_WILDCARD,$(WIN32_INSTALLER_IN)) $(SUBMAKEFILES) libs-$(AB_CD)
@echo 'Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT).'
$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
$(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx
$(MAKE) repackage-zip \
AB_CD=$(AB_CD) \
MOZ_PKG_FORMAT=SFX7Z \
ZIP_IN='$(WIN32_INSTALLER_IN)' \
ZIP_OUT='$(WIN32_INSTALLER_OUT)' \
SFX_HEADER='$(PWD)/../installer/windows/l10ngen/7zSD.sfx \
$(_ABS_SRCDIR)/suite/installer/windows/app.tag'
ifeq (WINNT,$(OS_ARCH))
-repackage-win32-installer-%: libs-% unpack
+repackage-win32-installer-%: unpack
@$(MAKE) repackage-win32-installer AB_CD=$* WIN32_INSTALLER_IN='$(WIN32_INSTALLER_IN)'
+
+repackage-zip-%: repackage-win32-installer-%
+
else
repackage-win32-installer-%: ;
endif
repackage-zip: repackage-extensions
repackage-extensions: $(STAGEDIST)
ifdef MOZ_IRC
$(MAKE) -C $(DEPTH)/extensions/irc/locales repackage-zip-$(AB_CD) STAGEDIST=$(STAGEDIST)
endif
ifeq ($(MOZ_PACKAGER_FORMAT),omni)
$(NSINSTALL) -D $(STAGEDIST)/distribution/extensions
$(MAKE) -C ../app pack-ext AB_CD=$(AB_CD) STAGEDIST=$(STAGEDIST)/extensions;
$(MAKE) -C ../app pack-ext AB_CD=$(AB_CD) STAGEDIST=$(STAGEDIST)/distribution/extensions;
endif
-repackage-zip-%: $(call ESCAPE_WILDCARD,$(ZIP_IN)) $(STAGEDIST) libs-%
- @$(MAKE) repackage-zip AB_CD=$* ZIP_IN=$(ZIP_IN)
-
langpack: langpack-$(AB_CD)
ifdef MOZ_UPDATER
-libs:: $(addprefix $(LOCALE_SRCDIR)/,updater/updater.ini)
+libs:: $(call MERGE_FILE,updater/updater.ini) $(call mkdir_deps,$(DIST)/bin)
ifeq ($(OS_ARCH),WINNT)
cat $< $(srcdir)/../installer/windows/nsis/updater_append.ini | \
sed -e 's/^InfoText=/Info=/' -e 's/^TitleText=/Title=/' | \
sed -e 's/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/' > \
$(FINAL_TARGET)/updater.ini
else
cat $< | \
sed -e 's/^InfoText=/Info=/' -e 's/^TitleText=/Title=/' | \
sed -e 's/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/' > \
$(FINAL_TARGET)/updater.ini
endif
endif
+ifndef IS_LANGPACK
ifdef MOZ_CRASHREPORTER
libs:: $(call MERGE_FILE,crashreporter/crashreporter-override.ini)
$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)
endif
+endif
ident:
@printf 'comm_revision '
@$(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py \
$(STAGEDIST)/application.ini App SourceStamp
@printf 'moz_revision '
@$(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py \
$(STAGEDIST)/platform.ini Build SourceStamp
@printf 'buildid '
@$(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py \
$(STAGEDIST)/application.ini App BuildID
-merge-%:
-ifdef LOCALE_MERGEDIR
- $(RM) -rf $(LOCALE_MERGEDIR)
- $(moztopsrcdir)/mach compare-locales --merge-dir $(LOCALE_MERGEDIR) --l10n-ini $(srcdir)/l10n.ini $*
-endif
- @echo
-
.PHONY: repackage-extensions
ifdef MOZ_IRC
MOZ_PKG_EXTRAL10N += extensions/langpack-$(AB_CD)@chatzilla.mozilla.org=$(DIST)/xpi-stage/chatzilla-$(AB_CD)
endif
ifdef MOZ_CALENDAR
-LIGHTNING_PATH=$(DEPTH)/calendar/lightning
-GDATA_PATH=$(DEPTH)/calendar/providers/gdata
+LIGHTNING_PATH=$(commtopobjdir)/calendar/lightning
+GDATA_PATH=$(commtopobjdir)/calendar/providers/gdata
define run-calendar-rule
-$(MAKE) -C $(LIGHTNING_PATH) LOCALE_MERGEDIR=$(LOCALE_MERGEDIR) $(subst calendar-,,$@)
-$(MAKE) -C $(GDATA_PATH) LOCALE_MERGEDIR=$(LOCALE_MERGEDIR) $(subst calendar-,,$@)
+$(MAKE) -C $(LIGHTNING_PATH) $(subst calendar-,,$@) AB_CD=$(AB_CD)
+$(MAKE) -C $(GDATA_PATH) $(subst calendar-,,$@) AB_CD=$(AB_CD)
endef
sm-wget-en-US:
$(NSINSTALL) -D $(ABS_DIST)/$(PKG_PATH)
(cd $(ABS_DIST)/$(PKG_PATH) && $(WGET) --no-cache -nv --no-iri -N '$(EN_US_BINARY_URL)/$(PACKAGE)')
@echo 'Downloaded $(EN_US_BINARY_URL)/$(PACKAGE) to $(ABS_DIST)/$(PKG_PATH)/$(PACKAGE)'
ifdef RETRIEVE_WINDOWS_INSTALLER
ifeq ($(OS_ARCH), WINNT)
@@ -231,22 +244,22 @@ ifeq ($(OS_ARCH), WINNT)
(cd $(ABS_DIST)/$(PKG_INST_PATH) && $(WGET) --no-cache -nv --no-iri -N '$(EN_US_BINARY_URL)/$(PKG_PATH)$(PKG_INST_BASENAME).exe')
@echo 'Downloaded $(EN_US_BINARY_URL)/$(PKG_PATH)$(PKG_INST_BASENAME).exe to $(ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe'
endif
endif
# Add calendar targets for pattern rules. Unfortunately multiple pattern rules
# on the left hand side do something different with make, therefore we need to
# write a line for each target.
-calendar-merge-%:
- $(run-calendar-rule)
calendar-clobber-%:
$(run-calendar-rule)
+calendar-langpack-%: AB_CD=$*
calendar-langpack-%:
$(run-calendar-rule)
+calendar-repackage-zip-%: AB_CD=$*
calendar-repackage-zip-%:
$(run-calendar-rule)
calendar-wget-en-US: sm-wget-en-US
$(run-calendar-rule)
calendar-unpack:
$(run-calendar-rule)
calendar-upload:
$(MAKE) -C $(LIGHTNING_PATH) upload AB_CD=$(AB_CD)
@@ -259,17 +272,17 @@ MOZ_PKG_EXTRAL10N += distribution/extens
endif
# Hook calendar targets to the mail non-pattern rules
wget-en-US: calendar-wget-en-US
unpack: calendar-unpack
upload: calendar-upload
# Hook into the pattern rules, this will be used later on in the installers-% target.
-CALENDAR_INSTALLERS_TARGETS = calendar-merge-% calendar-clobber-% calendar-langpack-% calendar-repackage-zip-%
+CALENDAR_INSTALLERS_TARGETS = calendar-clobber-% calendar-langpack-% calendar-repackage-zip-%
endif
# This is a generic target that will make a langpack, repack ZIP (+tarball)
# builds, and repack and installer if applicable. It is called from the
# tinderbox scripts. Alter it with caution.
-INSTALLERS_TARGETS = clobber-% $(CALENDAR_INSTALLERS_TARGETS) langpack-% repackage-win32-installer-% repackage-zip-%
-installers-%: $(INSTALLERS_TARGETS)
+installers-%: IS_LANGUAGE_REPACK=1
+installers-%: clobber-% $(CALENDAR_INSTALLERS_TARGETS) langpack-% repackage-win32-installer-% repackage-zip-%
@echo 'repackaging done'
--- a/suite/locales/filter.py
+++ b/suite/locales/filter.py
@@ -1,17 +1,17 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
def test(mod, path, entity=None):
import re
# ignore anything but SeaMonkey
if mod not in ("netwerk", "dom", "toolkit", "security/manager",
- "devtools/shared", "devtools/client",
+ "devtools/client", "devtools/shared", "devtools/shim",
"editor/ui", "suite", "services/sync"):
return "ignore"
# ignore temporary files, hiden files and files from rejects
if (re.match(r".*?\/[.#].+", path) or
re.match(r".*~$", path) or
re.match(r".+\.(orig|rej)", path)):
return "ignore"
if mod not in ("suite"):
--- a/suite/locales/l10n.toml
+++ b/suite/locales/l10n.toml
@@ -9,17 +9,16 @@ locales = [
"cs",
"da",
"de",
"en-GB",
"es-AR",
"es-ES",
"fi",
"fr",
- "gl",
"hu",
"it",
"ja",
"ja-JP-mac",
"ka",
"lt",
"nb-NO",
"nl",
@@ -36,37 +35,38 @@ locales = [
"zh-CN",
"zh-TW",
]
[env]
l = "{l10n_base}/{locale}/"
mozilla = "mozilla"
-
[[paths]]
reference = "suite/locales/en-US/**"
l10n = "{l}suite/**"
[[paths]]
reference = "editor/ui/locales/en-US/**"
l10n = "{l}editor/ui/**"
[[paths]]
+ reference = "{mozilla}/devtools/shim/locales/en-US/**"
+ l10n = "{l}devtools/shim/**"
+
+[[paths]]
reference = "{mozilla}/services/sync/locales/en-US/**"
l10n = "{l}services/sync/**"
-
[[includes]]
path = "{mozilla}/devtools/client/locales/l10n.toml"
[[includes]]
path = "{mozilla}/toolkit/locales/l10n.toml"
-
# ignore MOZ_LANGPACK_CONTRIBUTORS
[[filters]]
path = "{l}suite/defines.inc"
key = "MOZ_LANGPACK_CONTRIBUTORS"
action = "ignore"
# defines.inc and all-l10n.js can be missing completely
[[filters]]