build 2.57 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/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') %]
23
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/node/bin:/var/tmp/dist/fenix-clang/bin:/var/tmp/dist/binutils/bin:$PATH"
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49

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

50
51
# We unbreak mach, see: https://bugzilla.mozilla.org/show_bug.cgi?id=1656993.
export MACH_USE_SYSTEM_PYTHON=1
52
53
54
55
56
57
58
59
60
61
62
63
./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'),
    }) %]