new versions (torbrowser, gscan2pdf)

This commit is contained in:
Jörg Deckert 2015-03-25 10:21:28 +01:00
parent 9437d8a7dc
commit 718f96182b
5 changed files with 435 additions and 12 deletions

View File

@ -1,2 +1,2 @@
DIST gscan2pdf-1.2.6.tar.gz 652165 SHA256 83bd68c77f838a62c068606bba5ae4962a505ef7eeab7b06f76d474af2a909e5 SHA512 087f06cebb8d8eb237a29735f9655092d02da9e39947cf725fb24c2ecee1ec9272365d9448a9c87e97c7e8f4a459ea6a3e201296f5e2bfb378444cdefec25397 WHIRLPOOL 488a8ee4f6ea318a117e3e9e665734f0523e67c2e23f0af4cbf940972974ef726fb92bdc5c48e6d0bdb982eed639fac6aa1b3d5b2e698d0284d11e4788247b2c
EBUILD gscan2pdf-1.2.6.ebuild 1572 SHA256 c1bb482adba83807fb5783e53ce15956d0c9682c7c04954bcec636a158c05797 SHA512 6d7ff9fe83ddc014788078542a6deeec5d86b22a7f5bb803dfa2f2766f95e6ff6b361999bd453c67fbb0ccf6cfdbb94db20fbcb5a340b5e47612dcaedc68c709 WHIRLPOOL 2c1fef00654c8be35e81e0857864c8d89bb40db37daf79c37146a00feb09e4da24ef8a116bab1283bd86437520481ead48e5a462a4ed35967922388fab5ac4dd
DIST gscan2pdf-1.3.0.tar.gz 677564 SHA256 49f09924b6eed0d6a7384e2c589466b47867e18c39137b4d87fc84340cc9a985 SHA512 490db9cf8acd0aab07457ff4e9ed08152b35bd2d6ab8794c4e82b59c02e5a7a75c581fb87ae65b7884db3e1edf463b5059beb138536c258c3a8a05aea7e6bd6f WHIRLPOOL 12c0f9e38e3bf3efc7d834c6bbc481c66b6f6e54b06d53c11300fc4856a6e869a12ee863aec9856a3f1bbe149af1de3e6a19c16f47b3b268c6cd6736c8d07c01
EBUILD gscan2pdf-1.3.0.ebuild 1838 SHA256 191dd5b17c513287fe6b410c098429b0509a7cf30d233e6f6e9766d57f39aa23 SHA512 63f5acbb83f6367efa651eb2187b6b020e389e1ff60bb1ebecb155fe71f6b1ea6de6a0682d5cb51c34b9ae21fba9a129bf685bbcff9c111d846c5ff82e9cbbd3 WHIRLPOOL 10ec004ccb53a040eb695727038329799e5842ebabc5658f97dd5173d8312b0363960be81a14f6d9de889560e249b7663573fbf3066ea8231c26643fae7ac9c1

View File

@ -1,8 +1,8 @@
# Copyright 1999-2014 Gentoo Foundation
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="4"
EAPI="5"
inherit perl-app
DESCRIPTION="GUI to produce PDF or DjVu files from scanned documents"
@ -40,20 +40,36 @@ RDEPEND="dev-lang/perl[ithreads]
>=virtual/perl-version-0.990.800
media-gfx/imagemagick[perl]
media-gfx/sane-backends
media-libs/tiff"
media-libs/tiff:0"
src_install() {
perl-module_src_install
dodoc History
}
my_optfeature() {
local desc=$1
shift
while (( $# )); do
if has_version "$1"; then
elog " [I] $1 - ${desc}"
else
elog " [ ] $1 - ${desc}"
fi
shift
done
}
pkg_postinst() {
elog "Optional dependencies:"
elog "app-text/cuneiform, app-text/gocr, app-text/tesseract" \
"(or OCRopus, not in Portage) - for OCR"
elog "app-text/unpaper - image post processing utility"
elog "dev-perl/Gtk2-Ex-PodViewer - for displaying help"
elog "app-text/djvu - DjVu support"
elog "media-gfx/sane-frontends - for ADF scanners"
elog "x11-misc/xdg-utils - required for email as PDF"
my_optfeature "for OCR support" \
app-text/gocr \
app-text/tesseract \
app-text/cuneiform
elog " [-] OCRopus for OCR support (not in Portage)"
my_optfeature "to post-process scans with unpaper" app-text/unpaper
my_optfeature "for sending to mail" x11-misc/xdg-utils
my_optfeature "to scan via ADF" media-gfx/sane-frontends
my_optfeature "to convert/scan to DJVU" app-text/djvu
my_optfeature "for displaying help" dev-perl/Gtk2-Ex-PodViewer
}

View File

@ -0,0 +1,72 @@
--- torbrowser-31.5.3.ebuild.orig 2015-03-25 07:59:29.997544495 +0100
+++ torbrowser-31.5.3.ebuild 2015-03-25 08:00:36.591382124 +0100
@@ -33,14 +33,21 @@
# BSD license applies to torproject-related code like the patches
# icons are under CCPL-Attribution-3.0
LICENSE="BSD CC-BY-3.0 MPL-2.0 GPL-2 LGPL-2.1"
-IUSE="hardened test"
+IUSE="hardened test linguas_de"
BASE_SRC_URI="https://dist.torproject.org/${PN}/${TOR_PV}"
SRC_URI="https://gitweb.torproject.org/tor-browser.git/snapshot/${GIT_TAG}.tar.gz -> ${GIT_TAG}.tar.gz
http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
http://dev.gentoo.org/~axs/distfiles/${PATCH}.tar.xz
- x86? ( ${BASE_SRC_URI}/tor-browser-linux32-${TOR_PV}_en-US.tar.xz )
- amd64? ( ${BASE_SRC_URI}/tor-browser-linux64-${TOR_PV}_en-US.tar.xz )"
+ !linguas_de? (
+ x86? ( ${BASE_SRC_URI}/tor-browser-linux32-${TOR_PV}_en-US.tar.xz )
+ amd64? ( ${BASE_SRC_URI}/tor-browser-linux64-${TOR_PV}_en-US.tar.xz )
+ )
+ linguas_de? (
+ x86? ( ${BASE_SRC_URI}/tor-browser-linux32-${TOR_PV}_de.tar.xz )
+ amd64? ( ${BASE_SRC_URI}/tor-browser-linux64-${TOR_PV}_de.tar.xz )
+ )
+"
ASM_DEPEND=">=dev-lang/yasm-1.1"
@@ -219,9 +226,15 @@
|| die
# see: https://gitweb.torproject.org/builders/tor-browser-bundle.git/tree/gitian/descriptors/linux/gitian-bundle.yml?h=maint-4.0#n148
- echo "pref(\"general.useragent.locale\", \"en-US\");" \
- >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
- || die
+ if use linguas_de ; then
+ echo "pref(\"general.useragent.locale\", \"de\");" \
+ >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
+ || die
+ else
+ echo "pref(\"general.useragent.locale\", \"en-US\");" \
+ >> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
+ || die
+ fi
MOZ_MAKE_FLAGS="${MAKEOPTS}" \
emake DESTDIR="${D}" install
@@ -260,7 +273,11 @@
# Profile without the tor-launcher extension
# see: https://trac.torproject.org/projects/tor/ticket/10160
- local profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default"
+ if use linguas_de ; then
+ local profile_dir="${WORKDIR}/tor-browser_de/Browser/TorBrowser/Data/Browser/profile.default"
+ else
+ local profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default"
+ fi
docompress -x "${EROOT}/usr/share/doc/${PF}/tor-launcher@torproject.org.xpi"
dodoc "${profile_dir}/extensions/tor-launcher@torproject.org.xpi"
@@ -276,7 +293,11 @@
# see: https://gitweb.torproject.org/builders/tor-browser-bundle.git/tree/RelativeLink/RelativeLink.sh?h=maint-4.0#n248
dodoc "${FILESDIR}/README.tor-launcher"
- dodoc "${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt"
+ if use linguas_de ; then
+ dodoc "${WORKDIR}/tor-browser_de/Browser/TorBrowser/Docs/ChangeLog.txt"
+ else
+ dodoc "${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt"
+ fi
}
pkg_preinst() {

View File

@ -3,8 +3,14 @@ AUX tor-browser.git-bccc144c21f6069a294038a6559ba46ceb8da2a2.patch 15904 SHA256
AUX torbrowser-24.3.0-allow-lightspark.patch 615 SHA256 904a090199d82d3fea3f96c2e077a08ea7e28ef46a4f4d1e7e6da936b08bafd1 SHA512 35772c3c716fe5004d3306591b9ab1612a78644cb272de473fbf0da91a19075e6a166bb97a8365065828de829dc3b68618a31820f3b0eb7399e2bfe008f797d8 WHIRLPOOL 75ed0e691d9bfb877a368b0946f3cf8007e3201456a47e6d2ddd9b3d295cf782347a8cac45f63242d1bf6cea3a1acdead3b9494d26f52387253fe490be6a598d
DIST firefox-31.0-patches-0.2.tar.xz 4636 SHA256 fdcd4e68093fb905af06cd89aad7042f8a4e695dea9c184351945fcb5872a062 SHA512 2fee84ac6027a1e1317470112df54fef411596a522bca756f82c525b13ba952015e71f2aa05a807fec04c3bd092e8cbebd0c2349e0dc4950b329a88811b00151 WHIRLPOOL 59dc5f3457dc2a0c0c83a0128063da00d127cee13487b112064368de7d98438b7ffeb1dfe362080eca6a82af4834f3e27c6bd887e51b5d59c728ae124b26114d
DIST tor-browser-31.5.0esr-4.0-1-build1.tar.gz 170142149 SHA256 75c39110209cb20d9b83782114edbf3d94e77fa4bf9c2ef0b79ebe8bc6100375 SHA512 d9b692cd5678ea96c3b62f630017057c07a9976fb11102d9f1bb489cf495e6ab890ebc36b756e6efc39b1837804c32efa72c76621bbad563ecb9954bcd61771b WHIRLPOOL d9432bb1dee8e39ba8bdaac252315f83d645cf2374789b2f7eb3f4453bb87b5a67422c3e6f92a81c007db17f6f9069e7f9023051073123c07178fc3fca3e9b5b
DIST tor-browser-31.5.3esr-4.0-1-build1.tar.gz 170134864 SHA256 346039cb3ca3cafb085c3bf01ef04a718dc27f48ad774b3f1e5bef85881ed3ca SHA512 8f73bb575d5f764fdf48c4324657966cb38c9f200148370b08d9bbab4b12869530baf6779eabd41f9cf2665a9ce24bb1d4f83b9fd7909577fc12677597ed5a3e WHIRLPOOL d7c0c2bf9d85b0cfc9f54f5e4a4f805e1b3811be8c9ec246a16e4067d0a2082777557a826619ff4ec22ebbfc53f3aab8a577f04a0c6bc9eff88b5a5030fd6826
DIST tor-browser-linux32-4.0.4_de.tar.xz 43232372 SHA256 954f630c426d3961253d99913926422c62804b9ed058e38ba39e622c670bc9f4 SHA512 1c16dbcf5faefafb9c3b5a93ca8fc85d1a6cdada233cd96ac63f96c110db188e39ee96ca822a8dde1e778fd748dc6a8741f27c698e136606da88c0e01bccaf56 WHIRLPOOL b2a49f38f965708956bd3a32f4a3d1e08d9cf87647bad49c2a62b090fc4923990977f5da1adfa612de7a67356ab17e0b4761836a75e61ebf4b1f88b6f9c9a4dc
DIST tor-browser-linux32-4.0.4_en-US.tar.xz 42884008 SHA256 f527b85a057ae402fa1dc84e6c175071e6448300cd2ebdd0d50494e1dd605185 SHA512 f5846b01d9b6bcac69c188bdb1d2d2fade86aec37c9f2216a6efcb8e95286cee9558acb5d2acf8fb1d36c11540ab460c3159d7f66f36d386d4c5e47e1da4fe16 WHIRLPOOL ae293d1fa156058b0f475c230723d8b3a7844ba50c98e3a21e0251d2e634802fde8facb56e28c8168e023d33dc75278e8421429de42bf9b7e8b06db8dd659e8c
DIST tor-browser-linux32-4.0.5_de.tar.xz 43294656 SHA256 b82fb144d928670c65a79efba03e6e3986028ef8f21f0dca6521391bf1eb97be SHA512 3ddc3be402a4af369fdde9ab2884fbb7e6d8cd67f16f0ed9ef9aaa25a3cc81cc85656c2a8dd229def3e88b7c4b8dd818e9fe925f3ffd15da9a7040d0c5f7e87e WHIRLPOOL d4358d65fdfe43d210b88453e1942fc46e008cb1c898d72869178e83658f359c9c59497c701e44a52b8e2b1f4d68e5748e297c3403a0fa1ccbc4c9c3416e15d9
DIST tor-browser-linux32-4.0.5_en-US.tar.xz 42954776 SHA256 c30c9897d3bf0056a36eafe5f5f8fe0c5e6b6077b5db1e62aed7503f07f992fa SHA512 74f3ed7addaaf3bd14fb018a862dd6406a3b4e595667ccb0c0e23f2877e29e9e5c5fcf24718b50b8ddb8ac88e428a877411487601a764afaf97c497ea449273a WHIRLPOOL e6822995c746cae94eb9d001848f24124a5bd30f911a4253e1bf3f0bb00fd69f6de3b7e717b695d92f64c9d934b4c70a189bf15799dc92b6c6c671424594f741
DIST tor-browser-linux64-4.0.4_de.tar.xz 42429892 SHA256 58942a6979ef817f6a645eeb6e1be869b4793ea64f59aec989de88fdae7b44ba SHA512 5d3341d82a15b1e65ef0160e358eadca239764c90e6b3d8b0526cbc97f20d3df1d359219791e33fb976c7d11a2ade2c4e529abed658c5dacb10ceed8ae01e294 WHIRLPOOL 61d82917e9a86ec1eaade3aa8abe6e6e401d53407cd61d061b11b8d84bcd39e149038edc1ea4788f64148c7f58cf6502addba900049ffb45ad88abd524dee411
DIST tor-browser-linux64-4.0.4_en-US.tar.xz 42068548 SHA256 0f0a07905daaf714322bc54cf25ed0e3b8ef91aeb937ab0df2d39010c9ee7b82 SHA512 8dbed4d037ad4927811089ce05c0411c71d6f7fb6614d9131a4554c00630a397b9c88ea31c0389ffb813297ed77a69ed158a2cc5186a7df8b0d8728b35e480ba WHIRLPOOL 40f93d1fb610095dd8762ffb41d5d989d5e357c7ddb8dd8a07b3dd87962988e25fe07de8fa5bbe995f8ca2f368f395dd6a0e0bcb12a43fe4a8cd8f48feeb51b2
DIST tor-browser-linux64-4.0.5_de.tar.xz 42484704 SHA256 d296e6798365498c3bf633bf7b964430a634618590c01b64f2bb45130b22376b SHA512 d645495f8c316422e49f8c550017f90da068d5394e97536085b485010e14a79c1d2e7dc3b06d9b56e4cc94312664b7d7fc9f3e21cc03348f33b823c385970297 WHIRLPOOL 0545b5fdc366d782771e6f4cd6119860ad968a298314f81200718a87b7f49b94b623ef332478c7a728d42c4835881ef03647524245216871cec8e6748ef01c04
DIST tor-browser-linux64-4.0.5_en-US.tar.xz 42136108 SHA256 e1f6f74e1c73e9830d488669d097d7f6720fd0b45f80bf07283382b99dc03b70 SHA512 c4a508d2bece3883dfc21bf566b6a9cfb82d3ef55182d0479786c72cad41aa098f871247fd379326ade2792dbc4591718f6f76f8c1ce5daa436946ae1f1b3c5b WHIRLPOOL bdc7402155c571384104ea833726b9ccdf9ec46b7900938e142243e85924596253da15dce4597927501691cbbeb30e2ed9b0eda2bf038ff42dd970448d5dfb0a
EBUILD torbrowser-31.5.0.ebuild 10670 SHA256 c27eccf48212314d182c47a19fce7bef3e1f3535ed59414b7d9aa5f7bdea5daa SHA512 2f7891db7e8cc613a240c9491c151ee5cefe56f2a37f9c9e55601b041d345c3fa071d68efb006700c265a9a4cd0c0bad0bc0a427035d92d31843a8c0b29d72f7 WHIRLPOOL abc0eb3003b4e22a0d9a0df1a663b1f944e8ae5a2f0657b54b824b5cb9c42c307606efb157d18cdb5729a5c522ed3a219233c4c75e4696efabc36f6c6aec0dd1
EBUILD torbrowser-31.5.3.ebuild 10670 SHA256 337d93d0bcf625639ca4d9cecbf8229fc7680e75aae0eb64866c185ddee5deb9 SHA512 1389a21dcd96ed28892c2a483b9764f824fb9c1d5d5c1b9833fe49cc6d2aecbf74537de495def959bb25557f12da21fbe1d172345ddfb24cd5dba0e98592e05f WHIRLPOOL 9c5e99cf5da660f498ec3d1fbdec5b5a1ee2747dc1938fdeff437fd0dfb0d7fcb816f229bf37d65302e47e3cdcd8820fcd82661ddb741439991a8a75a787d0ee

View File

@ -0,0 +1,329 @@
# Copyright 1999-2015 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: $
EAPI="5"
WANT_AUTOCONF="2.1"
MOZ_ESR="1"
MY_PN="firefox"
if [[ ${MOZ_ESR} == 1 ]]; then
# ESR releases have slightly version numbers
MOZ_PV="${PV}esr"
fi
# see https://gitweb.torproject.org/builders/tor-browser-bundle.git/tree/gitian/versions?h=maint-4.0
TOR_PV="4.0.5"
GIT_TAG="tor-browser-${MOZ_PV}-4.0-1-build1"
# Patch version
PATCH="${MY_PN}-31.0-patches-0.2"
MOZCONFIG_OPTIONAL_WIFI=1
MOZCONFIG_OPTIONAL_JIT="enabled"
inherit check-reqs flag-o-matic toolchain-funcs eutils gnome2-utils mozconfig-v5.31 multilib pax-utils autotools
DESCRIPTION="The Tor Browser"
HOMEPAGE="https://www.torproject.org/projects/torbrowser.html
https://gitweb.torproject.org/tor-browser.git"
KEYWORDS="~amd64 ~x86"
SLOT="0"
# BSD license applies to torproject-related code like the patches
# icons are under CCPL-Attribution-3.0
LICENSE="BSD CC-BY-3.0 MPL-2.0 GPL-2 LGPL-2.1"
IUSE="hardened test linguas_de"
BASE_SRC_URI="https://dist.torproject.org/${PN}/${TOR_PV}"
SRC_URI="https://gitweb.torproject.org/tor-browser.git/snapshot/${GIT_TAG}.tar.gz -> ${GIT_TAG}.tar.gz
http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.xz
http://dev.gentoo.org/~axs/distfiles/${PATCH}.tar.xz
!linguas_de? (
x86? ( ${BASE_SRC_URI}/tor-browser-linux32-${TOR_PV}_en-US.tar.xz )
amd64? ( ${BASE_SRC_URI}/tor-browser-linux64-${TOR_PV}_en-US.tar.xz )
)
linguas_de? (
x86? ( ${BASE_SRC_URI}/tor-browser-linux32-${TOR_PV}_de.tar.xz )
amd64? ( ${BASE_SRC_URI}/tor-browser-linux64-${TOR_PV}_de.tar.xz )
)
"
ASM_DEPEND=">=dev-lang/yasm-1.1"
CDEPEND=">=dev-libs/nss-3.17.1
>=dev-libs/nspr-4.10.6"
DEPEND="${CDEPEND}
amd64? ( ${ASM_DEPEND}
virtual/opengl )
x86? ( ${ASM_DEPEND}
virtual/opengl )"
QA_PRESTRIPPED="usr/$(get_libdir)/${PN}/${MY_PN}/firefox"
S="${WORKDIR}/${GIT_TAG}"
# See mozcoreconf-2.eclass
mozversion_is_new_enough() {
if [[ $(get_version_component_range 1) -ge 17 ]] ; then
return 0
fi
return 1
}
pkg_setup() {
moz_pkgsetup
# These should *always* be cleaned up anyway
unset DBUS_SESSION_BUS_ADDRESS \
DISPLAY \
ORBIT_SOCKETDIR \
SESSION_MANAGER \
XDG_SESSION_COOKIE \
XAUTHORITY
}
pkg_pretend() {
# Ensure we have enough disk space to compile
if use debug || use test ; then
CHECKREQS_DISK_BUILD="8G"
else
CHECKREQS_DISK_BUILD="4G"
fi
check-reqs_pkg_setup
if use jit && [[ -n ${PROFILE_IS_HARDENED} ]]; then
ewarn "You are emerging this package on a hardened profile with USE=jit enabled."
ewarn "This is horribly insecure as it disables all PAGEEXEC restrictions."
ewarn "Please ensure you know what you are doing. If you don't, please consider"
ewarn "emerging the package with USE=-jit"
fi
}
src_prepare() {
# Apply gentoo firefox patches
EPATCH_SUFFIX="patch" \
EPATCH_FORCE="yes" \
epatch "${WORKDIR}/firefox"
# Revert "Change the default Firefox profile directory to be TBB-relative"
epatch -R "${FILESDIR}/tor-browser.git-bccc144c21f6069a294038a6559ba46ceb8da2a2.patch"
# FIXME: https://trac.torproject.org/projects/tor/ticket/10925
# Except lightspark-plugin from blocklist
epatch "${FILESDIR}"/${PN}-24.3.0-allow-lightspark.patch
# Allow user to apply any additional patches without modifing ebuild
epatch_user
# Enable gnomebreakpad
if use debug ; then
sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
"${S}"/build/unix/run-mozilla.sh || die "sed failed!"
fi
# Ensure that our plugins dir is enabled as default
sed -i -e "s:/usr/lib/mozilla/plugins:/usr/lib/nsbrowser/plugins:" \
"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 32bit!"
sed -i -e "s:/usr/lib64/mozilla/plugins:/usr/lib64/nsbrowser/plugins:" \
"${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path for 64bit!"
# Fix sandbox violations during make clean, bug 372817
sed -e "s:\(/no-such-file\):${T}\1:g" \
-i "${S}"/config/rules.mk \
-i "${S}"/nsprpub/configure{.in,} \
|| die
# Don't exit with error when some libs are missing which we have in
# system.
sed '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' \
-i "${S}"/browser/installer/Makefile.in || die
# Don't error out when there's no files to be removed:
sed 's@\(xargs rm\)$@\1 -f@' \
-i "${S}"/toolkit/mozapps/installer/packager.mk || die
eautoreconf
# Must run autoconf in js/src
cd "${S}"/js/src || die
eautoconf
}
src_configure() {
MOZILLA_FIVE_HOME="${EPREFIX}"/usr/$(get_libdir)/${PN}/${MY_PN}
MEXTENSIONS="default"
####################################
#
# mozconfig, CFLAGS and CXXFLAGS setup
#
####################################
mozconfig_init
mozconfig_config
# Add full relro support for hardened
use hardened && append-ldflags "-Wl,-z,relro,-z,now"
mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
mozconfig_annotate '' --disable-mailnews
# Other ff-specific settings
mozconfig_annotate '' --with-default-mozilla-five-home=${MOZILLA_FIVE_HOME}
# Rename the install directory and the executable
mozconfig_annotate 'torbrowser' --libdir="${EPREFIX}"/usr/$(get_libdir)/${PN}
mozconfig_annotate 'torbrowser' --with-app-name=torbrowser
mozconfig_annotate 'torbrowser' --with-app-basename=torbrowser
# see https://gitweb.torproject.org/tor-browser.git/tree/configure.in?h=tor-browser-31.3.0esr-4.0-1#n6401
mozconfig_annotate 'torbrowser' --disable-tor-browser-update
mozconfig_annotate 'torbrowser' --with-tor-browser-version=${TOR_PV}
# Finalize and report settings
mozconfig_final
if [[ $(gcc-major-version) -lt 4 ]]; then
append-cxxflags -fno-stack-protector
elif [[ $(gcc-major-version) -gt 4 || $(gcc-minor-version) -gt 3 ]]; then
if use amd64 || use x86; then
append-flags -mno-avx
fi
fi
}
src_compile() {
CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" \
MOZ_MAKE_FLAGS="${MAKEOPTS}" SHELL="${SHELL}" \
emake -f client.mk
}
src_install() {
MOZILLA_FIVE_HOME="${EPREFIX}"/usr/$(get_libdir)/${PN}/${MY_PN}
DICTPATH="\"${EPREFIX}/usr/share/myspell\""
# MOZ_BUILD_ROOT, and hence OBJ_DIR change depending on arch, compiler etc.
local obj_dir="$(echo */config.log)"
obj_dir="${obj_dir%/*}"
cd "${S}/${obj_dir}" || die
# Pax mark xpcshell for hardened support, only used for startupcache creation.
pax-mark m "${S}/${obj_dir}"/dist/bin/xpcshell
# Add an emty default prefs for mozconfig-3.eclass
touch "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
|| die
# Set default path to search for dictionaries.
echo "pref(\"spellchecker.dictionary_path\", ${DICTPATH});" \
>> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/all-gentoo.js" \
|| die
# Disable adobe-flash by default
sed -i -e 's:pref("plugin.state.flash", 1);:pref("plugin.state.flash", 0);:g' \
"${S}/${obj_dir}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
|| die
# see: https://gitweb.torproject.org/builders/tor-browser-bundle.git/tree/gitian/descriptors/linux/gitian-bundle.yml?h=maint-4.0#n148
if use linguas_de ; then
echo "pref(\"general.useragent.locale\", \"de\");" \
>> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
|| die
else
echo "pref(\"general.useragent.locale\", \"en-US\");" \
>> "${S}/${obj_dir}/dist/bin/browser/defaults/preferences/000-tor-browser.js" \
|| die
fi
MOZ_MAKE_FLAGS="${MAKEOPTS}" \
emake DESTDIR="${D}" install
# Install icons and .desktop for menu entry
local size sizes icon_path
sizes="16 24 32 48 256"
icon_path="${S}/browser/branding/official"
for size in ${sizes}; do
newicon -s ${size} "${icon_path}/default${size}.png" ${PN}.png
done
# The 128x128 icon has a different name
newicon -s 128 "${icon_path}/mozicon128.png" ${PN}.png
make_desktop_entry ${PN} "TorBrowser" ${PN} "Network;WebBrowser"
# Add StartupNotify=true bug 237317
if use startup-notification ; then
echo "StartupNotify=true" \
>> "${ED}/usr/share/applications/${PN}-${PN}.desktop" \
|| die
fi
# Required in order to use plugins and even run torbrowser on hardened.
pax-mark m "${ED}"${MOZILLA_FIVE_HOME}/plugin-container
# Required in order for jit to work on hardened, as of torbroser-31
use jit && pax-mark pm "${ED}"${MOZILLA_FIVE_HOME}/{torbrowser,torbrowser-bin}
# We dont want development files
rm -r "${ED}"/usr/include "${ED}${MOZILLA_FIVE_HOME}"/{idl,include,lib,sdk} \
|| die "Failed to remove sdk and headers"
# revdep-rebuild entry
insinto /etc/revdep-rebuild
echo "SEARCH_DIRS_MASK=${MOZILLA_FIVE_HOME}" >> ${T}/10${PN}
doins "${T}"/10${PN} || die
# Profile without the tor-launcher extension
# see: https://trac.torproject.org/projects/tor/ticket/10160
if use linguas_de ; then
local profile_dir="${WORKDIR}/tor-browser_de/Browser/TorBrowser/Data/Browser/profile.default"
else
local profile_dir="${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Data/Browser/profile.default"
fi
docompress -x "${EROOT}/usr/share/doc/${PF}/tor-launcher@torproject.org.xpi"
dodoc "${profile_dir}/extensions/tor-launcher@torproject.org.xpi"
rm "${profile_dir}/extensions/tor-launcher@torproject.org.xpi" || die "Failed to remove torlauncher extension"
# Force remote Tor check since the control port might not be available
echo "pref(\"extensions.torbutton.local_tor_check\", false);" \
>> "${profile_dir}/preferences/extension-overrides.js" \
|| die
insinto ${MOZILLA_FIVE_HOME}/browser/defaults/profile
doins -r "${profile_dir}"/{extensions,preferences,bookmarks.html}
# see: https://gitweb.torproject.org/builders/tor-browser-bundle.git/tree/RelativeLink/RelativeLink.sh?h=maint-4.0#n248
dodoc "${FILESDIR}/README.tor-launcher"
if use linguas_de ; then
dodoc "${WORKDIR}/tor-browser_de/Browser/TorBrowser/Docs/ChangeLog.txt"
else
dodoc "${WORKDIR}/tor-browser_en-US/Browser/TorBrowser/Docs/ChangeLog.txt"
fi
}
pkg_preinst() {
gnome2_icon_savelist
}
pkg_postinst() {
echo
ewarn "This patched firefox build is _NOT_ recommended by Tor upstream but uses"
ewarn "the exact same sources. Use this only if you know what you are doing!"
echo
elog "Torbrowser uses port 9150 to connect to Tor. You can change the port"
elog "in the connection settings to match your setup."
echo
if [[ "${REPLACING_VERSIONS}" ]] && [[ "${REPLACING_VERSIONS}" < "31.2.0" ]]; then
echo
ewarn "Since this is a major upgrade, you need to start with a fresh profile."
ewarn "Either move or remove your profile in \"~/.mozilla/torbrowser/\""
ewarn "and let Torbrowser generate a new one."
echo
fi
gnome2_icon_cache_update
}
pkg_postrm() {
gnome2_icon_cache_update
}