[tor-commits] [torbrowser/master] OSX: update Makefiles and config files with FF17+torbutton changes

erinn at torproject.org erinn at torproject.org
Tue Feb 19 17:57:53 UTC 2013


commit 8c70e93c181e06d3f1dbc64853399dfbb7dc9595
Author: Erinn Clark <erinn at torproject.org>
Date:   Tue Feb 12 17:28:02 2013 +0100

    OSX: update Makefiles and config files with FF17+torbutton changes
---
 build-scripts/config/torrc-osx           |    4 +-
 build-scripts/config/vidalia.conf.ff-osx |    3 +-
 build-scripts/osx-alpha.mk               |    2 +-
 build-scripts/osx.mk                     |   75 ++++++++++++++++++++++-------
 4 files changed, 61 insertions(+), 23 deletions(-)

diff --git a/build-scripts/config/torrc-osx b/build-scripts/config/torrc-osx
index 4c7f0d9..22c9953 100644
--- a/build-scripts/config/torrc-osx
+++ b/build-scripts/config/torrc-osx
@@ -8,6 +8,6 @@ GeoIPFile ../../Contents/Resources/Data/Tor/geoip
 Log notice stdout
 # Bind to this address to listen to connections from SOCKS-speaking
 # applications.
-SocksPort auto
 SocksListenAddress 127.0.0.1
-ControlPort auto
+SocksPort 9150
+ControlPort 9151
diff --git a/build-scripts/config/vidalia.conf.ff-osx b/build-scripts/config/vidalia.conf.ff-osx
index f698d2b..8b00cc2 100644
--- a/build-scripts/config/vidalia.conf.ff-osx
+++ b/build-scripts/config/vidalia.conf.ff-osx
@@ -8,8 +8,7 @@ DefaultPluginsDirectory=../../MacOS/Data/plugins
 LanguageCode=en
 
 [Tor]
-ControlPort=9051
+ControlPort=9151
 TorExecutable=../../../tor
 Torrc=../../../../../Library/Vidalia/torrc
-AutoControl=true
 DataDirectory=../../../../Resources/Data/Tor/
diff --git a/build-scripts/osx-alpha.mk b/build-scripts/osx-alpha.mk
index 6d12ae4..bd4fa27 100644
--- a/build-scripts/osx-alpha.mk
+++ b/build-scripts/osx-alpha.mk
@@ -197,7 +197,7 @@ endif
 DEFAULT_EXTENSIONS=torbutton.xpi
 
 ## Where to download Mozilla language packs
-MOZILLA_LANGUAGE=http://releases.mozilla.org/pub/mozilla.org/firefox/releases/latest/mac/xpi
+MOZILLA_LANGUAGE=https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/$(FIREFOX_VER)/mac/xpi
 
 ## Put more extensions here
 EXTENSIONS_DIR=extensions
diff --git a/build-scripts/osx.mk b/build-scripts/osx.mk
index f420e46..757b9f3 100644
--- a/build-scripts/osx.mk
+++ b/build-scripts/osx.mk
@@ -103,11 +103,12 @@ build-firefox: $(FIREFOX_DIR) config/mozconfig-osx-$(ARCH_TYPE)
 	cp config/mozconfig-osx-$(ARCH_TYPE) $(FIREFOX_DIR)/mozconfig
 	cp branding/* $(FIREFOX_DIR)/browser/branding/official
 	cd $(FIREFOX_DIR) && make -f client.mk build
+	cd $(FIREFOX_DIR) && make -C obj* package
 	touch $(STAMP_DIR)/build-firefox
 
 copy-firefox:
 	-rm -rf $(BUILD_DIR)/TorBrowser.app
-	cp -r $(FIREFOX_DIR)/obj*/dist/*.app $(BUILD_DIR)/TorBrowser.app
+	cp -r $(FIREFOX_DIR)/obj*/dist/firefox/*.app $(BUILD_DIR)/TorBrowser.app
 
 build-all-binaries: build-zlib build-openssl build-vidalia build-libevent build-tor build-firefox copy-firefox
 	echo "If we're here, we've done something right."
@@ -270,13 +271,31 @@ install-docs:
 install-firefox:
 	cp -R $(FIREFOX) $(APPDIR)
 
-## Configure Firefox, Vidalia, and Tor
+# Configure Firefox, Vidalia, and Tor
 configure-apps:
 	## Configure Firefox preferences
 	#mkdir -p $(DEST)/.mozilla/Firefox/firefox.default
 	cp -R config/firefox-profiles.ini $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profiles.ini
 	cp config/bookmarks.html $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile
-	cp config/prefs.js $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile/prefs.js
+	## Override Firefox extension preferences
+	mkdir -p $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile/preferences
+	cp config/extension-overrides.js $(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile/preferences/
+	## Patch Firefox default home page and omnibox
+	LC="en-US";															\
+	PFILE="omni.ja";													\
+	FFDIR=$(DEST)/Contents/MacOS/TorBrowser.app/Contents/MacOS/;			\
+	CHROMEDIR="$$FFDIR/chrome/";									\
+	mkdir -p "$$CHROMEDIR/$$LC/locale/branding";							\
+	mkdir -p "$$CHROMEDIR/$$LC/locale/browser-region";						\
+	cp config/region.properties											\
+		"$$CHROMEDIR/$$LC/locale/browser-region/";							\
+	sed -e "s/SHPONKA/$$LC/g" config/browserconfig.properties				\
+		> "$$CHROMEDIR/$$LC/locale/branding/browserconfig.properties";		\
+	(cd "$$FFDIR";													\
+		zip -u "$$PFILE" "chrome/$$LC/locale/branding/browserconfig.properties" \
+                       "chrome/$$LC/locale/browser-region/region.properties"); \
+	rm -rf "$$CHROMEDIR"
+
 	cp config/Info.plist $(DEST)/Contents
 	cp config/PkgInfo $(DEST)/Contents
 	cp config/qt.conf $(DEST)/Contents/MacOS/Vidalia.app/Contents/Resources
@@ -313,7 +332,7 @@ bundle_%:
 compressed-bundle_%:
 	LANGCODE=$* make -f osx.mk compressed-bundle-localized
 bundle-localized_%.stamp:
-	make -f osx.mk copy-files_$* install-torbutton install-httpseverywhere install-noscript install-lang-extensions patch-vidalia-language patch-firefox-language patch-pidgin-language update-extension-pref write-tbb-version final
+	make -f osx.mk copy-files_$* install-torbutton install-httpseverywhere install-noscript install-lang-extensions patch-vidalia-language patch-firefox-config final
 	touch $(STAMP_DIR)/bundle-localized_$*.stamp
 
 bundle-localized: bundle-localized_$(LANGCODE).stamp
@@ -322,7 +341,7 @@ compressed-bundle-localized: bundle-localized_$(LANGCODE).stamp
 	-rm -f $(DISTDIR)/$(COMPRESSED_NAME)_$(LANGCODE).zip
 	-mkdir $(DISTDIR)
 	#hdiutil create -volname "Tor Browser Bundle for OS X" -format UDBZ -imagekey zlib-level=9 -srcfolder $(DISTDIR)/tmp/ $(DISTDIR)/$(DEFAULT_COMPRESSED_BASENAME)$(LANGCODE).dmg
-	zip -r $(DISTDIR)/$(DEFAULT_COMPRESSED_BASENAME)$(LANGCODE).zip $(NAME)_$(LANGCODE).app
+	zip -r $(DISTDIR)/$(COMPRESSED_NAME)$(LANGCODE).zip $(NAME)_$(LANGCODE).app
 	rm -f *.zip *.xpi
 
 copy-files_%: generic-bundle.stamp
@@ -351,6 +370,22 @@ install-lang-extensions: $(filter-out langpack_en-US.xpi,langpack_$(LANGCODE).xp
 ifneq ($(LANGCODE), en-US)
 	mkdir -p $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/
 	cp langpack_$(LANGCODE).xpi $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/langpack-$(LANGCODE)@firefox.mozilla.org.xpi
+	## Patch Firefox default home page within language pack
+	LC=$(LANGCODE);															\
+	PFILE=langpack-$(LANGCODE)@firefox.mozilla.org.xpi;						\
+	FFDIR=$(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/extensions/;	\
+	CHROMEDIR="$$FFDIR/chrome/";											\
+	mkdir -p "$$CHROMEDIR/$$LC/locale/branding";							\
+	mkdir -p "$$CHROMEDIR/$$LC/locale/browser-region";						\
+	cp config/region.properties											\
+		"$$CHROMEDIR/$$LC/locale/browser-region/";							\
+	sed -e "s/SHPONKA/$$LC/g" config/browserconfig.properties				\
+		> "$$CHROMEDIR/$$LC/locale/branding/browserconfig.properties";		\
+	(cd "$$FFDIR";													\
+		zip -u "$$PFILE" "chrome/$$LC/locale/branding/browserconfig.properties" \
+                       "chrome/$$LC/locale/browser-region/region.properties"); \
+	rm -rf "$$CHROMEDIR"
+
 endif
 
 install-torbutton: torbutton.xpi
@@ -381,23 +416,27 @@ ifeq ($(USE_PIDGIN),1)
                                    $(BUNDLE)/PidginPortable/App/GTK/share/locale
 endif
 
-patch-firefox-language:
-	## Patch the default Firefox prefs.js
-	## Don't use {} because they aren't always interpreted correctly. Thanks, sh. 
-	cp config/prefs.js $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/prefs.js
+patch-firefox-config:
+	## Patch Firefox default preferences by adding a patched #tor.js file:
+	PREFSDIR=$(BUNDLE)/Contents/MacOS/TorBrowser.app/Contents/MacOS/defaults/preferences; \
+	mkdir -p "$$PREFSDIR";													\
+	sed -e "s/SHPONKA/$(LANGCODE)/g" config/pound_tor.js					\
+		> "$$PREFSDIR/#tor.js";												\
+	./patch-firefox-language.sh "$$PREFSDIR/#tor.js" $(LANGCODE) -e;		\
+	printf 'pref("torbrowser.version", "%s");\n'							\
+			"$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)"						\
+			>> "$$PREFSDIR/#tor.js";										\
+	(cd $(BUNDLE)/Contents/MacOS/TorBrowser.app/Contents/MacOS;				\
+			zip -u omni.ja defaults/preferences/#tor.js);					\
+	rm -rf "$$PREFSDIR"
+	## Copy bookmarks and extension pref. overrides into profile
 	cp config/bookmarks.html $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile
-	./patch-firefox-language.sh $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/prefs.js $(LANGCODE) -e
-
-## Fix prefs.js since extensions.checkCompatibility, false doesn't work
-update-extension-pref:
-	sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/prefs.js
-	sed -i -e "s/SHPONKA/$(LANGCODE)/g" $(BUNDLE)/Contents/MacOS/TorBrowser.app/Contents/MacOS/Data/profile/prefs.js
+	OVERRIDEDIR=$(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/preferences; \
+	mkdir "$$OVERRIDEDIR";													\
+	cp config/extension-overrides.js "$$OVERRIDEDIR"
 
 print-version:
 	@echo $(RELEASE_VER)-$(BUILD_NUM)
 
-write-tbb-version:
-	printf 'user_pref("torbrowser.version", "%s");\n' "$(RELEASE_VER)-$(BUILD_NUM)-$(PLATFORM)-$(ARCH_TYPE)" >> $(BUNDLE)/Library/Application\ Support/Firefox/Profiles/profile/prefs.js
-
 final: 
 	mv $(BUNDLE) $(BUNDLE).app





More information about the tor-commits mailing list