From 4c278ef34725d39acb2295b03829a9c2db5b150e Mon Sep 17 00:00:00 2001 From: caspar Date: Mon, 14 Nov 2022 22:13:58 +0000 Subject: [PATCH] Tor Browser: update to 12.0a4 Better way of handling alpha release version numbers from landry@. Add back Xrandr to WANTLIB; based on email from Josh Grosse. Testing and further WANTLIB tweaks by sdk@. OK landry@ sdk@ --- meta/tor-browser/Makefile | 4 +-- www/tor-browser/Makefile.inc | 2 +- www/tor-browser/browser/Makefile | 24 +++++-------- www/tor-browser/browser/distinfo | 10 +++--- www/tor-browser/browser/files/unveil.main | 1 + ...ch-browser_app_profile_000-tor-browser_js} | 8 ++--- ...tch-browser_config_mozconfigs_base-browser | 12 +++++++ ..._tor-launcher_src_components_tl-process_js | 36 ------------------- ...sions_tor-launcher_src_modules_tl-util_jsm | 15 -------- ...omponents_tor-launcher_TorLauncherUtil_jsm | 15 ++++++++ ...kit_components_tor-launcher_TorProcess_jsm | 34 ++++++++++++++++++ ...ser_TorBrowser_Data_fontconfig_fonts_conf} | 6 ++-- 12 files changed, 85 insertions(+), 82 deletions(-) rename www/tor-browser/browser/patches/{patch-browser_extensions_tor-launcher_src_defaults_preferences_torlauncher-prefs_js => patch-browser_app_profile_000-tor-browser_js} (79%) delete mode 100644 www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_components_tl-process_js delete mode 100644 www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_modules_tl-util_jsm create mode 100644 www/tor-browser/browser/patches/patch-toolkit_components_tor-launcher_TorLauncherUtil_jsm create mode 100644 www/tor-browser/browser/patches/patch-toolkit_components_tor-launcher_TorProcess_jsm rename www/tor-browser/browser/patches/{patch-tor-browser_en-US_Browser_TorBrowser_Data_fontconfig_fonts_conf => patch-tor-browser-linux64_Browser_TorBrowser_Data_fontconfig_fonts_conf} (53%) diff --git a/meta/tor-browser/Makefile b/meta/tor-browser/Makefile index 24b0588d151..8706a526acd 100644 --- a/meta/tor-browser/Makefile +++ b/meta/tor-browser/Makefile @@ -2,10 +2,10 @@ COMMENT= Tor Browser meta package MAINTAINER= Caspar Schutijser -PKGNAME= tor-browser-12.0alpha3 +PKGNAME= tor-browser-12.0alpha4 ONLY_FOR_ARCHS = amd64 -RUN_DEPENDS= www/tor-browser/browser>=12.0alpha3 \ +RUN_DEPENDS= www/tor-browser/browser>=12.0alpha4 \ www/tor-browser/noscript>=11.4.11 \ net/tor>=0.4.7.10 diff --git a/www/tor-browser/Makefile.inc b/www/tor-browser/Makefile.inc index e88088932a1..12639beb719 100644 --- a/www/tor-browser/Makefile.inc +++ b/www/tor-browser/Makefile.inc @@ -3,7 +3,7 @@ HOMEPAGE ?= https://www.torproject.org PERMIT_PACKAGE ?= Yes CATEGORIES = www BROWSER_NAME = tor-browser -TB_VERSION = 12.0a3 +TB_VERSION = 12.0a4 TB_PREFIX = tb SUBST_VARS += BROWSER_NAME TB_VERSION diff --git a/www/tor-browser/browser/Makefile b/www/tor-browser/browser/Makefile index 62cbf36df62..e7a5d862a8c 100644 --- a/www/tor-browser/browser/Makefile +++ b/www/tor-browser/browser/Makefile @@ -13,16 +13,12 @@ TL_VERSION = 0.2.39 EXTRACT_SUFX = .tar.xz PATCHORIG = .pat.orig -# XXX -#PKGNAME = ${TB_PREFIX}-browser-${TB_VERSION} -PKGNAME = ${TB_PREFIX}-browser-12.0alpha3 -DISTNAME = src-firefox-tor-browser-102.3.0esr-12.0-1-build2 -REVISION = 0 +PKGNAME = ${TB_PREFIX}-browser-${TB_VERSION:S/a/alpha/} +DISTNAME = src-firefox-tor-browser-102.4.0esr-12.0-2-build1 FIX_EXTRACT_PERMISSIONS = Yes DISTFILES += ${DISTNAME}.tar.xz \ - src-tor-launcher-${TL_VERSION}.tar.xz \ - tor-browser-linux64-${TB_VERSION}_en-US.tar.xz + tor-browser-linux64-${TB_VERSION}_ALL.tar.xz SO_VERSION = 8.0 MOZILLA_LIBS = xul clearkey lgpllibs mozavcodec mozavutil mozgtk @@ -56,8 +52,8 @@ BUILD_DEPENDS += lang/wasi-sdk/compiler-rt \ lang/wasi-libc # uses pledge() -# Extra: Xcomposite.4 Xdamage.4 Xfixes.6 gdk-x11-2.0.2400 gtk-x11-2.0.2400 -WANTLIB += Xt gthread-2.0 pangoft2-1.0 +# Extra: Xcomposite.4 Xcursor.5 Xdamage.4 Xfixes.6 Xi.12 Xrender.6 +WANTLIB += Xrandr # Regression tests are too hard to adapt to run here NO_TEST = Yes @@ -96,9 +92,7 @@ DEBUG_CONFIGURE_ARGS += --enable-debug-symbols \ --disable-install-strip post-extract: - mv ${WRKDIR}/tor-browser_en-US ${WRKSRC} - mv ${WRKDIR}/tor-launcher-${TL_VERSION}/ \ - ${WRKSRC}/browser/extensions/tor-launcher + mv ${WRKDIR}/tor-browser ${WRKSRC}/tor-browser-linux64/ post-patch: # hack config/baseconfig.mk to not use MOZ_APP_VERSION in a few places @@ -107,7 +101,7 @@ post-patch: # drop in sh front end to configure.py so CONFIGURE_STYLE=simple works ${SUBST_PROGRAM} ${FILESDIR}/configure ${WRKSRC}/configure ${SUBST_PROGRAM} ${FILESDIR}/configure ${WRKSRC}/js/src/configure - ${SUBST_CMD} ${WRKSRC}/browser/extensions/tor-launcher/src/defaults/preferences/torlauncher-prefs.js + ${SUBST_CMD} ${WRKSRC}/browser/app/profile/000-tor-browser.js # Not using a patch for this; patch context would contain UTF-8 sed -i 's/#ifdef XP_LINUX/#if defined(XP_LINUX) || defined(XP_OPENBSD)/' \ ${WRKSRC}/browser/app/profile/000-tor-browser.js @@ -158,10 +152,10 @@ post-install: # install fonts.conf and fonts ${INSTALL_DATA_DIR} ${BROWSER_DIR}/browser/fontconfig ${SUBST_DATA} \ - ${WRKSRC}/tor-browser_en-US/Browser/TorBrowser/Data/fontconfig/fonts.conf \ + ${WRKSRC}/tor-browser-linux64/Browser/TorBrowser/Data/fontconfig/fonts.conf \ ${BROWSER_DIR}/browser/fontconfig/fonts.conf ${INSTALL_DATA_DIR} ${BROWSER_DIR}/browser/fonts - cp ${WRKSRC}/tor-browser_en-US/Browser/fonts/* \ + cp ${WRKSRC}/tor-browser-linux64/Browser/fonts/* \ ${BROWSER_DIR}/browser/fonts # install wrapper script (remove symlink first) diff --git a/www/tor-browser/browser/distinfo b/www/tor-browser/browser/distinfo index c47a8f871d3..e7c4f0eb9ab 100644 --- a/www/tor-browser/browser/distinfo +++ b/www/tor-browser/browser/distinfo @@ -1,6 +1,4 @@ -SHA256 (mozilla/src-firefox-tor-browser-102.3.0esr-12.0-1-build2.tar.xz) = DKDsS/d5QHBPrM35Pofmpr2A5rK0KYV2XgNBObB3Qcg= -SHA256 (mozilla/src-tor-launcher-0.2.39.tar.xz) = w9zcO9aM433DWvGQeHuR3ea9yEqsxG3ttzjqIcxME68= -SHA256 (mozilla/tor-browser-linux64-12.0a3_en-US.tar.xz) = qEHwPxZouA6Of6c0zWUWHKbNLHpibI+TuOZe9wijwa0= -SIZE (mozilla/src-firefox-tor-browser-102.3.0esr-12.0-1-build2.tar.xz) = 511983476 -SIZE (mozilla/src-tor-launcher-0.2.39.tar.xz) = 262744 -SIZE (mozilla/tor-browser-linux64-12.0a3_en-US.tar.xz) = 113342676 +SHA256 (mozilla/src-firefox-tor-browser-102.4.0esr-12.0-2-build1.tar.xz) = 1ECZ70MRsUn8eXatwlHYYFTcnjjprRTeHEmw7VroErk= +SHA256 (mozilla/tor-browser-linux64-12.0a4_ALL.tar.xz) = oIxPAh+U3uw//SUlNSPyLLRpLcyg+Wk+RmdQDpFiwLA= +SIZE (mozilla/src-firefox-tor-browser-102.4.0esr-12.0-2-build1.tar.xz) = 512227588 +SIZE (mozilla/tor-browser-linux64-12.0a4_ALL.tar.xz) = 110950112 diff --git a/www/tor-browser/browser/files/unveil.main b/www/tor-browser/browser/files/unveil.main index 734f6d01376..7389c26178d 100644 --- a/www/tor-browser/browser/files/unveil.main +++ b/www/tor-browser/browser/files/unveil.main @@ -13,6 +13,7 @@ # normally "pledge dns" exempts this from unveil, but pledge might be disabled /etc/resolv.conf r +/usr/local/bin/tor rx /usr/local/lib r /usr/local/lib/tor-browser rx /usr/local/share r diff --git a/www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_defaults_preferences_torlauncher-prefs_js b/www/tor-browser/browser/patches/patch-browser_app_profile_000-tor-browser_js similarity index 79% rename from www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_defaults_preferences_torlauncher-prefs_js rename to www/tor-browser/browser/patches/patch-browser_app_profile_000-tor-browser_js index de8e25bf891..2eaec2a96a0 100644 --- a/www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_defaults_preferences_torlauncher-prefs_js +++ b/www/tor-browser/browser/patches/patch-browser_app_profile_000-tor-browser_js @@ -1,9 +1,9 @@ Set all path-related prefs to minimize patching of tl-util.jsm/tl-process.js -Index: browser/extensions/tor-launcher/src/defaults/preferences/torlauncher-prefs.js ---- browser/extensions/tor-launcher/src/defaults/preferences/torlauncher-prefs.js.orig -+++ browser/extensions/tor-launcher/src/defaults/preferences/torlauncher-prefs.js -@@ -44,14 +44,17 @@ pref("extensions.torlauncher.socks_port_flags", "Exten +Index: browser/app/profile/000-tor-browser.js +--- browser/app/profile/000-tor-browser.js.orig ++++ browser/app/profile/000-tor-browser.js +@@ -132,14 +132,17 @@ pref("extensions.torlauncher.socks_port_flags", "Exten // The tor_path is relative to the application directory. On Linux and // Windows this is the Browser/ directory that contains the firefox // executables, and on Mac OS it is the TorBrowser.app directory. diff --git a/www/tor-browser/browser/patches/patch-browser_config_mozconfigs_base-browser b/www/tor-browser/browser/patches/patch-browser_config_mozconfigs_base-browser index 09919379d95..63efc9156fe 100644 --- a/www/tor-browser/browser/patches/patch-browser_config_mozconfigs_base-browser +++ b/www/tor-browser/browser/patches/patch-browser_config_mozconfigs_base-browser @@ -3,6 +3,10 @@ means we can not pass --disable-eme to configure so comment that out. Don't use --enable-rust-simd, fails to build. +Remove $WASI_SYSROOT test, it breaks the build for us. Not sure if the test +is relevant for us. Was added upstream in +https://gitlab.torproject.org/tpo/applications/tor-browser/-/issues/41406 + Index: browser/config/mozconfigs/base-browser --- browser/config/mozconfigs/base-browser.orig +++ browser/config/mozconfigs/base-browser @@ -28,3 +32,11 @@ Index: browser/config/mozconfigs/base-browser ac_add_options --enable-proxy-bypass-protection # See bugs #30575 and #32418: system policies are harmful either because they # could allow proxy bypass, and override a number of other preferences we set +@@ -37,7 +37,3 @@ ac_add_options --enable-base-browser + + # Disable telemetry + ac_add_options MOZ_TELEMETRY_REPORTING= +- +-if test -z "$WASI_SYSROOT"; then +- ac_add_options --without-wasm-sandboxed-libraries +-fi diff --git a/www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_components_tl-process_js b/www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_components_tl-process_js deleted file mode 100644 index 80fb0989827..00000000000 --- a/www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_components_tl-process_js +++ /dev/null @@ -1,36 +0,0 @@ -Let geoip/geoip6 file paths be set by prefs like everything else and let -the new getTorFile() deal with it. - -Index: browser/extensions/tor-launcher/src/components/tl-process.js ---- browser/extensions/tor-launcher/src/components/tl-process.js.orig -+++ browser/extensions/tor-launcher/src/components/tl-process.js -@@ -388,6 +388,8 @@ TorProcessService.prototype = - var torrcFile = TorLauncherUtil.getTorFile("torrc", true); - var torrcDefaultsFile = - TorLauncherUtil.getTorFile("torrc-defaults", false); -+ var geoipFile = TorLauncherUtil.getTorFile("geoip", false); -+ var geoip6File = TorLauncherUtil.getTorFile("geoip6", false); - var hashedPassword = this.mProtocolSvc.TorGetPassword(true); - var controlIPCFile = this.mProtocolSvc.TorGetControlIPCFile(); - var controlPort = this.mProtocolSvc.TorGetControlPort(); -@@ -415,19 +417,14 @@ TorProcessService.prototype = - return; - } - -- // The geoip and geoip6 files are in the same directory as torrc-defaults. -- var geoipFile = torrcDefaultsFile.clone(); -- geoipFile.leafName = "geoip"; - -- var geoip6File = torrcDefaultsFile.clone(); -- geoip6File.leafName = "geoip6"; -- - var args = []; - if (torrcDefaultsFile) - { - args.push("--defaults-torrc"); - args.push(torrcDefaultsFile.path); - } -+ args.push("--ignore-missing-torrc"); - args.push("-f"); - args.push(torrcFile.path); - args.push("DataDirectory"); diff --git a/www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_modules_tl-util_jsm b/www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_modules_tl-util_jsm deleted file mode 100644 index dc041925b05..00000000000 --- a/www/tor-browser/browser/patches/patch-browser_extensions_tor-launcher_src_modules_tl-util_jsm +++ /dev/null @@ -1,15 +0,0 @@ -Force DataOutsideOfAppDir on OpenBSD since it will always be true -(turned on in ../browser/patches/patch-patch-xpcom_io_TorFileUtils_cpp) - -Index: browser/extensions/tor-launcher/src/modules/tl-util.jsm ---- browser/extensions/tor-launcher/src/modules/tl-util.jsm.orig -+++ browser/extensions/tor-launcher/src/modules/tl-util.jsm -@@ -836,7 +836,7 @@ let TLUtilInternal = // Private - mStringBundle : null, - mOS : "", - // mIsUserDataOutsideOfAppDir is true when TorBrowser-Data is used. -- mIsUserDataOutsideOfAppDir: undefined, // Boolean (cached; access via -+ mIsUserDataOutsideOfAppDir: true, // Boolean (cached; access via - // this._isUserDataOutsideOfAppDir) - mAppDir: null, // nsIFile (cached; access via this._appDir) - mDataDir: null, // nsIFile (cached; access via this._dataDir) diff --git a/www/tor-browser/browser/patches/patch-toolkit_components_tor-launcher_TorLauncherUtil_jsm b/www/tor-browser/browser/patches/patch-toolkit_components_tor-launcher_TorLauncherUtil_jsm new file mode 100644 index 00000000000..7b50cf81140 --- /dev/null +++ b/www/tor-browser/browser/patches/patch-toolkit_components_tor-launcher_TorLauncherUtil_jsm @@ -0,0 +1,15 @@ +Force DataOutsideOfAppDir on OpenBSD since it will always be true +(turned on in patch-xpcom_io_TorFileUtils_cpp). + +Index: toolkit/components/tor-launcher/TorLauncherUtil.jsm +--- toolkit/components/tor-launcher/TorLauncherUtil.jsm.orig ++++ toolkit/components/tor-launcher/TorLauncherUtil.jsm +@@ -31,7 +31,7 @@ class TorFile { + checkIPCPathLen = true; + + static _isFirstIPCPathRequest = true; +- static _isUserDataOutsideOfAppDir = undefined; ++ static _isUserDataOutsideOfAppDir = true; + static _dataDir = null; + static _appDir = null; + diff --git a/www/tor-browser/browser/patches/patch-toolkit_components_tor-launcher_TorProcess_jsm b/www/tor-browser/browser/patches/patch-toolkit_components_tor-launcher_TorProcess_jsm new file mode 100644 index 00000000000..dd0beb0e857 --- /dev/null +++ b/www/tor-browser/browser/patches/patch-toolkit_components_tor-launcher_TorProcess_jsm @@ -0,0 +1,34 @@ +Let geoip/geoip6 file paths be set by prefs like everything else and let +the new getTorFile() deal with it. + +Index: toolkit/components/tor-launcher/TorProcess.jsm +--- toolkit/components/tor-launcher/TorProcess.jsm.orig ++++ toolkit/components/tor-launcher/TorProcess.jsm +@@ -253,6 +253,8 @@ class TorProcess { + const torrcFile = TorLauncherUtil.getTorFile("torrc", true); + this._dataDir = TorLauncherUtil.getTorFile("tordatadir", true); + const onionAuthDir = TorLauncherUtil.getTorFile("toronionauthdir", true); ++ const geoipFile = TorLauncherUtil.getTorFile("geoip", false); ++ const geoip6File = TorLauncherUtil.getTorFile("geoip6", false); + const hashedPassword = TorProtocolService.torGetPassword(true); + let detailsKey; + if (!this._exeFile) { +@@ -281,17 +283,13 @@ class TorProcess { + "torrc-defaults", + false + ); +- // The geoip and geoip6 files are in the same directory as torrc-defaults. +- const geoipFile = torrcDefaultsFile.clone(); +- geoipFile.leafName = "geoip"; +- const geoip6File = torrcDefaultsFile.clone(); +- geoip6File.leafName = "geoip6"; + + this._args = []; + if (torrcDefaultsFile) { + this._args.push("--defaults-torrc"); + this._args.push(torrcDefaultsFile.path); + } ++ this._args.push("--ignore-missing-torrc"); + this._args.push("-f"); + this._args.push(torrcFile.path); + this._args.push("DataDirectory"); diff --git a/www/tor-browser/browser/patches/patch-tor-browser_en-US_Browser_TorBrowser_Data_fontconfig_fonts_conf b/www/tor-browser/browser/patches/patch-tor-browser-linux64_Browser_TorBrowser_Data_fontconfig_fonts_conf similarity index 53% rename from www/tor-browser/browser/patches/patch-tor-browser_en-US_Browser_TorBrowser_Data_fontconfig_fonts_conf rename to www/tor-browser/browser/patches/patch-tor-browser-linux64_Browser_TorBrowser_Data_fontconfig_fonts_conf index 5837b8fcc48..b219e988769 100644 --- a/www/tor-browser/browser/patches/patch-tor-browser_en-US_Browser_TorBrowser_Data_fontconfig_fonts_conf +++ b/www/tor-browser/browser/patches/patch-tor-browser-linux64_Browser_TorBrowser_Data_fontconfig_fonts_conf @@ -1,8 +1,8 @@ Set path to bundled fonts. -Index: tor-browser_en-US/Browser/TorBrowser/Data/fontconfig/fonts.conf ---- tor-browser_en-US/Browser/TorBrowser/Data/fontconfig/fonts.conf.orig -+++ tor-browser_en-US/Browser/TorBrowser/Data/fontconfig/fonts.conf +Index: tor-browser-linux64/Browser/TorBrowser/Data/fontconfig/fonts.conf +--- tor-browser-linux64/Browser/TorBrowser/Data/fontconfig/fonts.conf.orig ++++ tor-browser-linux64/Browser/TorBrowser/Data/fontconfig/fonts.conf @@ -39,7 +39,7 @@ PERFORMANCE OF THIS SOFTWARE.