Bug 519685: package search engines in locale JARs, and tell the search service to load them from there, r=mfinkle
authorGavin Sharp <gavin@gavinsharp.com>
Fri, 16 Oct 2009 23:14:58 -0400
changeset 65721 84cc56c6c01d4db9e385794fc4d0c3757b513979
parent 65720 3f197bb3b5f2d1853b5dd304f90692321ef327c5
child 65722 d90650d25dc9024a8b935a6640382086f07b2d6e
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs519685
Bug 519685: package search engines in locale JARs, and tell the search service to load them from there, r=mfinkle
mobile/app/mobile.js
mobile/locales/Makefile.in
--- a/mobile/app/mobile.js
+++ b/mobile/app/mobile.js
@@ -397,8 +397,11 @@ pref("ui.threeddarkshadow", "#000");
 pref("ui.threedface", "#ece7e2");
 pref("ui.threedhighlight", "#fff");
 pref("ui.threedlightshadow", "#ece7e2");
 pref("ui.threedshadow", "#aea194");
 pref("ui.window", "#efebe7");
 pref("ui.windowtext", "#101010");
 pref("ui.windowframe", "#efebe7");
 
+// Tell the search service to load search plugins from the locale JAR
+pref("browser.search.loadFromJars", true);
+pref("browser.search.jarURIs", "chrome://browser/locale/searchplugins/");
--- a/mobile/locales/Makefile.in
+++ b/mobile/locales/Makefile.in
@@ -39,18 +39,16 @@ DEPTH     = ../..
 topsrcdir = @top_srcdir@
 srcdir    = @srcdir@
 VPATH     = @srcdir@
 relativesrcdir = mobile/locales
 
 include $(DEPTH)/config/autoconf.mk
 include $(topsrcdir)/config/config.mk
 
-vpath %.xml @srcdir@/en-US/searchplugins
-vpath %.xml $(LOCALE_SRCDIR)/searchplugins
 ifdef LOCALE_MERGEDIR
 vpath book%.inc $(LOCALE_MERGEDIR)/mobile/profile
 endif
 vpath book%.inc $(LOCALE_SRCDIR)/profile
 ifdef LOCALE_MERGEDIR
 vpath book%.inc @srcdir@/en-US/profile
 endif
 
@@ -62,42 +60,55 @@ SUBMAKEFILES += \
 MOZ_LANGPACK_EID=langpack-$(AB_CD)@firefox-mobile.mozilla.org
 PREF_JS_EXPORTS = $(firstword $(wildcard $(LOCALE_SRCDIR)/mobile-l10n.js) \
                        @srcdir@/en-US/mobile-l10n.js )
 
 SEARCH_PLUGINS = $(shell cat \
   $(firstword $(wildcard $(LOCALE_SRCDIR)/searchplugins/list.txt) \
        @srcdir@/en-US/searchplugins/list.txt ) )
 
-libs:: $(addsuffix .xml, $(SEARCH_PLUGINS))
-	$(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/searchplugins
+searchplugins::
+	@echo "$(AB_CD).jar:" > tmp-search.jar.mn
+	@for line in $(foreach plugin,$(SEARCH_PLUGINS),"locale/$(AB_CD)/browser/searchplugins/$(notdir $(plugin)).xml ($(plugin).xml)"); do \
+	    echo " $$line" >> tmp-search.jar.mn; \
+	done
+	@echo " locale/$(AB_CD)/browser/searchplugins/list.txt (list.txt)" >> tmp-search.jar.mn;
+	$(PYTHON) $(MOZILLA_DIR)/config/JarMaker.py \
+          $(QUIET) -j $(FINAL_TARGET)/chrome \
+          -s $(topsrcdir)/$(relativesrcdir)/en-US/searchplugins \
+          -s $(LOCALE_SRCDIR)/searchplugins \
+          $(MAKE_JARS_FLAGS) tmp-search.jar.mn
+
+export:: searchplugins
+
+GARBAGE += tmp-search.jar.mn
 
 include $(topsrcdir)/config/rules.mk
 
 include $(topsrcdir)/toolkit/locales/l10n.mk
 
 clobber-zip:
 	$(RM) $(STAGEDIST)/chrome/$(AB_CD).jar \
 	  $(STAGEDIST)/chrome/$(AB_CD).manifest \
 	  $(STAGEDIST)/defaults/preferences/mobile-l10n.js
-	$(RM) -r $(STAGEDIST)/searchplugins \
-	  $(STAGEDIST)/dictionaries \
+	$(RM) -r $(STAGEDIST)/dictionaries \
 	  $(STAGEDIST)/defaults/profile \
 	  $(STAGEDIST)/chrome/$(AB_CD)
 
 libs-%:
 	$(NSINSTALL) -D $(DIST)/install
 	@$(MAKE) -C ../../toolkit/locales libs-$* BOTH_MANIFESTS=1
 	@$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=defaults/preferences BOTH_MANIFESTS=1
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$* BOTH_MANIFESTS=1
 
 # Tailored target to just add the chrome processing for multi-locale builds
 chrome-%:
 	@$(MAKE) -C $(DEPTH)/toolkit/locales chrome-$*
 	@$(MAKE) -B bookmarks.json AB_CD=$*
+	@$(MAKE) -B searchplugins AB_CD=$*
 	@$(MAKE) chrome AB_CD=$*
 	@$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales chrome AB_CD=$*
 
 # This is a generic target that will make a langpack and repack tarball
 # builds. It is called from the tinderbox scripts. Alter it with caution.
 
 installers-%: clobber-% langpack-% repackage-zip-%
 	@echo "repackaging done"