Gentoo Archives: gentoo-commits

From: "Julian Ospald (hasufell)" <hasufell@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in www-client/torbrowser: ChangeLog torbrowser-12.0-r2.ebuild torbrowser-12.0.ebuild
Date: Fri, 01 Jun 2012 15:52:40
Message-Id: 20120601155228.22C692004B@flycatcher.gentoo.org
1 hasufell 12/06/01 15:52:28
2
3 Modified: ChangeLog
4 Added: torbrowser-12.0-r2.ebuild
5 Removed: torbrowser-12.0.ebuild
6 Log:
7 sync with firefox ebuild
8
9 (Portage version: 2.2.0_alpha108/cvs/Linux x86_64)
10
11 Revision Changes Path
12 1.2 www-client/torbrowser/ChangeLog
13
14 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/ChangeLog?rev=1.2&view=markup
15 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/ChangeLog?rev=1.2&content-type=text/plain
16 diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/ChangeLog?r1=1.1&r2=1.2
17
18 Index: ChangeLog
19 ===================================================================
20 RCS file: /var/cvsroot/gentoo-x86/www-client/torbrowser/ChangeLog,v
21 retrieving revision 1.1
22 retrieving revision 1.2
23 diff -u -r1.1 -r1.2
24 --- ChangeLog 12 May 2012 22:24:39 -0000 1.1
25 +++ ChangeLog 1 Jun 2012 15:52:27 -0000 1.2
26 @@ -1,6 +1,12 @@
27 # ChangeLog for www-client/torbrowser
28 # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
29 -# $Header: /var/cvsroot/gentoo-x86/www-client/torbrowser/ChangeLog,v 1.1 2012/05/12 22:24:39 hasufell Exp $
30 +# $Header: /var/cvsroot/gentoo-x86/www-client/torbrowser/ChangeLog,v 1.2 2012/06/01 15:52:27 hasufell Exp $
31 +
32 +*torbrowser-12.0-r2 (01 Jun 2012)
33 +
34 + 01 Jun 2012; Julian Ospald <hasufell@g.o> -torbrowser-12.0.ebuild,
35 + +torbrowser-12.0-r2.ebuild:
36 + sync with firefox ebuild
37
38 *torbrowser-12.0 (12 May 2012)
39
40
41
42
43 1.1 www-client/torbrowser/torbrowser-12.0-r2.ebuild
44
45 file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/torbrowser-12.0-r2.ebuild?rev=1.1&view=markup
46 plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/www-client/torbrowser/torbrowser-12.0-r2.ebuild?rev=1.1&content-type=text/plain
47
48 Index: torbrowser-12.0-r2.ebuild
49 ===================================================================
50 # Copyright 1999-2012 Gentoo Foundation
51 # Distributed under the terms of the GNU General Public License v2
52 # $Header: /var/cvsroot/gentoo-x86/www-client/torbrowser/torbrowser-12.0-r2.ebuild,v 1.1 2012/06/01 15:52:27 hasufell Exp $
53
54 EAPI="3"
55 VIRTUALX_REQUIRED="pgo"
56 WANT_AUTOCONF="2.1"
57
58 MY_PN="firefox"
59 # latest version of the torbrowser-bundle we use the profile-folder from
60 # https://www.torproject.org/dist/torbrowser/linux/
61 TB_V="2.2.35-11"
62
63 # Patch version
64 PATCH="${MY_PN}-12.0-patches-0.5"
65 # Upstream ftp release URI that's used by mozlinguas.eclass
66 # We don't use the http mirror because it deletes old tarballs.
67 MOZ_FTP_URI="ftp://ftp.mozilla.org/pub/${MY_PN}/releases/"
68
69 inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-3 multilib pax-utils autotools python virtualx
70
71 DESCRIPTION="Torbrowser without vidalia or tor, includes profile and extensions"
72 HOMEPAGE="https://www.torproject.org/projects/torbrowser.html.en"
73
74 # may work on other arches, but untested
75 KEYWORDS="~amd64 ~x86"
76 SLOT="0"
77 # BSD license applies to torproject-related code like the patches
78 # GPL-2 and MIT applies to the extensions
79 # icons are under CCPL-Attribution-3.0
80 LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )
81 BSD
82 GPL-2
83 MIT
84 CCPL-Attribution-3.0"
85 IUSE="bindist +crashreporter +ipc +jit pgo selinux system-sqlite +webm"
86
87 SRC_URI="${SRC_URI}
88 http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
89 ${MOZ_FTP_URI}/${PV}/source/${MY_PN}-${PV}.source.tar.bz2
90 amd64? ( https://www.torproject.org/dist/${PN}/linux/tor-browser-gnu-linux-x86_64-${TB_V}-dev-en-US.tar.gz )
91 x86? ( https://www.torproject.org/dist/${PN}/linux/tor-browser-gnu-linux-i686-${TB_V}-dev-en-US.tar.gz )"
92
93 ASM_DEPEND=">=dev-lang/yasm-1.1"
94
95 # Mesa 7.10 needed for WebGL + bugfixes
96 RDEPEND="
97 >=sys-devel/binutils-2.16.1
98 >=dev-libs/nss-3.13.3
99 >=dev-libs/nspr-4.9
100 >=dev-libs/glib-2.26:2
101 >=media-libs/mesa-7.10
102 media-libs/libpng[apng]
103 virtual/libffi
104 system-sqlite? ( >=dev-db/sqlite-3.7.10[fts3,secure-delete,threadsafe,unlock-notify,debug=] )
105 webm? ( >=media-libs/libvpx-1.0.0
106 media-libs/alsa-lib )
107 crashreporter? ( net-misc/curl )
108 selinux? ( sec-policy/selinux-mozilla )"
109 # We don't use PYTHON_DEPEND/PYTHON_USE_WITH for some silly reason
110 DEPEND="${RDEPEND}
111 virtual/pkgconfig
112 pgo? (
113 =dev-lang/python-2*[sqlite]
114 >=sys-devel/gcc-4.5 )
115 webm? ( x86? ( ${ASM_DEPEND} )
116 amd64? ( ${ASM_DEPEND} )
117 virtual/opengl )"
118
119 S="${WORKDIR}/mozilla-release"
120
121 QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/${MY_PN}/firefox"
122
123 pkg_setup() {
124 moz_pkgsetup
125
126 # Avoid PGO profiling problems due to enviroment leakage
127 # These should *always* be cleaned up anyway
128 unset DBUS_SESSION_BUS_ADDRESS \
129 DISPLAY \
130 ORBIT_SOCKETDIR \
131 SESSION_MANAGER \
132 XDG_SESSION_COOKIE \
133 XAUTHORITY
134
135 if ! use bindist; then
136 einfo
137 elog "You are enabling official branding. You may not redistribute this build"
138 elog "to any users on your network or the internet. Doing so puts yourself into"
139 elog "a legal problem with Mozilla Foundation"
140 elog "You can disable it by emerging ${PN} _with_ the bindist USE-flag"
141 fi
142
143 if use pgo; then
144 einfo
145 ewarn "You will do a double build for profile guided optimization."
146 ewarn "This will result in your build taking at least twice as long as before."
147 fi
148
149 # Ensure we have enough disk space to compile
150 if use pgo || use debug || use test ; then
151 CHECKREQS_DISK_BUILD="8G"
152 else
153 CHECKREQS_DISK_BUILD="4G"
154 fi
155 check-reqs_pkg_setup
156 }
157
158 src_prepare() {
159 # Apply our patches
160 EPATCH_SUFFIX="patch" \
161 EPATCH_FORCE="yes" \
162 epatch "${WORKDIR}/firefox"
163
164 # Torbrowser patches for firefox 12, check regularly/for every version-bump
165 # https://gitweb.torproject.org/torbrowser.git/history/HEAD:/src/current-patches
166 EPATCH_SUFFIX="patch" \
167 EPATCH_FORCE="yes" \
168 epatch "${FILESDIR}/${PV}"
169
170 # Allow user to apply any additional patches without modifing ebuild
171 epatch_user
172
173 # Enable gnomebreakpad
174 if use debug ; then
175 sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
176 "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
177 fi
178
179 # Disable gnomevfs extension
180 sed -i -e "s:gnomevfs::" "${S}/"browser/confvars.sh \
181 -e "s:gnomevfs::" "${S}/"xulrunner/confvars.sh \
182 || die "Failed to remove gnomevfs extension"
183
184 # Ensure that plugins dir is enabled as default
185 # and is different from firefox-location
186 sed -i -e "s:/usr/lib/mozilla/plugins:/usr/$(get_libdir)/${PN}/${MY_PN}/plugins:" \
187 "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path!"
188
189 # Fix sandbox violations during make clean, bug 372817
190 sed -e "s:\(/no-such-file\):${T}\1:g" \
191 -i "${S}"/config/rules.mk \
192 -i "${S}"/js/src/config/rules.mk \
193 -i "${S}"/nsprpub/configure{.in,} \
194 || die
195
196 #Fix compilation with curl-7.21.7 bug 376027
197 sed -e '/#include <curl\/types.h>/d' \
198 -i "${S}"/toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc \
199 -i "${S}"/toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc \
200 -i "${S}"/config/system-headers \
201 -i "${S}"/js/src/config/system-headers || die "Sed failed"
202
203 eautoreconf
204 }
205
206 src_configure() {
207 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}/${MY_PN}"
208 MEXTENSIONS="default"
209
210 ####################################
211 #
212 # mozconfig, CFLAGS and CXXFLAGS setup
213 #
214 ####################################
215
216 mozconfig_init
217 mozconfig_config
218
219 mozconfig_annotate '' --prefix="${EPREFIX}"/usr
220 mozconfig_annotate '' --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN}
221 mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
222 mozconfig_annotate '' --disable-gconf
223 mozconfig_annotate '' --disable-mailnews
224 mozconfig_annotate '' --enable-canvas
225 mozconfig_annotate '' --enable-safe-browsing
226 mozconfig_annotate '' --with-system-png
227 mozconfig_annotate '' --enable-system-ffi
228
229 # Other ff-specific settings
230 mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
231 mozconfig_annotate '' --target="${CTARGET:-${CHOST}}"
232
233 mozconfig_use_enable system-sqlite
234 # Both methodjit and tracejit conflict with PaX
235 mozconfig_use_enable jit methodjit
236 mozconfig_use_enable jit tracejit
237
238 # Allow for a proper pgo build
239 if use pgo; then
240 echo "mk_add_options PROFILE_GEN_SCRIPT='\$(PYTHON) \$(OBJDIR)/_profile/pgo/profileserver.py'" >> "${S}"/.mozconfig
241 fi
242
243 # Finalize and report settings
244 mozconfig_final
245
246 if [[ $(gcc-major-version) -lt 4 ]]; then
247 append-cxxflags -fno-stack-protector
248 elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
249 if use amd64 || use x86; then
250 append-flags -mno-avx
251 fi
252 fi
253 }
254
255 src_compile() {
256 if use pgo; then
257 addpredict /root
258 addpredict /etc/gconf
259 # Reset and cleanup environment variables used by GNOME/XDG
260 gnome2_environment_reset
261
262 # Firefox tries to use dri stuff when it's run, see bug 380283
263 shopt -s nullglob
264 cards=$(echo -n /dev/dri/card* | sed 's/ /:/g')
265 if test -n "${cards}"; then
266 # FOSS drivers are fine
267 addpredict "${cards}"
268 else
269 cards=$(echo -n /dev/ati/card* /dev/nvidiactl* | sed 's/ /:/g')
270 if test -n "${cards}"; then
271 # Binary drivers seem to cause access violations anyway, so
272 # let's use indirect rendering so that the device files aren't
273 # touched at all. See bug 394715.
274 export LIBGL_ALWAYS_INDIRECT=1
275 addpredict "${cards}"
276 fi
277 fi
278 shopt -u nullglob
279
280 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
281 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
282 Xemake -f client.mk profiledbuild || die "Xemake failed"
283 else
284 CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
285 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
286 emake -f client.mk || die "emake failed"
287 fi
288 }
289
290 src_install() {
291 MOZILLA_FIVE_HOME="/usr/$(get_libdir)/${PN}/${MY_PN}"
292
293 # MOZ_BUILD_ROOT, and hence OBJ_DIR change depending on arch, compiler, pgo, etc.
294 local obj_dir="$(echo */config.log)"
295 obj_dir="${obj_dir%/*}"
296 cd "${S}/${obj_dir}"
297
298 # Without methodjit and tracejit there's no conflict with PaX
299 if use jit; then
300 # Pax mark xpcshell for hardened support, only used for startupcache creation.
301 pax-mark m "${S}/${obj_dir}"/dist/bin/xpcshell
302 fi
303
304 MOZ_MAKE_FLAGS="${MAKEOPTS}" \
305 emake DESTDIR="${D}" install || die "emake install failed"
306
307 # remove default symlink in /usr/bin, because we add a proper wrapper-script later
308 rm "${ED}"/usr/bin/${MY_PN} || die "Failed to remove binary-symlink"
309 # we dont want development stuff for this kind of build, might as well
310 # conflict with other firefox-builds
311 rm -rf "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} || \
312 die "Failed to remove sdk and headers"
313
314 # Without methodjit and tracejit there's no conflict with PaX
315 if use jit; then
316 # Required in order to use plugins and even run firefox on hardened.
317 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/{firefox,firefox-bin}
318 fi
319
320 # Plugin-container needs to be pax-marked for hardened to ensure plugins such as flash
321 # continue to work as expected.
322 pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
323
324 # Plugins dir
325 keepdir /usr/$(get_libdir)/${PN}/${MY_PN}/plugins
326
327 # Install pre-configured Torbrowser-profile
328 insinto /usr/share/${PN}
329 doins -r "${WORKDIR}"/tor-browser_en-US/Data/profile || die
330
331 # create wrapper to start torbrowser
332 make_wrapper ${PN} "/usr/$(get_libdir)/${PN}/${MY_PN}/${MY_PN} -no-remote -profile ~/.${PN}/profile"
333
334 newicon "${WORKDIR}"/tor-browser_en-US/App/Firefox/icons/mozicon128.png ${PN}.png
335 make_desktop_entry ${PN} "Torbrowser" ${PN} "Network;WebBrowser"
336 dodoc "${WORKDIR}"/tor-browser_en-US/Docs/changelog
337 }
338
339 pkg_postinst() {
340 ewarn "This patched firefox build is _NOT_ recommended by TOR upstream but uses"
341 ewarn "the exact same patches (excluding Vidalia-patch). Use this only if you know"
342 ewarn "what you are doing!"
343 einfo ""
344 elog "Copy the folder contents from /usr/share/${PN}/profile into ~/.${PN}/profile and run '${PN}'."
345 einfo
346 elog "This profile folder includes pre-configuration recommended by upstream,"
347 elog "as well as the extensions Torbutton, NoScript and HTTPS-Everywhere."
348 elog "If you want to start from scratch just create the directories '~/.${PN}/profile'."
349 einfo
350 elog "The update check when you first start ${PN} does not recognize this version."
351 einfo
352 }