Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/mozilla:master commit in: www-client/torbrowser/, www-client/torbrowser/files/
Date: Sun, 31 Mar 2019 14:56:03
Message-Id: 1554043992.d364462a450ea11896b249eab5641a097f51b3a2.anarchy@gentoo
1 commit: d364462a450ea11896b249eab5641a097f51b3a2
2 Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 31 14:53:12 2019 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 31 14:53:12 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=d364462a
7
8 www-client/torbrowser: version bump, nre esr release
9
10 www-client/torbrowser/Manifest | 7 +-
11 www-client/torbrowser/files/99torbrowser.example | 26 --
12 www-client/torbrowser/files/README.tor-launcher | 33 --
13 www-client/torbrowser/files/Readme.md | 20 --
14 www-client/torbrowser/files/profile.cfg | 42 ---
15 www-client/torbrowser/files/torbrowser-lto.patch | 32 ++
16 .../torbrowser/files/torbrowser-profiledir.patch | 44 +++
17 .../files/torbrowser-rust_missing_docs.patch | 21 ++
18 www-client/torbrowser/metadata.xml | 46 ++-
19 .../torbrowser/torbrowser-52.8.1_p756.ebuild | 311 -----------------
20 .../torbrowser/torbrowser-60.6.1.8.0.8.1.1.ebuild | 368 +++++++++++++++++++++
21 11 files changed, 491 insertions(+), 459 deletions(-)
22
23 diff --git a/www-client/torbrowser/Manifest b/www-client/torbrowser/Manifest
24 index 3599314..3a1fff6 100644
25 --- a/www-client/torbrowser/Manifest
26 +++ b/www-client/torbrowser/Manifest
27 @@ -1,3 +1,4 @@
28 -DIST tor-browser-linux32-7.5.6_en-US.tar.xz 70907548 BLAKE2B 226b4437ed18daffeee73670328585821853991a0cb4d9e466b49e34d9ff69e1f41f50f8a4768075e0fc43cbf55fcaddfb1c66a293f8ffd90bc73e4baa5c25a4 SHA512 7e68d88da5addc52b2c9f0ce07f192692739fb484f83c5e5c63327a87b1535cf92f4387de408244588d55f718fa9dbb4c3bbe4ad5e1dafa08e5e6da0ce191ca6
29 -DIST tor-browser-linux64-7.5.6_en-US.tar.xz 69094120 BLAKE2B 8b32b6d338f48df5b05f591979b5862074455628de32aea1bed993a51f43f2a1336efa23f4f1007781e93f33a4bbf5d61e46c3894f382417a81d3a31eaad316b SHA512 4697d82157321c2a15521e11f39953924336d29e9eb376931a0047a3060007715f3c29c568d592271a4d3ff090e9d20d82c295fad4f7579b9a3b51f48d476650
30 -DIST torbrowser-52.8-patches-01.tar.xz 17756 BLAKE2B 3bc3424bbc47feb4f6e7b09e6c72073a4ef18e3a7cd611555d3c80a7deb166ee1317062305eee4f75d17f3f505edaf639a3bd3ef74443d0a8c73304a780fe151 SHA512 edcf1e4fac5f78788ae3c9b81ae7f746fa04b9c76789e772006ead60a65e19c0bda9582f67f0a1f4fb9cfefc98e20d98d0d29194b0e18bc4c1b1eea578d19b60
31 +DIST firefox-60.6-patches-01.tar.xz 14548 BLAKE2B 412059a6db015fff0985e637768426f877b33bb6b649c54f1292780b9d871f8fe9bf8e6b150ec36ab3647b4501fa6aec821c089a5d6fa861402f05e948f1a9d4 SHA512 b97da7a7b65bbf53cb6b9f48fc6c07a32cefa9d4b4a79ce57df047f941f5269e21bf09fa56a5f31bbf757ed2d76f8a1fe01d2306c92d20cab979e0a21f895e64
32 +DIST tor-browser-60.6.1esr-8.0-1-build1.tar.gz 386384151 BLAKE2B 18c9a07296317a0e62e40939c9b839850069836f9d489910fc364e1e2929a3218d3a2fc8a521a59d8971b925a09e0c29820a964bc326b0143480f2839b9f72cf SHA512 9a39ed63494cd2be4952312d8160884f2fa35211f3ea54fc2e9dcc737236102938d8c17b3a112420d847b7c7e98d0f33f210afb3d0fd979e21f7e23769372b4b
33 +DIST tor-browser-linux32-8.0.8_en-US.tar.xz 76761628 BLAKE2B 0c21f3c5718da9fcfe8961a59cd98be495411ea85200294f1918aa9c27af25428e18d7b8a52bab1c27360e6ded221ea981554b7f4130ccd646bc9edb53039f43 SHA512 ebd2b93bdaf87d34cb03ecc2d0811d376a3942de9ea84b6f049358127e91c76aaef4bdd7fcaa9467660e907f9ee5d3fd239f80d7a1667fea2e9b5fbb80355d42
34 +DIST tor-browser-linux64-8.0.8_en-US.tar.xz 75228720 BLAKE2B 2e368225ca44868b700f1a6c8cb7a0f8f532adbca0f38d998741f5a8e24b76553ab861416724d0101b5b30a8bb305b96d308bfc6315619be4489a8f98ebc979a SHA512 a046d56280b24c3a524b894b94ecacd876d27f732bcc1744a5b194684b1477fcb468e6978a20bee456242708e7f9a4e58a7e82e58f31ed3b84f652689cec546e
35
36 diff --git a/www-client/torbrowser/files/99torbrowser.example b/www-client/torbrowser/files/99torbrowser.example
37 deleted file mode 100644
38 index 4fb07fa..0000000
39 --- a/www-client/torbrowser/files/99torbrowser.example
40 +++ /dev/null
41 @@ -1,26 +0,0 @@
42 -# /etc/env.d/99torbrowser
43 -#
44 -# The Tor ControlPort password should be given inside double quotes, inside
45 -# single quotes, i.e. if the ControlPort password is “secret” (without
46 -# curly quotes) then we must set the environment variable *exactly* like
47 -# this:
48 -# TOR_CONTROL_PASSWD='"secret"'
49 -# Yes, the variable MUST be double-quoted, then single-quoted, exactly as
50 -# shown. This is used by TorButton to authenticate to Tor's ControlPort, and
51 -# is necessary for using TB with a system-installed Tor
52 -
53 -TOR_CONTROL_PORT=9051
54 -TOR_CONTROL_HOST=127.0.0.1
55 -TOR_CONTROL_PASSWD='"secret"'
56 -#TOR_CONTROL_COOKIE_AUTH_FILE=/var/run/tor/control.authcookie
57 -
58 -# Environment variable to skip TorButton control port verification
59 -#TOR_SKIP_CONTROLPORTTEST=1
60 -
61 -# Environment variable to disable the "TorButton" -> "Open Network Settings..."
62 -# menu item.
63 -#TOR_NO_DISPLAY_NETWORK_SETTINGS=1
64 -
65 -# Environment variable to disable the "TorButton" -> "Check for Updates..."
66 -# menu item.
67 -#TOR_HIDE_UPDATE_CHECK_UI=1
68
69 diff --git a/www-client/torbrowser/files/README.tor-launcher b/www-client/torbrowser/files/README.tor-launcher
70 deleted file mode 100644
71 index 0683733..0000000
72 --- a/www-client/torbrowser/files/README.tor-launcher
73 +++ /dev/null
74 @@ -1,33 +0,0 @@
75 -Using a system-installed Tor process with Tor Browser:
76 -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
77 -The Tor ControlPort password should be given inside double quotes, inside
78 -single quotes, i.e. if the ControlPort password is “secret” (without
79 -curly quotes) then we must set the environment variable *exactly* like
80 -this:
81 -
82 -TOR_CONTROL_PASSWD='"secret"'
83 -
84 -Yes, the variable MUST be double-quoted, then single-quoted, exactly as
85 -shown. This is used by TorButton and Tor Launcher to authenticate to Tor's
86 -ControlPort, and is necessary for using TB with a system-installed Tor.
87 -
88 -Additionally, if using a system-installed Tor, the following about:config
89 -options should be set (values in <> mean they are the value taken from your
90 -torrc):
91 -
92 -SETTING NAME VALUE
93 -network.security.ports.banned [...],<SocksPort>,<ControlPort>
94 -network.proxy.socks 127.0.0.1
95 -network.proxy.socks_port <SocksPort>
96 -extensions.torbutton.inserted_button true
97 -extensions.torbutton.launch_warning false
98 -extensions.torbutton.loglevel 2
99 -extensions.torbutton.logmethod 0
100 -extensions.torlauncher.control_port <ControlPort>
101 -extensions.torlauncher.loglevel 2
102 -extensions.torlauncher.logmethod 0
103 -extensions.torlauncher.prompt_at_startup false
104 -extensions.torlauncher.start_tor false
105 -
106 -where the '[...]' in the banned_ports option means "leave anything that was
107 -already in the preference alone, just append the things specified after it".
108
109 diff --git a/www-client/torbrowser/files/Readme.md b/www-client/torbrowser/files/Readme.md
110 deleted file mode 100644
111 index 9227583..0000000
112 --- a/www-client/torbrowser/files/Readme.md
113 +++ /dev/null
114 @@ -1,20 +0,0 @@
115 -# Advanced torbutton functionality
116 -
117 -To get the advanced functionality of Torbutton (network information,
118 -new identity feature), `www-client/torbrowser` needs to access a control port.
119 -
120 -![Tor Onion Menu ](https://people.torproject.org/~mikeperry/images/OnionMenu.jpg)
121 -
122 -* If you use `www-client/torbrowser`, you need to **adjust and export** the environment variables from
123 - [99torbrowser.example](https://github.com/MeisterP/torbrowser-overlay/blob/master/www-client/torbrowser/files/99torbrowser.example).
124 - You can do this either with gentoo's `/etc/env.d`
125 - [mechanism](https://wiki.gentoo.org/wiki/Handbook:X86/Working/EnvVar#Defining_variables_globally)
126 - or on the command line.
127 -
128 - _Tor Network Settings_ and _Check for Tor Browser Update_ functionality is not working with the `www-client/torbrowser`.
129 -
130 -* If you use `www-client/torbrowser-launcher`, make sure that the environment variables from
131 - [99torbrowser.example](https://github.com/MeisterP/torbrowser-overlay/blob/master/www-client/torbrowser/files/99torbrowser.example)
132 - are **unset** and that you **don't** have the system wide tor running on port `9150`.
133 -
134 - With `www-client/torbrowser-launcher`, all menu entries are available and working.
135
136 diff --git a/www-client/torbrowser/files/profile.cfg b/www-client/torbrowser/files/profile.cfg
137 deleted file mode 100644
138 index d14309a..0000000
139 --- a/www-client/torbrowser/files/profile.cfg
140 +++ /dev/null
141 @@ -1,42 +0,0 @@
142 -//
143 -const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
144 -Cu.import("resource://gre/modules/Services.jsm");
145 -Cu.import("resource://gre/modules/FileUtils.jsm");
146 -
147 -var profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
148 -var certDBFile = profileDir.clone();
149 -certDBFile.append("cert8.db")
150 -// If cert8.db isn't there, it's a new profile
151 -if (!certDBFile.exists()) {
152 - var defaultProfileDir = Services.dirsvc.get("GreD", Ci.nsIFile);
153 - defaultProfileDir.append("defaults");
154 - defaultProfileDir.append("profile");
155 - try {
156 - copyDir(defaultProfileDir, profileDir);
157 - } catch (e) {
158 - Components.utils.reportError(e);
159 - }
160 -}
161 -
162 -function copyDir(aOriginal, aDestination) {
163 - var enumerator = aOriginal.directoryEntries;
164 - while (enumerator.hasMoreElements()) {
165 - var file = enumerator.getNext().QueryInterface(Components.interfaces.nsIFile);
166 - if (file.isDirectory()) {
167 - var subdir = aDestination.clone();
168 - subdir.append(file.leafName);
169 - try {
170 - subdir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY);
171 - copyDir(file, subdir);
172 - } catch (e) {
173 - Components.utils.reportError(e);
174 - }
175 - } else {
176 - try {
177 - file.copyTo(aDestination, null);
178 - } catch (e) {
179 - Components.utils.reportError(e);
180 - }
181 - }
182 - }
183 -}
184
185 diff --git a/www-client/torbrowser/files/torbrowser-lto.patch b/www-client/torbrowser/files/torbrowser-lto.patch
186 new file mode 100644
187 index 0000000..2db67db
188 --- /dev/null
189 +++ b/www-client/torbrowser/files/torbrowser-lto.patch
190 @@ -0,0 +1,32 @@
191 +--- a/security/sandbox/linux/moz.build
192 ++++ b/security/sandbox/linux/moz.build
193 +@@ -102,7 +102,12 @@ if CONFIG['CC_TYPE'] in ('clang', 'gcc')
194 + # gcc lto likes to put the top level asm in syscall.cc in a different partition
195 + # from the function using it which breaks the build. Work around that by
196 + # forcing there to be only one partition.
197 +-if '-flto' in CONFIG['OS_CXXFLAGS'] and CONFIG['CC_TYPE'] != 'clang':
198 ++lto=False
199 ++for f in CONFIG['OS_CXXFLAGS']:
200 ++ if f.startswith('-flto'):
201 ++ lto=True
202 ++ break
203 ++if lto and CONFIG['CC_TYPE'] != 'clang':
204 + LDFLAGS += ['--lto-partition=one']
205 +
206 + if CONFIG['MOZ_ALSA']:
207 +--- a/build/unix/elfhack/moz.build
208 ++++ b/build/unix/elfhack/moz.build
209 +@@ -14,7 +14,12 @@ if not CONFIG['CROSS_COMPILE']:
210 + 'test-ctors.c',
211 + ]
212 +
213 +- if '-flto' in CONFIG['OS_CFLAGS']:
214 ++ lto=False
215 ++ for f in CONFIG['OS_CFLAGS']:
216 ++ if f.startswith('-flto'):
217 ++ lto=True
218 ++ break
219 ++ if lto:
220 + SOURCES['test-array.c'].flags += ['-fno-lto']
221 + SOURCES['test-ctors.c'].flags += ['-fno-lto']
222 +
223
224 diff --git a/www-client/torbrowser/files/torbrowser-profiledir.patch b/www-client/torbrowser/files/torbrowser-profiledir.patch
225 new file mode 100644
226 index 0000000..bec2495
227 --- /dev/null
228 +++ b/www-client/torbrowser/files/torbrowser-profiledir.patch
229 @@ -0,0 +1,44 @@
230 +--- a/xpcom/io/TorFileUtils.cpp
231 ++++ b/xpcom/io/TorFileUtils.cpp
232 +@@ -81,7 +81,7 @@
233 + }
234 + #endif
235 +
236 +-#elif defined(ANDROID)
237 ++#elif defined(ANDROID) || defined(TOR_BROWSER_DATA_IN_HOME_DIR)
238 + // Orfox stores data in the app home directory.
239 + const char* homeDir = getenv("HOME");
240 + if (!homeDir || !*homeDir)
241 +--- a/toolkit/xre/nsXREDirProvider.cpp
242 ++++ b/toolkit/xre/nsXREDirProvider.cpp
243 +@@ -1283,6 +1283,9 @@
244 + #if !defined(ANDROID)
245 + #ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
246 + rv = localDir->AppendNative(NS_LITERAL_CSTRING("Browser"));
247 ++#elif defined(TOR_BROWSER_DATA_IN_HOME_DIR)
248 ++ rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING(MOZ_USER_DIR
249 ++ XPCOM_FILE_PATH_SEPARATOR "torbrowser"));
250 + #else
251 + rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING("Data"
252 + XPCOM_FILE_PATH_SEPARATOR "Browser"));
253 +@@ -1291,7 +1294,20 @@
254 + #endif
255 +
256 + if (aLocal) {
257 ++#ifndef TOR_BROWSER_DATA_IN_HOME_DIR
258 + rv = localDir->AppendNative(NS_LITERAL_CSTRING("Caches"));
259 ++#else
260 ++ const char* cacheHome = getenv("XDG_CACHE_HOME");
261 ++ if (cacheHome && *cacheHome) {
262 ++ rv = NS_NewNativeLocalFile(nsDependentCString(cacheHome), true,
263 ++ getter_AddRefs(localDir));
264 ++ } else {
265 ++ rv = NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")), true,
266 ++ getter_AddRefs(localDir));
267 ++ rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING(".cache"));
268 ++ }
269 ++ rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING("torbrowser"));
270 ++#endif
271 + NS_ENSURE_SUCCESS(rv, rv);
272 + }
273 +
274
275 diff --git a/www-client/torbrowser/files/torbrowser-rust_missing_docs.patch b/www-client/torbrowser/files/torbrowser-rust_missing_docs.patch
276 new file mode 100644
277 index 0000000..6b38618
278 --- /dev/null
279 +++ b/www-client/torbrowser/files/torbrowser-rust_missing_docs.patch
280 @@ -0,0 +1,21 @@
281 +--- a/servo/components/style_traits/lib.rs
282 ++++ b/servo/components/style_traits/lib.rs
283 +@@ -9,7 +9,7 @@
284 + #![crate_name = "style_traits"]
285 + #![crate_type = "rlib"]
286 +
287 +-#![deny(unsafe_code, missing_docs)]
288 ++#![deny(unsafe_code)]
289 +
290 + extern crate app_units;
291 + #[macro_use] extern crate bitflags;
292 +--- a/servo/components/style/lib.rs
293 ++++ b/servo/components/style/lib.rs
294 +@@ -23,7 +23,6 @@
295 + //! [cssparser]: ../cssparser/index.html
296 + //! [selectors]: ../selectors/index.html
297 +
298 +-#![deny(missing_docs)]
299 +
300 + extern crate app_units;
301 + extern crate arrayvec;
302
303 diff --git a/www-client/torbrowser/metadata.xml b/www-client/torbrowser/metadata.xml
304 index 86934b2..6c81206 100644
305 --- a/www-client/torbrowser/metadata.xml
306 +++ b/www-client/torbrowser/metadata.xml
307 @@ -1,28 +1,26 @@
308 <?xml version="1.0" encoding="UTF-8"?>
309 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
310 <pkgmetadata>
311 -<maintainer type="person">
312 - <email>poncho@××××××.ch</email>
313 - <name>Poncho</name>
314 -</maintainer>
315 -<use>
316 - <flag name="custom-optimization">Build with user-specified compiler optimizations
317 - (-Os, -O0, -O1, -O2, -O3) from CFLAGS (unsupported)</flag>
318 - <flag name="gtk2">Use the cairo-gtk2 rendering engine</flag>
319 - <flag name="jemalloc">Enable or disable jemalloc</flag>
320 - <flag name="system-cairo">Use the system-wide <pkg>x11-libs/cairo</pkg>
321 - instead of bundled.</flag>
322 - <flag name="system-harfbuzz">Use the system-wide <pkg>media-libs/harfbuzz</pkg>
323 - and <pkg>media-gfx/graphite2</pkg> instead of bundled.</flag>
324 - <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg>
325 - instead of bundled.</flag>
326 - <flag name="system-jpeg">Use the system-wide <pkg>media-libs/libjpeg-turbo</pkg>
327 - instead of bundled.</flag>
328 - <flag name="system-libevent">Use the system-wide <pkg>dev-libs/libevent</pkg>
329 - instead of bundled.</flag>
330 - <flag name="system-libvpx">Use the system-wide <pkg>media-libs/libvpx</pkg>
331 - instead of bundled.</flag>
332 - <flag name="system-sqlite">Use the system-wide <pkg>dev-db/sqlite</pkg>
333 - installation with secure-delete enabled</flag>
334 -</use>
335 + <maintainer type="person">
336 + <email>4nykey@×××××.com</email>
337 + </maintainer>
338 + <use>
339 + <flag name="clang">Use Clang compiler instead of GCC</flag>
340 + <flag name="custom-optimization">Fine-tune custom compiler
341 + optimizations (-Os, -O0, -O1, -O2, -O3)</flag>
342 + <flag name="hwaccel">Use hardware-accelerated rendering</flag>
343 + <flag name="screenshot">Allow to disable screenshot extension in global profile</flag>
344 + <flag name="system-harfbuzz">Use the system-wide <pkg>media-libs/harfbuzz</pkg>
345 + and <pkg>media-gfx/graphite2</pkg> instead of bundled.</flag>
346 + <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg>
347 + instead of bundled.</flag>
348 + <flag name="system-jpeg">Use the system-wide <pkg>media-libs/libjpeg-turbo</pkg>
349 + instead of bundled.</flag>
350 + <flag name="system-libevent">Use the system-wide <pkg>dev-libs/libevent</pkg>
351 + instead of bundled.</flag>
352 + <flag name="system-libvpx">Use the system-wide <pkg>media-libs/libvpx</pkg>
353 + instead of bundled.</flag>
354 + <flag name="system-sqlite">Use the system-wide <pkg>dev-db/sqlite</pkg>
355 + installation with secure-delete enabled</flag>
356 + </use>
357 </pkgmetadata>
358
359 diff --git a/www-client/torbrowser/torbrowser-52.8.1_p756.ebuild b/www-client/torbrowser/torbrowser-52.8.1_p756.ebuild
360 deleted file mode 100644
361 index 80a8947..0000000
362 --- a/www-client/torbrowser/torbrowser-52.8.1_p756.ebuild
363 +++ /dev/null
364 @@ -1,311 +0,0 @@
365 -# Copyright 1999-2018 Gentoo Foundation
366 -# Distributed under the terms of the GNU General Public License v2
367 -
368 -EAPI=6
369 -WANT_AUTOCONF="2.1"
370 -MOZ_ESR=1
371 -
372 -if [[ ${MOZ_ESR} == 1 ]]; then
373 - # ESR releases have slightly different version numbers
374 - MOZ_PV="${PV/_p*}esr"
375 -fi
376 -
377 -# see https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/firefox/config?h=maint-7.5#n4
378 -TOR_PV="7.5.6"
379 -EGIT_COMMIT="tor-browser-${MOZ_PV}-${TOR_PV%.*}-1-build1"
380 -
381 -# Patch version
382 -PATCH="${PN}-52.8-patches-01"
383 -
384 -MOZCONFIG_OPTIONAL_GTK2ONLY=1
385 -MOZCONFIG_OPTIONAL_WIFI=1
386 -
387 -inherit git-r3 check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v6.52 pax-utils autotools
388 -
389 -DESCRIPTION="The Tor Browser"
390 -HOMEPAGE="https://www.torproject.org/projects/torbrowser.html
391 - https://gitweb.torproject.org/tor-browser.git"
392 -
393 -KEYWORDS="~amd64 ~x86"
394 -SLOT="0"
395 -# BSD license applies to torproject-related code like the patches
396 -# icons are under CCPL-Attribution-3.0
397 -LICENSE="BSD CC-BY-3.0 MPL-2.0 GPL-2 LGPL-2.1"
398 -IUSE="hardened test"
399 -
400 -EGIT_REPO_URI="https://git.torproject.org/tor-browser.git"
401 -EGIT_CLONE_TYPE="shallow"
402 -BASE_SRC_URI="https://dist.torproject.org/${PN}/${TOR_PV}"
403 -ARCHIVE_SRC_URI="https://archive.torproject.org/tor-package-archive/${PN}/${TOR_PV}"
404 -PATCH_URIS=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c}/mozilla/patchsets/${PATCH}.tar.xz )
405 -
406 -SRC_URI="${SRC_URI}
407 - x86? ( ${BASE_SRC_URI}/tor-browser-linux32-${TOR_PV}_en-US.tar.xz
408 - ${ARCHIVE_SRC_URI}/tor-browser-linux32-${TOR_PV}_en-US.tar.xz )
409 - amd64? ( ${BASE_SRC_URI}/tor-browser-linux64-${TOR_PV}_en-US.tar.xz
410 - ${ARCHIVE_SRC_URI}/tor-browser-linux64-${TOR_PV}_en-US.tar.xz )
411 - ${PATCH_URIS[@]}"
412 -
413 -ASM_DEPEND=">=dev-lang/yasm-1.1"
414 -
415 -RDEPEND="
416 - >=dev-libs/nspr-4.19
417 - !!<=www-client/torbrowser-45.5.1_p607"
418 -
419 -DEPEND="${RDEPEND}
420 - ${ASM_DEPEND}
421 - virtual/opengl"
422 -
423 -QA_PRESTRIPPED="usr/lib*/${PN}/torbrowser"
424 -
425 -BUILD_OBJ_DIR="${S}/torsecure"
426 -
427 -pkg_setup() {
428 - moz_pkgsetup
429 -
430 - # These should *always* be cleaned up anyway
431 - unset DBUS_SESSION_BUS_ADDRESS \
432 - DISPLAY \
433 - ORBIT_SOCKETDIR \
434 - SESSION_MANAGER \
435 - XDG_SESSION_COOKIE \
436 - XAUTHORITY
437 -}
438 -
439 -pkg_pretend() {
440 - # Ensure we have enough disk space to compile
441 - if use debug || use test ; then
442 - CHECKREQS_DISK_BUILD="8G"
443 - else
444 - CHECKREQS_DISK_BUILD="4G"
445 - fi
446 - check-reqs_pkg_setup
447 -}
448 -
449 -src_unpack() {
450 - unpack ${A}
451 - git-r3_src_unpack
452 -}
453 -
454 -src_prepare() {
455 - # Apply gentoo firefox patches
456 - eapply "${WORKDIR}/${PN}"
457 -
458 - # Allow user to apply any additional patches without modifing ebuild
459 - eapply_user
460 -
461 - # Enable gnomebreakpad
462 - if use debug ; then
463 - sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
464 - "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
465 - fi
466 -
467 - # Ensure that our plugins dir is enabled as default
468 - sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
469 - "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
470 - sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
471 - "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
472 -
473 - # Fix sandbox violations during make clean, bug 372817
474 - sed -e "s:\(/no-such-file\):${T}\1:g" \
475 - -i "${S}"/config/rules.mk \
476 - -i "${S}"/nsprpub/configure{.in,} \
477 - || die
478 -
479 - # Don't exit with error when some libs are missing which we have in
480 - # system.
481 - sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
482 - -i "${S}"/browser/installer/Makefile.in || die
483 -
484 - # Don't error out when there's no files to be removed:
485 - sed 's@\(xargs rm\)$@\1 -f@' \
486 - -i "${S}"/toolkit/mozapps/installer/packager.mk || die
487 -
488 - # Keep codebase the same even if not using official branding
489 - sed '/^MOZ_DEV_EDITION=1/d' \
490 - -i "${S}"/browser/branding/aurora/configure.sh || die
491 -
492 - # Allow user to apply any additional patches without modifing ebuild
493 - eapply_user
494 -
495 - # Autotools configure is now called old-configure.in
496 - # This works because there is still a configure.in that happens to be for the
497 - # shell wrapper configure script
498 - eautoreconf old-configure.in
499 -
500 - # Must run autoconf in js/src
501 - cd "${S}"/js/src || die
502 - eautoconf old-configure.in
503 -
504 - # Need to update jemalloc's configure
505 - cd "${S}"/memory/jemalloc/src || die
506 - WANT_AUTOCONF= eautoconf
507 -}
508 -
509 -src_configure() {
510 - MEXTENSIONS="default"
511 -
512 - mozconfig_init
513 - mozconfig_config
514 -
515 - # Add full relro support for hardened
516 - use hardened && append-ldflags "-Wl,-z,relro,-z,now"
517 -
518 - mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
519 -
520 - # Rename the install directory and the executable
521 - mozconfig_annotate 'torbrowser' --with-app-name=torbrowser
522 - mozconfig_annotate 'torbrowser' --with-app-basename=torbrowser
523 - # see https://gitweb.torproject.org/tor-browser.git/tree/old-configure.in?h=tor-browser-52.6.0esr-7.5-2#n3917
524 - mozconfig_annotate 'torbrowser' --with-tor-browser-version=${TOR_PV}
525 - mozconfig_annotate 'torbrowser' --disable-tor-browser-update
526 -
527 - # torbrowser uses a patched nss library
528 - # see https://gitweb.torproject.org/tor-browser.git/log/security/nss?h=tor-browser-52.6.0esr-7.5-2
529 - mozconfig_annotate 'torbrowser' --without-system-nspr
530 - mozconfig_annotate 'torbrowser' --without-system-nss
531 -
532 - echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
533 - echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig
534 -
535 - # Finalize and report settings
536 - mozconfig_final
537 -
538 - # workaround for funky/broken upstream configure...
539 - SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
540 - emake -f client.mk configure
541 -}
542 -
543 -src_compile() {
544 - MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
545 - emake -f client.mk realbuild
546 -}
547 -
548 -src_install() {
549 - cd "${BUILD_OBJ_DIR}" || die
550 -
551 - # Pax mark xpcshell for hardened support, only used for startupcache creation.
552 - pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
553 -
554 - # see: https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/tor-browser/build?h=maint-7.5#n23
555 - touch "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/extension-overrides.js" \
556 - || die
557 -
558 - # see: https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/tor-browser/build?h=maint-7.5#n158
559 - echo "pref(\"extensions.torlauncher.prompt_for_locale\", \"false\");" \
560 - >> "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/extension-overrides.js" \
561 - || die
562 -
563 - echo "pref(\"intl.locale.matchOS\", \"false\");" \
564 - >> "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/extension-overrides.js" \
565 - || die
566 -
567 - # see: https://gitweb.torproject.org/builders/tor-browser-build.git/tree/projects/tor-browser/build?h=maint-7.5#n196
568 - echo "pref(\"general.useragent.locale\", \"en-US\");" \
569 - >> "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
570 - || die
571 -
572 - # Reenable defaults/profile functionality
573 - # see: https://bugzilla.mozilla.org/show_bug.cgi?id=1234012
574 - # see: https://mike.kaply.com/2016/05/24/default-profile-directory-doesnt-work-in-firefox-46/
575 - echo "pref(\"general.config.filename\", \"profile.cfg\");" \
576 - >> "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
577 - || die
578 -
579 - echo "pref(\"general.config.obscure_value\", 0);" \
580 - >> "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
581 - || die
582 -
583 - insinto ${MOZILLA_FIVE_HOME}
584 - doins "${FILESDIR}/profile.cfg"
585 -
586 - MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX%/}/bin/bash}" \
587 - emake DESTDIR="${D}" install
588 -
589 - # Install icons and .desktop for menu entry
590 - local size sizes icon_path
591 - sizes="16 24 32 48 256"
592 - icon_path="${S}/browser/branding/official"
593 - for size in ${sizes}; do
594 - newicon -s ${size} "${icon_path}/default${size}.png" ${PN}.png
595 - done
596 - # The 128x128 icon has a different name
597 - newicon -s 128 "${icon_path}/mozicon128.png" ${PN}.png
598 - make_desktop_entry ${PN} "Tor Browser" ${PN} "Network;WebBrowser" "StartupWMClass=Torbrowser"
599 -
600 - # Add StartupNotify=true bug 237317
601 - if use startup-notification ; then
602 - echo "StartupNotify=true" \
603 - >> "${ED}/usr/share/applications/${PN}-${PN}.desktop" \
604 - || die
605 - fi
606 -
607 - # Required in order to use plugins and even run torbrowser on hardened.
608 - pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{torbrowser,torbrowser-bin,plugin-container}
609 -
610 - # Profile without the tor-launcher extension
611 - # see: https://trac.torproject.org/projects/tor/ticket/10160
612 - local profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default"
613 -
614 - docompress -x "${EROOT}/usr/share/doc/${PF}/tor-launcher@××××××××××××××.xpi"
615 - dodoc "${profile_dir}/extensions/tor-launcher@××××××××××××××.xpi"
616 - rm "${profile_dir}/extensions/tor-launcher@××××××××××××××.xpi" || die "Failed to remove torlauncher extension"
617 -
618 - insinto ${MOZILLA_FIVE_HOME}/defaults/profile
619 - doins -r "${profile_dir}"/{extensions,preferences,bookmarks.html}
620 -
621 - # see: https://gitweb.torproject.org/builders/tor-browser-bundle.git/tree/RelativeLink/start-tor-browser#n301
622 - dodoc "${FILESDIR}/README.tor-launcher"
623 - dodoc "${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt"
624 -
625 - # see: https://trac.torproject.org/projects/tor/ticket/11751#comment:2
626 - # see: https://github.com/Whonix/anon-ws-disable-stacked-tor/blob/master/usr/lib/anon-ws-disable-stacked-tor/torbrowser.sh
627 - dodoc "${FILESDIR}/99torbrowser.example"
628 -}
629 -
630 -pkg_preinst() {
631 - gnome2_icon_savelist
632 -
633 - # if the apulse libs are available in MOZILLA_FIVE_HOME then apulse
634 - # doesn't need to be forced into the LD_LIBRARY_PATH
635 - if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
636 - einfo "APULSE found - Generating library symlinks for sound support"
637 - local lib
638 - pushd "${ED}"${MOZILLA_FIVE_HOME} &>/dev/null || die
639 - for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
640 - # a quickpkg rolled by hand will grab symlinks as part of the package,
641 - # so we need to avoid creating them if they already exist.
642 - if ! [ -L ${lib##*/} ]; then
643 - ln -s "${lib}" ${lib##*/} || die
644 - fi
645 - done
646 - popd &>/dev/null || die
647 - fi
648 -}
649 -
650 -pkg_postinst() {
651 - gnome2_icon_cache_update
652 -
653 - if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
654 - elog "Apulse was detected at merge time on this system and so it will always be"
655 - elog "used for sound. If you wish to use pulseaudio instead please unmerge"
656 - elog "media-sound/apulse."
657 - fi
658 -
659 - if [[ -z ${REPLACING_VERSIONS} ]]; then
660 - ewarn "This patched firefox build is _NOT_ recommended by Tor upstream but uses"
661 - ewarn "the exact same sources. Use this only if you know what you are doing!"
662 - elog "Torbrowser uses port 9150 to connect to Tor. You can change the port"
663 - elog "in the connection settings to match your setup."
664 - elog ""
665 - elog "To get the advanced functionality of Torbutton (network information,"
666 - elog "new identity), Torbrowser needs to access a control port."
667 - elog "See 99torbrowser.example in /usr/share/doc/${PF} and"
668 - elog "https://github.com/MeisterP/torbrowser-overlay/blob/master/Readme.md"
669 - elog "for further information."
670 - fi
671 -}
672 -
673 -pkg_postrm() {
674 - gnome2_icon_cache_update
675 -}
676
677 diff --git a/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1.ebuild b/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1.ebuild
678 new file mode 100644
679 index 0000000..9034134
680 --- /dev/null
681 +++ b/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1.ebuild
682 @@ -0,0 +1,368 @@
683 +# Copyright 1999-2019 Gentoo Authors
684 +# Distributed under the terms of the GNU General Public License v2
685 +
686 +EAPI=6
687 +WANT_AUTOCONF="2.1"
688 +
689 +PYTHON_COMPAT=( python3_{5,6,7} )
690 +PYTHON_REQ_USE='ncurses,sqlite,ssl,threads(+)'
691 +MOZCONFIG_OPTIONAL_WIFI=1
692 +
693 +LLVM_MAX_SLOT=8
694 +
695 +inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils llvm \
696 + mozconfig-v6.${PV%%.*} pax-utils xdg-utils autotools
697 +inherit eapi7-ver
698 +
699 +MOZ_PV="$(ver_cut 1-3)esr"
700 +# https://dist.torproject.org/torbrowser
701 +TOR_PV="$(ver_cut 4-6)"
702 +if [[ -z ${PV%%*_alpha} ]]; then
703 + TOR_PV="$(ver_rs 2 a ${TOR_PV})"
704 +else
705 + KEYWORDS="~amd64 ~x86"
706 +fi
707 +TOR_PV="${TOR_PV%.0}"
708 +# https://gitweb.torproject.org/tor-browser.git/refs/tags
709 +GIT_TAG="$(ver_cut 4-5)-$(ver_cut 7-8)"
710 +GIT_TAG="tor-browser-${MOZ_PV}-$(ver_rs 3 '-build' ${GIT_TAG})"
711 +
712 +DESCRIPTION="The Tor Browser"
713 +HOMEPAGE="
714 +https://www.torproject.org/projects/torbrowser.html
715 +https://gitweb.torproject.org/tor-browser.git
716 +"
717 +
718 +SLOT="0"
719 +# BSD license applies to torproject-related code like the patches
720 +# icons are under CCPL-Attribution-3.0
721 +LICENSE="BSD CC-BY-3.0 MPL-2.0 GPL-2 LGPL-2.1"
722 +IUSE="hardened hwaccel jack -screenshot selinux test"
723 +
724 +SRC_URI="mirror://tor/dist/${PN}/${TOR_PV}"
725 +PATCH="firefox-${PV%%.*}.6-patches-01"
726 +PATCH=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c}/mozilla/patchsets/${PATCH}.tar.xz )
727 +SRC_URI="
728 + https://gitweb.torproject.org/tor-browser.git/snapshot/${GIT_TAG}.tar.gz
729 + -> ${GIT_TAG}.tar.gz
730 + x86? (
731 + ${SRC_URI}/tor-browser-linux32-${TOR_PV}_en-US.tar.xz
732 + )
733 + amd64? (
734 + ${SRC_URI}/tor-browser-linux64-${TOR_PV}_en-US.tar.xz
735 + )
736 + ${PATCH[@]}
737 +"
738 +RESTRICT="primaryuri"
739 +
740 +RDEPEND="
741 + system-icu? ( >=dev-libs/icu-60.2 )
742 + jack? ( virtual/jack )
743 + selinux? ( sec-policy/selinux-mozilla )
744 +"
745 +DEPEND="
746 + ${RDEPEND}
747 + >=sys-devel/llvm-4.0.1
748 + >=sys-devel/clang-4.0.1
749 + >=dev-lang/yasm-1.1
750 + virtual/opengl
751 +"
752 +RDEPEND="
753 + ${RDEPEND}
754 + >=net-vpn/tor-0.3.3.9
755 +"
756 +
757 +S="${WORKDIR}/${GIT_TAG}"
758 +
759 +QA_PRESTRIPPED="usr/lib*/${PN}/${PN}/${PN}"
760 +
761 +BUILD_OBJ_DIR="${WORKDIR}/tb"
762 +
763 +llvm_check_deps() {
764 + if ! has_version "sys-devel/clang:${LLVM_SLOT}" ; then
765 + ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..."
766 + return 1
767 + fi
768 +
769 + if use clang ; then
770 + if ! has_version "=sys-devel/lld-${LLVM_SLOT}*" ; then
771 + ewarn "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..."
772 + return 1
773 + fi
774 + fi
775 +
776 + einfo "Will use LLVM slot ${LLVM_SLOT}!"
777 +}
778 +
779 +pkg_setup() {
780 + moz_pkgsetup
781 +
782 + # Avoid PGO profiling problems due to enviroment leakage
783 + # These should *always* be cleaned up anyway
784 + unset DBUS_SESSION_BUS_ADDRESS \
785 + DISPLAY \
786 + ORBIT_SOCKETDIR \
787 + SESSION_MANAGER \
788 + XDG_SESSION_COOKIE \
789 + XAUTHORITY
790 +
791 + append-cppflags "-DTOR_BROWSER_DATA_IN_HOME_DIR"
792 + MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}/${PN}"
793 +
794 + addpredict /proc/self/oom_score_adj
795 +
796 + llvm_pkg_setup
797 +}
798 +
799 +pkg_pretend() {
800 + # Ensure we have enough disk space to compile
801 + CHECKREQS_DISK_BUILD="4G"
802 +
803 + check-reqs_pkg_setup
804 +}
805 +
806 +src_prepare() {
807 + local PATCHES=(
808 + "${WORKDIR}"/firefox
809 + "${FILESDIR}"/${PN}-profiledir.patch
810 + "${FILESDIR}"/${PN}-lto.patch
811 + "${FILESDIR}"/${PN}-rust_missing_docs.patch
812 + )
813 +
814 + sed \
815 + -e '/Unknown option: %s/ s:raise InvalidOptionError:print:' \
816 + -i python/mozbuild/mozbuild/configure/__init__.py
817 +
818 + # Enable gnomebreakpad
819 + if use debug ; then
820 + sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
821 + "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
822 + fi
823 +
824 + # Ensure that our plugins dir is enabled as default
825 + sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
826 + "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
827 + sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
828 + "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
829 +
830 + # Fix sandbox violations during make clean, bug 372817
831 + sed -e "s:\(/no-such-file\):${T}\1:g" \
832 + -i "${S}"/config/rules.mk \
833 + -i "${S}"/nsprpub/configure{.in,} \
834 + || die
835 +
836 + # Don't exit with error when some libs are missing which we have in
837 + # system.
838 + sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
839 + -i "${S}"/browser/installer/Makefile.in || die
840 +
841 + # Don't error out when there's no files to be removed:
842 + sed 's@\(xargs rm\)$@\1 -f@' \
843 + -i "${S}"/toolkit/mozapps/installer/packager.mk || die
844 +
845 + # Keep codebase the same even if not using official branding
846 + sed '/^MOZ_DEV_EDITION=1/d' \
847 + -i "${S}"/browser/branding/aurora/configure.sh || die
848 +
849 + default
850 +
851 + # Autotools configure is now called old-configure.in
852 + # This works because there is still a configure.in that happens to be for the
853 + # shell wrapper configure script
854 + eautoreconf old-configure.in
855 +
856 + # Must run autoconf in js/src
857 + cd "${S}"/js/src || die
858 + eautoconf old-configure.in
859 +}
860 +
861 +src_configure() {
862 + MEXTENSIONS="default"
863 +
864 + # Add information about TERM to output (build.log) to aid debugging
865 + # blessings problems
866 + if [[ -n "${TERM}" ]] ; then
867 + einfo "TERM is set to: \"${TERM}\""
868 + else
869 + einfo "TERM is unset."
870 + fi
871 +
872 + ####################################
873 + #
874 + # mozconfig, CFLAGS and CXXFLAGS setup
875 + #
876 + ####################################
877 +
878 + mozconfig_init
879 + mozconfig_config
880 +
881 + # enable JACK, bug 600002
882 + mozconfig_use_enable jack
883 +
884 + # Add full relro support for hardened
885 + if use hardened; then
886 + append-ldflags "-Wl,-z,relro,-z,now"
887 + mozconfig_use_enable hardened hardening
888 + fi
889 +
890 + # Disable built-in ccache support to avoid sandbox violation, #665420
891 + # Use FEATURES=ccache instead!
892 + mozconfig_annotate '' --without-ccache
893 + sed -i -e 's/ccache_stats = None/return None/' \
894 + python/mozbuild/mozbuild/controller/building.py || \
895 + die "Failed to disable ccache stats call"
896 +
897 + mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
898 +
899 + # allow elfhack to work in combination with unstripped binaries
900 + # when they would normally be larger than 2GiB.
901 + append-ldflags "-Wl,--compress-debug-sections=zlib"
902 +
903 + if use clang ; then
904 + # https://bugzilla.mozilla.org/show_bug.cgi?id=1423822
905 + mozconfig_annotate 'elf-hack is broken when using Clang' --disable-elf-hack
906 + fi
907 +
908 + echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
909 + echo "mk_add_options XARGS=/usr/bin/xargs" >> "${S}"/.mozconfig
910 +
911 + # Default mozilla_five_home no longer valid option
912 + sed '/with-default-mozilla-five-home=/d' -i "${S}"/.mozconfig
913 + # Rename the install directory and the executable
914 + mozconfig_annotate 'torbrowser' --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN}
915 + mozconfig_annotate 'torbrowser' --with-app-name=${PN}
916 + mozconfig_annotate 'torbrowser' --with-app-basename=${PN}
917 + mozconfig_annotate 'torbrowser' --disable-tor-browser-update
918 + mozconfig_annotate 'torbrowser' --with-tor-browser-version=${TOR_PV}
919 + mozconfig_annotate 'torbrowser' --disable-tor-browser-data-outside-app-dir
920 + mozconfig_annotate 'torbrowser' --with-branding=browser/branding/official
921 + mozconfig_annotate 'torbrowser' --disable-maintenance-service
922 + mozconfig_annotate 'torbrowser' --disable-webrtc
923 + mozconfig_annotate 'torbrowser' --disable-eme
924 +
925 + mozconfig_annotate 'torbrowser' --without-system-nspr
926 + mozconfig_annotate 'torbrowser' --without-system-nss
927 +
928 + # Finalize and report settings
929 + mozconfig_final
930 +
931 + # workaround for funky/broken upstream configure...
932 + SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
933 + ./mach configure || die
934 +}
935 +
936 +src_compile() {
937 + MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
938 + BUILD_VERBOSE_LOG=1 \
939 + ./mach build --verbose || die
940 +}
941 +
942 +src_install() {
943 + local profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default"
944 + cd "${BUILD_OBJ_DIR}" || die
945 +
946 + cat "${profile_dir}"/bookmarks.html > \
947 + dist/bin/browser/chrome/en-US/locale/browser/bookmarks.html
948 +
949 + # Pax mark xpcshell for hardened support, only used for startupcache creation.
950 + pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
951 +
952 + touch "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
953 + || die
954 +
955 + mozconfig_install_prefs \
956 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
957 +
958 + # Augment this with hwaccel prefs
959 + if use hwaccel ; then
960 + printf 'pref("%s", true);\npref("%s", true);\n' \
961 + layers.acceleration.force-enabled webgl.force-enabled >> \
962 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
963 + || die
964 + fi
965 +
966 + if ! use screenshot; then
967 + echo "pref(\"extensions.screenshots.disabled\", true);" >> \
968 + "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
969 + || die
970 + fi
971 +
972 + sed -e '/extensions\.autoDisableScopes/s:\<0\>:3:' \
973 + -i "${BUILD_OBJ_DIR}"/dist/bin/browser/defaults/preferences/000-tor-browser.js \
974 + || die
975 +
976 + cd "${S}"
977 + MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
978 + DESTDIR="${D}" ./mach install || die
979 +
980 + # Install icons and .desktop for menu entry
981 + local size icon_path
982 + icon_path="${S}/browser/branding/official"
983 + for size in 16 32 48 64 128 256; do
984 + newicon -s ${size} "${icon_path}/default${size}.png" ${PN}.png
985 + done
986 + make_desktop_entry ${PN} "Tor Browser" ${PN} "Network;WebBrowser" "StartupWMClass=Torbrowser"
987 +
988 + # Add StartupNotify=true bug 237317
989 + if use startup-notification ; then
990 + echo "StartupNotify=true"\
991 + >> "${ED}/usr/share/applications/${PN}-${PN}.desktop" \
992 + || die
993 + fi
994 +
995 + # Required in order to use plugins and even run torbrowser on hardened.
996 + pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{${PN},${PN}-bin,plugin-container}
997 +
998 + # Profile without the tor-launcher extension
999 + # see: https://trac.torproject.org/projects/tor/ticket/10160
1000 +
1001 + rm "${profile_dir}/extensions/tor-launcher@××××××××××××××.xpi" || die \
1002 + "Failed to remove torlauncher extension"
1003 +
1004 + insinto ${MOZILLA_FIVE_HOME}/browser
1005 + doins -r "${profile_dir}"/extensions
1006 +
1007 + dodoc "${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt"
1008 +}
1009 +
1010 +pkg_preinst() {
1011 + gnome2_icon_savelist
1012 +
1013 + # if the apulse libs are available in MOZILLA_FIVE_HOME then apulse
1014 + # doesn't need to be forced into the LD_LIBRARY_PATH
1015 + if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
1016 + einfo "APULSE found - Generating library symlinks for sound support"
1017 + local lib
1018 + pushd "${ED}"${MOZILLA_FIVE_HOME} &>/dev/null || die
1019 + for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
1020 + # a quickpkg rolled by hand will grab symlinks as part of the package,
1021 + # so we need to avoid creating them if they already exist.
1022 + if ! [ -L ${lib##*/} ]; then
1023 + ln -s "${lib}" ${lib##*/} || die
1024 + fi
1025 + done
1026 + popd &>/dev/null || die
1027 + fi
1028 +}
1029 +
1030 +pkg_postinst() {
1031 + ewarn "This patched firefox build is _NOT_ recommended by Tor upstream but uses"
1032 + ewarn "the exact same sources. Use this only if you know what you are doing!"
1033 + elog "Torbrowser uses port 9150 to connect to Tor. You can change the port"
1034 + elog "in the connection settings to match your setup."
1035 +
1036 + gnome2_icon_cache_update
1037 + xdg_desktop_database_update
1038 +
1039 + if use pulseaudio && has_version ">=media-sound/apulse-0.1.9"; then
1040 + elog "Apulse was detected at merge time on this system and so it will always be"
1041 + elog "used for sound. If you wish to use pulseaudio instead please unmerge"
1042 + elog "media-sound/apulse."
1043 + elog
1044 + fi
1045 +}
1046 +
1047 +pkg_postrm() {
1048 + gnome2_icon_cache_update
1049 + xdg_desktop_database_update
1050 +}