diff options
author | Justin Lecher <jlec@gentoo.org> | 2012-05-14 10:54:57 +0000 |
---|---|---|
committer | Justin Lecher <jlec@gentoo.org> | 2012-05-14 10:54:57 +0000 |
commit | 84a4eb7dcdd18b84ae085c96881076d0bc89cb8d (patch) | |
tree | 99ea116959d4677137df933a150c14c94c3224b3 /net-im | |
parent | punt old, fails to compile with glib 2.31 and higher (diff) | |
download | gentoo-2-84a4eb7dcdd18b84ae085c96881076d0bc89cb8d.tar.gz gentoo-2-84a4eb7dcdd18b84ae085c96881076d0bc89cb8d.tar.bz2 gentoo-2-84a4eb7dcdd18b84ae085c96881076d0bc89cb8d.zip |
net-im/gajim: Update SA48695 patch with changesets f6f78f3802c07736cb63b3e696778dabe8263cbb and f046e4aaf7d49b2934622db66da1667ddddb1703; #415891
(Portage version: 2.2.0_alpha104/cvs/Linux x86_64)
Diffstat (limited to 'net-im')
-rw-r--r-- | net-im/gajim/ChangeLog | 9 | ||||
-rw-r--r-- | net-im/gajim/files/gajim-0.15-SA48695-2.patch | 132 | ||||
-rw-r--r-- | net-im/gajim/gajim-0.15-r2.ebuild | 103 |
3 files changed, 243 insertions, 1 deletions
diff --git a/net-im/gajim/ChangeLog b/net-im/gajim/ChangeLog index ce37a9fefc5b..af81c5ae5a9e 100644 --- a/net-im/gajim/ChangeLog +++ b/net-im/gajim/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for net-im/gajim # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/net-im/gajim/ChangeLog,v 1.140 2012/05/10 19:30:34 ranger Exp $ +# $Header: /var/cvsroot/gentoo-x86/net-im/gajim/ChangeLog,v 1.141 2012/05/14 10:54:57 jlec Exp $ + +*gajim-0.15-r2 (14 May 2012) + + 14 May 2012; Justin Lecher <jlec@gentoo.org> +gajim-0.15-r2.ebuild, + +files/gajim-0.15-SA48695-2.patch: + Update SA48695 patch with changesets f6f78f3802c07736cb63b3e696778dabe8263cbb + and f046e4aaf7d49b2934622db66da1667ddddb1703; #415891 10 May 2012; Brent Baude <ranger@gentoo.org> gajim-0.15-r1.ebuild: Marking gajim-0.15-r1 ppc64 for bug 412215 diff --git a/net-im/gajim/files/gajim-0.15-SA48695-2.patch b/net-im/gajim/files/gajim-0.15-SA48695-2.patch new file mode 100644 index 000000000000..b8e5f192b48b --- /dev/null +++ b/net-im/gajim/files/gajim-0.15-SA48695-2.patch @@ -0,0 +1,132 @@ + src/common/latex.py | 52 ++++++++++++++++++++++++++++++-------------------- + 1 files changed, 31 insertions(+), 21 deletions(-) + +diff --git a/src/common/latex.py b/src/common/latex.py +index 7567eb6..cedf2f1 100644 +--- a/src/common/latex.py ++++ b/src/common/latex.py +@@ -29,7 +29,7 @@ + + import os + import random +-from tempfile import gettempdir ++from tempfile import mkstemp, mkdtemp + from subprocess import Popen, PIPE + + import logging +@@ -57,11 +57,6 @@ def check_blacklist(str_): + return True + return False + +-def get_tmpfile_name(): +- random.seed() +- int_ = random.randint(0, 100) +- return os.path.join(gettempdir(), 'gajimtex_' + int_.__str__()) +- + def write_latex(filename, str_): + texstr = '\\documentclass[12pt]{article}\\usepackage[dvips]{graphicx}' + texstr += '\\usepackage{amsmath}\\usepackage{amssymb}' +@@ -78,12 +73,13 @@ def write_latex(filename, str_): + # a wrapper for Popen so that no window gets opened on Windows + # (i think this is the reason we're using Popen rather than just system()) + # stdout goes to a pipe so that it can be read +-def popen_nt_friendly(command): ++def popen_nt_friendly(command, directory): + if os.name == 'nt': + # CREATE_NO_WINDOW +- return Popen(command, creationflags=0x08000000, cwd=gettempdir(), stdout=PIPE) ++ return Popen(command, creationflags=0x08000000, cwd=directory, ++ stdout=PIPE) + else: +- return Popen(command, cwd=gettempdir(), stdout=PIPE) ++ return Popen(command, cwd=directory, stdout=PIPE) + + def check_for_latex_support(): + """ +@@ -99,16 +95,16 @@ def check_for_latex_support(): + except LatexError: + return False + +-def try_run(argv): ++def try_run(argv, directory): + try: +- p = popen_nt_friendly(argv) ++ p = popen_nt_friendly(argv, directory) + out = p.communicate()[0] + log.info(out) + return p.wait() + except Exception, e: + return _('Error executing "%(command)s": %(error)s') % { +- 'command': " ".join(argv), +- 'error': helpers.decode_string(str(e))} ++ 'command': " ".join(argv), ++ 'error': helpers.decode_string(str(e))} + + + def latex_to_image(str_): +@@ -124,32 +120,41 @@ def latex_to_image(str_): + return [] + except AttributeError: + # interface may not be available when we test latext at startup +- return ['-fg', 'rgb 0.0 0.0 0.0'] ++ return {'hex': ['+level-colors', '0x000000'], ++ 'tex': ['-fg', 'rgb 0.0 0.0 0.0']}[fmt] + + # filter latex code with bad commands + if check_blacklist(str_): + # we triggered the blacklist, immediately return None + return None + +- tmpfile = get_tmpfile_name() ++ try: ++ tmpdir = mkdtemp(prefix='gajimtex') ++ tmppng = mkstemp(prefix='gajim_tex', suffix='.png')[1] ++ except Exception: ++ raise LatexError('could not securely create one or more temporary files' ++ ' for LaTeX conversion') ++ ++ tmpfile = os.path.join(tmpdir, 'gajim_tex') + + # build latex string +- write_latex(os.path.join(tmpfile + '.tex'), str_) ++ write_latex(tmpfile + '.tex', str_) + + # convert TeX to dvi +- exitcode = try_run(['latex', '--interaction=nonstopmode', +- tmpfile + '.tex']) ++ exitcode = try_run(['latex', '--interaction=nonstopmode', tmpfile + '.tex'], ++ tmpdir) + + if exitcode == 0: + # convert dvi to png + latex_png_dpi = gajim.config.get('latex_png_dpi') + exitcode = try_run(['dvipng'] + fg_str('tex') + ['-T', 'tight', '-D', +- latex_png_dpi, tmpfile + '.dvi', '-o', tmpfile + '.png']) ++ latex_png_dpi, tmpfile + '.dvi', '-o', tmpfile + '.png'], tmpdir) + + if exitcode: + # dvipng failed, try convert + exitcode = try_run(['convert'] + fg_str('hex') + ['-trim', +- '-density', latex_png_dpi, tmpfile + '.dvi', tmpfile + '.png']) ++ '-density', latex_png_dpi, tmpfile + '.dvi', tmpfile + '.png'], ++ tmpdir) + + # remove temp files created by us and TeX + extensions = ['.tex', '.log', '.aux', '.dvi'] +@@ -159,10 +164,15 @@ def latex_to_image(str_): + except Exception: + pass + ++ if exitcode == 0: ++ os.rename(tmpfile + '.png', tmppng) ++ ++ os.rmdir(tmpdir) ++ + if isinstance(exitcode, (unicode, str)): + raise LatexError(exitcode) + + if exitcode == 0: +- result = tmpfile + '.png' ++ result = tmppng + + return result diff --git a/net-im/gajim/gajim-0.15-r2.ebuild b/net-im/gajim/gajim-0.15-r2.ebuild new file mode 100644 index 000000000000..c76a4284b1b4 --- /dev/null +++ b/net-im/gajim/gajim-0.15-r2.ebuild @@ -0,0 +1,103 @@ +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-im/gajim/gajim-0.15-r2.ebuild,v 1.1 2012/05/14 10:54:57 jlec Exp $ + +EAPI=4 + +PYTHON_DEPEND="2" +PYTHON_USE_WITH="sqlite xml" + +inherit autotools eutils python versionator + +DESCRIPTION="Jabber client written in PyGTK" +HOMEPAGE="http://www.gajim.org/" +SRC_URI="http://www.gajim.org/downloads/$(get_version_component_range 1-2)/${P}.tar.bz2" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd" +IUSE="avahi crypt dbus gmail gnome kde idle jingle libnotify networkmanager nls spell srv X xhtml" + +REQUIRED_USE=" + libnotify? ( dbus ) + avahi? ( dbus )" + +COMMON_DEPEND=" + dev-python/pygtk:2 + x11-libs/gtk+:2" +DEPEND="${COMMON_DEPEND} + >=dev-util/intltool-0.40.1 + virtual/pkgconfig + >=sys-devel/gettext-0.17-r1" +RDEPEND="${COMMON_DEPEND} + dev-python/pyasn1 + dev-python/pyopenssl + crypt? ( + app-crypt/gnupg + dev-python/pycrypto + ) + dbus? ( + dev-python/dbus-python + dev-libs/dbus-glib + libnotify? ( dev-python/notify-python ) + avahi? ( net-dns/avahi[dbus,gtk,python] ) + ) + gmail? ( net-dns/bind-tools ) + gnome? ( + dev-python/libgnome-python + dev-python/gnome-keyring-python + dev-python/egg-python + ) + idle? ( x11-libs/libXScrnSaver ) + jingle? ( net-libs/farsight2[python] ) + kde? ( kde-base/kwallet ) + networkmanager? ( + dev-python/dbus-python + net-misc/networkmanager + ) + srv? ( + || ( + dev-python/libasyncns-python + net-dns/bind-tools ) + ) + spell? ( app-text/gtkspell:2 ) + xhtml? ( dev-python/docutils )" + +pkg_setup() { + python_set_active_version 2 + python_pkg_setup +} + +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-plugin.patch \ + "${FILESDIR}"/${P}-SA48695-2.patch \ + "${FILESDIR}"/0.14-python-version.patch \ + "${FILESDIR}"/0.14.1-testing.patch + echo '#!/bin/sh' > config/py-compile + eautoreconf +} + +src_configure() { + econf \ + $(use_enable nls) \ + $(use_with X x) \ + --docdir="/usr/share/doc/${PF}" \ + --libdir="$(python_get_sitedir)" \ + --enable-site-packages +} + +src_install() { + default + + rm "${D}/usr/share/doc/${PF}/README.html" || die + dohtml README.html +} + +pkg_postinst() { + python_mod_optimize ${PN} +} + +pkg_postrm() { + python_mod_cleanup ${PN} +} |