Bug 1405407 - part 2 Allow to enable or disable extension building via confvars. r=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Thu, 26 Oct 2017 20:39:07 +0200
changeset 29262 c0f7fd94ed10f542f467a1e32cba21ec8b02af0d
parent 29261 ef9be31bf1c2ed8c61bbbb3918bf1b363573eb2f
child 29263 8ec9774f4f747d1a3498a10c91dbe2d75825315c
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs1405407
Bug 1405407 - part 2 Allow to enable or disable extension building via confvars. r=IanN
suite/configure.in
suite/confvars.sh
suite/extensions/Makefile.in
suite/extensions/moz.build
suite/installer/Makefile.in
suite/installer/package-manifest.in
suite/locales/Makefile.in
suite/moz.build
--- a/suite/configure.in
+++ b/suite/configure.in
@@ -6,16 +6,19 @@ dnl file, You can obtain one at http://m
 
 dnl Things we need to carry from confvars.sh
 AC_DEFINE(MOZ_SUITE)
 AC_SUBST(MOZ_SUITE)
 AC_SUBST(MOZ_COMPOSER)
 AC_SUBST(SEAMONKEY_VERSION)
 AC_DEFINE(MOZ_SEPARATE_MANIFEST_FOR_THEME_OVERRIDES)
 AC_SUBST(MOZ_BUNDLED_FONTS)
+AC_SUBST(MOZ_IRC)
+AC_SUBST(MOZ_DOMINSPECTOR)
+AC_SUBST(MOZ_DEBUGQA)
 
 dnl More things we need to carry from confvars.sh
 AC_SUBST(moztopsrcdir)
 AC_SUBST(commtopsrcdir)
 AC_SUBST(mozreltopsrcdir)
 AC_SUBST(commreltopsrcdir)
 AC_SUBST(commtopobjdir)
 
--- a/suite/confvars.sh
+++ b/suite/confvars.sh
@@ -9,17 +9,16 @@ MOZ_APP_BASENAME=SeaMonkey
 MOZ_APP_VENDOR=Mozilla
 MOZ_APP_NAME=seamonkey
 MOZ_APP_DISPLAYNAME=SeaMonkey
 MOZ_LDAP_XPCOM=1
 MOZ_COMPOSER=1
 MOZ_SUITE=1
 MOZ_BRANDING_DIRECTORY=$commreltopsrcdir/suite/branding/nightly
 MOZ_OFFICIAL_BRANDING_DIRECTORY=$commreltopsrcdir/suite/branding/nightly
-MOZ_EXTENSIONS_DEFAULT=" inspector irc"
 MOZ_UPDATER=1
 # This should usually be the same as the value MAR_CHANNEL_ID.
 # If more than one ID is needed, then you should use a comma separated list
 # of values.
 ACCEPTED_MAR_CHANNEL_IDS=seamonkey-comm-central
 # The MAR_CHANNEL_ID must not contain the following 3 characters: ",\t "
 MAR_CHANNEL_ID=seamonkey-comm-central
 MOZ_MORK=1
@@ -39,8 +38,25 @@ fi
 
 if test "$OS_ARCH" = "WINNT" -o \
         "$OS_ARCH" = "Linux"; then
   MOZ_BUNDLED_FONTS=1
 fi
 
 # Include the DevTools client, not just the server (which is the default)
 MOZ_DEVTOOLS=all
+
+# Bundled extensions Lightning Chatzilla DOM Inspector and debugQA
+MOZ_CALENDAR=1
+MOZ_IRC=1
+MOZ_DOMINSPECTOR=1
+
+if [[ $MOZ_APP_VERSION == *a* ]]; then
+  MOZ_DEBUGQA=1
+fi
+
+if [[ $MOZ_IRC == 1 ]]; then
+  MOZ_EXTENSIONS_DEFAULT='irc'
+fi
+
+if [[ $MOZ_DOMINSPECTOR == 1 ]]; then
+  MOZ_EXTENSIONS_DEFAULT+=' inspector'
+fi
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/suite/extensions/Makefile.in
@@ -0,0 +1,37 @@
+#
+# 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/.
+
+DISTROEXT = $(ABS_DIST)/bin/distribution/extensions
+
+include $(moztopsrcdir)/config/rules.mk
+
+# If adding extra extensions here, check that EXTRA_ARGS defined below won't
+# affect them unintentionally.
+EXTENSIONS = \
+  $(NULL)
+
+# We are in release mode, we don't want to ship the debug file.
+ifndef MOZ_DEBUG
+EXTRA_ARGS = -x content/debug.html
+endif
+
+DEFINES += \
+  -DMOZ_APP_VERSION=$(MOZ_APP_VERSION) \
+  -DMOZ_APP_MAXVERSION=$(MOZ_APP_MAXVERSION) \
+  $(NULL)
+
+define _INSTALL_EXTENSION
+$(NSINSTALL) -D $(dir) && \
+  $(PYTHON) -m mozbuild.action.preprocessor $(DEFINES) $(ACDEFINES) $(srcdir)/$(dir)/install.rdf.in -o $(dir)/install.rdf && \
+  cd $(dir) && \
+  $(ZIP) -r9XD $(DISTROEXT)/$(dir).xpi install.rdf && \
+  cd $(abspath $(srcdir)/$(dir)) && \
+  $(ZIP) -r9XD $(DISTROEXT)/$(dir).xpi * -x install.rdf.in $(EXTRA_ARGS)
+
+endef # do not remove the blank line!
+
+libs::
+	$(NSINSTALL) -D $(DISTROEXT)
+	$(foreach dir,$(EXTENSIONS),$(_INSTALL_EXTENSION))
--- a/suite/extensions/moz.build
+++ b/suite/extensions/moz.build
@@ -1,9 +1,20 @@
 # vim: set filetype=python:
 # 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/.
 
-DIRS += [
-    'debugQA',
-]
+if CONFIG['MOZ_DEBUGQA']:
+    DIRS += [
+        'debugQA',
+    ]
 
+# for later
+# if CONFIG['MOZ_IRC']:
+#     DIRS += [
+#         'irc',
+#     ]
+
+# if CONFIG['MOZ_DOMINSPECTOR']:
+#     DIRS += [
+#         'inspector',
+#     ]
--- a/suite/installer/Makefile.in
+++ b/suite/installer/Makefile.in
@@ -59,23 +59,28 @@ endif
 
 ifneq (,$(filter gtk%,$(MOZ_WIDGET_TOOLKIT)))
 DEFINES += -DMOZ_GTK=1
 ifeq ($(MOZ_WIDGET_TOOLKIT),gtk3)
 DEFINES += -DMOZ_GTK3=1
 endif
 endif
 
-# Check whether this build is an alpha or nightly:
-# replace "pre" with "a" in the version then look if "a" matches.
-# This should match /suite/Makefile.in.
-ifneq (,$(findstring a,$(MOZ_APP_VERSION:pre=a)))
+ifdef MOZ_DEBUGQA
 DEFINES += -DMOZ_PACKAGE_DEBUGQA=1
 endif
 
+ifdef MOZ_IRC
+DEFINES += -DMOZ_IRC=1
+endif
+
+ifdef MOZ_DOMINSPECTOR
+DEFINES += -DMOZ_DOMINSPECTOR=1
+endif
+
 ifdef NSS_DISABLE_DBM
 DEFINES += -DNSS_DISABLE_DBM=1
 endif
 
 ifdef _MSC_VER
 DEFINES += -D_MSC_VER=$(_MSC_VER)
 endif
 
--- a/suite/installer/package-manifest.in
+++ b/suite/installer/package-manifest.in
@@ -890,16 +890,17 @@ bin/libfreebl_32int64_3.so
 #endif
 #endif
 
 #if defined(MOZ_ASAN) && defined(CLANG_CL)
 @BINPATH@/clang_rt.asan_dynamic-*.dll
 #endif
 
 [chatzilla]
+#ifdef MOZ_IRC
 #ifdef MOZ_OMNIJAR
 @RESPATH@/distribution/extensions/{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}.xpi
 #else
 @RESPATH@/extensions/{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}/chrome/chatzilla@JAREXT@
 #ifdef MOZ_GTK
 @RESPATH@/extensions/{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}/chrome/icons/default/chatzilla-window.xpm
 @RESPATH@/extensions/{59c81df5-4b7a-477b-912d-4e0fdf64e5f2}/chrome/icons/default/chatzilla-window16.xpm
 #elifdef XP_WIN32
@@ -915,34 +916,37 @@ bin/libfreebl_32int64_3.so
 @RESPATH@/distribution/extensions/langpack-@AB_CD@@chatzilla.mozilla.org.xpi
 #else
 @RESPATH@/extensions/langpack-@AB_CD@@chatzilla.mozilla.org/chrome/chatzilla@JAREXT@
 @RESPATH@/extensions/langpack-@AB_CD@@chatzilla.mozilla.org/chrome.manifest
 @RESPATH@/extensions/langpack-@AB_CD@@chatzilla.mozilla.org/install.js
 @RESPATH@/extensions/langpack-@AB_CD@@chatzilla.mozilla.org/install.rdf
 #endif
 #endif
+#endif
 
 [inspector]
+#ifdef MOZ_DOMINSPECTOR
 #ifdef MOZ_OMNIJAR
 @RESPATH@/distribution/extensions/inspector@mozilla.org.xpi
 #else
 @RESPATH@/extensions/inspector@mozilla.org/install.rdf
 @RESPATH@/extensions/inspector@mozilla.org/chrome.manifest
 @RESPATH@/extensions/inspector@mozilla.org/chrome/inspector@JAREXT@
 #ifdef MOZ_GTK
 @RESPATH@/extensions/inspector@mozilla.org/platform/Linux/chrome/icons/default/winInspectorMain16.xpm
 @RESPATH@/extensions/inspector@mozilla.org/platform/Linux/chrome/icons/default/winInspectorMain.xpm
 #elifdef XP_WIN32
 @RESPATH@/extensions/inspector@mozilla.org/platform/WINNT/chrome/icons/default/winInspectorMain.ico
 #endif
 @RESPATH@/extensions/inspector@mozilla.org/components/components.list
 @RESPATH@/extensions/inspector@mozilla.org/components/inspector-cmdline.js
 @RESPATH@/extensions/inspector@mozilla.org/defaults/preferences/inspector.js
 #endif
+#endif
 
 [debugqa]
 #ifdef MOZ_PACKAGE_DEBUGQA
 #ifdef MOZ_OMNIJAR
 @RESPATH@/distribution/extensions/debugQA@mozilla.org.xpi
 #else
 @RESPATH@/extensions/debugQA@mozilla.org/install.rdf
 @RESPATH@/extensions/debugQA@mozilla.org/chrome.manifest
--- a/suite/locales/Makefile.in
+++ b/suite/locales/Makefile.in
@@ -110,24 +110,28 @@ 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
 clobber-%:
+ifdef MOZ_IRC
 	$(RM) -rf $(DIST)/xpi-stage/chatzilla-$* $(DIST)/xpi-stage/chatzilla-*.$*.xpi
+endif
 
 libs-%:
 	$(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) 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)
 	@echo 'Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT).'
 	$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
@@ -145,18 +149,21 @@ repackage-win32-installer-%: libs-% unpa
 	@$(MAKE) repackage-win32-installer AB_CD=$* WIN32_INSTALLER_IN='$(WIN32_INSTALLER_IN)'
 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)
@@ -196,17 +203,19 @@ 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
 
 define run-calendar-rule
 $(MAKE) -C $(LIGHTNING_PATH) LOCALE_MERGEDIR=$(LOCALE_MERGEDIR) $(subst calendar-,,$@)
 $(MAKE) -C $(GDATA_PATH) LOCALE_MERGEDIR=$(LOCALE_MERGEDIR) $(subst calendar-,,$@)
--- a/suite/moz.build
+++ b/suite/moz.build
@@ -1,22 +1,19 @@
 # vim: set filetype=python:
 # 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/.
 
 CONFIGURE_SUBST_FILES += ['installer/Makefile']
 
-# This should match /suite/installer/moz.build.
-if 'pre' in CONFIG['MOZ_APP_VERSION'] or 'a' in CONFIG['MOZ_APP_VERSION']:
-    DIRS += ['extensions']
-
 DIRS += [
     'browser',
     'common',
+    'extensions',
     'feeds/public',
     'feeds/src',
     'locales',
     'mailnews',
     'modules',
     'themes/classic',
     'themes/modern',
     'profile',