diff options
Diffstat (limited to 'binary_tarball/scripts')
-rwxr-xr-x | binary_tarball/scripts/1_Install_Dependencies.sh | 45 | ||||
-rwxr-xr-x | binary_tarball/scripts/3_Configure_Source_Code.sh | 23 | ||||
-rwxr-xr-x | binary_tarball/scripts/4_Build_Binary_Tarball.sh | 66 |
3 files changed, 65 insertions, 69 deletions
diff --git a/binary_tarball/scripts/1_Install_Dependencies.sh b/binary_tarball/scripts/1_Install_Dependencies.sh index 58ac13c..833b139 100755 --- a/binary_tarball/scripts/1_Install_Dependencies.sh +++ b/binary_tarball/scripts/1_Install_Dependencies.sh @@ -5,7 +5,43 @@ set -e # Setup Script Variables # _DEPENDENCIES="mercurial wget git flatpak flatpak-builder"; -_DEPENDENCIES="wget git xvfb build-essential xz-utils curl python3 libjack-dev nasm-mozilla libstdc++6"; +_DEPENDENCIES="wget git xvfb \ + xz-utils \ + curl python3 libjack-dev \ + autotools-dev \ + autoconf2.13 \ + zip \ + libx11-dev \ + libx11-xcb-dev \ + libxt-dev \ + libxext-dev \ + libgtk2.0-dev \ + libgtk-3-dev \ + libglib2.0-dev \ + libpango1.0-dev \ + libfontconfig1-dev \ + libfreetype6-dev \ + libstartup-notification0-dev \ + libasound2-dev \ + libcurl4-openssl-dev \ + libdbus-glib-1-dev \ + hardening-wrapper \ + lsb-release \ + libiw-dev \ + mesa-common-dev \ + libnotify-dev \ + libxrender-dev \ + libpulse-dev \ + yasm \ + unzip \ + dbus-x11 \ + python \ + cargo \ + rustc \ + nodejs-mozilla \ + nasm-mozilla \ + gcc-mozilla" + export DEBIAN_FRONTEND=noninteractive # Installs Dependencies @@ -20,6 +56,7 @@ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add apt-get update apt-get -y install clang-9 libclang-9-dev -# Installs (non-ancient) clang -curl -sL https://deb.nodesource.com/setup_13.x | bash - -apt-get install -y nodejs +# Installs (non-ancient) nodejs +# => use nodejs-mozilla instead +# curl -sL https://deb.nodesource.com/setup_13.x | bash - +# apt-get install -y nodejs diff --git a/binary_tarball/scripts/3_Configure_Source_Code.sh b/binary_tarball/scripts/3_Configure_Source_Code.sh index e912c92..3a8813c 100755 --- a/binary_tarball/scripts/3_Configure_Source_Code.sh +++ b/binary_tarball/scripts/3_Configure_Source_Code.sh @@ -21,8 +21,11 @@ cat >${CI_PROJECT_DIR}/mozconfig <<END ac_add_options --enable-application=browser # to build on ubuntu and pick up clang -ac_add_options --with-libclang-path="/usr/lib/llvm-9/lib" -ac_add_options --with-clang-path="/usr/bin/clang-9" +#ac_add_options --with-libclang-path="/usr/lib/llvm-9/lib" +#ac_add_options --with-clang-path="/usr/bin/clang-9" +ac_add_options NODEJS=/usr/lib/nodejs-mozilla/bin/node +ac_add_options NASM=/usr/lib/nasm-mozilla/bin/nasm +ac_add_options --disable-install-strip # let's see if this works: make things backwards-compatible as much as possible # TODO: check if this would also work when building on something newer to have it run on @@ -88,8 +91,8 @@ export CXXFLAGS+=" -g0" export RUSTFLAGS="-Cdebuginfo=0" # from ALARM -# See https://bugzilla.mozilla.org/show_bug.cgi?id=1430094 -ac_add_options --disable-webrtc +# should only fail on armv7x +# ac_add_options --disable-webrtc END @@ -97,9 +100,21 @@ END patch -p1 -i ${$CI_PROJECT_DIR}/arm.patch wget https://raw.githubusercontent.com/archlinuxarm/PKGBUILDs/master/extra/firefox/build-arm-libopus.patch -O ${$CI_PROJECT_DIR}/build-arm-libopus.patch patch -p1 -i ${$CI_PROJECT_DIR}/build-arm-libopus.patch + # might not even be needed for aarch64? + patch -p1 -i ${$CI_PROJECT_DIR}/deb_patches/fix-armhf-webrtc-build.patch + patch -p1 -i ${$CI_PROJECT_DIR}/deb_patches/webrtc-fix-compiler-flags-for-armhf.patch + +else + cat >>${CI_PROJECT_DIR}/mozconfig <<END +ac_add_options --disable-elf-hack +END fi +# hopefully the magic sauce that makes things build on 16.04 and later on work "everywhere": +patch -p1 -i "${$CI_PROJECT_DIR}/deb_patches/drop-check-glibc-symbols.patch" +patch -p1 -i "${$CI_PROJECT_DIR}/deb_patches/build-with-libstdc++-7.patch" + # Disabling Pocket printf "\nDisabling Pocket\n"; sed -i "s/'pocket'/#'pocket'/g" browser/components/moz.build diff --git a/binary_tarball/scripts/4_Build_Binary_Tarball.sh b/binary_tarball/scripts/4_Build_Binary_Tarball.sh index d7649e4..cd1bed3 100755 --- a/binary_tarball/scripts/4_Build_Binary_Tarball.sh +++ b/binary_tarball/scripts/4_Build_Binary_Tarball.sh @@ -41,72 +41,20 @@ export SHELL=/bin/bash; cd $srcdir; # Runs bootstrapper to install dependencies -printf "\nRunning bootstrapper to install build dependencies (using ./mach script within source code)\n"; -./mach bootstrap --application-choice=browser --no-interactive +# printf "\nRunning bootstrapper to install build dependencies (using ./mach script within source code)\n"; +# ./mach bootstrap --application-choice=browser --no-interactive + +# ./mach configure # add cargo binary to path -source /root/.cargo/env +# source /root/.cargo/env # install cbindgen cargo install cbindgen -rm -f mozconfig - -# Do 3-tier PGO -echo "Building instrumented browser..." - -if [[ $CARCH == 'aarch64' ]]; then - -cat >.mozconfig ${CI_PROJECT_DIR}/mozconfig - <<END -ac_add_options --enable-profile-generate -END - -else - -# -fno-plt with cross-LTO causes obscure LLVM errors -# LLVM ERROR: Function Import: link error -CFLAGS="${CFLAGS/-fno-plt/}" -CXXFLAGS="${CXXFLAGS/-fno-plt/}" - -cat >.mozconfig ${CI_PROJECT_DIR}/mozconfig - <<END -ac_add_options --enable-profile-generate=cross -END - -fi - -# Executes the actual build -printf "\nBuilding LibreWolf\n"; -./mach build; - -echo "Profiling instrumented browser..." -./mach package -LLVM_PROFDATA=llvm-profdata \ - JARLOG_FILE="$PWD/jarlog" \ - xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \ - ./mach python build/pgo/profileserver.py - -if [[ ! -s merged.profdata ]]; then - echo "No profile data produced." - exit 1 -fi - -if [[ ! -s jarlog ]]; then - echo "No jar log produced." - exit 1 -fi - -echo "Removing instrumented browser..." -./mach clobber - -echo "Building optimized browser..." - if [[ $CARCH == 'aarch64' ]]; then cat >.mozconfig ${CI_PROJECT_DIR}/mozconfig - <<END -ac_add_options --enable-lto -ac_add_options --enable-profile-use -ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata -ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog # seems to break on arm # ac_add_options --enable-linker=gold END @@ -114,10 +62,6 @@ END else cat >.mozconfig ${CI_PROJECT_DIR}/mozconfig - <<END -ac_add_options --enable-lto=cross -ac_add_options --enable-profile-use=cross -ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata -ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog ac_add_options --enable-linker=gold END |