From 80d5ca1ed1eb568e470432f31a38508bd6b624dc Mon Sep 17 00:00:00 2001 From: Pier Angelo Vendrame Date: Wed, 26 Jan 2022 15:23:42 +0100 Subject: [PATCH] fixup! TB3: Tor Browser's official .mozconfigs. This fixes bug #40793. --- build/moz.configure/old.configure | 5 -- moz.configure | 81 +++++++++++++++++++++++++++++++ old-configure.in | 49 ------------------- 3 files changed, 81 insertions(+), 54 deletions(-) diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure index 95f4200d0973..35ab75df3a14 100644 --- a/build/moz.configure/old.configure +++ b/build/moz.configure/old.configure @@ -119,11 +119,6 @@ def old_configure_options(*options): "--with-user-appdir", "--x-includes", "--x-libraries", - # Tor additions. - "--with-tor-browser-version", - "--enable-tor-browser-update", - "--enable-tor-browser-data-outside-app-dir", - "--enable-tor-launcher", ) def prepare_configure_options(host, target, all_options, *options): # old-configure only supports the options listed in @old_configure_options diff --git a/moz.configure b/moz.configure index 089b5489ffcd..0cd28fd02681 100755 --- a/moz.configure +++ b/moz.configure @@ -1117,6 +1117,87 @@ set_config("MOZ_SYSTEM_ZLIB", True, when="--with-system-zlib") add_old_configure_assignment("MOZ_SYSTEM_ZLIB", True, when="--with-system-zlib") +# Tor additions. + +option( + "--with-tor-browser-version", + nargs=1, + help="Set Tor Browser version, e.g., 7.0a1" +) + + +@depends("--with-tor-browser-version") +def tor_browser_version(value): + if not value: + die("--with-tor-browser-version is required for Tor Browser.") + return value[0] + + +@depends("--with-tor-browser-version") +def tor_browser_version_quoted(value): + if not value: + die("--with-tor-browser-version is required for Tor Browser.") + return '"{}"'.format(value[0]) + + +set_config("TOR_BROWSER_VERSION", tor_browser_version) +set_define("TOR_BROWSER_VERSION", tor_browser_version) +set_define("TOR_BROWSER_VERSION_QUOTED", tor_browser_version_quoted) + + +option( + "--enable-tor-browser-update", + help="Enable Tor Browser update" +) + + +@depends("--enable-tor-browser-update") +def tor_browser_update(value): + if value: + return True + + +set_config("TOR_BROWSER_UPDATE", tor_browser_update) +set_define("TOR_BROWSER_UPDATE", tor_browser_update) +add_old_configure_assignment("TOR_BROWSER_UPDATE", tor_browser_update) + + +option( + "--enable-tor-browser-data-outside-app-dir", + help="Enable Tor Browser data outside of app directory" +) + + +@depends("--enable-tor-browser-data-outside-app-dir") +def tor_browser_data_outside_app_dir(value): + if value: + return True + + +set_define( + "TOR_BROWSER_DATA_OUTSIDE_APP_DIR", tor_browser_data_outside_app_dir) +add_old_configure_assignment( + "TOR_BROWSER_DATA_OUTSIDE_APP_DIR", tor_browser_data_outside_app_dir) + + +option( + "--disable-tor-launcher", + help="Do not include Tor Launcher" +) + + +@depends("--disable-tor-launcher") +def tor_browser_disable_launcher(value): + if not value: + return True + + +set_config("TOR_BROWSER_DISABLE_TOR_LAUNCHER", tor_browser_disable_launcher) +set_define("TOR_BROWSER_DISABLE_TOR_LAUNCHER", tor_browser_disable_launcher) +add_old_configure_assignment( + "TOR_BROWSER_DISABLE_TOR_LAUNCHER", tor_browser_disable_launcher) + + # Please do not add configure checks from here on. # Fallthrough to autoconf-based configure diff --git a/old-configure.in b/old-configure.in index 10fede751d6a..bf86baaa5313 100644 --- a/old-configure.in +++ b/old-configure.in @@ -1881,55 +1881,6 @@ if test -n "$MOZ_UPDATER"; then AC_DEFINE(MOZ_UPDATER) fi -dnl ======================================================== -dnl Tor additions -dnl ======================================================== -MOZ_ARG_WITH_STRING(tor-browser-version, -[ --with-tor-browser-version=VERSION - Set Tor Browser version, e.g., 7.0a1], - TOR_BROWSER_VERSION="$withval") - -if test -z "$TOR_BROWSER_VERSION"; then - AC_MSG_ERROR([--with-tor-browser-version is required for Tor Browser.]) -fi - -MOZ_ARG_ENABLE_BOOL(tor-browser-update, -[ --enable-tor-browser-update - Enable Tor Browser update], - TOR_BROWSER_UPDATE=1, - TOR_BROWSER_UPDATE= ) - -if test -n "$TOR_BROWSER_UPDATE"; then - AC_DEFINE(TOR_BROWSER_UPDATE) -fi - -MOZ_ARG_ENABLE_BOOL(tor-browser-data-outside-app-dir, -[ --enable-tor-browser-data-outside-app-dir - Enable Tor Browser data outside of app directory], - TOR_BROWSER_DATA_OUTSIDE_APP_DIR=1, - TOR_BROWSER_DATA_OUTSIDE_APP_DIR= ) - -if test -n "$TOR_BROWSER_DATA_OUTSIDE_APP_DIR"; then - AC_DEFINE(TOR_BROWSER_DATA_OUTSIDE_APP_DIR) -fi - -AC_DEFINE_UNQUOTED(TOR_BROWSER_VERSION,$TOR_BROWSER_VERSION) -AC_DEFINE_UNQUOTED(TOR_BROWSER_VERSION_QUOTED,"$TOR_BROWSER_VERSION") -AC_SUBST(TOR_BROWSER_UPDATE) -AC_SUBST(TOR_BROWSER_DATA_OUTSIDE_APP_DIR) - -MOZ_ARG_DISABLE_BOOL(tor-launcher, -[ --disable-tor-launcher - Do not include Tor Launcher], - TOR_BROWSER_DISABLE_TOR_LAUNCHER=1, - TOR_BROWSER_DISABLE_TOR_LAUNCHER=) - -if test -n "$TOR_BROWSER_DISABLE_TOR_LAUNCHER"; then - AC_DEFINE(TOR_BROWSER_DISABLE_TOR_LAUNCHER) -fi - -AC_SUBST(TOR_BROWSER_DISABLE_TOR_LAUNCHER) - dnl ======================================================== dnl parental controls (for Windows Vista) dnl ======================================================== -- GitLab