diff options
author | Rémi Cardona <remi@gentoo.org> | 2014-08-17 23:03:08 +0000 |
---|---|---|
committer | Rémi Cardona <remi@gentoo.org> | 2014-08-17 23:03:08 +0000 |
commit | bfe95bd4de585ae52bc8169775c3a9fd61a8a938 (patch) | |
tree | e26fb9e8792fdf4a8bbd5f38449c494c0a8b2723 /x11-apps | |
parent | Keyword ~ppc ~ppc64, bug #513108 (diff) | |
download | gentoo-2-bfe95bd4de585ae52bc8169775c3a9fd61a8a938.tar.gz gentoo-2-bfe95bd4de585ae52bc8169775c3a9fd61a8a938.tar.bz2 gentoo-2-bfe95bd4de585ae52bc8169775c3a9fd61a8a938.zip |
x11-apps/intel-gpu-tools: Fix python script to handle non-UTF-8 locales
(Portage version: 2.2.12/cvs/Linux x86_64, unsigned Manifest commit)
Diffstat (limited to 'x11-apps')
3 files changed, 46 insertions, 2 deletions
diff --git a/x11-apps/intel-gpu-tools/ChangeLog b/x11-apps/intel-gpu-tools/ChangeLog index 2d136a83de95..3bc9dc8c173f 100644 --- a/x11-apps/intel-gpu-tools/ChangeLog +++ b/x11-apps/intel-gpu-tools/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for x11-apps/intel-gpu-tools # Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/x11-apps/intel-gpu-tools/ChangeLog,v 1.18 2014/08/01 22:00:34 remi Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-apps/intel-gpu-tools/ChangeLog,v 1.19 2014/08/17 23:03:08 remi Exp $ + + 17 Aug 2014; Rémi Cardona <remi@gentoo.org> intel-gpu-tools-1.7.ebuild, + +files/intel-gpu-tools-1.7-shader-debugger-Force-file-stdout-IO-as-UTF-8.patc + h: + Fix python script to handle non-UTF-8 locales, see bug #519434. 01 Aug 2014; Rémi Cardona <remi@gentoo.org> intel-gpu-tools-1.7.ebuild: Add missing pkg_setup for proper python-single-r1 use. See bug #518538. diff --git a/x11-apps/intel-gpu-tools/files/intel-gpu-tools-1.7-shader-debugger-Force-file-stdout-IO-as-UTF-8.patch b/x11-apps/intel-gpu-tools/files/intel-gpu-tools-1.7-shader-debugger-Force-file-stdout-IO-as-UTF-8.patch new file mode 100644 index 000000000000..3b87f69ac590 --- /dev/null +++ b/x11-apps/intel-gpu-tools/files/intel-gpu-tools-1.7-shader-debugger-Force-file-stdout-IO-as-UTF-8.patch @@ -0,0 +1,37 @@ +From e9e9df216180bcecc5d4c17bbe48b2efd88b3ed2 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?R=C3=A9mi=20Cardona?= <remi@gentoo.org> +Date: Mon, 18 Aug 2014 00:44:32 +0200 +Subject: [PATCH] shader-debugger: Force file/stdout IO as UTF-8 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Not all locales on linux are UTF-8, the most notable being the C locale. +Python will use the ASCII codec for stream IO in this case and will barf +on the Copyright sign at the top of .g4a files. + +Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=519434 +Signed-off-by: Rémi Cardona <remi@gentoo.org> +--- + debugger/system_routine/pre_cpp.py | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/debugger/system_routine/pre_cpp.py b/debugger/system_routine/pre_cpp.py +index effea0e..584d2af 100755 +--- a/debugger/system_routine/pre_cpp.py ++++ b/debugger/system_routine/pre_cpp.py +@@ -33,7 +33,10 @@ + + import sys,re + +-file = open(sys.argv[1], "r") ++# make sure both input file and stdout are handled as utf-8 text, regardless ++# of current locale (eg. LANG=C which tells python to use ascii encoding) ++sys.stdout = open(sys.__stdout__.fileno(), "a", encoding="utf-8") ++file = open(sys.argv[1], "r", encoding="utf-8") + + lines = file.readlines() + len(lines) +-- +2.0.4 + diff --git a/x11-apps/intel-gpu-tools/intel-gpu-tools-1.7.ebuild b/x11-apps/intel-gpu-tools/intel-gpu-tools-1.7.ebuild index bffc13a2c858..5633ccfb0fba 100644 --- a/x11-apps/intel-gpu-tools/intel-gpu-tools-1.7.ebuild +++ b/x11-apps/intel-gpu-tools/intel-gpu-tools-1.7.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2014 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/x11-apps/intel-gpu-tools/intel-gpu-tools-1.7.ebuild,v 1.3 2014/08/01 22:00:34 remi Exp $ +# $Header: /var/cvsroot/gentoo-x86/x11-apps/intel-gpu-tools/intel-gpu-tools-1.7.ebuild,v 1.4 2014/08/17 23:03:08 remi Exp $ EAPI=5 @@ -21,6 +21,8 @@ DEPEND="dev-libs/glib:2 python? ( ${PYTHON_DEPS} )" RDEPEND="${DEPEND}" +PATCHES=( "${FILESDIR}/${P}-shader-debugger-Force-file-stdout-IO-as-UTF-8.patch" ) + pkg_setup() { use python && python-single-r1_pkg_setup } |