[tor-commits] [tor-messenger-build/master] Fix instantbird OSX build

boklm at torproject.org boklm at torproject.org
Thu Jun 25 14:19:15 UTC 2015


commit 2558d308860add10c6d75123ee178897e1d27f52
Author: Nicolas Vigier <boklm at torproject.org>
Date:   Thu Jun 25 16:17:15 2015 +0200

    Fix instantbird OSX build
---
 projects/gcc/build                                 |    3 +-
 projects/gcc/config                                |    9 ++++++
 .../instantbird/OSX-package-as-tar.bz2.mozpatch    |   22 ++++++++++++++
 projects/instantbird/build                         |    4 +++
 projects/instantbird/config                        |   15 ++++++++++
 projects/instantbird/mozconfig-osx-x86_64          |   31 ++++++++++++++++++++
 projects/macosx-toolchain/config                   |    8 ++---
 7 files changed, 86 insertions(+), 6 deletions(-)

diff --git a/projects/gcc/build b/projects/gcc/build
index 82ed5f1..d727bc5 100644
--- a/projects/gcc/build
+++ b/projects/gcc/build
@@ -3,8 +3,7 @@ set -e
 distdir=/var/tmp/dist/[% project %]
 tar xf [% project %]-[% c("version") %].tar.bz2
 cd [% project %]-[% c("version") %]
-./configure --prefix=$distdir --enable-multilib --enable-languages=c,c++ \
-            --with-arch_32=i686
+./configure --prefix=$distdir [% c("var/configure_opt") %]
 make -j4
 make install
 cd /var/tmp/dist
diff --git a/projects/gcc/config b/projects/gcc/config
index ae202bf..e27929e 100644
--- a/projects/gcc/config
+++ b/projects/gcc/config
@@ -7,6 +7,7 @@ lsb_release:
   release: 10.04
   codename: lucid
 var:
+  configure_opt: --enable-multilib --enable-languages=c,c++ --with-arch_32=i686
   deps:
     - build-essential
     - libmpc-dev
@@ -20,6 +21,14 @@ var:
     [% ELSE -%]
     export LD_LIBRARY_PATH=/var/tmp/dist/gcc/lib64
     [% END -%]
+targets:
+  osx-x86_64:
+    var:
+      configure_opt: --enable-multilib --enable-languages=c,c++
+    lsb_release:
+      id: Ubuntu
+      release: 12.04
+      codename: precise
 input_files:
   - URL: 'https://ftp.gnu.org/gnu/gcc/gcc-[% c("version") %]/gcc-[% c("version") %].tar.bz2'
     sha256sum: d334781a124ada6f38e63b545e2a3b8c2183049515a1abab6d513f109f1d717e
diff --git a/projects/instantbird/OSX-package-as-tar.bz2.mozpatch b/projects/instantbird/OSX-package-as-tar.bz2.mozpatch
new file mode 100644
index 0000000..0e0e389
--- /dev/null
+++ b/projects/instantbird/OSX-package-as-tar.bz2.mozpatch
@@ -0,0 +1,22 @@
+From ec76d7c64ed6c08b5916d0af6d84a8faeb7e6488 Mon Sep 17 00:00:00 2001
+From: Nicolas Vigier <boklm at torproject.org>
+Date: Thu, 25 Jun 2015 12:18:43 +0200
+Subject: [PATCH] OSX: package as tar.bz2
+
+---
+ toolkit/mozapps/installer/upload-files.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/toolkit/mozapps/installer/upload-files.mk b/toolkit/mozapps/installer/upload-files.mk
+index b546717b9f64..70e33723c9b2 100644
+--- a/toolkit/mozapps/installer/upload-files.mk
++++ b/toolkit/mozapps/installer/upload-files.mk
+@@ -4,7 +4,7 @@
+ 
+ ifndef MOZ_PKG_FORMAT
+ ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
+-MOZ_PKG_FORMAT  = DMG
++MOZ_PKG_FORMAT  = BZ2
+ else
+ ifeq (,$(filter-out WINNT, $(OS_ARCH)))
+ MOZ_PKG_FORMAT  = ZIP
diff --git a/projects/instantbird/build b/projects/instantbird/build
index 703388f..23b23d0 100644
--- a/projects/instantbird/build
+++ b/projects/instantbird/build
@@ -3,6 +3,10 @@ set -e
 rootdir=$(pwd)
 export SHELL=/bin/sh
 export HOME=$rootdir
+[% IF c('var/osx') -%]
+[% pc('gcc', 'var/setup', { compiler_tarfile => c('input_files_by_name/gcchost') }) %]
+ln -s /var/tmp/dist/gcc/bin/gcc /var/tmp/dist/gcc/bin/cc
+[% END -%]
 [% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
 mkdir -p /var/tmp/dist
 cd /var/tmp/dist
diff --git a/projects/instantbird/config b/projects/instantbird/config
index 2d04dc8..92adb3f 100644
--- a/projects/instantbird/config
+++ b/projects/instantbird/config
@@ -52,6 +52,16 @@ targets:
         - lib32z1-dev
         - lib32asound2-dev
         - yasm-1
+  osx-x86_64:
+    lsb_release:
+      id: Ubuntu
+      release: 12.04
+      codename: precise
+    var:
+      arch_deps:
+        - yasm
+        - rsync
+        - sqlite3
 input_files:
   - name: mozilla-src
     project: mozilla
@@ -98,6 +108,8 @@ input_files:
     enable: '[% c("var/windows") %]'
   - filename: Bug-1133689-backport-Make-D3DVsyncDisplay-destructor.mozpatch
     enable: '[% c("var/windows") %]'
+  - filename: OSX-package-as-tar.bz2.mozpatch
+    enable: '[% c("var/osx") %]'
   - filename: 'mozconfig-[% c("var/osname") %]'
     name: mozconfig
   - name: python
@@ -106,6 +118,9 @@ input_files:
   - name: binutils
     project: binutils
     enable: '[% c("var/linux") %]'
+  - name: gcchost
+    project: gcc
+    enable: '[% c("var/osx") %]'
   - name: '[% c("var/compiler") %]'
     project: '[% c("var/compiler") %]'
   - project: docker-image
diff --git a/projects/instantbird/mozconfig-osx-x86_64 b/projects/instantbird/mozconfig-osx-x86_64
new file mode 100644
index 0000000..f624ec4
--- /dev/null
+++ b/projects/instantbird/mozconfig-osx-x86_64
@@ -0,0 +1,31 @@
+CROSS_COMPILE=1
+
+no_tooltool=1
+
+TOOLCHAIN_PREFIX="$ccbindir/x86_64-apple-darwin10-"
+CROSS_PRIVATE_FRAMEWORKS="$sysrootdir/System/Library/PrivateFrameworks"
+
+FLAGS="-arch x86_64 -isysroot $sysrootdir"
+CC="$ccbindir/x86_64-apple-darwin10-clang $FLAGS"
+CXX="$ccbindir/x86_64-apple-darwin10-clang++ $FLAGS"
+
+CONCURRENCY=$(( `grep processor /proc/cpuinfo | wc -l` + 2 ))
+mk_add_options MOZ_MAKE_FLAGS="-j$CONCURRENCY"
+
+ac_add_options --enable-application=im
+ac_add_options --enable-optimize
+ac_add_options --disable-debug
+ac_add_options --target=x86_64-apple-darwin10
+ac_add_options --enable-strip
+ac_add_options --with-macos-private-frameworks="$CROSS_PRIVATE_FRAMEWORKS"
+ac_add_options --disable-crashreporter
+ac_add_options --disable-maintenance-service
+ac_add_options --disable-webrtc
+ac_add_options --disable-tests
+# Let's not compile EME at least until we can enable ClearKey and only Clearkey.
+# (Apart from that there is no Adobe CRM module for OS X right now)
+ac_add_options --disable-eme
+
+ac_add_options --with-l10n-base=..
+
+ac_add_options --with-branding=im/branding/messenger
diff --git a/projects/macosx-toolchain/config b/projects/macosx-toolchain/config
index 19e2c5c..494ccb6 100644
--- a/projects/macosx-toolchain/config
+++ b/projects/macosx-toolchain/config
@@ -5,13 +5,13 @@ var:
   setup: |
     mkdir -p /var/tmp/dist
     tar -C /var/tmp/dist -xf [% c("compiler_tarfile") %]
-    sysrootdir=/var/tmp/dist/[% project %]/SDK/
-    ccbindir=/var/tmp/dist/[% project %]/x-tools/x86_64-apple-darwin10/bin
+    export sysrootdir=/var/tmp/dist/[% project %]/SDK/
+    export ccbindir=/var/tmp/dist/[% project %]/x-tools/x86_64-apple-darwin10/bin
     export PATH="$ccbindir:$PATH"
     CFLAGS="-arch x86_64 -isysroot $sysrootdir"
     CXXFLAGS="-arch x86_64 -isysroot $sysrootdir"
-    CC="$ccbindir/x86_64-apple-darwin10-clang $FLAGS"
-    CXX="$ccbindir/x86_64-apple-darwin10-clang++ $FLAGS"
+    CC="$ccbindir/x86_64-apple-darwin10-clang $CFLAGS"
+    CXX="$ccbindir/x86_64-apple-darwin10-clang++ $CFLAGS"
     RANLIB=$ccbindir/x86_64-apple-darwin10-ranlib
     AR=$ccbindir/x86_64-apple-darwin10-ar
     AS=$ccbindir/x86_64-apple-darwin10-as



More information about the tor-commits mailing list