commit:     23b7a081b5d8f52330a3a9950d4fb6c3494e4fb5
Author:     YOSHIOKA Takuma <lo48576 <AT> hard-wi <DOT> red>
AuthorDate: Wed Jan 20 12:26:01 2021 +0000
Commit:     YOSHIOKA Takuma <lo48576 <AT> hard-wi <DOT> red>
CommitDate: Wed Jan 20 12:26:01 2021 +0000
URL:        https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=23b7a081

media-gfx/silicon: Apply a patch to unblock python 3.9

Package-Manager: Portage-3.0.14, Repoman-3.0.2
Signed-off-by: YOSHIOKA Takuma <lo48576 <AT> hard-wi.red>

 .../silicon/files/rust-xcb-0.8.2-python-3.9.patch  | 43 ++++++++++++++++++++++
 media-gfx/silicon/silicon-0.4.0.ebuild             | 14 ++++---
 2 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/media-gfx/silicon/files/rust-xcb-0.8.2-python-3.9.patch 
b/media-gfx/silicon/files/rust-xcb-0.8.2-python-3.9.patch
new file mode 100644
index 00000000..a7e346d8
--- /dev/null
+++ b/media-gfx/silicon/files/rust-xcb-0.8.2-python-3.9.patch
@@ -0,0 +1,43 @@
+From b41c79a73069160af5290c328acecd499f5d216a Mon Sep 17 00:00:00 2001
+From: Michel Alexandre Salim <[email protected]>
+Date: Mon, 8 Jun 2020 22:59:11 -0700
+Subject: [PATCH] Use `ElementTree` instead of `cElementTree`
+
+`cElementTree` has been deprecated since Python 3.3; `ElementTree` will use a 
fast implementation whenever available.
+
+`cElementTree` is actually removed as of Python 3.9 beta 1, and on Python 3.8 
it's an alias to `ElementTree`.
+
+See https://docs.python.org/3.8/library/xml.etree.elementtree.html
+
+Signed-off-by: Michel Alexandre Salim <[email protected]>
+---
+ xcbgen/matcher.py | 2 +-
+ xcbgen/state.py   | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/xcbgen/matcher.py b/xcbgen/matcher.py
+index bfa315eb..97ae5f9f 100644
+--- a/xcbgen/matcher.py
++++ b/xcbgen/matcher.py
+@@ -7,7 +7,7 @@
+ '''
+ 
+ from os.path import join
+-from xml.etree.cElementTree import parse
++from xml.etree.ElementTree import parse
+ 
+ from xcbgen.xtypes import *
+ 
+diff --git a/xcbgen/state.py b/xcbgen/state.py
+index 1f5479e9..95af5a40 100644
+--- a/xcbgen/state.py
++++ b/xcbgen/state.py
+@@ -2,7 +2,7 @@
+ This module contains the namespace class and the singleton module class.
+ '''
+ from os.path import dirname, basename
+-from xml.etree.cElementTree import parse
++from xml.etree.ElementTree import parse
+ 
+ from xcbgen import matcher
+ from xcbgen.error import *

diff --git a/media-gfx/silicon/silicon-0.4.0.ebuild 
b/media-gfx/silicon/silicon-0.4.0.ebuild
index e5356468..0f5b4d79 100644
--- a/media-gfx/silicon/silicon-0.4.0.ebuild
+++ b/media-gfx/silicon/silicon-0.4.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2017-2020 Gentoo Authors
+# Copyright 2017-2021 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # Auto-Generated by cargo-ebuild 0.3.1
@@ -188,11 +188,8 @@ LICENSE="Apache-2.0 Boost-1.0 BSD-2 CC0-1.0 MIT MPL-2.0 
ZLIB"
 SLOT="0"
 KEYWORDS="~amd64 ~x86"
 
-# Python 3.9 cannot be used for now.
-# See <https://github.com/rtbo/rust-xcb/issues/84>
-# (fixed but not yet released).
 BDEPEND="
-       <dev-lang/python-3.9
+       dev-lang/python
        virtual/pkgconfig"
 DEPEND="
        media-libs/fontconfig
@@ -201,6 +198,13 @@ DEPEND="
 RDEPEND="${DEPEND}
        x11-misc/xclip"
 
+src_unpack() {
+       cargo_src_unpack
+
+       # Apply patch <https://github.com/rtbo/rust-xcb/pull/87> for python 3.9 
support.
+       ( cd "${WORKDIR}"/cargo_home/gentoo/xcb-0.8.2 && eapply 
"${FILESDIR}"/rust-xcb-0.8.2-python-3.9.patch )
+}
+
 src_install() {
        cargo_src_install
 

Reply via email to