Verified Commit a826e00b authored by Richard Pospesel's avatar Richard Pospesel Committed by Pier Angelo Vendrame
Browse files

Bug 41089: Add tor-browser build scripts + Makefile to tor-browser

parent c34c0d8a
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -351,3 +351,6 @@ mobile/android/annotations/bin/

# Ignore generated log files under media/libvpx
media/libvpx/config/**/config.log

# Ignore binary base of Tor Browser
.binaries
+1 −0
Original line number Diff line number Diff line
android-env.sh
+43 −0
Original line number Diff line number Diff line
.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)
+7 −0
Original line number Diff line number Diff line
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
+7 −0
Original line number Diff line number Diff line
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@11/libexec/openjdk.jdk/Contents/Home/ # for arm64. Or JAVA_HOME=/usr/local/opt/openjdk@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@7/7.6.4 # for arm64 or /usr/local/Cellar/gradle@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
Loading