Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/gegl/files/, media-libs/gegl/
Date: Mon, 20 Jan 2020 13:03:29
Message-Id: 1579525390.e5106d923c2d796469a4da6e0e8d5524cf958126.juippis@gentoo
1 commit: e5106d923c2d796469a4da6e0e8d5524cf958126
2 Author: band-a-prend <torokhov-s-a <AT> yandex <DOT> ru>
3 AuthorDate: Sun Jan 19 07:02:27 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Mon Jan 20 13:03:10 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e5106d92
7
8 media-libs/gegl: Fix compilation error due to non-ascii symbols
9
10 This patch force using utf8 while reading files on converting .cl files
11 to .h files in env where for some reasons sandbox system codepage isn't utf8.
12
13 The patch provides compatibility both with python2.7 and python3.x.
14 When python2.7 support will be dropped the addition of
15 from __future__ import unicode_literals
16 import io
17 and "io."
18 could be removed as not neccessary for python3.x.
19
20 Closes: https://bugs.gentoo.org/705286
21 Signed-off-by: Sergey Torokhov <torokhov-s-a <AT> yandex.ru>
22 Closes: https://github.com/gentoo/gentoo/pull/14387
23 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
24
25 .../files/gegl-0.4.18-cltostring_force_utf8.patch | 30 ++++++++++++++++++++++
26 media-libs/gegl/gegl-0.4.18.ebuild | 5 ++--
27 2 files changed, 33 insertions(+), 2 deletions(-)
28
29 diff --git a/media-libs/gegl/files/gegl-0.4.18-cltostring_force_utf8.patch b/media-libs/gegl/files/gegl-0.4.18-cltostring_force_utf8.patch
30 new file mode 100644
31 index 00000000000..ecb1be4c735
32 --- /dev/null
33 +++ b/media-libs/gegl/files/gegl-0.4.18-cltostring_force_utf8.patch
34 @@ -0,0 +1,30 @@
35 +--- a/opencl/cltostring.py 2019-10-27 02:01:07.000000000 +0300
36 ++++ b/opencl/cltostring.py 2020-01-12 21:22:25.000000000 +0300
37 +@@ -1,8 +1,10 @@
38 + #!/usr/bin/env python
39 + from __future__ import print_function
40 ++from __future__ import unicode_literals
41 +
42 + import os
43 + import sys
44 ++import io
45 +
46 + # Search for lines that look like #include "blah.h" and replace them
47 + # with the contents of blah.h.
48 +@@ -34,12 +36,12 @@
49 +
50 +
51 + if len(sys.argv) == 2:
52 +- infile = open(sys.argv[1], "r")
53 +- outfile = open(sys.argv[1] + '.h', "w")
54 ++ infile = io.open(sys.argv[1], "r", encoding="utf-8")
55 ++ outfile = io.open(sys.argv[1] + '.h', "w", encoding="utf-8")
56 +
57 + elif len(sys.argv) == 3:
58 +- infile = open(sys.argv[1], "r")
59 +- outfile = open(sys.argv[2], "w")
60 ++ infile = io.open(sys.argv[1], "r", encoding="utf-8")
61 ++ outfile = io.open(sys.argv[2], "w", encoding="utf-8")
62 +
63 + else:
64 + print("Usage: %s input [output]" % sys.argv[0])
65
66 diff --git a/media-libs/gegl/gegl-0.4.18.ebuild b/media-libs/gegl/gegl-0.4.18.ebuild
67 index f2c662e0cba..56b18bcd87a 100644
68 --- a/media-libs/gegl/gegl-0.4.18.ebuild
69 +++ b/media-libs/gegl/gegl-0.4.18.ebuild
70 @@ -82,9 +82,10 @@ BDEPEND="
71 DOCS=( AUTHORS docs/ChangeLog docs/NEWS.txt )
72
73 PATCHES=(
74 - "${FILESDIR}"/${PN}-0.4.18-drop-failing-tests.patch
75 - "${FILESDIR}"/${PN}-0.4.18-program-suffix.patch
76 + "${FILESDIR}"/${P}-drop-failing-tests.patch
77 + "${FILESDIR}"/${P}-program-suffix.patch
78 "${FILESDIR}"/${P}-meson_cpu_detection.patch
79 + "${FILESDIR}"/${P}-cltostring_force_utf8.patch
80 )
81
82 python_check_deps() {