bug 1382632, make installers-% just work, tb follow-up, r?tomprince
This makes the thunderbird repacks incrementally better.
The current version is running compare-locales too often, but
given that we're downloading the lightning xpi 4 times on prod
right now, that seems to come with the territory.
I verified locally that merged strings are in Thunderbird and
in the lightning xpi on a mac, didn't test other platforms.
MozReview-Commit-ID: AuIePJsIhvU
--- a/calendar/lightning/lightning-packager.mk
+++ b/calendar/lightning/lightning-packager.mk
@@ -80,31 +80,28 @@ unpack: $(XPI_ZIP_IN)
$(NSINSTALL) -D $(XPI_STAGE_PATH)/$(XPI_NAME)
cd $(XPI_STAGE_PATH)/$(XPI_NAME) && $(UNZIP) $(XPI_ZIP_IN)
@echo done unpacking
# Nothing to package for en-US, its just the usual english xpi
langpack-en-US:
@echo "Skipping $@ as en-US is the default"
+merge-%: AB_CD=$*
merge-%:
-ifdef LOCALE_MERGEDIR
- $(RM) -rf $(LOCALE_MERGEDIR)/calendar
+ $(RM) -rf $(REAL_LOCALE_MERGEDIR)/calendar
$(MOZILLA_SRCDIR)/mach compare-locales \
- --merge-dir $(LOCALE_MERGEDIR) \
+ --merge-dir $(REAL_LOCALE_MERGEDIR) \
--l10n-ini $(topsrcdir)/calendar/locales/l10n.ini \
$*
# This file requires a bugfix with string changes, see bug 1154448
[ -f $(L10NBASEDIR)/$*/calendar/chrome/calendar/calendar-extract.properties ] && \
- $(RM) $(LOCALE_MERGEDIR)/calendar/chrome/calendar/calendar-extract.properties \
+ $(RM) $(REAL_LOCALE_MERGEDIR)/calendar/chrome/calendar/calendar-extract.properties \
|| true
-else
- @echo "Not merging Lightning locales due to missing LOCALE_MERGEDIR"
-endif
# Calling these targets with prerequisites causes the libs and subsequent
# targets to be switched in order due to some make voodoo. Therefore we call
# the targets explicitly, which seems to work better. Also, the
# target-specific variable are not expanded for dependent targets.
langpack-%: L10N_XPI_NAME=$(XPI_NAME)-$*
langpack-%: L10N_XPI_PKGNAME=$(subst $(AB_CD),$*,$(XPI_PKGNAME))
langpack-%: AB_CD=$*
@@ -131,17 +128,19 @@ repack-stage:
# Actual locale packaging targets. If L10N_XPI_NAME is set, then use it.
# Otherwise keep the original XPI_NAME
# Overriding the final target is a bit of a hack for universal builds
# so that we can ensure we get the right xpi that gets repacked.
libs-%: FINAL_XPI_NAME=$(if $(L10N_XPI_NAME),$(L10N_XPI_NAME),$(XPI_NAME))
libs-%: FINAL_XPI_PKGNAME=$(if $(L10N_XPI_PKGNAME),$(L10N_XPI_PKGNAME),$(XPI_PKGNAME))
+libs-%: AB_CD=$*
libs-%:
+ @$(MAKE) merge-$*
$(MAKE) -C locales libs AB_CD=$* FINAL_TARGET=$(ABS_DIST)/xpi-stage/$(FINAL_XPI_NAME) \
XPI_NAME=$(FINAL_XPI_NAME) XPI_PKGNAME=$(FINAL_XPI_PKGNAME) USE_EXTENSION_MANIFEST=1
$(MAKE) -C locales tools AB_CD=$* FINAL_TARGET=$(ABS_DIST)/xpi-stage/$(FINAL_XPI_NAME) \
XPI_NAME=$(FINAL_XPI_NAME) XPI_PKGNAME=$(FINAL_XPI_PKGNAME) USE_EXTENSION_MANIFEST=1
# The calling makefile might need to process some extra files. Provide an empty
# rule to overwrite
repack-process-extrafiles:
@@ -157,16 +156,18 @@ repack-process-extrafiles:
echo "BuildID=$(call print_ltnconfig,App,BuildID)" >> $(DIST)/bin/platform.ini
recreate-platformini: $(DIST)/bin/platform.ini
# Lightning uses Thunderbird's build machinery, so we need to hack the post
# upload command to use Lightning's directories and version.
upload: upload-$(AB_CD)
+
+upload-%: AB_CD=$*
upload-%: LTN_UPLOAD_CMD := $(patsubst $(THUNDERBIRD_VERSION)%,$(LIGHTNING_VERSION),$(subst thunderbird,calendar/lightning,$(POST_UPLOAD_CMD)))
upload-%: stage_upload
POST_UPLOAD_CMD="$(LTN_UPLOAD_CMD)" \
$(PYTHON) $(MOZILLA_DIR)/build/upload.py --base-path $(DIST) \
--properties-file $(DIST)/$(XPI_NAME)_build_properties.json \
"$(DIST)/$(MOZ_PKG_PLATFORM)/$(XPI_PKGNAME).xpi"
stage_upload:
--- a/mail/locales/Makefile.in
+++ b/mail/locales/Makefile.in
@@ -20,17 +20,17 @@ PWD := $(CURDIR)
# 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)@thunderbird.mozilla.org
# For Nightly, we know where to get the builds from to do local repacks
ifdef NIGHTLY_BUILD
-EN_US_BINARY_URL=https://archive.mozilla.org/pub/thunderbird/nightly/latest-comm-central
+export EN_US_BINARY_URL ?= https://archive.mozilla.org/pub/thunderbird/nightly/latest-comm-central
endif
L10N_PREF_JS_EXPORTS = $(call MERGE_FILE,all-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 (cocoa,$(MOZ_WIDGET_TOOLKIT))
@@ -78,17 +78,24 @@ include $(topsrcdir)/mozilla/toolkit/loc
$(list-json): $(call mkdir_deps,$(SEARCHPLUGINS_PATH)) $(if $(IS_LANGUAGE_REPACK),FORCE)
$(call py_action,generate_searchjson,$(srcdir)/search/list.json $(AB_CD) $(list-json))
searchplugins:: $(list-json)
$(DIST)/branding:
$(NSINSTALL) -D $@
+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-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@$(MAKE) -C $(DEPTH)/devtools/client/locales AB_CD=$* XPI_NAME=locale-$* XPI_ROOT_APPID='$(XPI_ROOT_APPID)'
@$(MAKE) -C ../../chat/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C ../../editor/ui/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -C $(DEPTH)/intl/locales AB_CD=$* XPI_NAME=locale-$*
@$(MAKE) -B searchplugins AB_CD=$* XPI_NAME=locale-$*
@@ -184,36 +191,36 @@ endif
chmod -vR 775 $(UPLOAD_DIR)
# test target, depends on make package
# try to repack x-test, with just toolkit/defines.inc being there
l10n-check::
$(RM) -rf x-test
$(NSINSTALL) -D x-test/toolkit
echo '#define MOZ_LANG_TITLE Just testing' > x-test/toolkit/defines.inc
- $(MAKE) installers-x-test L10NBASEDIR='$(PWD)' LOCALE_MERGEDIR='$(PWD)/mergedir'
+ $(MAKE) installers-x-test L10NBASEDIR='$(PWD)'
ifdef MOZ_CALENDAR
LIGHTNING_PATH=$(DEPTH)/calendar/lightning
GDATA_PATH=$(DEPTH)/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
# 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:
$(run-calendar-rule)
calendar-unpack:
$(run-calendar-rule)
calendar-upload:
$(MAKE) -C $(LIGHTNING_PATH) upload AB_CD=$(AB_CD)
@@ -226,17 +233,18 @@ 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-%: IS_LANGUAGE_REPACK=1
installers-%: $(INSTALLERS_TARGETS)
@echo 'repackaging done'