@@ -2,15 +2,53 @@ TERMUX_PKG_HOMEPAGE=https://www.torproject.org/
22TERMUX_PKG_DESCRIPTION=" Tor Browser Bundle: anonymous browsing using Firefox and Tor"
33TERMUX_PKG_LICENSE=" MPL-2.0"
44TERMUX_PKG_MAINTAINER=" @termux"
5- TERMUX_PKG_VERSION=" 128.2.0esr-14.0-1-build3"
5+ TERMUX_PKG_GIT_BRANCH=" tor-browser-128.2.0esr-14.0-1-build5"
6+ TERMUX_PKG_VERSION=" 14.0a5"
67TERMUX_PKG_SRCURL=git+https://gitlab.torproject.org/tpo/applications/tor-browser
78# ffmpeg and pulseaudio are dependencies through dlopen(3):
89TERMUX_PKG_DEPENDS=" ffmpeg, fontconfig, freetype, gdk-pixbuf, glib, gtk3, libandroid-shmem, libandroid-spawn, libc++, libcairo, libevent, libffi, libice, libicu, libjpeg-turbo, libnspr, libnss, libpixman, libsm, libvpx, libwebp, libx11, libxcb, libxcomposite, libxdamage, libxext, libxfixes, libxrandr, libxtst, pango, pulseaudio, tor, zlib"
910TERMUX_PKG_BUILD_DEPENDS=" libcpufeatures, libice, libsm"
1011TERMUX_PKG_BUILD_IN_SRC=true
11- TERMUX_PKG_AUTO_UPDATE=true
12- TERMUX_PKG_GIT_BRANCH=" tor-browser-$TERMUX_PKG_VERSION "
13- TERMUX_PKG_UPDATE_TAG_TYPE=" newest-tag"
12+ # TERMUX_PKG_AUTO_UPDATE=true
13+ # TODO: termux_pkg_auto_update() to detect the appropriate TERMUX_PKG_GIT_BRANCH
14+ # perhaps can be done by searching the directory of https://dist.torproject.org/torbrowser/$TERMUX_PKG_VERSION/
15+
16+
17+ # tor-browser needed components beside the firefox browser itself
18+ # for more details, see the relationship between tor-browser and tor-browser-build
19+ # https://gitlab.torproject.org/tpo/applications/team/-/wikis/Development-Information/Tor-Browser/Tor-Browser-Repository-Overview
20+ # also https://gitlab.torproject.org/tpo/applications/tor-browser-build
21+ # Here, we skip the hassle and extract directly from a release file.
22+ termux_step_handle_host_build () {
23+ # app logo
24+ mkdir -p " $TERMUX_PREFIX /share/pixmaps"
25+ cp " browser/branding/tb-release/content/about-logo.svg" " $TERMUX_PREFIX /share/pixmaps/tor-browser.svg"
26+ # component files
27+ local install_dir=" $TERMUX_PREFIX /lib/tor-browser"
28+ mkdir -p " $install_dir "
29+ wget https://dist.torproject.org/torbrowser/${TERMUX_PKG_VERSION} /tor-browser-linux-x86_64-${TERMUX_PKG_VERSION} .tar.xz -O ./tor-browser-bin.tar.xz
30+ if [[ " $( tar -tf ./tor-browser-bin.tar.xz | grep -E ' ^([^/]+/){2}[^/]+/$' | wc -l) " -ne 8 ]]; then
31+ termux_error_exit " The number of folders in tor-browser has changed and please recheck the official release file.
32+ If still in doubt, check the official tor-browser-build repo.
33+ In particular, https://gitlab.torproject.org/tpo/applications/tor-browser-build/-/tree/main/projects/browser."
34+ fi
35+ for folder in .config TorBrowser distribution fontconfig fonts icons; do
36+ tar -C " $install_dir /" -xvf ./tor-browser-bin.tar.xz tor-browser/Browser/${folder} --strip-components=2
37+ done
38+ rm ./tor-browser-bin.tar.xz
39+ # handle architecture-dependent binaries
40+ rm -rf " $install_dir /TorBrowser/Tor/" *
41+ ln -s " $TERMUX_PREFIX /bin/tor" " $install_dir /TorBrowser/Tor/tor"
42+ # TODO: TorBrowser/Tor/pluggable-transports, probably can be copied from
43+ # https://dist.torproject.org/torbrowser/${TERMUX_PKG_VERSION}/tor-expert-bundle-android-${TERMUX_ARCH}-${TERMUX_PKG_VERSION}.tar.xz
44+ # but not familiar how to test it, therefore not implemented.
45+ }
46+
47+
48+ # #############################
49+ # Firefox build script below #
50+ # update when rebased #
51+ # #############################
1452
1553termux_step_post_get_source () {
1654 local f=" media/ffvpx/config_unix_aarch64.h"
0 commit comments