Commit 67cf5ed5 authored by Sukhbir Singh's avatar Sukhbir Singh
Browse files

Improve Windows builds (update instantbird/build)

Changes borrowed from tor-browser-buid.git/projects/firefox/build and
modified for TM builds. This fixes the Windows XP bug (#17469) as well
as other unreported issues which prevented Tor Messenger from starting
on Windows during our testing of the transition to Firefox 52.
parent d47648c8
Loading
Loading
Loading
Loading
+24 −0
Original line number Original line Diff line number Diff line
@@ -61,6 +61,24 @@ then
fi
fi


[% IF c("var/windows") %]
[% IF c("var/windows") %]
  # FIXME
  # Ideally, using LDFLAGS (and e.g. DLLFLAGS for NSS) would be enough to get
  # all Firefox libraries linked against msvcr100. Alas, this does not hold for
  # NSPR. Without patching it we get a "missing entry points for _strcmpi in
  # msvcr100.dll". Now, this should be fixed in rev>=6179 as the def file there
  # contains a proper patch according to the mingw-w64 developers.
  # However, even with this patch the _strcmpi issue is still popping up,
  # probably due to a bug in our current linking setup. The small patch below
  # is therefore just a workaround which should get fixed but is at least
  # justified as the signature of _strcmpi and _stricmp is the same, see:
  # http://msdn.microsoft.com/en-us/library/k59z8dwe.aspx.
  sed 's/strcmpi/stricmp/' -i mozilla/nsprpub/pr/src/linking/prlink.c
  export HOST_LDFLAGS=" "
  export LDFLAGS="-specs=/var/tmp/dist/mingw-w64/msvcr100.spec"
  # Our flags don't get passed to NSS. We need to do that manually using an
  # obscure one.
  export DLLFLAGS="-specs=/var/tmp/dist/mingw-w64/msvcr100.spec"

  # Make sure widl is not inserting random timestamps, see #21837.
  # Make sure widl is not inserting random timestamps, see #21837.
  export WIDL_TIME_OVERRIDE="0"
  export WIDL_TIME_OVERRIDE="0"
[% END %]
[% END %]
@@ -78,8 +96,13 @@ echo ac_add_options --with-tor-browser-version='[% c("var/tormessenger_version")
./mozilla/mach package
./mozilla/mach package


mkdir -p [% dest_dir _ '/' _ c('filename') %]
mkdir -p [% dest_dir _ '/' _ c('filename') %]

mv obj-*/dist/instantbird-*.[% c('var/archive_suffix') %] [% dest_dir _ '/' _ c('filename') %]/instantbird.[% c('var/archive_suffix') %]
mv obj-*/dist/instantbird-*.[% c('var/archive_suffix') %] [% dest_dir _ '/' _ c('filename') %]/instantbird.[% c('var/archive_suffix') %]


[% IF c("var/windows") %]
  cp -a $gcclibs/libssp-0.dll [% dest_dir _ '/' _ c('filename') %]/
[% END %]

MARTOOLS=/var/tmp/dist/mar-tools
MARTOOLS=/var/tmp/dist/mar-tools
mkdir -p $MARTOOLS
mkdir -p $MARTOOLS
cp -p mozilla/config/createprecomplete.py $MARTOOLS/
cp -p mozilla/config/createprecomplete.py $MARTOOLS/
@@ -97,6 +120,7 @@ cp -p obj-*/dist/host/bin/mbsdiff $MARTOOLS/
[% END -%]
[% END -%]


cd /var/tmp/dist
cd /var/tmp/dist

[% c('zip', {
[% c('zip', {
        zip_src => [ 'mar-tools' ],
        zip_src => [ 'mar-tools' ],
        zip_args => dest_dir _ '/' _ c('filename') _ '/' _ c('var/martools_filename'),
        zip_args => dest_dir _ '/' _ c('filename') _ '/' _ c('var/martools_filename'),
+2 −0
Original line number Original line Diff line number Diff line
export CROSS_COMPILE=1
export CROSS_COMPILE=1


mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-mingw

ac_add_options --target=i686-w64-mingw32
ac_add_options --target=i686-w64-mingw32
ac_add_options --with-toolchain-prefix=i686-w64-mingw32-
ac_add_options --with-toolchain-prefix=i686-w64-mingw32-


+5 −0
Original line number Original line Diff line number Diff line
@@ -16,6 +16,10 @@ mkdir bundle
[% IF c("var/windows") -%]
[% IF c("var/windows") -%]
7z x -y -obundle [% c('input_files_by_name/instantbird') %]/instantbird.zip
7z x -y -obundle [% c('input_files_by_name/instantbird') %]/instantbird.zip
mv bundle/instantbird bundle/Browser
mv bundle/instantbird bundle/Browser

cp -a $rootdir/msvcr100.dll bundle/Browser
cp -a [% c('input_files_by_name/instantbird') %]/libssp-0.dll bundle/Browser

[% ELSE -%]
[% ELSE -%]
mkdir bundle/Browser
mkdir bundle/Browser
tar xf [% c('input_files_by_name/instantbird') %]/instantbird.tar.bz2 -C bundle/Browser --strip 1
tar xf [% c('input_files_by_name/instantbird') %]/instantbird.tar.bz2 -C bundle/Browser --strip 1
@@ -122,6 +126,7 @@ python pe_checksum_fix.py
mv tor-messenger-install-tmp2.exe tor-messenger-install.exe
mv tor-messenger-install-tmp2.exe tor-messenger-install.exe
rm tor-messenger-install-tmp.exe
rm tor-messenger-install-tmp.exe
mv tor-messenger-install.exe $OUTDIR/[% c('var/bundle_filename') %]
mv tor-messenger-install.exe $OUTDIR/[% c('var/bundle_filename') %]

[% ELSE -%]
[% ELSE -%]
[% c('tar', {
[% c('tar', {
        tar_src => [ 'tor-messenger' ],
        tar_src => [ 'tor-messenger' ],
+3 −0
Original line number Original line Diff line number Diff line
@@ -39,6 +39,9 @@ input_files:
  - project: nsis
  - project: nsis
    name: nsis
    name: nsis
    enable: '[% c("var/windows") %]'
    enable: '[% c("var/windows") %]'
  - URL: https://people.torproject.org/~mikeperry/mirrors/sources/msvcr100.dll
    sha256sum: 1221a09484964a6f38af5e34ee292b9afefccb3dc6e55435fd3aaf7c235d9067
    enable: '[% c("var/windows") %]'
  - project: container-image
  - project: container-image


var:
var: