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/icon/, ...
Date: Tue, 11 Feb 2020 13:54:26
Message-Id: 1581429253.a40e26529d1ece4f215fe579a859c5902aed7570.anarchy@gentoo
1 commit: a40e26529d1ece4f215fe579a859c5902aed7570
2 Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 11 13:54:13 2020 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 11 13:54:13 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=a40e2652
7
8 www-client/torbrowser: drop unsupported package from overlay
9
10 Package-Manager: Portage-2.3.88, Repoman-2.3.20
11 Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
12
13 www-client/torbrowser/Manifest | 4 -
14 .../torbrowser/files/icon/torbrowser.desktop | 9 -
15 ...nge_the_default_Firefox_profile_directory.patch | 425 ---------------------
16 ...0.5.0-Do_not_store_data_in_the_app_bundle.patch | 189 ---------
17 www-client/torbrowser/metadata.xml | 26 --
18 .../torbrowser/torbrowser-60.6.1.8.0.9.1.3.ebuild | 367 ------------------
19 6 files changed, 1020 deletions(-)
20
21 diff --git a/www-client/torbrowser/Manifest b/www-client/torbrowser/Manifest
22 deleted file mode 100644
23 index ccc59e0..0000000
24 --- a/www-client/torbrowser/Manifest
25 +++ /dev/null
26 @@ -1,4 +0,0 @@
27 -DIST firefox-60.6-patches-07.tar.xz 37404 BLAKE2B 5516ff768bee0253131381fdba3e08785ab31bb29e44ad7f7e2956fb7624fafc9bf22f892ddbd0617e5e7d18500686a9975a60ea77d23a2853f35936cd142030 SHA512 3c4160e632155b0a239e22d0c1b1c701545b0f6d0915f9bdcf3b8431cee1abf650191ffafc5c3224a61279c8b1b52a80444c811a3914e16127411991c963292b
28 -DIST tor-browser-60.6.1esr-8.0-1-build3.tar.gz 386385947 BLAKE2B ad979d6ceacf10588abd1d90bd4c561b5cc3a22a1296f32ee479f3732bb09aa84909cceb248d962aaac07faefbf34112fb8a914fcb74f6f5cf44205dafeab5af SHA512 5a49ded40cee8fecf57e716f4eb7f3df960ebfee2565dc8f26f1bad19a38e963be8e697a63c14fdc615d56bdcd429aeee20564198d199be499e978ba9cf47e63
29 -DIST tor-browser-linux32-8.0.9_en-US.tar.xz 76801980 BLAKE2B 7b3c65e77e010f62ecbfd96632db1918046f677a1dce59caaa5d8329fd0c89da7b18766461af732ac4352f450afc6b5affe8ad812250a2e22a7fc2e7796f46cf SHA512 f5f5a454e6c97dad9c56471d921eae84a922a5208608ef06d8ef6c4bd0215c08df94b24dbedf61b3557a2aa8773d963b449da7b1bb782bbe58165526d05f5ec4
30 -DIST tor-browser-linux64-8.0.9_en-US.tar.xz 75266932 BLAKE2B 881dc32d4a52eee3035dc0817255cc45eaddb24f78070fcd5b5697626bc0815209103f9457df0ba3eda4149b59c1ace8a3d309a75734e90bd8a75fd568d92e57 SHA512 239703e2791481ab1ec14b38633541bceb422040101b04e84a4a9adc96f7dbef9ffa98b61a40c0533157d0c93dd4e9df36ced03ddb50490819fb8d0d19ccc5a3
31
32 diff --git a/www-client/torbrowser/files/icon/torbrowser.desktop b/www-client/torbrowser/files/icon/torbrowser.desktop
33 deleted file mode 100644
34 index ecfabde..0000000
35 --- a/www-client/torbrowser/files/icon/torbrowser.desktop
36 +++ /dev/null
37 @@ -1,9 +0,0 @@
38 -[Desktop Entry]
39 -Name=@NAME@
40 -Comment=Web Browser
41 -Exec=torbrowser %u
42 -Icon=@ICON@
43 -Terminal=false
44 -Type=Application
45 -MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https;
46 -Categories=Network;WebBrowser
47
48 diff --git a/www-client/torbrowser/files/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch b/www-client/torbrowser/files/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch
49 deleted file mode 100644
50 index 3559402..0000000
51 --- a/www-client/torbrowser/files/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch
52 +++ /dev/null
53 @@ -1,425 +0,0 @@
54 -From e5b0afd7fee16e7f755095b8b85296fe401fb04d Mon Sep 17 00:00:00 2001
55 -From: Poncho <poncho@××××××.ch>
56 -Date: Wed, 30 Jan 2019 09:55:48 +0100
57 -Subject: [PATCH 2/4] Revert "Bug 9173: Change the default Firefox profile
58 - directory to be TBB-relative."
59 -
60 -This reverts commit b82691c60b6a3ade6939b0f68f28de1e3c120292.
61 ----
62 - toolkit/xre/nsXREDirProvider.cpp | 147 +++++++++++++++++++------
63 - toolkit/xre/nsXREDirProvider.h | 12 +-
64 - xpcom/io/nsAppFileLocationProvider.cpp | 97 ++++++++++------
65 - 3 files changed, 181 insertions(+), 75 deletions(-)
66 -
67 -diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
68 -index dbbaffd2a15f..00ee37ce9b5f 100644
69 ---- a/toolkit/xre/nsXREDirProvider.cpp
70 -+++ b/toolkit/xre/nsXREDirProvider.cpp
71 -@@ -32,7 +32,6 @@
72 - #include "nsArrayEnumerator.h"
73 - #include "nsEnumeratorUtils.h"
74 - #include "nsReadableUtils.h"
75 --#include "nsXPCOMPrivate.h" // for XPCOM_FILE_PATH_SEPARATOR
76 -
77 - #include "SpecialSystemDirectory.h"
78 -
79 -@@ -215,6 +214,9 @@ nsresult nsXREDirProvider::GetUserProfilesRootDir(nsIFile** aResult) {
80 - nsresult rv = GetUserDataDirectory(getter_AddRefs(file), false);
81 -
82 - if (NS_SUCCEEDED(rv)) {
83 -+#if !defined(XP_UNIX) || defined(XP_MACOSX)
84 -+ rv = file->AppendNative(NS_LITERAL_CSTRING("Profiles"));
85 -+#endif
86 - // We must create the profile directory here if it does not exist.
87 - nsresult tmp = EnsureDirectoryExists(file);
88 - if (NS_FAILED(tmp)) {
89 -@@ -230,6 +232,9 @@ nsresult nsXREDirProvider::GetUserProfilesLocalDir(nsIFile** aResult) {
90 - nsresult rv = GetUserDataDirectory(getter_AddRefs(file), true);
91 -
92 - if (NS_SUCCEEDED(rv)) {
93 -+#if !defined(XP_UNIX) || defined(XP_MACOSX)
94 -+ rv = file->AppendNative(NS_LITERAL_CSTRING("Profiles"));
95 -+#endif
96 - // We must create the profile directory here if it does not exist.
97 - nsresult tmp = EnsureDirectoryExists(file);
98 - if (NS_FAILED(tmp)) {
99 -@@ -1332,42 +1337,84 @@ nsresult nsXREDirProvider::GetProfileDir(nsIFile** aResult) {
100 - nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
101 - bool aLocal) {
102 - // Copied from nsAppFileLocationProvider (more or less)
103 -- NS_ENSURE_ARG_POINTER(aFile);
104 -+ nsresult rv;
105 - nsCOMPtr<nsIFile> localDir;
106 -
107 -- nsresult rv = GetAppDir()->Clone(getter_AddRefs(localDir));
108 -- NS_ENSURE_SUCCESS(rv, rv);
109 --
110 -- int levelsToRemove = 1; // In FF21+, appDir points to browser subdirectory.
111 - #if defined(XP_MACOSX)
112 -- levelsToRemove += 2;
113 -+ FSRef fsRef;
114 -+ OSType folderType;
115 -+ if (aLocal) {
116 -+ folderType = kCachedDataFolderType;
117 -+ } else {
118 -+#ifdef MOZ_THUNDERBIRD
119 -+ folderType = kDomainLibraryFolderType;
120 -+#else
121 -+ folderType = kApplicationSupportFolderType;
122 - #endif
123 -- while (localDir && (levelsToRemove > 0)) {
124 -- // When crawling up the hierarchy, components named "." do not count.
125 -- nsAutoCString removedName;
126 -- rv = localDir->GetNativeLeafName(removedName);
127 -- NS_ENSURE_SUCCESS(rv, rv);
128 -- bool didRemove = !removedName.Equals(".");
129 --
130 -- // Remove a directory component.
131 -- nsCOMPtr<nsIFile> parentDir;
132 -- rv = localDir->GetParent(getter_AddRefs(parentDir));
133 -- NS_ENSURE_SUCCESS(rv, rv);
134 -- localDir = parentDir;
135 -- if (didRemove) --levelsToRemove;
136 - }
137 -+ OSErr err = ::FSFindFolder(kUserDomain, folderType, kCreateFolder, &fsRef);
138 -+ NS_ENSURE_FALSE(err, NS_ERROR_FAILURE);
139 -
140 -- if (!localDir) return NS_ERROR_FAILURE;
141 -+ rv = NS_NewNativeLocalFile(EmptyCString(), true, getter_AddRefs(localDir));
142 -+ NS_ENSURE_SUCCESS(rv, rv);
143 -+
144 -+ nsCOMPtr<nsILocalFileMac> dirFileMac = do_QueryInterface(localDir);
145 -+ NS_ENSURE_TRUE(dirFileMac, NS_ERROR_UNEXPECTED);
146 -
147 -- rv = localDir->AppendRelativeNativePath(
148 -- NS_LITERAL_CSTRING("TorBrowser" XPCOM_FILE_PATH_SEPARATOR
149 -- "Data" XPCOM_FILE_PATH_SEPARATOR "Browser"));
150 -+ rv = dirFileMac->InitWithFSRef(&fsRef);
151 - NS_ENSURE_SUCCESS(rv, rv);
152 -
153 -+ localDir = do_QueryInterface(dirFileMac, &rv);
154 -+#elif defined(XP_IOS)
155 -+ nsAutoCString userDir;
156 -+ if (GetUIKitDirectory(aLocal, userDir)) {
157 -+ rv = NS_NewNativeLocalFile(userDir, true, getter_AddRefs(localDir));
158 -+ } else {
159 -+ rv = NS_ERROR_FAILURE;
160 -+ }
161 -+ NS_ENSURE_SUCCESS(rv, rv);
162 -+#elif defined(XP_WIN)
163 -+ nsString path;
164 - if (aLocal) {
165 -- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Caches"));
166 -- NS_ENSURE_SUCCESS(rv, rv);
167 -+ rv = GetShellFolderPath(FOLDERID_LocalAppData, path);
168 -+ if (NS_FAILED(rv)) rv = GetRegWindowsAppDataFolder(aLocal, path);
169 -+ }
170 -+ if (!aLocal || NS_FAILED(rv)) {
171 -+ rv = GetShellFolderPath(FOLDERID_RoamingAppData, path);
172 -+ if (NS_FAILED(rv)) {
173 -+ if (!aLocal) rv = GetRegWindowsAppDataFolder(aLocal, path);
174 -+ }
175 -+ }
176 -+ NS_ENSURE_SUCCESS(rv, rv);
177 -+
178 -+ rv = NS_NewLocalFile(path, true, getter_AddRefs(localDir));
179 -+#elif defined(XP_UNIX)
180 -+ const char* homeDir = getenv("HOME");
181 -+ if (!homeDir || !*homeDir) return NS_ERROR_FAILURE;
182 -+
183 -+#ifdef ANDROID /* We want (ProfD == ProfLD) on Android. */
184 -+ aLocal = false;
185 -+#endif
186 -+
187 -+ if (aLocal) {
188 -+ // If $XDG_CACHE_HOME is defined use it, otherwise use $HOME/.cache.
189 -+ const char* cacheHome = getenv("XDG_CACHE_HOME");
190 -+ if (cacheHome && *cacheHome) {
191 -+ rv = NS_NewNativeLocalFile(nsDependentCString(cacheHome), true,
192 -+ getter_AddRefs(localDir));
193 -+ } else {
194 -+ rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
195 -+ getter_AddRefs(localDir));
196 -+ if (NS_SUCCEEDED(rv))
197 -+ rv = localDir->AppendNative(NS_LITERAL_CSTRING(".cache"));
198 -+ }
199 -+ } else {
200 -+ rv = NS_NewNativeLocalFile(nsDependentCString(homeDir), true,
201 -+ getter_AddRefs(localDir));
202 - }
203 -+#else
204 -+#error "Don't know how to get product dir on your platform"
205 -+#endif
206 -
207 - NS_IF_ADDREF(*aFile = localDir);
208 - return rv;
209 -@@ -1537,23 +1584,39 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
210 - }
211 -
212 - nsAutoCString profile;
213 -+ nsAutoCString appName;
214 -+ nsAutoCString vendor;
215 - if (gAppData->profile) {
216 - profile = gAppData->profile;
217 -+ } else {
218 -+ appName = gAppData->name;
219 -+ vendor = gAppData->vendor;
220 - }
221 -
222 -- nsresult rv = NS_ERROR_FAILURE;
223 -+ nsresult rv;
224 -
225 - #if defined(XP_MACOSX)
226 - if (!profile.IsEmpty()) {
227 - rv = AppendProfileString(aFile, profile.get());
228 -- NS_ENSURE_SUCCESS(rv, rv);
229 -+ } else {
230 -+ // Note that MacOS ignores the vendor when creating the profile hierarchy -
231 -+ // all application preferences directories live alongside one another in
232 -+ // ~/Library/Application Support/
233 -+ rv = aFile->AppendNative(appName);
234 - }
235 -+ NS_ENSURE_SUCCESS(rv, rv);
236 -
237 - #elif defined(XP_WIN)
238 - if (!profile.IsEmpty()) {
239 - rv = AppendProfileString(aFile, profile.get());
240 -- NS_ENSURE_SUCCESS(rv, rv);
241 -+ } else {
242 -+ if (!vendor.IsEmpty()) {
243 -+ rv = aFile->AppendNative(vendor);
244 -+ NS_ENSURE_SUCCESS(rv, rv);
245 -+ }
246 -+ rv = aFile->AppendNative(appName);
247 - }
248 -+ NS_ENSURE_SUCCESS(rv, rv);
249 -
250 - #elif defined(ANDROID)
251 - // The directory used for storing profiles
252 -@@ -1563,6 +1626,11 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
253 - rv = aFile->AppendNative(nsDependentCString("mozilla"));
254 - NS_ENSURE_SUCCESS(rv, rv);
255 - #elif defined(XP_UNIX)
256 -+ nsAutoCString folder;
257 -+ // Make it hidden (by starting with "."), except when local (the
258 -+ // profile is already under ~/.cache or XDG_CACHE_HOME).
259 -+ if (!aLocal) folder.Assign('.');
260 -+
261 - if (!profile.IsEmpty()) {
262 - // Skip any leading path characters
263 - const char* profileStart = profile.get();
264 -@@ -1570,16 +1638,29 @@ nsresult nsXREDirProvider::AppendProfilePath(nsIFile* aFile, bool aLocal) {
265 -
266 - // On the off chance that someone wanted their folder to be hidden don't
267 - // let it become ".."
268 -- if (*profileStart == '.') profileStart++;
269 -+ if (*profileStart == '.' && !aLocal) profileStart++;
270 -
271 -- // Make it hidden (by starting with ".").
272 -- nsAutoCString folder(".");
273 - folder.Append(profileStart);
274 - ToLowerCase(folder);
275 -
276 - rv = AppendProfileString(aFile, folder.BeginReading());
277 -- NS_ENSURE_SUCCESS(rv, rv);
278 -+ } else {
279 -+ if (!vendor.IsEmpty()) {
280 -+ folder.Append(vendor);
281 -+ ToLowerCase(folder);
282 -+
283 -+ rv = aFile->AppendNative(folder);
284 -+ NS_ENSURE_SUCCESS(rv, rv);
285 -+
286 -+ folder.Truncate();
287 -+ }
288 -+
289 -+ folder.Append(appName);
290 -+ ToLowerCase(folder);
291 -+
292 -+ rv = aFile->AppendNative(folder);
293 - }
294 -+ NS_ENSURE_SUCCESS(rv, rv);
295 -
296 - #else
297 - #error "Don't know how to get profile path on your platform"
298 -diff --git a/toolkit/xre/nsXREDirProvider.h b/toolkit/xre/nsXREDirProvider.h
299 -index 6b92f3812882..5060b33cdded 100644
300 ---- a/toolkit/xre/nsXREDirProvider.h
301 -+++ b/toolkit/xre/nsXREDirProvider.h
302 -@@ -48,15 +48,15 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2,
303 -
304 - void DoShutdown();
305 -
306 -- nsresult GetUserAppDataDirectory(nsIFile** aFile) {
307 -+ static nsresult GetUserAppDataDirectory(nsIFile** aFile) {
308 - return GetUserDataDirectory(aFile, false);
309 - }
310 -- nsresult GetUserLocalDataDirectory(nsIFile** aFile) {
311 -+ static nsresult GetUserLocalDataDirectory(nsIFile** aFile) {
312 - return GetUserDataDirectory(aFile, true);
313 - }
314 -
315 - // GetUserDataDirectory gets the profile path from gAppData.
316 -- nsresult GetUserDataDirectory(nsIFile** aFile, bool aLocal);
317 -+ static nsresult GetUserDataDirectory(nsIFile** aFile, bool aLocal);
318 -
319 - /* make sure you clone it, if you need to do stuff to it */
320 - nsIFile* GetGREDir() { return mGREDir; }
321 -@@ -90,9 +90,9 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2,
322 - protected:
323 - nsresult GetFilesInternal(const char* aProperty,
324 - nsISimpleEnumerator** aResult);
325 -- nsresult GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal);
326 -- nsresult GetSysUserExtensionsDirectory(nsIFile** aFile);
327 -- nsresult GetSysUserExtensionsDevDirectory(nsIFile** aFile);
328 -+ static nsresult GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal);
329 -+ static nsresult GetSysUserExtensionsDirectory(nsIFile** aFile);
330 -+ static nsresult GetSysUserExtensionsDevDirectory(nsIFile** aFile);
331 - #if defined(XP_UNIX) || defined(XP_MACOSX)
332 - static nsresult GetSystemExtensionsDirectory(nsIFile** aFile);
333 - #endif
334 -diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp
335 -index 2aa5482f5789..f1491595a8ea 100644
336 ---- a/xpcom/io/nsAppFileLocationProvider.cpp
337 -+++ b/xpcom/io/nsAppFileLocationProvider.cpp
338 -@@ -14,7 +14,6 @@
339 - #include "nsISimpleEnumerator.h"
340 - #include "prenv.h"
341 - #include "nsCRT.h"
342 --#include "nsXPCOMPrivate.h" // for XPCOM_FILE_PATH_SEPARATOR
343 - #if defined(MOZ_WIDGET_COCOA)
344 - #include <Carbon/Carbon.h>
345 - #include "nsILocalFileMac.h"
346 -@@ -248,8 +247,9 @@ nsresult nsAppFileLocationProvider::CloneMozBinDirectory(nsIFile** aLocalFile) {
347 - // GetProductDirectory - Gets the directory which contains the application data
348 - // folder
349 - //
350 --// UNIX and WIN : <App Folder>/TorBrowser/Data/Browser
351 --// Mac : <App Folder>/../../TorBrowser/Data/Browser
352 -+// UNIX : ~/.mozilla/
353 -+// WIN : <Application Data folder on user's machine>\Mozilla
354 -+// Mac : :Documents:Mozilla:
355 - //----------------------------------------------------------------------------------------
356 - nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
357 - bool aLocal) {
358 -@@ -261,45 +261,49 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
359 - bool exists;
360 - nsCOMPtr<nsIFile> localDir;
361 -
362 -- rv = CloneMozBinDirectory(getter_AddRefs(localDir));
363 -- NS_ENSURE_SUCCESS(rv, rv);
364 --
365 -- int levelsToRemove = 1; // In FF21+, bin dir points to browser subdirectory.
366 --#if defined(XP_MACOSX)
367 -- levelsToRemove += 2;
368 --#endif
369 -- while (localDir && (levelsToRemove > 0)) {
370 -- // When crawling up the hierarchy, components named "." do not count.
371 -- nsAutoCString removedName;
372 -- rv = localDir->GetNativeLeafName(removedName);
373 -- NS_ENSURE_SUCCESS(rv, rv);
374 -- bool didRemove = !removedName.Equals(".");
375 --
376 -- // Remove a directory component.
377 -- nsCOMPtr<nsIFile> parentDir;
378 -- rv = localDir->GetParent(getter_AddRefs(parentDir));
379 -- NS_ENSURE_SUCCESS(rv, rv);
380 -- localDir = parentDir;
381 --
382 -- if (didRemove) {
383 -- --levelsToRemove;
384 -- }
385 -+#if defined(MOZ_WIDGET_COCOA)
386 -+ FSRef fsRef;
387 -+ OSType folderType =
388 -+ aLocal ? (OSType)kCachedDataFolderType : (OSType)kDomainLibraryFolderType;
389 -+ OSErr err = ::FSFindFolder(kUserDomain, folderType, kCreateFolder, &fsRef);
390 -+ if (err) {
391 -+ return NS_ERROR_FAILURE;
392 - }
393 --
394 -+ NS_NewLocalFile(EmptyString(), true, getter_AddRefs(localDir));
395 - if (!localDir) {
396 - return NS_ERROR_FAILURE;
397 - }
398 --
399 -- rv = localDir->AppendRelativeNativePath(
400 -- NS_LITERAL_CSTRING("TorBrowser" XPCOM_FILE_PATH_SEPARATOR
401 -- "Data" XPCOM_FILE_PATH_SEPARATOR "Browser"));
402 -- NS_ENSURE_SUCCESS(rv, rv);
403 --
404 -- if (aLocal) {
405 -- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Caches"));
406 -- NS_ENSURE_SUCCESS(rv, rv);
407 -+ nsCOMPtr<nsILocalFileMac> localDirMac(do_QueryInterface(localDir));
408 -+ rv = localDirMac->InitWithFSRef(&fsRef);
409 -+ if (NS_FAILED(rv)) {
410 -+ return rv;
411 -+ }
412 -+#elif defined(XP_WIN)
413 -+ nsCOMPtr<nsIProperties> directoryService =
414 -+ do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv);
415 -+ if (NS_FAILED(rv)) {
416 -+ return rv;
417 -+ }
418 -+ const char* prop = aLocal ? NS_WIN_LOCAL_APPDATA_DIR : NS_WIN_APPDATA_DIR;
419 -+ rv = directoryService->Get(prop, NS_GET_IID(nsIFile),
420 -+ getter_AddRefs(localDir));
421 -+ if (NS_FAILED(rv)) {
422 -+ return rv;
423 -+ }
424 -+#elif defined(XP_UNIX)
425 -+ rv = NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")), true,
426 -+ getter_AddRefs(localDir));
427 -+ if (NS_FAILED(rv)) {
428 -+ return rv;
429 - }
430 -+#else
431 -+#error dont_know_how_to_get_product_dir_on_your_platform
432 -+#endif
433 -
434 -+ rv = localDir->AppendRelativeNativePath(DEFAULT_PRODUCT_DIR);
435 -+ if (NS_FAILED(rv)) {
436 -+ return rv;
437 -+ }
438 - rv = localDir->Exists(&exists);
439 -
440 - if (NS_SUCCEEDED(rv) && !exists) {
441 -@@ -318,6 +322,10 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
442 - //----------------------------------------------------------------------------------------
443 - // GetDefaultUserProfileRoot - Gets the directory which contains each user
444 - // profile dir
445 -+//
446 -+// UNIX : ~/.mozilla/
447 -+// WIN : <Application Data folder on user's machine>\Mozilla\Profiles
448 -+// Mac : :Documents:Mozilla:Profiles:
449 - //----------------------------------------------------------------------------------------
450 - nsresult nsAppFileLocationProvider::GetDefaultUserProfileRoot(
451 - nsIFile** aLocalFile, bool aLocal) {
452 -@@ -333,6 +341,23 @@ nsresult nsAppFileLocationProvider::GetDefaultUserProfileRoot(
453 - return rv;
454 - }
455 -
456 -+#if defined(MOZ_WIDGET_COCOA) || defined(XP_WIN)
457 -+ // These 3 platforms share this part of the path - do them as one
458 -+ rv = localDir->AppendRelativeNativePath(NS_LITERAL_CSTRING("Profiles"));
459 -+ if (NS_FAILED(rv)) {
460 -+ return rv;
461 -+ }
462 -+
463 -+ bool exists;
464 -+ rv = localDir->Exists(&exists);
465 -+ if (NS_SUCCEEDED(rv) && !exists) {
466 -+ rv = localDir->Create(nsIFile::DIRECTORY_TYPE, 0775);
467 -+ }
468 -+ if (NS_FAILED(rv)) {
469 -+ return rv;
470 -+ }
471 -+#endif
472 -+
473 - localDir.forget(aLocalFile);
474 -
475 - return rv;
476 ---
477 -2.19.2
478 -
479
480 diff --git a/www-client/torbrowser/files/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch b/www-client/torbrowser/files/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch
481 deleted file mode 100644
482 index a4e6ae9..0000000
483 --- a/www-client/torbrowser/files/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch
484 +++ /dev/null
485 @@ -1,189 +0,0 @@
486 -From 0e4105afea7b10cf20ab20cb41b187d7d690ff46 Mon Sep 17 00:00:00 2001
487 -From: Poncho <poncho@××××××.ch>
488 -Date: Wed, 30 Jan 2019 09:55:25 +0100
489 -Subject: [PATCH 1/4] Revert "Bug 13252: Do not store data in the app bundle"
490 -
491 -This reverts commit 2ee4d81a2fbcac90996f4f4a99633a0b2d7019bb.
492 ----
493 - toolkit/xre/nsXREDirProvider.cpp | 43 ++++++++++++---------
494 - toolkit/xre/nsXREDirProvider.h | 6 ---
495 - xpcom/io/nsAppFileLocationProvider.cpp | 53 +++++++++++++++-----------
496 - 3 files changed, 55 insertions(+), 47 deletions(-)
497 -
498 -diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
499 -index d811da50b63d..dbbaffd2a15f 100644
500 ---- a/toolkit/xre/nsXREDirProvider.cpp
501 -+++ b/toolkit/xre/nsXREDirProvider.cpp
502 -@@ -44,8 +44,6 @@
503 - #include "mozilla/Preferences.h"
504 - #include "mozilla/Telemetry.h"
505 -
506 --#include "TorFileUtils.h"
507 --
508 - #include <stdlib.h>
509 -
510 - #ifdef XP_WIN
511 -@@ -1337,18 +1335,34 @@ nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile,
512 - NS_ENSURE_ARG_POINTER(aFile);
513 - nsCOMPtr<nsIFile> localDir;
514 -
515 -- nsresult rv = GetTorBrowserUserDataDir(getter_AddRefs(localDir));
516 -+ nsresult rv = GetAppDir()->Clone(getter_AddRefs(localDir));
517 - NS_ENSURE_SUCCESS(rv, rv);
518 -
519 --#if !defined(ANDROID)
520 --#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
521 -- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Browser"));
522 --#else
523 -- rv = localDir->AppendRelativeNativePath(
524 -- NS_LITERAL_CSTRING("Data" XPCOM_FILE_PATH_SEPARATOR "Browser"));
525 -+ int levelsToRemove = 1; // In FF21+, appDir points to browser subdirectory.
526 -+#if defined(XP_MACOSX)
527 -+ levelsToRemove += 2;
528 - #endif
529 -+ while (localDir && (levelsToRemove > 0)) {
530 -+ // When crawling up the hierarchy, components named "." do not count.
531 -+ nsAutoCString removedName;
532 -+ rv = localDir->GetNativeLeafName(removedName);
533 -+ NS_ENSURE_SUCCESS(rv, rv);
534 -+ bool didRemove = !removedName.Equals(".");
535 -+
536 -+ // Remove a directory component.
537 -+ nsCOMPtr<nsIFile> parentDir;
538 -+ rv = localDir->GetParent(getter_AddRefs(parentDir));
539 -+ NS_ENSURE_SUCCESS(rv, rv);
540 -+ localDir = parentDir;
541 -+ if (didRemove) --levelsToRemove;
542 -+ }
543 -+
544 -+ if (!localDir) return NS_ERROR_FAILURE;
545 -+
546 -+ rv = localDir->AppendRelativeNativePath(
547 -+ NS_LITERAL_CSTRING("TorBrowser" XPCOM_FILE_PATH_SEPARATOR
548 -+ "Data" XPCOM_FILE_PATH_SEPARATOR "Browser"));
549 - NS_ENSURE_SUCCESS(rv, rv);
550 --#endif
551 -
552 - if (aLocal) {
553 - rv = localDir->AppendNative(NS_LITERAL_CSTRING("Caches"));
554 -@@ -1433,15 +1447,6 @@ nsresult nsXREDirProvider::GetUserDataDirectory(nsIFile** aFile, bool aLocal) {
555 - return NS_OK;
556 - }
557 -
558 --nsresult nsXREDirProvider::GetTorBrowserUserDataDir(nsIFile** aFile) {
559 -- NS_ENSURE_ARG_POINTER(aFile);
560 -- nsCOMPtr<nsIFile> exeFile;
561 -- bool per = false;
562 -- nsresult rv = GetFile(XRE_EXECUTABLE_FILE, &per, getter_AddRefs(exeFile));
563 -- NS_ENSURE_SUCCESS(rv, rv);
564 -- return TorBrowser_GetUserDataDir(exeFile, aFile);
565 --}
566 --
567 - nsresult nsXREDirProvider::EnsureDirectoryExists(nsIFile* aDirectory) {
568 - bool exists;
569 - nsresult rv = aDirectory->Exists(&exists);
570 -diff --git a/toolkit/xre/nsXREDirProvider.h b/toolkit/xre/nsXREDirProvider.h
571 -index 6fe9d9ecbce5..6b92f3812882 100644
572 ---- a/toolkit/xre/nsXREDirProvider.h
573 -+++ b/toolkit/xre/nsXREDirProvider.h
574 -@@ -87,12 +87,6 @@ class nsXREDirProvider final : public nsIDirectoryServiceProvider2,
575 - */
576 - nsresult GetProfileDir(nsIFile** aResult);
577 -
578 -- /**
579 -- * Get the TorBrowser user data directory by calling the
580 -- * TorBrowser_GetUserDataDir() utility function.
581 -- */
582 -- nsresult GetTorBrowserUserDataDir(nsIFile** aFile);
583 --
584 - protected:
585 - nsresult GetFilesInternal(const char* aProperty,
586 - nsISimpleEnumerator** aResult);
587 -diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp
588 -index 3906c6590090..2aa5482f5789 100644
589 ---- a/xpcom/io/nsAppFileLocationProvider.cpp
590 -+++ b/xpcom/io/nsAppFileLocationProvider.cpp
591 -@@ -27,8 +27,6 @@
592 - #include <sys/param.h>
593 - #endif
594 -
595 --#include "TorFileUtils.h"
596 --
597 - // WARNING: These hard coded names need to go away. They need to
598 - // come from localizable resources
599 -
600 -@@ -250,14 +248,8 @@ nsresult nsAppFileLocationProvider::CloneMozBinDirectory(nsIFile** aLocalFile) {
601 - // GetProductDirectory - Gets the directory which contains the application data
602 - // folder
603 - //
604 --#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
605 --// UNIX and WIN : <App Folder>/../TorBrowser-Data/Browser
606 --// Mac : <App Folder>/../../../TorBrowser-Data/Browser OR
607 --// ~/Library/Application Support/TorBrowser-Data/Browser
608 --#else
609 - // UNIX and WIN : <App Folder>/TorBrowser/Data/Browser
610 - // Mac : <App Folder>/../../TorBrowser/Data/Browser
611 --#endif
612 - //----------------------------------------------------------------------------------------
613 - nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
614 - bool aLocal) {
615 -@@ -265,25 +257,42 @@ nsresult nsAppFileLocationProvider::GetProductDirectory(nsIFile** aLocalFile,
616 - return NS_ERROR_INVALID_ARG;
617 - }
618 -
619 -- nsresult rv = NS_ERROR_UNEXPECTED;
620 -+ nsresult rv;
621 - bool exists;
622 -- nsCOMPtr<nsIFile> localDir, exeFile;
623 -+ nsCOMPtr<nsIFile> localDir;
624 -
625 -- nsCOMPtr<nsIProperties> directoryService(
626 -- do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv));
627 -- NS_ENSURE_SUCCESS(rv, rv);
628 -- rv = directoryService->Get(XRE_EXECUTABLE_FILE, NS_GET_IID(nsIFile),
629 -- getter_AddRefs(exeFile));
630 -- NS_ENSURE_SUCCESS(rv, rv);
631 -- rv = TorBrowser_GetUserDataDir(exeFile, getter_AddRefs(localDir));
632 -+ rv = CloneMozBinDirectory(getter_AddRefs(localDir));
633 - NS_ENSURE_SUCCESS(rv, rv);
634 -
635 --#ifdef TOR_BROWSER_DATA_OUTSIDE_APP_DIR
636 -- rv = localDir->AppendNative(NS_LITERAL_CSTRING("Browser"));
637 --#else
638 -- rv = localDir->AppendRelativeNativePath(
639 -- NS_LITERAL_CSTRING("Data" XPCOM_FILE_PATH_SEPARATOR "Browser"));
640 -+ int levelsToRemove = 1; // In FF21+, bin dir points to browser subdirectory.
641 -+#if defined(XP_MACOSX)
642 -+ levelsToRemove += 2;
643 - #endif
644 -+ while (localDir && (levelsToRemove > 0)) {
645 -+ // When crawling up the hierarchy, components named "." do not count.
646 -+ nsAutoCString removedName;
647 -+ rv = localDir->GetNativeLeafName(removedName);
648 -+ NS_ENSURE_SUCCESS(rv, rv);
649 -+ bool didRemove = !removedName.Equals(".");
650 -+
651 -+ // Remove a directory component.
652 -+ nsCOMPtr<nsIFile> parentDir;
653 -+ rv = localDir->GetParent(getter_AddRefs(parentDir));
654 -+ NS_ENSURE_SUCCESS(rv, rv);
655 -+ localDir = parentDir;
656 -+
657 -+ if (didRemove) {
658 -+ --levelsToRemove;
659 -+ }
660 -+ }
661 -+
662 -+ if (!localDir) {
663 -+ return NS_ERROR_FAILURE;
664 -+ }
665 -+
666 -+ rv = localDir->AppendRelativeNativePath(
667 -+ NS_LITERAL_CSTRING("TorBrowser" XPCOM_FILE_PATH_SEPARATOR
668 -+ "Data" XPCOM_FILE_PATH_SEPARATOR "Browser"));
669 - NS_ENSURE_SUCCESS(rv, rv);
670 -
671 - if (aLocal) {
672 ---
673 -2.19.2
674 -
675
676 diff --git a/www-client/torbrowser/metadata.xml b/www-client/torbrowser/metadata.xml
677 deleted file mode 100644
678 index 6c81206..0000000
679 --- a/www-client/torbrowser/metadata.xml
680 +++ /dev/null
681 @@ -1,26 +0,0 @@
682 -<?xml version="1.0" encoding="UTF-8"?>
683 -<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
684 -<pkgmetadata>
685 - <maintainer type="person">
686 - <email>4nykey@×××××.com</email>
687 - </maintainer>
688 - <use>
689 - <flag name="clang">Use Clang compiler instead of GCC</flag>
690 - <flag name="custom-optimization">Fine-tune custom compiler
691 - optimizations (-Os, -O0, -O1, -O2, -O3)</flag>
692 - <flag name="hwaccel">Use hardware-accelerated rendering</flag>
693 - <flag name="screenshot">Allow to disable screenshot extension in global profile</flag>
694 - <flag name="system-harfbuzz">Use the system-wide <pkg>media-libs/harfbuzz</pkg>
695 - and <pkg>media-gfx/graphite2</pkg> instead of bundled.</flag>
696 - <flag name="system-icu">Use the system-wide <pkg>dev-libs/icu</pkg>
697 - instead of bundled.</flag>
698 - <flag name="system-jpeg">Use the system-wide <pkg>media-libs/libjpeg-turbo</pkg>
699 - instead of bundled.</flag>
700 - <flag name="system-libevent">Use the system-wide <pkg>dev-libs/libevent</pkg>
701 - instead of bundled.</flag>
702 - <flag name="system-libvpx">Use the system-wide <pkg>media-libs/libvpx</pkg>
703 - instead of bundled.</flag>
704 - <flag name="system-sqlite">Use the system-wide <pkg>dev-db/sqlite</pkg>
705 - installation with secure-delete enabled</flag>
706 - </use>
707 -</pkgmetadata>
708
709 diff --git a/www-client/torbrowser/torbrowser-60.6.1.8.0.9.1.3.ebuild b/www-client/torbrowser/torbrowser-60.6.1.8.0.9.1.3.ebuild
710 deleted file mode 100644
711 index 4582ae2..0000000
712 --- a/www-client/torbrowser/torbrowser-60.6.1.8.0.9.1.3.ebuild
713 +++ /dev/null
714 @@ -1,367 +0,0 @@
715 -# Copyright 1999-2019 Gentoo Authors
716 -# Distributed under the terms of the GNU General Public License v2
717 -
718 -EAPI=6
719 -WANT_AUTOCONF="2.1"
720 -
721 -PYTHON_COMPAT=( python3_{5,6,7} )
722 -PYTHON_REQ_USE='ncurses,sqlite,ssl,threads(+)'
723 -MOZCONFIG_OPTIONAL_WIFI=1
724 -
725 -LLVM_MAX_SLOT=8
726 -
727 -inherit check-reqs desktop flag-o-matic toolchain-funcs eutils gnome2-utils \
728 - llvm mozconfig-v6.${PV%%.*} pax-utils xdg-utils autotools
729 -inherit eapi7-ver
730 -
731 -MOZ_PV="$(ver_cut 1-3)esr"
732 -# https://dist.torproject.org/torbrowser
733 -TOR_PV="$(ver_cut 4-6)"
734 -if [[ -z ${PV%%*_alpha} ]]; then
735 - TOR_PV="$(ver_rs 2 a ${TOR_PV})"
736 -else
737 - KEYWORDS="~amd64 ~x86"
738 -fi
739 -TOR_PV="${TOR_PV%.0}"
740 -# https://gitweb.torproject.org/tor-browser.git/refs/tags
741 -GIT_TAG="$(ver_cut 4-5)-$(ver_cut 7-8)"
742 -GIT_TAG="tor-browser-${MOZ_PV}-$(ver_rs 3 '-build' ${GIT_TAG})"
743 -
744 -DESCRIPTION="The Tor Browser"
745 -HOMEPAGE="
746 - https://www.torproject.org/projects/torbrowser.html
747 - https://gitweb.torproject.org/tor-browser.git"
748 -
749 -SLOT="0"
750 -# BSD license applies to torproject-related code like the patches
751 -# icons are under CCPL-Attribution-3.0
752 -LICENSE="BSD CC-BY-3.0 MPL-2.0 GPL-2 LGPL-2.1"
753 -IUSE="hardened hwaccel jack -screenshot selinux test"
754 -
755 -SRC_URI="mirror://tor/${PN}/${TOR_PV}"
756 -PATCH="firefox-${PV%%.*}.6-patches-07"
757 -PATCH=( https://dev.gentoo.org/~{anarchy,axs,polynomial-c}/mozilla/patchsets/${PATCH}.tar.xz )
758 -SRC_URI="
759 - https://gitweb.torproject.org/tor-browser.git/snapshot/${GIT_TAG}.tar.gz
760 - -> ${GIT_TAG}.tar.gz
761 - x86? (
762 - ${SRC_URI}/tor-browser-linux32-${TOR_PV}_en-US.tar.xz
763 - )
764 - amd64? (
765 - ${SRC_URI}/tor-browser-linux64-${TOR_PV}_en-US.tar.xz
766 - )
767 - ${PATCH[@]}
768 -"
769 -RESTRICT="primaryuri"
770 -
771 -ASM_DEPEND=">=dev-lang/yasm-1.1"
772 -
773 -RDEPEND="
774 - >=dev-libs/nss-3.36.7
775 - >=dev-libs/nspr-4.19
776 - >=net-vpn/tor-0.3.3.9
777 - system-icu? ( >=dev-libs/icu-60.2 )
778 - jack? ( virtual/jack )
779 - selinux? ( sec-policy/selinux-mozilla )"
780 -
781 -DEPEND="
782 - ${RDEPEND}
783 - amd64? ( ${ASM_DEPEND} virtual/opengl )
784 - x86? ( ${ASM_DEPEND} virtual/opengl )"
785 -
786 -RESTRICT="!test? ( test )"
787 -
788 -S="${WORKDIR}/${GIT_TAG}"
789 -
790 -QA_PRESTRIPPED="usr/lib*/${PN}/${PN}"
791 -
792 -BUILD_OBJ_DIR="${WORKDIR}/torbrowser-build"
793 -
794 -llvm_check_deps() {
795 - if ! has_version "sys-devel/clang:${LLVM_SLOT}" ; then
796 - ewarn "sys-devel/clang:${LLVM_SLOT} is missing! Cannot use LLVM slot ${LLVM_SLOT} ..."
797 - return 1
798 - fi
799 -
800 - if use clang ; then
801 - if ! has_version "=sys-devel/lld-${LLVM_SLOT}*" ; then
802 - ewarn "=sys-devel/lld-${LLVM_SLOT}* is missing! Cannot use LLVM slot ${LLVM_SLOT} ..."
803 - return 1
804 - fi
805 - fi
806 -
807 - einfo "Will use LLVM slot ${LLVM_SLOT}!"
808 -}
809 -
810 -pkg_setup() {
811 - moz_pkgsetup
812 -
813 - # Avoid PGO profiling problems due to enviroment leakage
814 - # These should *always* be cleaned up anyway
815 - unset DBUS_SESSION_BUS_ADDRESS \
816 - DISPLAY \
817 - ORBIT_SOCKETDIR \
818 - SESSION_MANAGER \
819 - XDG_SESSION_COOKIE \
820 - XAUTHORITY
821 -
822 - addpredict /proc/self/oom_score_adj
823 -
824 - llvm_pkg_setup
825 -}
826 -
827 -pkg_pretend() {
828 - # Ensure we have enough disk space to compile
829 - CHECKREQS_DISK_BUILD="4G"
830 -
831 - check-reqs_pkg_setup
832 -}
833 -
834 -src_prepare() {
835 - local PATCHES=(
836 - "${WORKDIR}"/firefox
837 -
838 - # Revert "Change the default Firefox profile directory to be TBB-relative"
839 - "${FILESDIR}"/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch
840 - "${FILESDIR}"/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch
841 - )
842 -
843 - # Enable gnomebreakpad
844 - if use debug ; then
845 - sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
846 - "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
847 - fi
848 -
849 - # Ensure that our plugins dir is enabled as default
850 - sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
851 - "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
852 - sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
853 - "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
854 -
855 - # Fix sandbox violations during make clean, bug 372817
856 - sed -e "s:\(/no-such-file\):${T}\1:g" \
857 - -i "${S}"/config/rules.mk \
858 - -i "${S}"/nsprpub/configure{.in,} \
859 - || die
860 -
861 - # Don't exit with error when some libs are missing which we have in
862 - # system.
863 - sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
864 - -i "${S}"/browser/installer/Makefile.in || die
865 -
866 - # Don't error out when there's no files to be removed:
867 - sed 's@\(xargs rm\)$@\1 -f@' \
868 - -i "${S}"/toolkit/mozapps/installer/packager.mk || die
869 -
870 - # Keep codebase the same even if not using official branding
871 - sed '/^MOZ_DEV_EDITION=1/d' \
872 - -i "${S}"/browser/branding/aurora/configure.sh || die
873 -
874 - default
875 -
876 - # Autotools configure is now called old-configure.in
877 - # This works because there is still a configure.in that happens to be for the
878 - # shell wrapper configure script
879 - eautoreconf old-configure.in
880 -
881 - # Must run autoconf in js/src
882 - cd "${S}"/js/src || die
883 - eautoconf old-configure.in
884 -}
885 -
886 -src_configure() {
887 - MEXTENSIONS="default"
888 -
889 - # Add information about TERM to output (build.log) to aid debugging
890 - # blessings problems
891 - if [[ -n "${TERM}" ]] ; then
892 - einfo "TERM is set to: \"${TERM}\""
893 - else
894 - einfo "TERM is unset."
895 - fi
896 -
897 - ####################################
898 - #
899 - # mozconfig, CFLAGS and CXXFLAGS setup
900 - #
901 - ####################################
902 -
903 - mozconfig_init
904 - mozconfig_config
905 -
906 - # enable JACK, bug 600002
907 - mozconfig_use_enable jack
908 -
909 - # Add full relro support for hardened
910 - if use hardened; then
911 - append-ldflags "-Wl,-z,relro,-z,now"
912 - mozconfig_use_enable hardened hardening
913 - fi
914 -
915 - # Disable built-in ccache support to avoid sandbox violation, #665420
916 - # Use FEATURES=ccache instead!
917 - mozconfig_annotate '' --without-ccache
918 - sed -i -e 's/ccache_stats = None/return None/' \
919 - python/mozbuild/mozbuild/controller/building.py || \
920 - die "Failed to disable ccache stats call"
921 -
922 - mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
923 -
924 - # allow elfhack to work in combination with unstripped binaries
925 - # when they would normally be larger than 2GiB.
926 - append-ldflags "-Wl,--compress-debug-sections=zlib"
927 -
928 - if use clang ; then
929 - # https://bugzilla.mozilla.org/show_bug.cgi?id=1423822
930 - mozconfig_annotate 'elf-hack is broken when using Clang' --disable-elf-hack
931 - fi
932 -
933 - echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
934 - echo "mk_add_options XARGS="${EPREFIX}"/usr/bin/xargs" >> "${S}"/.mozconfig
935 -
936 - # Use .mozconfig settings from torbrowser (setting this here since it gets overwritten by mozcoreconf-v6.eclass)
937 - # see https://gitweb.torproject.org/tor-browser.git/tree/.mozconfig?h=tor-browser-60.2.0esr-8.0-1
938 - echo "mk_add_options MOZ_APP_DISPLAYNAME=\"Tor Browser\"" >> "${S}"/.mozconfig
939 - echo "mk_add_options MOZILLA_OFFICIAL=1" >> "${S}"/.mozconfig
940 - echo "mk_add_options BUILD_OFFICIAL=1" >> "${S}"/.mozconfig
941 - mozconfig_annotate 'torbrowser' --enable-official-branding
942 - mozconfig_annotate 'torbrowser' --disable-webrtc
943 - mozconfig_annotate 'torbrowser' --disable-eme
944 - mozconfig_annotate 'torbrowser' --enable-proxy-bypass-protection
945 -
946 - # Rename the binary and set the profile location
947 - mozconfig_annotate 'torbrowser' --with-app-name="${PN}"
948 - mozconfig_annotate 'torbrowser' --with-app-basename="${PN}"
949 -
950 - # see https://gitweb.torproject.org/tor-browser.git/tree/old-configure.in?h=tor-browser-60.2.0esr-8.0-1#n3205
951 - mozconfig_annotate 'torbrowser' --with-tor-browser-version="${TOR_PV}"
952 - mozconfig_annotate 'torbrowser' --disable-tor-browser-update
953 -
954 - echo "mk_add_options MOZ_OBJDIR=${BUILD_OBJ_DIR}" >> "${S}"/.mozconfig
955 - echo "mk_add_options XARGS="${EPREFIX}"/usr/bin/xargs" >> "${S}"/.mozconfig
956 -
957 - # Default mozilla_five_home no longer valid option
958 - sed '/with-default-mozilla-five-home=/d' -i "${S}"/.mozconfig
959 -
960 - # Finalize and report settings
961 - mozconfig_final
962 -
963 - # workaround for funky/broken upstream configure...
964 - SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
965 - ./mach configure || die
966 -}
967 -
968 -src_compile() {
969 - MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
970 - ./mach build --verbose || die
971 -}
972 -
973 -src_install() {
974 - local profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default"
975 - cd "${BUILD_OBJ_DIR}" || die
976 -
977 - cat "${profile_dir}"/bookmarks.html > \
978 - dist/bin/browser/chrome/en-US/locale/browser/bookmarks.html
979 -
980 - # Pax mark xpcshell for hardened support, only used for startupcache creation.
981 - pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell
982 -
983 - touch "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
984 - || die
985 -
986 - mozconfig_install_prefs \
987 - "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js"
988 -
989 - # Augment this with hwaccel prefs
990 - if use hwaccel ; then
991 - printf 'pref("%s", true);\npref("%s", true);\n' \
992 - layers.acceleration.force-enabled webgl.force-enabled >> \
993 - "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
994 - || die
995 - fi
996 -
997 - if ! use screenshot; then
998 - echo "pref(\"extensions.screenshots.disabled\", true);" >> \
999 - "${BUILD_OBJ_DIR}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
1000 - || die
1001 - fi
1002 -
1003 - # Must ensure we use bundled nss/nspr during signing and not system
1004 - cd "${S}"
1005 - MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL:-${EPREFIX}/bin/bash}" MOZ_NOSPAM=1 \
1006 - DESTDIR="${D}" ./mach install || die
1007 -
1008 - # Install icons and .desktop for menu entry
1009 - local size icon_path name
1010 - icon_path="${S}/browser/branding/official"
1011 - name="Tor Browser"
1012 - for size in 16 32 48 64 128 256; do
1013 - newicon -s ${size} "${icon_path}/default${size}.png" ${PN}.png
1014 - done
1015 - newicon "${icon_path}/default48.png" "${icon}.png"
1016 - newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop"
1017 - sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${PN}:" \
1018 - "${ED}/usr/share/applications/${PN}.desktop" || die
1019 -
1020 - # Add StartupNotify=true bug 237317
1021 - if use startup-notification ; then
1022 - echo "StartupNotify=true"\
1023 - >> "${ED}/usr/share/applications/${PN}.desktop" \
1024 - || die
1025 - fi
1026 -
1027 - # Required in order to use plugins and even run torbrowser on hardened.
1028 - pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{${PN},plugin-container}
1029 -
1030 - # Profile without the tor-launcher extension
1031 - # see: https://trac.torproject.org/projects/tor/ticket/10160
1032 - rm "${profile_dir}/extensions/tor-launcher@××××××××××××××.xpi" || die \
1033 - "Failed to remove torlauncher extension"
1034 -
1035 - insinto ${MOZILLA_FIVE_HOME}/browser
1036 - doins -r "${profile_dir}"/extensions
1037 -
1038 - dodoc "${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt"
1039 -}
1040 -
1041 -pkg_preinst() {
1042 - gnome2_icon_savelist
1043 -
1044 - # if the apulse libs are available in MOZILLA_FIVE_HOME then apulse
1045 - # doesn't need to be forced into the LD_LIBRARY_PATH
1046 - if use pulseaudio && has_version ">=media-sound/apulse-0.1.9" ; then
1047 - einfo "APULSE found - Generating library symlinks for sound support"
1048 - local lib
1049 - pushd "${ED}"${MOZILLA_FIVE_HOME} &>/dev/null || die
1050 - for lib in ../apulse/libpulse{.so{,.0},-simple.so{,.0}} ; do
1051 - # a quickpkg rolled by hand will grab symlinks as part of the package,
1052 - # so we need to avoid creating them if they already exist.
1053 - if ! [ -L ${lib##*/} ]; then
1054 - ln -s "${lib}" ${lib##*/} || die
1055 - fi
1056 - done
1057 - popd &>/dev/null || die
1058 - fi
1059 -}
1060 -
1061 -pkg_postinst() {
1062 - ewarn "This patched firefox build is _NOT_ recommended by Tor upstream but uses"
1063 - ewarn "the exact same sources. Use this only if you know what you are doing!"
1064 - elog "Torbrowser uses port 9150 to connect to Tor. You can change the port"
1065 - elog "in the connection settings to match your setup."
1066 -
1067 - gnome2_icon_cache_update
1068 - xdg_desktop_database_update
1069 -
1070 - if use pulseaudio && has_version ">=media-sound/apulse-0.1.9"; then
1071 - elog "Apulse was detected at merge time on this system and so it will always be"
1072 - elog "used for sound. If you wish to use pulseaudio instead please unmerge"
1073 - elog "media-sound/apulse."
1074 - elog
1075 - fi
1076 -}
1077 -
1078 -pkg_postrm() {
1079 - gnome2_icon_cache_update
1080 - xdg_desktop_database_update
1081 -}