1 |
commit: 01f5131df06807e65363bd30bd20e599470449a5 |
2 |
Author: Jory Pratt <anarchy <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Apr 19 16:48:51 2019 +0000 |
4 |
Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Apr 19 16:48:51 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/mozilla.git/commit/?id=01f5131d |
7 |
|
8 |
www-client/torbrowser: misc cleanup, system tor setup required |
9 |
|
10 |
Package-Manager: Portage-2.3.63, Repoman-2.3.12 |
11 |
Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org> |
12 |
|
13 |
www-client/torbrowser/files/99torbrowser.example | 20 ----------- |
14 |
.../torbrowser/files/icon/torbrowser.desktop | 9 +++++ |
15 |
www-client/torbrowser/files/profile.cfg | 42 ---------------------- |
16 |
.../torbrowser-60.5.0-nss-fixup-warnings.patch | 25 ------------- |
17 |
...build => torbrowser-60.6.1.8.0.8.1.1-r2.ebuild} | 35 ++++++++++-------- |
18 |
5 files changed, 29 insertions(+), 102 deletions(-) |
19 |
|
20 |
diff --git a/www-client/torbrowser/files/99torbrowser.example b/www-client/torbrowser/files/99torbrowser.example |
21 |
deleted file mode 100644 |
22 |
index e138b30..0000000 |
23 |
--- a/www-client/torbrowser/files/99torbrowser.example |
24 |
+++ /dev/null |
25 |
@@ -1,20 +0,0 @@ |
26 |
-# /etc/env.d/99torbrowser |
27 |
-# |
28 |
-# The Tor ControlPort password should be given inside double quotes, inside |
29 |
-# single quotes, i.e. if the ControlPort password is “secret” (without |
30 |
-# curly quotes) then we must set the environment variable *exactly* like |
31 |
-# this: |
32 |
-# TOR_CONTROL_PASSWD='"secret"' |
33 |
-# Yes, the variable MUST be double-quoted, then single-quoted, exactly as |
34 |
-# shown. This is used by TorButton to authenticate to Tor's ControlPort, and |
35 |
-# is necessary for using TB with a system-installed Tor |
36 |
- |
37 |
-#TOR_SOCKS_HOST=127.0.0.1 |
38 |
-#TOR_SOCKS_PORT=9150 |
39 |
-#TOR_SOCKS_IPC_PATH=/var/run/tor/socks |
40 |
- |
41 |
-#TOR_CONTROL_HOST=127.0.0.1 |
42 |
-#TOR_CONTROL_PORT=9151 |
43 |
-#TOR_CONTROL_PASSWD='"secret"' |
44 |
-#TOR_CONTROL_COOKIE_AUTH_FILE=/var/run/tor/control.authcookie |
45 |
-#TOR_CONTROL_IPC_PATH=/var/run/tor/control |
46 |
|
47 |
diff --git a/www-client/torbrowser/files/icon/torbrowser.desktop b/www-client/torbrowser/files/icon/torbrowser.desktop |
48 |
new file mode 100644 |
49 |
index 0000000..ecfabde |
50 |
--- /dev/null |
51 |
+++ b/www-client/torbrowser/files/icon/torbrowser.desktop |
52 |
@@ -0,0 +1,9 @@ |
53 |
+[Desktop Entry] |
54 |
+Name=@NAME@ |
55 |
+Comment=Web Browser |
56 |
+Exec=torbrowser %u |
57 |
+Icon=@ICON@ |
58 |
+Terminal=false |
59 |
+Type=Application |
60 |
+MimeType=text/html;text/xml;application/xhtml+xml;application/vnd.mozilla.xul+xml;text/mml;x-scheme-handler/http;x-scheme-handler/https; |
61 |
+Categories=Network;WebBrowser |
62 |
|
63 |
diff --git a/www-client/torbrowser/files/profile.cfg b/www-client/torbrowser/files/profile.cfg |
64 |
deleted file mode 100644 |
65 |
index d14309a..0000000 |
66 |
--- a/www-client/torbrowser/files/profile.cfg |
67 |
+++ /dev/null |
68 |
@@ -1,42 +0,0 @@ |
69 |
-// |
70 |
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components; |
71 |
-Cu.import("resource://gre/modules/Services.jsm"); |
72 |
-Cu.import("resource://gre/modules/FileUtils.jsm"); |
73 |
- |
74 |
-var profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile); |
75 |
-var certDBFile = profileDir.clone(); |
76 |
-certDBFile.append("cert8.db") |
77 |
-// If cert8.db isn't there, it's a new profile |
78 |
-if (!certDBFile.exists()) { |
79 |
- var defaultProfileDir = Services.dirsvc.get("GreD", Ci.nsIFile); |
80 |
- defaultProfileDir.append("defaults"); |
81 |
- defaultProfileDir.append("profile"); |
82 |
- try { |
83 |
- copyDir(defaultProfileDir, profileDir); |
84 |
- } catch (e) { |
85 |
- Components.utils.reportError(e); |
86 |
- } |
87 |
-} |
88 |
- |
89 |
-function copyDir(aOriginal, aDestination) { |
90 |
- var enumerator = aOriginal.directoryEntries; |
91 |
- while (enumerator.hasMoreElements()) { |
92 |
- var file = enumerator.getNext().QueryInterface(Components.interfaces.nsIFile); |
93 |
- if (file.isDirectory()) { |
94 |
- var subdir = aDestination.clone(); |
95 |
- subdir.append(file.leafName); |
96 |
- try { |
97 |
- subdir.create(Ci.nsIFile.DIRECTORY_TYPE, FileUtils.PERMS_DIRECTORY); |
98 |
- copyDir(file, subdir); |
99 |
- } catch (e) { |
100 |
- Components.utils.reportError(e); |
101 |
- } |
102 |
- } else { |
103 |
- try { |
104 |
- file.copyTo(aDestination, null); |
105 |
- } catch (e) { |
106 |
- Components.utils.reportError(e); |
107 |
- } |
108 |
- } |
109 |
- } |
110 |
-} |
111 |
|
112 |
diff --git a/www-client/torbrowser/files/torbrowser-60.5.0-nss-fixup-warnings.patch b/www-client/torbrowser/files/torbrowser-60.5.0-nss-fixup-warnings.patch |
113 |
deleted file mode 100644 |
114 |
index 48289b0..0000000 |
115 |
--- a/www-client/torbrowser/files/torbrowser-60.5.0-nss-fixup-warnings.patch |
116 |
+++ /dev/null |
117 |
@@ -1,25 +0,0 @@ |
118 |
-From f749a3cc5fc0397e5f4c0948dd35beacac17e2d5 Mon Sep 17 00:00:00 2001 |
119 |
-From: Poncho <poncho@××××××.ch> |
120 |
-Date: Sun, 16 Aug 2015 14:47:29 +0200 |
121 |
-Subject: [PATCH 4/4] security/nss/coreconf/Linux.mk: add -fno-strict-aliasing |
122 |
- |
123 |
-taken from nss-3.15-gentoo-fixup-warnings.patch |
124 |
---- |
125 |
- security/nss/coreconf/Linux.mk | 1 + |
126 |
- 1 file changed, 1 insertion(+) |
127 |
- |
128 |
-diff --git a/security/nss/coreconf/Linux.mk b/security/nss/coreconf/Linux.mk |
129 |
-index bb9db413b411..43355237f98a 100644 |
130 |
---- a/security/nss/coreconf/Linux.mk |
131 |
-+++ b/security/nss/coreconf/Linux.mk |
132 |
-@@ -119,6 +119,7 @@ ifdef MOZ_DEBUG_SYMBOLS |
133 |
- OPTIMIZER += -gdwarf-2 |
134 |
- endif |
135 |
- endif |
136 |
-+OPTIMIZER += -fno-strict-aliasing |
137 |
- endif |
138 |
- |
139 |
- ifndef COMPILER_TAG |
140 |
--- |
141 |
-2.19.2 |
142 |
- |
143 |
|
144 |
diff --git a/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r1.ebuild b/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r2.ebuild |
145 |
similarity index 91% |
146 |
rename from www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r1.ebuild |
147 |
rename to www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r2.ebuild |
148 |
index bfe9bcb..68989d0 100644 |
149 |
--- a/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r1.ebuild |
150 |
+++ b/www-client/torbrowser/torbrowser-60.6.1.8.0.8.1.1-r2.ebuild |
151 |
@@ -10,8 +10,8 @@ MOZCONFIG_OPTIONAL_WIFI=1 |
152 |
|
153 |
LLVM_MAX_SLOT=8 |
154 |
|
155 |
-inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils llvm \ |
156 |
- mozconfig-v6.${PV%%.*} pax-utils xdg-utils autotools |
157 |
+inherit check-reqs desktop flag-o-matic toolchain-funcs eutils gnome2-utils \ |
158 |
+ llvm mozconfig-v6.${PV%%.*} pax-utils xdg-utils autotools |
159 |
inherit eapi7-ver |
160 |
|
161 |
MOZ_PV="$(ver_cut 1-3)esr" |
162 |
@@ -73,7 +73,7 @@ S="${WORKDIR}/${GIT_TAG}" |
163 |
|
164 |
QA_PRESTRIPPED="usr/lib*/${PN}/${PN}" |
165 |
|
166 |
-BUILD_OBJ_DIR="${WORKDIR}/torb" |
167 |
+BUILD_OBJ_DIR="${WORKDIR}/torbrowser-build" |
168 |
|
169 |
llvm_check_deps() { |
170 |
if ! has_version "sys-devel/clang:${LLVM_SLOT}" ; then |
171 |
@@ -122,9 +122,6 @@ src_prepare() { |
172 |
# Revert "Change the default Firefox profile directory to be TBB-relative" |
173 |
"${FILESDIR}"/torbrowser-60.5.0-Do_not_store_data_in_the_app_bundle.patch |
174 |
"${FILESDIR}"/torbrowser-60.5.0-Change_the_default_Firefox_profile_directory.patch |
175 |
- |
176 |
- # FIXME: prevent warnings in bundled nss |
177 |
- "${FILESDIR}"/torbrowser-60.5.0-nss-fixup-warnings.patch |
178 |
) |
179 |
|
180 |
# Enable gnomebreakpad |
181 |
@@ -258,8 +255,12 @@ src_compile() { |
182 |
} |
183 |
|
184 |
src_install() { |
185 |
+ local profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default" |
186 |
cd "${BUILD_OBJ_DIR}" || die |
187 |
|
188 |
+ cat "${profile_dir}"/bookmarks.html > \ |
189 |
+ dist/bin/browser/chrome/en-US/locale/browser/bookmarks.html |
190 |
+ |
191 |
# Pax mark xpcshell for hardened support, only used for startupcache creation. |
192 |
pax-mark m "${BUILD_OBJ_DIR}"/dist/bin/xpcshell |
193 |
|
194 |
@@ -289,30 +290,34 @@ src_install() { |
195 |
DESTDIR="${D}" ./mach install || die |
196 |
|
197 |
# Install icons and .desktop for menu entry |
198 |
- local size icon_path |
199 |
+ local size icon_path name |
200 |
icon_path="${S}/browser/branding/official" |
201 |
+ name="Tor Browser" |
202 |
for size in 16 32 48 64 128 256; do |
203 |
newicon -s ${size} "${icon_path}/default${size}.png" ${PN}.png |
204 |
done |
205 |
- make_desktop_entry ${PN} "Tor Browser" ${PN} "Network;WebBrowser" "StartupWMClass=Torbrowser" |
206 |
+ newicon "${icon_path}/default48.png" "${icon}.png" |
207 |
+ newmenu "${FILESDIR}/icon/${PN}.desktop" "${PN}.desktop" |
208 |
+ sed -i -e "s:@NAME@:${name}:" -e "s:@ICON@:${PN}:" \ |
209 |
+ "${ED}/usr/share/applications/${PN}.desktop" || die |
210 |
|
211 |
# Add StartupNotify=true bug 237317 |
212 |
if use startup-notification ; then |
213 |
echo "StartupNotify=true"\ |
214 |
- >> "${ED}/usr/share/applications/${PN}-${PN}.desktop" \ |
215 |
+ >> "${ED}/usr/share/applications/${PN}.desktop" \ |
216 |
|| die |
217 |
fi |
218 |
|
219 |
# Required in order to use plugins and even run torbrowser on hardened. |
220 |
pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{${PN},plugin-container} |
221 |
|
222 |
- # Profile with settings and extensions |
223 |
- insinto ${MOZILLA_FIVE_HOME}/defaults/profile |
224 |
- doins -r "${WORKDIR}"/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default/{extensions,bookmarks.html} |
225 |
+ # Profile without the tor-launcher extension |
226 |
+ # see: https://trac.torproject.org/projects/tor/ticket/10160 |
227 |
+ rm "${profile_dir}/extensions/tor-launcher@××××××××××××××.xpi" || die \ |
228 |
+ "Failed to remove torlauncher extension" |
229 |
|
230 |
- # see: https://trac.torproject.org/projects/tor/ticket/11751#comment:2 |
231 |
- # see: https://github.com/Whonix/anon-ws-disable-stacked-tor/blob/master/usr/lib/anon-ws-disable-stacked-tor/torbrowser.sh |
232 |
- dodoc "${FILESDIR}/99torbrowser.example" |
233 |
+ insinto ${MOZILLA_FIVE_HOME}/browser |
234 |
+ doins -r "${profile_dir}"/extensions |
235 |
|
236 |
dodoc "${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt" |
237 |
} |