components/desktop/thunderbird/Makefile
changeset 5527 611b2d6efdfe
parent 5415 9f594fa41da4
child 5532 fac132cc7531
--- a/components/desktop/thunderbird/Makefile	Tue Mar 01 10:33:35 2016 -0800
+++ b/components/desktop/thunderbird/Makefile	Tue Mar 01 12:56:53 2016 -0800
@@ -31,35 +31,50 @@
 include ../../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		thunderbird
-COMPONENT_VERSION=	31.6.0
+COMPONENT_VERSION=	38.5.0
 COMPONENT_PROJECT_URL=	http://www.mozilla.com/thunderbird
-COMPONENT_SRC=		comm-esr31
+COMPONENT_SRC=		comm-esr38
 COMPONENT_SRC_NAME =	$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC_NAME).source.tar.bz2
 COMPONENT_ARCHIVE_HASH= \
-    sha256:ccbf8cbb740bc1b30ecf4fe39aab226607f9a41e23a07e994c508a90e8b70508
+	sha256:7da187d4d5df17b1457bd93b584f78f5e41d2094f87c14e74ee9d8064de25d0d
 MOZILLA_FTP = 		http://ftp.mozilla.org/pub/mozilla.org/$(COMPONENT_NAME)/releases/$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE_URL=	$(MOZILLA_FTP)/source/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	tbird/mailer
 
-TPNO=			22326
+TPNO=			26829
+
+LIGHTNING_VERSION=	lightning-4.0.5
 
 # There are a set of .xpi files (as given in the LANG_LIST definition below)
 # that we need. These are available under:
 # http://ftp.mozilla.org/pub/mozilla.org/thunderbird/releases/31.6.0/linux-i686/xpi/
+# https://ftp.mozilla.org/pub/calendar/lightning/candidates/4.0.5-candidates/build1/linux-i686/
 # We could download and unpack them individually, but instead I've created
 # a compressed tarball of them, and made that available locally for download.
 # Downloading them individually can be a problem because firefox/thunderbird 
 # collide due to different files with identical .xpi names. 
-COMPONENT_ARCHIVE_1 =   thunderbird-31.6.0-xpi.tar.gz
+COMPONENT_ARCHIVE_1 =   	$(COMPONENT_SRC_NAME)-xpi.tar.gz
 COMPONENT_ARCHIVE_HASH_1 = \
-    sha256:80e9cc4b152d75f5c3887c01ad1767680aff5ca7c3aee87254bdc1574590b95e
+    sha256:eeb85b3e5ef7a97abff831f3aa895c2034cb8f039bb3383dba3a5f495e1fe93f
 COMPONENT_ARCHIVE_URL_1 =       $(INTERNAL_ARCHIVE_MIRROR)/source-archives/$(COMPONENT_ARCHIVE_1)
 
+COMPONENT_ARCHIVE_2 =		$(LIGHTNING_VERSION)-xpi.tar.gz
+COMPONENT_ARCHIVE_HASH_2 = \
+    sha256:96f263984b1e939215a614dea21fda479eb4babf1574141728b9dbf273067893
+COMPONENT_ARCHIVE_URL_2 = 	$(INTERNAL_ARCHIVE_MIRROR)/source-archives/$(COMPONENT_ARCHIVE_2)
+
 LANG_LIST = ar bg ca cs da de el es-AR es-ES et eu fi \
 	fr gl he hu id is it ja ko lt nb-NO nl nn-NO pa-IN pl \
 	pt-BR pt-PT ro ru sk sl sq sv-SE tr uk zh-CN zh-TW
 
+# Firefox and Thunderbird share the same firefox*.patch patches. Copy these 
+# patches from the Firefox patches directory, except for patches 42 and 46, 
+# which don't get applied in Thunderbird.
+COMPONENT_POST_UNPACK_ACTION += \
+	rm -f patches/firefox*.patch ; \
+	cp ../firefox/patches/*.patch patches/ ; \
+	rm -f patches/firefox*42*.patch patches/firefox*46*.patch;
 include $(WS_MAKE_RULES)/prep.mk
 include $(WS_MAKE_RULES)/configure.mk
 
@@ -81,6 +96,7 @@
 COMPONENT_PRE_CONFIGURE_ACTION += \
 	echo "mk_add_options BUILD_OFFICIAL=1" > $(MOZCONFIG) ; \
 	echo "mk_add_options MOZILLA_OFFICIAL=1" >> $(MOZCONFIG) ; \
+	echo "ac_add_options --enable-application=mail" >> $(MOZCONFIG) ; \
 	echo "ac_add_options --prefix=/usr" >> $(MOZCONFIG) ; \
 	echo "ac_add_options --libdir=/usr/lib" >> $(MOZCONFIG) ; \
 	echo "ac_add_options --mandir=/usr/share/man" >> $(MOZCONFIG) ; \
@@ -115,7 +131,9 @@
 
 CONFIGURE_ENV +=	PKG_CONFIG_PATH=$(CONFIGURE_LIBDIR.$(BITS))/pkgconfig
 CONFIGURE_ENV +=	OS_DEFINES="-D__USE_LEGACY_PROTOTYPES__"
-CONFIGURE_ENV +=	LDFLAGS="-z ignore"
+# -L.../dist/bin needs to be set otherwise it will report missing libnss3.so, 
+# libssl3.so, etc, while linking.
+CONFIGURE_ENV +=	LDFLAGS="-z ignore -z interpose -B nodirect -L$(BUILD_DIR_32)/dist/lib"
 
 CONFIGURE_ENV +=	MOZCONFIG=$(MOZCONFIG)
 CONFIGURE_ENV +=	"CC=$(CC)"
@@ -132,25 +150,34 @@
 CONFIGURE_OPTIONS = --prefix=$(CONFIGURE_PREFIX)
 CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
 
+COMPONENT_POST_CONFIGURE_ACTION += \
+        $(CP) $(MOZCONFIG) $(COMPONENT_SRC)/mozconfig
+
 COMPONENT_POST_BUILD_ACTION = \
         (cd $(@D)/mail/installer ; $(ENV) $(COMPONENT_BUILD_ENV) \
                 $(GMAKE) $(COMPONENT_BUILD_ARGS) $(COMPONENT_BUILD_TARGETS))
 
-COMPONENT_POST_INSTALL_ACTION += \
-	$(CP) $(BUILD_DIR_32)/mozilla/dist/thunderbird/precomplete \
-		$(PROTOUSRLIBDIR)/thunderbird-$(COMPONENT_VERSION)/precomplete ;
+# Path to lightning extension directory
+LIGHTNING_EXT_DIR = \
+	$(PROTOUSRLIBDIR)/thunderbird-$(COMPONENT_VERSION)/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103}
 
 COMPONENT_POST_INSTALL_ACTION += \
-	$(CP) -r $(BUILD_DIR_32)/mozilla/dist/bin/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} \
-		$(PROTOUSRLIBDIR)/thunderbird-$(COMPONENT_VERSION)/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} ;
+	$(CP) -r $(BUILD_DIR_32)/dist/bin/distribution/extensions/{e2fda1a4-762b-4020-b5ad-a41df1933103} \
+		$(LIGHTNING_EXT_DIR) ;
 
 COMPONENT_POST_INSTALL_ACTION += \
         $(RM) -rf xpi ; \
         /usr/bin/tar xvf $(COMPONENT_ARCHIVE_1) > /dev/null 2>&1 ; \
+	/usr/bin/tar xvf $(COMPONENT_ARCHIVE_2) > /dev/null 2>&1 ; \
         list1='$(LANG_LIST)' ; for f in $$list1 ; do \
             $(CP) xpi/$$f.xpi \
                 $(PROTOUSRLIBDIR)/thunderbird-$(COMPONENT_VERSION)/extensions/[email protected] ; \
-        done ;
+	    unzip xpi-lightning/$(LIGHTNING_VERSION).$$f.linux-i686.xpi \
+		chrome/calendar-$$f/\* chrome/lightning-$$f/\* -d \
+		    $(LIGHTNING_EXT_DIR)/ ; \
+	    echo 'locale calendar '$$f' chrome/calendar-'$$f'/locale/'$$f'/calendar/' >> $(LIGHTNING_EXT_DIR)/chrome.manifest ; \
+	    echo 'locale lightning '$$f' chrome/lightning-'$$f'/locale/'$$f'/lightning/' >> $(LIGHTNING_EXT_DIR)/chrome.manifest ; \
+	done ;
 
 LIB_LIST.i386 =
 LIB_LIST.sparc = $(PROTOUSRLIBDIR)/thunderbird-devel-$(COMPONENT_VERSION)/sdk/lib/cpu/sparcv8plus/libnspr_flt4.so
@@ -164,11 +191,13 @@
 
 ASLR_MODE =	$(ASLR_ENABLE)
 
-COMPONENT_TEST_DIR =    $(@D)/mozilla/js/src
+COMPONENT_TEST_DIR =    $(@D)/js/src
 COMPONENT_TEST_TARGETS=check-jit-test
 COMPONENT_TEST_TRANSFORMS += \
         '-e "/\(^TEST-PASS\).*/d" '
 
+$(SOURCE_DIR)/.patched-firefox38-%: GPATCH_FLAGS += -d $(@D)/mozilla
+
 configure:	$(CONFIGURE_32)
 
 build:          $(BUILD_32)