[tbb-commits] [tor-browser-build/master] Bug 25837: Integrate fxc2 for Windows Tor Browser builds

gk at torproject.org gk at torproject.org
Thu Jun 14 15:38:57 UTC 2018


commit 57693e01837f0fc7c60bb056e5b752f5f67a987b
Author: Sukhbir Singh <sukhbir at torproject.org>
Date:   Thu Jun 14 13:21:18 2018 +0000

    Bug 25837: Integrate fxc2 for Windows Tor Browser builds
    
    This commit adds support for building and bundling fxc2 which is
    required for Windows cross-compilation on Linux.
---
 projects/firefox/build  | 18 ++++++++++++++++++
 projects/firefox/config |  8 ++++++++
 projects/fxc2/build     | 30 ++++++++++++++++++++++++++++++
 projects/fxc2/config    | 14 ++++++++++++++
 4 files changed, 70 insertions(+)

diff --git a/projects/firefox/build b/projects/firefox/build
index 0fd3da2..81032c6 100644
--- a/projects/firefox/build
+++ b/projects/firefox/build
@@ -34,6 +34,23 @@ EOF
   export PATH="$mingwdir/helpers:$PATH"
 [% END -%]
 
+[% IF c("var/windows") %]
+  # Unpack fxc2.
+  mkdir -p /var/tmp/dist
+  tar -C /var/tmp/dist -xf [% c('input_files_by_name/fxc2') %]
+  fxcdir=/var/tmp/dist/fxc2/bin
+  cp $mingwdir/[% c("arch") %]-w64-mingw32/bin/libwinpthread-1.dll $fxcdir
+  export PATH="$fxcdir:$PATH"
+  # fxc2 requires Wine.
+  [% IF c("var/windows-x86_64") %]
+    export WINEARCH=win64
+  [% END %]
+  export HOME=/var/tmp/home
+  mkdir -p $HOME
+  WINEROOT=$HOME/.wine/drive_c
+  wine wineboot -i
+[% END -%]
+
 [% IF c("var/linux") %]
   mkdir -p /var/tmp/dist
   tar -C /var/tmp/dist -xf $rootdir/[% c('input_files_by_name/binutils') %]
@@ -161,6 +178,7 @@ rm -f js/src/configure
   cp -a obj-*/dist/firefox/* $distdir/Browser/
   cp -a $rootdir/msvcr100.dll $distdir/Browser
   cp -a $gcclibs/libssp-0.dll $distdir/Browser
+  cp -a $fxcdir/d3dcompiler_47.dll $distdir/Browser
 [% END %]
 
 # Make MAR-based update tools available for use during the bundle phase.
diff --git a/projects/firefox/config b/projects/firefox/config
index 6cb17c7..5bde93d 100644
--- a/projects/firefox/config
+++ b/projects/firefox/config
@@ -65,6 +65,11 @@ targets:
       arch_deps:
         - rsync
 
+  windows:
+    var:
+      arch_deps:
+        - wine
+
   windows-i686:
     var:
       martools_filename: mar-tools-win32.zip
@@ -107,3 +112,6 @@ input_files:
   - project: llvm
     name: llvm
     enable: '[% c("var/linux") %]'
+  - project: fxc2
+    name: fxc2
+    enable: '[% c("var/windows") %]'
diff --git a/projects/fxc2/build b/projects/fxc2/build
new file mode 100644
index 0000000..46a7db8
--- /dev/null
+++ b/projects/fxc2/build
@@ -0,0 +1,30 @@
+#!/bin/bash
+[% c("var/set_default_env") -%]
+distdir="/var/tmp/dist/[% project %]"
+
+[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
+
+mkdir -p /var/tmp/build
+tar -C /var/tmp/build -xf [% project %]-[% c("version") %].tar.gz
+cd /var/tmp/build/[% project %]-[% c("version") %]
+
+[% IF c("var/windows-i686") -%]
+  make x86
+[% ELSE -%]
+  make x64
+[% END -%]
+
+mkdir -p $distdir/bin/
+cp fxc2.exe $distdir/bin/
+[% IF c("var/windows-i686") -%]
+  cp dll/d3dcompiler_47_32.dll $distdir/bin/d3dcompiler_47.dll
+[% ELSE -%]
+  cp dll/d3dcompiler_47.dll $distdir/bin/
+[% END -%]
+
+cd /var/tmp/dist
+
+[% c('tar', {
+        tar_src => [ project ],
+        tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
+    }) %]
diff --git a/projects/fxc2/config b/projects/fxc2/config
new file mode 100644
index 0000000..aac9158
--- /dev/null
+++ b/projects/fxc2/config
@@ -0,0 +1,14 @@
+# vim: filetype=yaml sw=2
+version: '[% c("abbrev") %]'
+git_url: https://github.com/azadi/fxc2.git
+git_hash: 079f5c7b9f6ea0b7e5504bb53abf8709cc92835d
+filename: '[% project %]-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
+
+var:
+  container:
+    use_container: 1
+
+input_files:
+  - project: container-image
+  - name: '[% c("var/compiler") %]'
+    project: '[% c("var/compiler") %]'



More information about the tbb-commits mailing list