GitLab is used only for code review, issue tracking and project management. Canonical locations for source code are still https://gitweb.torproject.org/ https://git.torproject.org/ and git-rw.torproject.org.

Unverified Commit e1a81f52 authored by Georg Koppen's avatar Georg Koppen
Browse files

Bug 33626: Add GeckoView project

We include a new project, geckoview. While this increases the
boilerplate a bit it should make it easier to move mobile to the regular
release series while desktop stays on ESR, and it is conceptually
clearer as well (no, we don't build firefox on mobile but a library to
be consumed by other projects).
parent 49ebf71c
#!/usr/bin/perl -w
# Generate a MOZ_BUILD_DATE based on Tor Browser version number
use strict;
die "wrong number of arguments" unless @ARGV == 2;
my ($year, $version) = @ARGV;
my $date;
if ($version =~ m/^tbb-nightly\.([^\.]+)\.([^\.]+)\.([^\.]+)$/) {
$date = sprintf("%d%02d%02d010101", $1, $2, $3);
} elsif ($version eq 'testbuild') {
# There is no need for an increasing build date in test builds. Just hardcode
# it.
$date = 20010101010101;
} else {
my @v = split(/[\.ab]/, $version);
push @v, '0' if @v < 4;
push @v, '0' if @v < 4;
# When MOZ_BUILD_DATE was based on the firefox version, with
# Tor Browser 8.0.6 and firefox 60.5.1 it was 20190204060201
# We can remove 5 from the month, while keeping it increasing.
my $month = $v[0] - 5;
$date = 1010101 + $year * 10000000000 + $month * 100000000
+ $v[1] * 1000000 + $v[2] * 10000 + $v[3];
$date += 1000000 unless $version =~ m/[ab]/;
}
print "export MOZ_BUILD_DATE=$date\n";
#!/bin/bash
[% c("var/set_default_env") -%]
[% pc(c('var/compiler'), 'var/setup', { compiler_tarfile => c('input_files_by_name/' _ c('var/compiler')) }) %]
distdir=/var/tmp/dist
mkdir -p /var/tmp/build
mkdir -p $distdir/[% project %]
# We need to have the get-moz-build-date script available in the container
# but we can't include it via input_files as it is a script shared between
# projects.
cat > get-moz-build-date << "EOF"
[% INCLUDE "get-moz-build-date" %]
EOF
tar -C /var/tmp/dist -xf [% c('input_files_by_name/rust') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/cbindgen') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/nasm') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/python') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/node') %]
tar -C /var/tmp/dist -xf [% c('input_files_by_name/clang') %]
export LLVM_CONFIG="/var/tmp/dist/clang/bin/llvm-config"
tar -C /var/tmp/dist -xf [% c('input_files_by_name/binutils') %]
export PATH="/var/tmp/dist/fenix-rust/bin:/var/tmp/dist/fenix-cbindgen:/var/tmp/dist/nasm/bin:/var/tmp/dist/python/bin:/var/tmp/dist/fenix-node/bin:/var/tmp/dist/fenix-clang/bin:/var/tmp/dist/binutils/bin:$PATH"
tar -C /var/tmp/build -xf [% project %]-[% c('version') %].tar.gz
cd /var/tmp/build/[% project %]-[% c("version") %]
mv -f $rootdir/[% c('input_files_by_name/mozconfig') %] .mozconfig
eval $(perl $rootdir/get-moz-build-date [% c("var/copyright_year") %] [% c("var/torbrowser_version") %])
if [ -z $MOZ_BUILD_DATE ]
then
echo "MOZ_BUILD_DATE is not set"
exit 1
fi
export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64
gradle_repo=/var/tmp/dist/gradle-dependencies
export GRADLE_MAVEN_REPOSITORIES="file://$gradle_repo"
export GRADLE_FLAGS="--no-daemon --offline"
# Move the Gradle repo to a hard-coded location. The location is embedded in
# the file chrome/toolkit/content/global/buildconfig.html so it needs to be
# standardized for reproducibility.
mv $rootdir/[% c('input_files_by_name/gradle-dependencies') %] $gradle_repo
cp -r $gradle_repo/m2/* $gradle_repo
rm -f configure
rm -f js/src/configure
./mach configure --with-tor-browser-version=[% c("var/torbrowser_version") %]
./mach build --verbose
# We don't want to have the debug .aar but the one that has `$channel`, `$arch`,
# and `$version` in its name.
find obj-* -type f -name geckoview-*-*-*.aar -exec cp {} $distdir/[% project %] \;
cd $distdir
[% c('tar', {
tar_src => [ project ],
tar_args => '-czf ' _ dest_dir _ '/' _ c('filename'),
}) %]
# vim: filetype=yaml sw=2
version: '[% c("abbrev") %]'
filename: 'geckoview-[% c("version") %]-[% c("var/osname") %]-[% c("var/build_id") %].tar.gz'
git_hash: 'tor-browser-[% c("var/geckoview_version") %]-[% c("var/torbrowser_branch") %]-1-build2'
tag_gpg_id: 1
git_url: https://git.torproject.org/tor-browser.git
git_submodule: 1
gpg_keyring: torbutton.gpg
var:
geckoview_version: '78.0b[% c("var/beta_version") %]'
beta_version: 5
torbrowser_branch: 10
copyright_year: '[% exec("git show -s --format=%ci").remove("-.*") %]'
deps:
- build-essential
- unzip
- zip
- autoconf2.13
- yasm
# We are building our own version of Python 3.6, which is required
# for the build. However mach still requires Python 2.7, so we
# install this version using the package.
- python
- pkg-config
container:
use_container: 1
# this should be updated when the list of gradle dependencies is changed
gradle_dependencies_version: 1
targets:
nightly:
git_hash: 'tor-browser-[% c("var/geckoview_version") %]-[% c("var/torbrowser_branch") %]-1'
tag_gpg_id: 0
input_files:
- project: container-image
- name: '[% c("var/compiler") %]'
project: '[% c("var/compiler") %]'
- filename: 'mozconfig-[% c("var/osname") %]'
name: mozconfig
- project: binutils
name: binutils
- project: fenix-rust
name: rust
- project: fenix-cbindgen
name: cbindgen
- project: fenix-node
name: node
- project: nasm
name: nasm
- project: python
name: python
- project: fenix-clang
name: clang
- filename: 'gradle-dependencies-[% c("var/gradle_dependencies_version") %]'
name: gradle-dependencies
exec: '[% INCLUDE "fetch-gradle-dependencies" %]'
This diff is collapsed.
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-aarch64-linux-android
mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
export MOZILLA_OFFICIAL=1
CC="clang"
CXX="clang++"
ac_add_options --with-android-min-sdk=21
ac_add_options --enable-optimize
ac_add_options --enable-official-branding
ac_add_options --enable-application=mobile/android
ac_add_options --target=aarch64-linux-android
ac_add_options --with-android-ndk=/var/tmp/dist/fenix-android-toolchain/android-ndk/android-ndk-r20
ac_add_options --with-android-sdk=/var/tmp/dist/fenix-android-toolchain/android-sdk-linux
ac_add_options --with-gradle=/var/tmp/dist/fenix-android-toolchain/gradle/gradle-5.1.1/bin/gradle
# We do not use Tor Launcher on Android:
ac_add_options --disable-tor-launcher
ac_add_options --disable-tor-browser-update
ac_add_options --disable-verify-mar
# We only use beta GeckoView for now
ac_add_options --enable-update-channel=beta
ac_add_options --enable-strip
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-rust-debug
ac_add_options --disable-crashreporter
ac_add_options --disable-webrtc
ac_add_options --enable-proxy-bypass-protection
# Disable telemetry
ac_add_options MOZ_TELEMETRY_REPORTING=
ac_add_options --enable-application=mobile/android
ac_add_options --disable-compile-environment
# We want to have a similar fat .aar versioning as Mozilla and make it clear we
# are on the beta channel for GeckoView
ac_add_options --enable-update-channel=beta
ac_add_options --with-android-sdk=/var/tmp/dist/fenix-android-toolchain/android-sdk-linux
ac_add_options --with-gradle=/var/tmp/dist/fenix-android-toolchain/gradle/gradle-5.1.1/bin/gradle
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-arm-linux-androideabi
mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
export MOZILLA_OFFICIAL=1
CC="clang"
CXX="clang++"
ac_add_options --with-android-min-sdk=16
ac_add_options --enable-optimize
ac_add_options --enable-official-branding
ac_add_options --enable-application=mobile/android
ac_add_options --target=arm-linux-androideabi
ac_add_options --with-android-ndk=/var/tmp/dist/fenix-android-toolchain/android-ndk/android-ndk-r20
ac_add_options --with-android-sdk=/var/tmp/dist/fenix-android-toolchain/android-sdk-linux
ac_add_options --with-gradle=/var/tmp/dist/fenix-android-toolchain/gradle/gradle-5.1.1/bin/gradle
# We do not use Tor Launcher on Android:
ac_add_options --disable-tor-launcher
ac_add_options --disable-tor-browser-update
ac_add_options --disable-verify-mar
# We only use beta GeckoView for now
ac_add_options --enable-update-channel=beta
ac_add_options --enable-strip
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-rust-debug
ac_add_options --disable-crashreporter
ac_add_options --disable-webrtc
ac_add_options --enable-proxy-bypass-protection
# Disable telemetry
ac_add_options MOZ_TELEMETRY_REPORTING=
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-i386-linux-android
mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
export MOZILLA_OFFICIAL=1
CC="clang"
CXX="clang++"
ac_add_options --with-android-min-sdk=16
ac_add_options --enable-optimize
ac_add_options --enable-official-branding
ac_add_options --enable-application=mobile/android
ac_add_options --target=i686-linux-android
ac_add_options --with-android-ndk=/var/tmp/dist/fenix-android-toolchain/android-ndk/android-ndk-r20
ac_add_options --with-android-sdk=/var/tmp/dist/fenix-android-toolchain/android-sdk-linux
ac_add_options --with-gradle=/var/tmp/dist/fenix-android-toolchain/gradle/gradle-5.1.1/bin/gradle
# We do not use Tor Launcher on Android:
ac_add_options --disable-tor-launcher
ac_add_options --disable-tor-browser-update
ac_add_options --disable-verify-mar
# We only use beta GeckoView for now
ac_add_options --enable-update-channel=beta
ac_add_options --enable-strip
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-rust-debug
ac_add_options --disable-crashreporter
ac_add_options --disable-webrtc
ac_add_options --enable-proxy-bypass-protection
# Disable telemetry
ac_add_options MOZ_TELEMETRY_REPORTING=
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-x86_64-linux-android
mk_add_options MOZ_APP_DISPLAYNAME="Tor Browser"
export MOZILLA_OFFICIAL=1
CC="clang"
CXX="clang++"
ac_add_options --with-android-min-sdk=21
ac_add_options --enable-optimize
ac_add_options --enable-official-branding
ac_add_options --enable-application=mobile/android
ac_add_options --target=x86_64-linux-android
ac_add_options --with-android-ndk=/var/tmp/dist/fenix-android-toolchain/android-ndk/android-ndk-r20
ac_add_options --with-android-sdk=/var/tmp/dist/fenix-android-toolchain/android-sdk-linux
ac_add_options --with-gradle=/var/tmp/dist/fenix-android-toolchain/gradle/gradle-5.1.1/bin/gradle
# We do not use Tor Launcher on Android:
ac_add_options --disable-tor-launcher
ac_add_options --disable-tor-browser-update
ac_add_options --disable-verify-mar
# We only use beta GeckoView for now
ac_add_options --enable-update-channel=beta
ac_add_options --enable-strip
ac_add_options --disable-tests
ac_add_options --disable-debug
ac_add_options --disable-rust-debug
ac_add_options --disable-crashreporter
ac_add_options --disable-webrtc
ac_add_options --enable-proxy-bypass-protection
# Disable telemetry
ac_add_options MOZ_TELEMETRY_REPORTING=
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment