public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Jory Pratt" <anarchy@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/mozilla:master commit in: www-client/torbrowser/files/icon/, www-client/torbrowser/files/, ...
Date: Fri, 19 Apr 2019 16:49:01 +0000 (UTC)	[thread overview]
Message-ID: <1555692531.01f5131df06807e65363bd30bd20e599470449a5.anarchy@gentoo> (raw)

commit:     01f5131df06807e65363bd30bd20e599470449a5
Author:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 19 16:48:51 2019 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Fri Apr 19 16:48:51 2019 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=01f5131d

www-client/torbrowser: misc cleanup, system tor setup required

Package-Manager: Portage-2.3.63, Repoman-2.3.12
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>

 www-client/torbrowser/files/99torbrowser.example   | 20 -----------
 .../torbrowser/files/icon/torbrowser.desktop       |  9 +++++
 www-client/torbrowser/files/profile.cfg            | 42 ----------------------
 .../torbrowser-60.5.0-nss-fixup-warnings.patch     | 25 -------------
 ...build => torbrowser-60.6.1.8.0.8.1.1-r2.ebuild} | 35 ++++++++++--------
 5 files changed, 29 insertions(+), 102 deletions(-)

diff --git a/www-client/torbrowser/files/99torbrowser.example b/www-client/torbrowser/files/99torbrowser.example
deleted file mode 100644
index e138b30..0000000
--- a/www-client/torbrowser/files/99torbrowser.example
+++ /dev/null
@@ -1,20 +0,0 @@
-# /etc/env.d/99torbrowser
-#
-# The Tor ControlPort password should be given inside double quotes, inside
-# single quotes, i.e. if the ControlPort password is “secret” (without
-# curly quotes) then we must set the environment variable *exactly* like
-# this:
-# TOR_CONTROL_PASSWD='"secret"'
-# Yes, the variable MUST be double-quoted, then single-quoted, exactly as
-# shown. This is used by TorButton to authenticate to Tor's ControlPort, and
-# is necessary for using TB with a system-installed Tor
-
-#TOR_SOCKS_HOST=127.0.0.1
-#TOR_SOCKS_PORT=9150
-#TOR_SOCKS_IPC_PATH=/var/run/tor/socks
-
-#TOR_CONTROL_HOST=127.0.0.1
-#TOR_CONTROL_PORT=9151
-#TOR_CONTROL_PASSWD='"secret"'
-#TOR_CONTROL_COOKIE_AUTH_FILE=/var/run/tor/control.authcookie
-#TOR_CONTROL_IPC_PATH=/var/run/tor/control

diff --git a/www-client/torbrowser/files/icon/torbrowser.desktop b/www-client/torbrowser/files/icon/torbrowser.desktop
new file mode 100644
index 0000000..ecfabde
--- /dev/null
+++ b/www-client/torbrowser/files/icon/torbrowser.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=@NAME@
+Comment=Web Browser
+Exec=torbrowser %u
+Icon=@ICON@
+Terminal=false
+Type=Application
+MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
+Categories=Network;WebBrowser

diff --git a/www-client/torbrowser/files/profile.cfg b/www-client/torbrowser/files/profile.cfg
deleted file mode 100644
index d14309a..0000000
--- a/www-client/torbrowser/files/profile.cfg
+++ /dev/null
@@ -1,42 +0,0 @@
-//
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-
-var profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
-var certDBFile = profileDir.clone();
-certDBFile.append("cert8.db")
-// If cert8.db isn't there, it's a new profile
-if (!certDBFile.exists()) {
-  var defaultProfileDir = Services.dirsvc.get("GreD", Ci.nsIFile);
-  defaultProfileDir.append("defaults");
-  defaultProfileDir.append("profile");
-  try {
-    copyDir(defaultProfileDir, profileDir);
-  } catch (e) {
-    Components.utils.reportError(e);
-  }
-}
- 
-function copyDir(aOriginal, aDestination) {
-  var enumerator = aOriginal.directoryEntries;
-  while (enumerator.hasMoreElements()) {
-    var file = enumerator.getNext().QueryInterface(Components.interfaces.nsIFile);
-    if (file.isDirectory()) {
-      var subdir = aDestination.clone();
-      subdir.append(file.leafName);
-      try {
-        subdir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
-        copyDir(file, subdir);
-      } catch (e) {
-        Components.utils.reportError(e);
-      }
-    } else {
-      try {
-        file.copyTo(aDestination, null);
-      } catch (e) {
-        Components.utils.reportError(e);
-      }
-    }
-  }
-}

diff --git a/www-client/torbrowser/files/torbrowser-60.5.0-nss-fixup-warnings.patch b/www-client/torbrowser/files/torbrowser-60.5.0-nss-fixup-warnings.patch
deleted file mode 100644
index 48289b0..0000000
--- a/www-client/torbrowser/files/torbrowser-60.5.0-nss-fixup-warnings.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From f749a3cc5fc0397e5f4c0948dd35beacac17e2d5 Mon Sep 17 00:00:00 2001
-From: Poncho <poncho@spahan.ch>
-Date: Sun, 16 Aug 2015 14:47:29 +0200
-Subject: [PATCH 4/4] security/nss/coreconf/Linux.mk: add -fno-strict-aliasing
-
-taken from nss-3.15-gentoo-fixup-warnings.patch
----
- security/nss/coreconf/Linux.mk | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/security/nss/coreconf/Linux.mk b/security/nss/coreconf/Linux.mk
-index bb9db413b411..43355237f98a 100644
---- a/security/nss/coreconf/Linux.mk
-+++ b/security/nss/coreconf/Linux.mk
-@@ -119,6 +119,7 @@ ifdef MOZ_DEBUG_SYMBOLS
- 		OPTIMIZER += -gdwarf-2
- 	endif
- endif
-+OPTIMIZER += -fno-strict-aliasing
- endif
- 
- ifndef COMPILER_TAG
--- 
-2.19.2
-

diff --git a/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r1.ebuild b/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r2.ebuild
similarity index 91%
rename from www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r1.ebuild
rename to www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r2.ebuild
index bfe9bcb..68989d0 100644
--- a/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r1.ebuild
+++ b/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r2.ebuild
@@ -10,8 +10,8 @@ MOZCONFIG_OPTIONAL_WIFI=1
 
 LLVM_MAX_SLOT=8
 
-inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils llvm \
-		mozconfig-v6.${PV%%.*} pax-utils xdg-utils autotools
+inherit check-reqs desktop flag-o-matic toolchain-funcs eutils gnome2-utils \
+	llvm mozconfig-v6.${PV%%.*} pax-utils xdg-utils autotools
 inherit eapi7-ver
 
 MOZ_PV="$(ver_cut 1-3)esr"
@@ -73,7 +73,7 @@ S="${WORKDIR}/${GIT_TAG}"
 
 QA_PRESTRIPPED="usr/lib*/${PN}/${PN}"
 
-BUILD_OBJ_DIR="${WORKDIR}/torb"
+BUILD_OBJ_DIR="${WORKDIR}/torbrowser-build"
 
 llvm_check_deps() {
 	if ! has_version "sys-devel/clang:${LLVM_SLOT}" ; then
@@ -122,9 +122,6 @@ src_prepare() {
 		# Revert "Change the default Firefox profile directory to be TBB-relative"
 		"${FILESDIR}"/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch
 		"${FILESDIR}"/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch
-
-		# FIXME: prevent warnings in bundled nss
-		"${FILESDIR}"/torbrowser-60.5.0-nss-fixup-warnings.patch
 	)
 
 	# Enable gnomebreakpad
@@ -258,8 +255,12 @@ src_compile() {
 }
 
 src_install() {
+	local profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default"
 	cd "${BUILD_OBJ_DIR}" || die
 
+	cat "${profile_dir}"/bookmarks.html > \
+		dist/bin/browser/chrome/en-US/locale/browser/bookmarks.html
+
 	# Pax mark xpcshell for hardened support, only used for startupcache creation.
 	pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
 
@@ -289,30 +290,34 @@ src_install() {
 	DESTDIR="${D}" ./mach install || die
 
 	# Install icons and .desktop for menu entry
-	local size icon_path
+	local size icon_path name
 	icon_path="${S}/browser/branding/official"
+	name="Tor Browser"
 	for size in 16 32 48 64 128 256; do
 		newicon -s ${size} "${icon_path}/default${size}.png" ${PN}.png
 	done
-	make_desktop_entry ${PN} "Tor Browser" ${PN} "Network;WebBrowser" "StartupWMClass=Torbrowser"
+	newicon "${icon_path}/default48.png" "${icon}.png"
+	newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
+	sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${PN}:" \
+		"${ED}/usr/share/applications/${PN}.desktop" || die
 
 	# Add StartupNotify=true bug 237317
 	if use startup-notification ; then
 		echo "StartupNotify=true"\
-			 >> "${ED}/usr/share/applications/${PN}-${PN}.desktop" \
+			 >> "${ED}/usr/share/applications/${PN}.desktop" \
 			|| die
 	fi
 
 	# Required in order to use plugins and even run torbrowser on hardened.
 	pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{${PN},plugin-container}
 
-	# Profile with settings and extensions
-	insinto ${MOZILLA_FIVE_HOME}/defaults/profile
-	doins -r "${WORKDIR}"/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default/{extensions,bookmarks.html}
+	# Profile without the tor-launcher extension
+	# see: https://trac.torproject.org/projects/tor/ticket/10160
+	rm "${profile_dir}/extensions/tor-launcher@torproject.org.xpi" || die \
+		"Failed to remove torlauncher extension"
 
-	# see: https://trac.torproject.org/projects/tor/ticket/11751#comment:2
-	# see: https://github.com/Whonix/anon-ws-disable-stacked-tor/blob/master/usr/lib/anon-ws-disable-stacked-tor/torbrowser.sh
-	dodoc "${FILESDIR}/99torbrowser.example"
+	insinto ${MOZILLA_FIVE_HOME}/browser
+	doins -r "${profile_dir}"/extensions
 
 	dodoc "${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt"
 }


             reply	other threads:[~2019-04-20 23:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-19 16:49 Jory Pratt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-02-11 13:43 [gentoo-commits] proj/mozilla:master commit in: www-client/torbrowser/files/icon/, www-client/torbrowser/files/, Jory Pratt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1555692531.01f5131df06807e65363bd30bd20e599470449a5.anarchy@gentoo \
    --to=anarchy@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox