commit:     72d280940ea4e830901e4269996d21b4b7587d44
Author:     Jory A. Pratt <anarchy <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 18 04:40:39 2018 +0000
Commit:     Jory Pratt <anarchy <AT> gentoo <DOT> org>
CommitDate: Mon Jun 18 04:40:39 2018 +0000
URL:        https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=72d28094

www-client/torbrowser: Initial ebuild for torbrowser

 www-client/torbrowser/Manifest                     |   3 +
 www-client/torbrowser/files/99torbrowser.example   |  26 ++
 www-client/torbrowser/files/README.tor-launcher    |  33 +++
 www-client/torbrowser/files/Readme.md              |  20 ++
 www-client/torbrowser/files/profile.cfg            |  42 +++
 www-client/torbrowser/metadata.xml                 |  28 ++
 .../torbrowser/torbrowser-52.8.1_p755.ebuild       | 311 +++++++++++++++++++++
 7 files changed, 463 insertions(+)

diff --git a/www-client/torbrowser/Manifest b/www-client/torbrowser/Manifest
new file mode 100644
index 0000000..d254b1b
--- /dev/null
+++ b/www-client/torbrowser/Manifest
@@ -0,0 +1,3 @@
+DIST tor-browser-linux32-7.5.5_en-US.tar.xz 70860112 BLAKE2B 
292322f99f2b26b12b9b9bc63057943ff5e6bd8f279b0a505dff8f11caf95aceab65fdc697a2a6c962344033c063f7131273741fba5d9d37750284909cbe6b6d
 SHA512 
439e857d28b8344cda17ed8e10469bad7609682dc286ee985855173bb25c6cf1b4ccb3cdbe748c5d326071171bf6bcacd0dafe893ea2469c261887af44877b42
+DIST tor-browser-linux64-7.5.5_en-US.tar.xz 69037144 BLAKE2B 
d2c45b85308d082cbcc8f02ba263e1c7e6b83a2278579f72b45b64c0684a6dd4c9f23d657190cc701142b246f8d499ad16f2c33b2738fa5d106004844434d624
 SHA512 
68f6dae920aa73911f4956ac51ecf587dd1c673a82b6a33c09b0d891d1aefe781c37d668d49f888250d440e9538aa06568d0dc31cdeedd50924c881fb8a6c266
+DIST torbrowser-52.8-patches-01.tar.xz 17756 BLAKE2B 
3bc3424bbc47feb4f6e7b09e6c72073a4ef18e3a7cd611555d3c80a7deb166ee1317062305eee4f75d17f3f505edaf639a3bd3ef74443d0a8c73304a780fe151
 SHA512 
edcf1e4fac5f78788ae3c9b81ae7f746fa04b9c76789e772006ead60a65e19c0bda9582f67f0a1f4fb9cfefc98e20d98d0d29194b0e18bc4c1b1eea578d19b60

diff --git a/www-client/torbrowser/files/99torbrowser.example 
b/www-client/torbrowser/files/99torbrowser.example
new file mode 100644
index 0000000..4fb07fa
--- /dev/null
+++ b/www-client/torbrowser/files/99torbrowser.example
@@ -0,0 +1,26 @@
+# /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_CONTROL_PORT=9051
+TOR_CONTROL_HOST=127.0.0.1
+TOR_CONTROL_PASSWD='"secret"'
+#TOR_CONTROL_COOKIE_AUTH_FILE=/var/run/tor/control.authcookie
+
+# Environment variable to skip TorButton control port verification
+#TOR_SKIP_CONTROLPORTTEST=1
+
+# Environment variable to disable the "TorButton" -> "Open Network Settings..."
+# menu item.
+#TOR_NO_DISPLAY_NETWORK_SETTINGS=1
+
+# Environment variable to disable the "TorButton" -> "Check for Updates..."
+# menu item.
+#TOR_HIDE_UPDATE_CHECK_UI=1

diff --git a/www-client/torbrowser/files/README.tor-launcher 
b/www-client/torbrowser/files/README.tor-launcher
new file mode 100644
index 0000000..0683733
--- /dev/null
+++ b/www-client/torbrowser/files/README.tor-launcher
@@ -0,0 +1,33 @@
+Using a system-installed Tor process with Tor Browser:
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+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 and Tor Launcher to authenticate to Tor's
+ControlPort, and is necessary for using TB with a system-installed Tor.
+
+Additionally, if using a system-installed Tor, the following about:config
+options should be set (values in <> mean they are the value taken from your
+torrc):
+
+SETTING NAME                            VALUE
+network.security.ports.banned           [...],<SocksPort>,<ControlPort>
+network.proxy.socks                     127.0.0.1
+network.proxy.socks_port                <SocksPort>
+extensions.torbutton.inserted_button    true
+extensions.torbutton.launch_warning     false
+extensions.torbutton.loglevel           2
+extensions.torbutton.logmethod          0
+extensions.torlauncher.control_port      <ControlPort>
+extensions.torlauncher.loglevel          2
+extensions.torlauncher.logmethod         0
+extensions.torlauncher.prompt_at_startup false
+extensions.torlauncher.start_tor         false
+
+where the '[...]' in the banned_ports option means "leave anything that was
+already in the preference alone, just append the things specified after it".

diff --git a/www-client/torbrowser/files/Readme.md 
b/www-client/torbrowser/files/Readme.md
new file mode 100644
index 0000000..9227583
--- /dev/null
+++ b/www-client/torbrowser/files/Readme.md
@@ -0,0 +1,20 @@
+# Advanced torbutton functionality
+
+To get the advanced functionality of Torbutton (network information,
+new identity feature), `www-client/torbrowser` needs to access a control port.
+
+![Tor Onion Menu 
](https://people.torproject.org/~mikeperry/images/OnionMenu.jpg)
+
+* If you use `www-client/torbrowser`, you need to **adjust and export** the 
environment variables from
+  
[99torbrowser.example](https://github.com/MeisterP/torbrowser-overlay/blob/master/www-client/torbrowser/files/99torbrowser.example).
+  You can do this either with gentoo's `/etc/env.d`
+  
[mechanism](https://wiki.gentoo.org/wiki/Handbook:X86/Working/EnvVar#Defining_variables_globally)
+  or on the command line.
+
+  _Tor Network Settings_ and _Check for Tor Browser Update_ functionality is 
not working with the `www-client/torbrowser`.
+
+* If you use `www-client/torbrowser-launcher`, make sure that the environment 
variables from
+  
[99torbrowser.example](https://github.com/MeisterP/torbrowser-overlay/blob/master/www-client/torbrowser/files/99torbrowser.example)
+  are **unset** and that you **don't** have the system wide tor running on 
port `9150`.
+
+  With `www-client/torbrowser-launcher`, all menu entries are available and 
working.

diff --git a/www-client/torbrowser/files/profile.cfg 
b/www-client/torbrowser/files/profile.cfg
new file mode 100644
index 0000000..d14309a
--- /dev/null
+++ b/www-client/torbrowser/files/profile.cfg
@@ -0,0 +1,42 @@
+//
+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/metadata.xml 
b/www-client/torbrowser/metadata.xml
new file mode 100644
index 0000000..86934b2
--- /dev/null
+++ b/www-client/torbrowser/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+<maintainer type="person">
+       <email>pon...@spahan.ch</email>
+       <name>Poncho</name>
+</maintainer>
+<use>
+       <flag name="custom-optimization">Build with user-specified compiler 
optimizations
+               (-Os, -O0, -O1, -O2, -O3) from CFLAGS (unsupported)</flag>
+       <flag name="gtk2">Use the cairo-gtk2 rendering engine</flag>
+       <flag name="jemalloc">Enable or disable jemalloc</flag>
+       <flag name="system-cairo">Use the system-wide <pkg>x11-libs/cairo</pkg>
+               instead of bundled.</flag>
+       <flag name="system-harfbuzz">Use the system-wide 
<pkg>media-libs/harfbuzz</pkg>
+               and <pkg>media-gfx/graphite2</pkg> instead of bundled.</flag>
+       <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg>
+               instead of bundled.</flag>
+       <flag name="system-jpeg">Use the system-wide 
<pkg>media-libs/libjpeg-turbo</pkg>
+               instead of bundled.</flag>
+       <flag name="system-libevent">Use the system-wide 
<pkg>dev-libs/libevent</pkg>
+               instead of bundled.</flag>
+       <flag name="system-libvpx">Use the system-wide 
<pkg>media-libs/libvpx</pkg>
+               instead of bundled.</flag>
+       <flag name="system-sqlite">Use the system-wide <pkg>dev-db/sqlite</pkg>
+               installation with secure-delete enabled</flag>
+</use>
+</pkgmetadata>

diff --git a/www-client/torbrowser/torbrowser-52.8.1_p755.ebuild 
b/www-client/torbrowser/torbrowser-52.8.1_p755.ebuild
new file mode 100644
index 0000000..bf59995
--- /dev/null
+++ b/www-client/torbrowser/torbrowser-52.8.1_p755.ebuild
@@ -0,0 +1,311 @@
+# Copyright 1999-2018 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+WANT_AUTOCONF="2.1"
+MOZ_ESR=1
+
+if [[ ${MOZ_ESR} == 1 ]]; then
+       # ESR releases have slightly different version numbers
+       MOZ_PV="${PV/_p*}esr"
+fi
+
+# see 
https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/firefox/config?h=maint-7.5#n4
+TOR_PV="7.5.5"
+EGIT_COMMIT="tor-browser-${MOZ_PV}-${TOR_PV%.*}-1-build1"
+
+# Patch version
+PATCH="${PN}-52.8-patches-01"
+
+MOZCONFIG_OPTIONAL_GTK2ONLY=1
+MOZCONFIG_OPTIONAL_WIFI=1
+
+inherit git-r3 check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils 
mozconfig-v6.52 pax-utils autotools
+
+DESCRIPTION="The Tor Browser"
+HOMEPAGE="https://www.torproject.org/projects/torbrowser.html
+       https://gitweb.torproject.org/tor-browser.git";
+
+KEYWORDS="~amd64 ~x86"
+SLOT="0"
+# BSD license applies to torproject-related code like the patches
+# icons are under CCPL-Attribution-3.0
+LICENSE="BSD CC-BY-3.0 MPL-2.0 GPL-2 LGPL-2.1"
+IUSE="hardened test"
+
+EGIT_REPO_URI="https://git.torproject.org/tor-browser.git";
+EGIT_CLONE_TYPE="shallow"
+BASE_SRC_URI="https://dist.torproject.org/${PN}/${TOR_PV}";
+ARCHIVE_SRC_URI="https://archive.torproject.org/tor-package-archive/${PN}/${TOR_PV}";
+PATCH_URIS=( 
https://dev.gentoo.org/~{anarchy,axs,polynomial-c}/mozilla/patchsets/${PATCH}.tar.xz
 )
+
+SRC_URI="${SRC_URI}
+       x86? ( ${BASE_SRC_URI}/tor-browser-linux32-${TOR_PV}_en-US.tar.xz
+               ${ARCHIVE_SRC_URI}/tor-browser-linux32-${TOR_PV}_en-US.tar.xz )
+       amd64? ( ${BASE_SRC_URI}/tor-browser-linux64-${TOR_PV}_en-US.tar.xz
+               ${ARCHIVE_SRC_URI}/tor-browser-linux64-${TOR_PV}_en-US.tar.xz )
+       ${PATCH_URIS[@]}"
+
+ASM_DEPEND=">=dev-lang/yasm-1.1"
+
+RDEPEND="
+       >=dev-libs/nspr-4.19
+       !!<=www-client/torbrowser-45.5.1_p607"
+
+DEPEND="${RDEPEND}
+       ${ASM_DEPEND}
+       virtual/opengl"
+
+QA_PRESTRIPPED="usr/lib*/${PN}/torbrowser"
+
+BUILD_OBJ_DIR="${S}/torsecure"
+
+pkg_setup() {
+       moz_pkgsetup
+
+       # These should *always* be cleaned up anyway
+       unset DBUS_SESSION_BUS_ADDRESS \
+               DISPLAY \
+               ORBIT_SOCKETDIR \
+               SESSION_MANAGER \
+               XDG_SESSION_COOKIE \
+               XAUTHORITY
+}
+
+pkg_pretend() {
+       # Ensure we have enough disk space to compile
+       if use debug || use test ; then
+               CHECKREQS_DISK_BUILD="8G"
+       else
+               CHECKREQS_DISK_BUILD="4G"
+       fi
+       check-reqs_pkg_setup
+}
+
+src_unpack() {
+       unpack ${A}
+       git-r3_src_unpack
+}
+
+src_prepare() {
+       # Apply gentoo firefox patches
+       eapply "${WORKDIR}/${PN}"
+
+       # Allow user to apply any additional patches without modifing ebuild
+       eapply_user
+
+       # Enable gnomebreakpad
+       if use debug ; then
+               sed -i -e 
"s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
+                       "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
+       fi
+
+       # Ensure that our plugins dir is enabled as default
+       sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
+               "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed 
failed to replace plugin path for 32bit!"
+       sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
+               "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed 
failed to replace plugin path for 64bit!"
+
+       # Fix sandbox violations during make clean, bug 372817
+       sed -e "s:\(/no-such-file\):${T}\1:g" \
+               -i "${S}"/config/rules.mk \
+               -i "${S}"/nsprpub/configure{.in,} \
+               || die
+
+       # Don't exit with error when some libs are missing which we have in
+       # system.
+       sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
+               -i "${S}"/browser/installer/Makefile.in || die
+
+       # Don't error out when there's no files to be removed:
+       sed 's@\(xargs rm\)$@\1 -f@' \
+               -i "${S}"/toolkit/mozapps/installer/packager.mk || die
+
+       # Keep codebase the same even if not using official branding
+       sed '/^MOZ_DEV_EDITION=1/d' \
+               -i "${S}"/browser/branding/aurora/configure.sh || die
+
+       # Allow user to apply any additional patches without modifing ebuild
+       eapply_user
+
+       # Autotools configure is now called old-configure.in
+       # This works because there is still a configure.in that happens to be 
for the
+       # shell wrapper configure script
+       eautoreconf old-configure.in
+
+       # Must run autoconf in js/src
+       cd "${S}"/js/src || die
+       eautoconf old-configure.in
+
+       # Need to update jemalloc's configure
+       cd "${S}"/memory/jemalloc/src || die
+       WANT_AUTOCONF= eautoconf
+}
+
+src_configure() {
+       MEXTENSIONS="default"
+
+       mozconfig_init
+       mozconfig_config
+
+       # Add full relro support for hardened
+       use hardened && append-ldflags "-Wl,-z,relro,-z,now"
+
+       mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
+
+       # Rename the install directory and the executable
+       mozconfig_annotate 'torbrowser' --with-app-name=torbrowser
+       mozconfig_annotate 'torbrowser' --with-app-basename=torbrowser
+       # see 
https://gitweb.torproject.org/tor-browser.git/tree/old-configure.in?h=tor-browser-52.6.0esr-7.5-2#n3917
+       mozconfig_annotate 'torbrowser' --with-tor-browser-version=${TOR_PV}
+       mozconfig_annotate 'torbrowser' --disable-tor-browser-update
+
+       # torbrowser uses a patched nss library
+       # see 
https://gitweb.torproject.org/tor-browser.git/log/security/nss?h=tor-browser-52.6.0esr-7.5-2
+       mozconfig_annotate 'torbrowser' --without-system-nspr
+       mozconfig_annotate 'torbrowser' --without-system-nss
+
+       echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
+       echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig
+
+       # Finalize and report settings
+       mozconfig_final
+
+       # workaround for funky/broken upstream configure...
+       SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
+       emake -f client.mk configure
+}
+
+src_compile() {
+       MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
+       emake -f client.mk realbuild
+}
+
+src_install() {
+       cd "${BUILD_OBJ_DIR}" || die
+
+       # Pax mark xpcshell for hardened support, only used for startupcache 
creation.
+       pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
+
+       # see: 
https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/tor-browser/build?h=maint-7.5#n23
+       touch 
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/extension-overrides.js" 
\
+               || die
+
+       # see: 
https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/tor-browser/build?h=maint-7.5#n158
+       echo "pref(\"extensions.torlauncher.prompt_for_locale\", \"false\");" \
+               >> 
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/extension-overrides.js" 
\
+               || die
+
+       echo "pref(\"intl.locale.matchOS\", \"false\");" \
+               >> 
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/extension-overrides.js" 
\
+               || die
+
+       # see: 
https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/tor-browser/build?h=maint-7.5#n196
+       echo "pref(\"general.useragent.locale\", \"en-US\");" \
+               >> 
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
+               || die
+
+       # Reenable defaults/profile functionality
+       # see: https://bugzilla.mozilla.org/show_bug.cgi?id=1234012
+       # see: 
https://mike.kaply.com/2016/05/24/default-profile-directory-doesnt-work-in-firefox-46/
+       echo "pref(\"general.config.filename\", \"profile.cfg\");" \
+               >> 
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
+               || die
+
+       echo "pref(\"general.config.obscure_value\", 0);" \
+               >> 
"${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
+               || die
+
+       insinto ${MOZILLA_FIVE_HOME}
+       doins "${FILESDIR}/profile.cfg"
+
+       MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
+       emake DESTDIR="${D}" install
+
+       # Install icons and .desktop for menu entry
+       local size sizes icon_path
+       sizes="16 24 32 48 256"
+       icon_path="${S}/browser/branding/official"
+       for size in ${sizes}; do
+               newicon -s ${size} "${icon_path}/default${size}.png" ${PN}.png
+       done
+       # The 128x128 icon has a different name
+       newicon -s 128 "${icon_path}/mozicon128.png" ${PN}.png
+       make_desktop_entry ${PN} "Tor Browser" ${PN} "Network;WebBrowser" 
"StartupWMClass=Torbrowser"
+
+       # Add StartupNotify=true bug 237317
+       if use startup-notification ; then
+               echo "StartupNotify=true" \
+                       >> "${ED}/usr/share/applications/${PN}-${PN}.desktop" \
+                       || die
+       fi
+
+       # Required in order to use plugins and even run torbrowser on hardened.
+       pax-mark m 
"${ED}"${MOZILLA_FIVE_HOME}/{torbrowser,torbrowser-bin,plugin-container}
+
+       # Profile without the tor-launcher extension
+       # see: https://trac.torproject.org/projects/tor/ticket/10160
+       local 
profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default"
+
+       docompress -x 
"${EROOT}/usr/share/doc/${PF}/tor-launc...@torproject.org.xpi"
+       dodoc "${profile_dir}/extensions/tor-launc...@torproject.org.xpi"
+       rm "${profile_dir}/extensions/tor-launc...@torproject.org.xpi" || die 
"Failed to remove torlauncher extension"
+
+       insinto ${MOZILLA_FIVE_HOME}/defaults/profile
+       doins -r "${profile_dir}"/{extensions,preferences,bookmarks.html}
+
+       # see: 
https://gitweb.torproject.org/builders/tor-browser-bundle.git/tree/RelativeLink/start-tor-browser#n301
+       dodoc "${FILESDIR}/README.tor-launcher"
+       dodoc 
"${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt"
+
+       # 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"
+}
+
+pkg_preinst() {
+       gnome2_icon_savelist
+
+       # if the apulse libs are available in MOZILLA_FIVE_HOME then apulse
+       # doesn't need to be forced into the LD_LIBRARY_PATH
+       if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
+               einfo "APULSE found - Generating library symlinks for sound 
support"
+               local lib
+               pushd "${ED}"${MOZILLA_FIVE_HOME} &>/dev/null || die
+               for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
+                       # a quickpkg rolled by hand will grab symlinks as part 
of the package,
+                       # so we need to avoid creating them if they already 
exist.
+                       if ! [ -L ${lib##*/} ]; then
+                               ln -s "${lib}" ${lib##*/} || die
+                       fi
+               done
+               popd &>/dev/null || die
+       fi
+}
+
+pkg_postinst() {
+       gnome2_icon_cache_update
+
+       if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
+               elog "Apulse was detected at merge time on this system and so 
it will always be"
+               elog "used for sound.  If you wish to use pulseaudio instead 
please unmerge"
+               elog "media-sound/apulse."
+       fi
+
+       if [[ -z ${REPLACING_VERSIONS} ]]; then
+               ewarn "This patched firefox build is _NOT_ recommended by Tor 
upstream but uses"
+               ewarn "the exact same sources. Use this only if you know what 
you are doing!"
+               elog "Torbrowser uses port 9150 to connect to Tor. You can 
change the port"
+               elog "in the connection settings to match your setup."
+               elog ""
+               elog "To get the advanced functionality of Torbutton (network 
information,"
+               elog "new identity), Torbrowser needs to access a control port."
+               elog "See 99torbrowser.example in /usr/share/doc/${PF} and"
+               elog 
"https://github.com/MeisterP/torbrowser-overlay/blob/master/Readme.md";
+               elog "for further information."
+       fi
+}
+
+pkg_postrm() {
+       gnome2_icon_cache_update
+}

Reply via email to