[tor-commits] [Git][tpo/applications/tor-browser][tor-browser-115.9.0esr-13.5-1] fixup! Bug 41089: Add tor-browser build scripts + Makefile to tor-browser
Pier Angelo Vendrame (@pierov)
git at gitlab.torproject.org
Tue Apr 9 17:53:13 UTC 2024
Pier Angelo Vendrame pushed to branch tor-browser-115.9.0esr-13.5-1 at The Tor Project / Applications / Tor Browser
Commits:
5dc406d2 by Dan Ballard at 2024-04-09T10:18:53-07:00
fixup! Bug 41089: Add tor-browser build scripts + Makefile to tor-browser
add geckoview tools
- - - - -
11 changed files:
- + tools/geckoview/.gitignore
- + tools/geckoview/Makefile
- + tools/geckoview/android-env-linux-template.sh
- + tools/geckoview/android-env-macos-template.sh
- + tools/geckoview/build.sh
- + tools/geckoview/clobber.sh
- + tools/geckoview/config.sh
- tools/torbrowser/fataar.py → tools/geckoview/fataar.py
- + tools/geckoview/jslint.sh
- + tools/geckoview/package-gradle.sh
- tools/torbrowser/Makefile
Changes:
=====================================
tools/geckoview/.gitignore
=====================================
@@ -0,0 +1 @@
+android-env.sh
=====================================
tools/geckoview/Makefile
=====================================
@@ -0,0 +1,43 @@
+.DEFAULT_GOAL := all
+
+# one of armv7 aarch64 x86 x86_64
+ARCH=aarch64
+
+ARCHS=$(ARCH)
+OS="${shell uname}"
+
+# https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile
+mkfile_path := "$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))"
+
+DEV_ROOT = "$(mkfile_path)/../.."
+
+clobber: env
+ ./clobber.sh $(DEV_ROOT) $(ARCH)
+
+config: env
+ ./config.sh $(DEV_ROOT) $(ARCH)
+
+build: env
+ ./build.sh $(DEV_ROOT) $(ARCH)
+
+fataar: env
+ bash -c "source android-env.sh && ./fataar.py $(DEV_ROOT) $(ARCHS)"
+
+package: env
+ ./package-gradle.sh $(DEV_ROOT) $(ARCH)
+
+show:
+ ls -lh ~/.m2/repository/org/mozilla/geckoview/geckoview-default-omni/
+ ls -lh ~/.m2/repository/org/mozilla/geckoview/geckoview-default-omni/$(shell ls ~/.m2/repository/org/mozilla/geckoview/geckoview-default-omni | tail -n 2 | head -n 1)
+
+env:
+ test -e android-env.sh || { echo "copy android-env-...-template.sh to android-env.sh and edit appropriatly"; exit 1; }
+
+all: env build package
+
+jslint:
+ ./jslint.sh $(DEV_ROOT) $(JS)
+
+clean:
+ rm -rf $(BUILD_OUTPUT)
+
=====================================
tools/geckoview/android-env-linux-template.sh
=====================================
@@ -0,0 +1,7 @@
+export MOZ_BUILD_DATE=20230710165010 # This should match the data in [firefox-android](https://gitlab.torproject.org/tpo/applications/firefox-android)/android-components/plugins/dependencies/src/main/java/Gecko.kt ~ln 12's def of the variable *version*, the date component
+export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
+export ANDROID_HOME=$HOME/.mozbuild/android-sdk-linux/ # or $HOME/Android/Sdk/ # Or .../android-toolchain/android-sdk-linux if you extract android-toolchain from tor-browser-build
+export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313/ # for 115esr
+export GRADLE_HOME=/FULL/PATH/TO/tor-browser-build/out/gradle/gradle-7.5.1 # Or the version that we currently use
+export LOCAL_DEV_BUILD=1
+export PATH=/FULL/PATH/TO/tor-browser-build/out/clang/clang-16.x.y-arm/bin/:$PATH # prepend our newly built and assembled clang to the path so it gets used to build geckoview
=====================================
tools/geckoview/android-env-macos-template.sh
=====================================
@@ -0,0 +1,7 @@
+export MOZ_BUILD_DATE=20230710165010 # This should match the data in [firefox-android](https://gitlab.torproject.org/tpo/applications/firefox-android)/android-components/plugins/dependencies/src/main/java/Gecko.kt ~ln 12's def of the variable *version*, the date component
+export JAVA_HOME=/opt/homebrew/opt/openjdk at 11/libexec/openjdk.jdk/Contents/Home/ # for arm64. Or JAVA_HOME=/usr/local/opt/openjdk at 11/libexec/openjdk.jdk/Contents/Home/ for x86_64.
+export ANDROID_HOME=$HOME/Library/Android/sdk # or $HOME/.mozbuild/android-sdk-macosx/
+export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/23.2.8568313 # will need to download NDK 23.2.8568313 via android studio
+export GRADLE_HOME=/opt/homebrew/Cellar/gradle at 7/7.6.4 # for arm64 or /usr/local/Cellar/gradle at 7/7.6.4 for x86_64. Make sure the version is up to date
+export LOCAL_DEV_BUILD=1
+export PATH=$ANDROID_HOME/ndk/25.2.9519653/toolchains/llvm/prebuilt/darwin-x86_64/bin/:$PATH # prepend android studios latest ndk to the path so it's clang gets used to build geckoview. NDK 25.2.9519653 uses clang 14.0.7, ideally we'd use clang 16 (to be the same as Linux) but that's not an option yet for android studio. NDK 26.1.10909125 uses clang 17.0.2, which we should evaluate with the esr128 migration
=====================================
tools/geckoview/build.sh
=====================================
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+DEV_ROOT=$1
+ARCH=$2
+
+source android-env.sh
+
+cd $DEV_ROOT
+MOZCONFIG=mozconfig-android-$ARCH ./mach build
=====================================
tools/geckoview/clobber.sh
=====================================
@@ -0,0 +1,10 @@
+#!/bin/bash
+set -e
+DEV_ROOT=$1
+ARCH=$2
+
+source android-env.sh
+
+cd $DEV_ROOT
+MOZCONFIG=mozconfig-android-$ARCH ./mach clobber
+MOZCONFIG=mozconfig-android-all ./mach clobber
=====================================
tools/geckoview/config.sh
=====================================
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+DEV_ROOT=$1
+ARCH=$2
+
+source android-env.sh
+
+cd $DEV_ROOT
+MOZCONFIG=mozconfig-android-$ARCH ./mach configure --without-wasm-sandboxed-libraries
=====================================
tools/torbrowser/fataar.py → tools/geckoview/fataar.py
=====================================
=====================================
tools/geckoview/jslint.sh
=====================================
@@ -0,0 +1,9 @@
+#!/bin/bash
+set -e
+DEV_ROOT=$1
+JS_FILE=$2
+
+source android-env.sh
+
+cd $DEV_ROOT
+./mach lint -l eslint --fix $JS_FILE
=====================================
tools/geckoview/package-gradle.sh
=====================================
@@ -0,0 +1,15 @@
+#!/bin/bash
+set -e
+DEV_ROOT=$1
+ARCH=$2
+
+source android-env.sh
+
+env ARCHS=$ARCH make fat-aar
+
+cd $DEV_ROOT
+MOZCONFIG=mozconfig-android-$ARCH ./mach build binaries
+MOZCONFIG=mozconfig-android-$ARCH ./mach gradle geckoview:publishWithGeckoBinariesDebugPublicationToMavenRepository
+MOZCONFIG=mozconfig-android-all ./mach gradle geckoview:publishWithGeckoBinariesDebugPublicationToMavenLocal exoplayer2:publishDebugPublicationToMavenLocal
+
+
=====================================
tools/torbrowser/Makefile
=====================================
@@ -47,9 +47,6 @@ build:
deploy:
./deploy.sh $(BINARIES) $(BUILD_OUTPUT)
-fat-aar:
- ./fataar.py $(DEV_ROOT) $(ARCHS)
-
all: build deploy
run:
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5dc406d21d88a40e73c7cf4a2d70d10ee1985bee
--
View it on GitLab: https://gitlab.torproject.org/tpo/applications/tor-browser/-/commit/5dc406d21d88a40e73c7cf4a2d70d10ee1985bee
You're receiving this email because of your account on gitlab.torproject.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tor-commits/attachments/20240409/c2352376/attachment-0001.htm>
More information about the tor-commits
mailing list