Automatically package purplexpcom when building Instantbird

ASSIGNED
Assigned to

Status

Chat Core
General
--
enhancement
ASSIGNED
3 years ago
3 years ago

People

(Reporter: clokep, Assigned: clokep)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

3 years ago
Created attachment 8580434 [details] [diff] [review]
Patch v1

It'd be nice if purplexpcom built an xpi when being built for Instantbird so we could directly just set this up for Thunderbird without messing with packaging things manually. This seems pretty easy to port over from Lightning.

This doesn't attempt to do any of the update URL things that Lightning does, if we want that we can add it in the future. I briefly tested the built XPI and it worked. We'd probably want to upload these to the FTP server, but that's not really part of this bug.

I'm unhappy with how MOZILLA_SRCDIR and topsrcdir are defined in here, but I guess that's because it's under mozilla/ instead of something in comm-central? Other thoughts: do we want to include some sort of Gecko version # in the PURPLEXPCOM_VERSION (this would let us have a newer version of the same libpurple version for a newer Gecko version).

Also the install.rdf I based this on was the one we've been using in the XPI, not the one Lightning uses. It has a few minor differences which I'm not sure about...

00:18:02 <clokep> Fallen: In an unrelated question...how are the XPIs for Lightning made?
00:18:27 <Fallen> clokep: just setting XPI_NAME=lightning in the Makefile.in
00:18:33 <Fallen> the build system does the rest
00:18:42 <clokep> Interesting...
00:19:10 <Fallen> the upload process requires some hooks if you are also interested in that
00:19:24 <Fallen> what are you planning
00:19:42 <clokep> I want to make our purplexpcom code make an XPI...
00:19:55 <clokep> Wasn't sure what I need to add (packaging code, etc.)
00:20:07 <clokep> How would I test this?
00:20:14 <clokep> Does mach package do it or...?
00:20:30 <Fallen> mach build already does. It gets put into dist/xpi-stage
00:20:56 <Fallen> mach package takes $app/installer/package-manifest.in and creates the distribution package
00:21:24 <clokep> I see
00:21:54 <Fallen> http://mxr.mozilla.org/comm-central/source/calendar/lightning/lightning-packager.mk contains a lot of extra stuff, the main stuff is in http://mxr.mozilla.org/comm-central/source/calendar/lightning/Makefile.in#8
00:22:08 <clokep> Thanks.
00:22:19 <Fallen> start with the Makefile, then pull in stuff from the packager as you need it
00:24:31 <Fallen> need sleep now. Let me know if you have questions
00:25:11 <clokep> Thanks! :)
00:26:53 <Fallen> clokep: oh and check the gdata provider. Makefile is a bit simpler there
00:27:05 <clokep> :) Thanks.
Attachment #8580434 - Flags: review?(florian)
Attachment #8580434 - Flags: feedback?(philipp)
(Assignee)

Comment 1

3 years ago
This should make future building of the additional chat protocols extension significantly easier, by the way!
Severity: normal → enhancement
OS: Mac OS X → All
Hardware: x86 → All
(Assignee)

Comment 2

3 years ago
Hmm...upon looking at this again, I think this patch might break Instantbird's packaging of purplexpcom.
Comment on attachment 8580434 [details] [diff] [review]
Patch v1

Review of attachment 8580434 [details] [diff] [review]:
-----------------------------------------------------------------

::: Makefile.in
@@ +5,5 @@
>  DEPTH		= @DEPTH@
>  topsrcdir	= @top_srcdir@
>  srcdir		= @srcdir@
>  VPATH		= @srcdir@
> +MOZILLA_SRCDIR	= $(topsrcdir)

Shouldn't MOZILLA_SRCDIR automatically be defined by the build system?

@@ +18,5 @@
> +XPI_NAME = purplexpcom
> +XPI_PKGNAME = purplexpcom-$(PURPLEXPCOM_VERSION).$(AB_CD).$(MOZ_PKG_PLATFORM)
> +XPI_VERSION = $(PURPLEXPCOM_VERSION)
> +
> +XPI_EM_ID = thunderbird@instantbird.org

Shouldn't this be something like purplexpcom@instantbird.org?

@@ +42,5 @@
> +           -DTHUNDERBIRD_MAXVERSION=$(THUNDERBIRD_MAXVERSION) \
> +           -DAB_CD=$(AB_CD) \
> +           -DPURPLEXPCOM_VERSION=$(PURPLEXPCOM_VERSION) \
> +           -DTARGET_PLATFORM=$(OS_TARGET)_$(TARGET_XPCOM_ABI) \
> +           -DXPI_EM_ID="$(XPI_EM_ID)" \

Note you only need to define what you will use in the install.rdf, i.e. you don't need AB_CD.

@@ +46,5 @@
> +           -DXPI_EM_ID="$(XPI_EM_ID)" \
> +           $(NULL)
> +
> +GRE_BUILDID = $(shell $(PYTHON) $(MOZILLA_SRCDIR)/config/printconfigsetting.py $(LIBXUL_DIST)/bin/application.ini App BuildID)
> +DEFINES += -DGRE_BUILDID=$(GRE_BUILDID)

I know we don't do this for Lightning, but you could try setting all the defines in moz.build. For the GRE_BUILDID you might be able to just import the functions from that script or see how its done for other mozilla scripts.
Attachment #8580434 - Flags: feedback?(philipp) → feedback+
(Assignee)

Comment 4

3 years ago
Comment on attachment 8580434 [details] [diff] [review]
Patch v1

This has issues where it breaks normal Instantbird builds. Also, I'm unsure this is useful with the state of binary extensions.
Attachment #8580434 - Flags: review?(florian)
You need to log in before you can comment on or make changes to this bug.