diff options
author | Richard Leitner <richard.leitner@skidata.com> | 2020-10-30 14:45:51 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-11-12 13:07:52 +0000 |
commit | 75e33acd40fe4b160af6c2949cefcc02a2bf49e3 (patch) | |
tree | dd5af4f286073568c3df4f6c182aab05fbeb8c6b /meta/recipes-graphics | |
parent | 40e448301edf142dc00a0ae6190017adac1e57b2 (diff) | |
download | poky-75e33acd40fe4b160af6c2949cefcc02a2bf49e3.tar.gz |
xcb-proto: backport fix for python gcd function
This backports the fix [1] for the following build error for nativesdk on
Fedora 33 which is caused by the removal of fractions.gcd() in favor of
math.gcd() in python 3.9 [2]:
ImportError: cannot import name 'gcd' from 'fractions' (/usr/lib64/python3.9/fractions.py)
[1] https://gitlab.freedesktop.org/xorg/proto/xcbproto/-/commit/426ae35bee1fa0fdb8b5120b1dcd20cee6e34512
[2] https://bugs.python.org/issue39350
(From OE-Core rev: 0f688c1419b1e2dfddff3c985f89a3f1949fc9fb)
Signed-off-by: Richard Leitner <richard.leitner@skidata.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-graphics')
-rw-r--r-- | meta/recipes-graphics/xorg-proto/xcb-proto/0001-xcbgen-use-math-gcd-for-python-3-5.patch | 40 | ||||
-rw-r--r-- | meta/recipes-graphics/xorg-proto/xcb-proto_1.13.bb | 3 |
2 files changed, 42 insertions, 1 deletions
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto/0001-xcbgen-use-math-gcd-for-python-3-5.patch b/meta/recipes-graphics/xorg-proto/xcb-proto/0001-xcbgen-use-math-gcd-for-python-3-5.patch new file mode 100644 index 0000000000..f9f4424da5 --- /dev/null +++ b/meta/recipes-graphics/xorg-proto/xcb-proto/0001-xcbgen-use-math-gcd-for-python-3-5.patch | |||
@@ -0,0 +1,40 @@ | |||
1 | From 426ae35bee1fa0fdb8b5120b1dcd20cee6e34512 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= <besser82@fedoraproject.org> | ||
3 | Date: Mon, 1 Jun 2020 12:24:16 +0200 | ||
4 | Subject: [PATCH] xcbgen: Use math.gcd() for Python >= 3.5. | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | fractions.gcd() has been deprecated since Python 3.5, and | ||
10 | was finally dropped in Python 3.9. It is recommended to | ||
11 | use math.gcd() instead. | ||
12 | |||
13 | Signed-off-by: Björn Esser <besser82@fedoraproject.org> | ||
14 | Upstream-Status: Backport [https://gitlab.freedesktop.org/xorg/proto/xcbproto/-/commit/426ae35bee1fa0fdb8b5120b1dcd20cee6e34512] | ||
15 | Signed-off-by: Richard Leitner <richard.leitner@skidata.com> | ||
16 | --- | ||
17 | xcbgen/align.py | 7 ++++++- | ||
18 | 1 file changed, 6 insertions(+), 1 deletion(-) | ||
19 | |||
20 | diff --git a/xcbgen/align.py b/xcbgen/align.py | ||
21 | index d4c12ee..5c4f517 100644 | ||
22 | --- a/xcbgen/align.py | ||
23 | +++ b/xcbgen/align.py | ||
24 | @@ -2,7 +2,12 @@ | ||
25 | This module contains helper classes for alignment arithmetic and checks | ||
26 | ''' | ||
27 | |||
28 | -from fractions import gcd | ||
29 | +from sys import version_info | ||
30 | + | ||
31 | +if version_info[:2] >= (3, 5): | ||
32 | + from math import gcd | ||
33 | +else: | ||
34 | + from fractions import gcd | ||
35 | |||
36 | class Alignment(object): | ||
37 | |||
38 | -- | ||
39 | GitLab | ||
40 | |||
diff --git a/meta/recipes-graphics/xorg-proto/xcb-proto_1.13.bb b/meta/recipes-graphics/xorg-proto/xcb-proto_1.13.bb index 7467090920..1f41821302 100644 --- a/meta/recipes-graphics/xorg-proto/xcb-proto_1.13.bb +++ b/meta/recipes-graphics/xorg-proto/xcb-proto_1.13.bb | |||
@@ -11,7 +11,8 @@ LICENSE = "MIT" | |||
11 | LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7 \ | 11 | LIC_FILES_CHKSUM = "file://COPYING;md5=d763b081cb10c223435b01e00dc0aba7 \ |
12 | file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65" | 12 | file://src/dri2.xml;beginline=2;endline=28;md5=f8763b13ff432e8597e0d610cf598e65" |
13 | 13 | ||
14 | SRC_URI = "http://xcb.freedesktop.org/dist/${BP}.tar.bz2" | 14 | SRC_URI = "http://xcb.freedesktop.org/dist/${BP}.tar.bz2 \ |
15 | file://0001-xcbgen-use-math-gcd-for-python-3-5.patch" | ||
15 | SRC_URI[md5sum] = "abe9aa4886138150bbc04ae4f29b90e3" | 16 | SRC_URI[md5sum] = "abe9aa4886138150bbc04ae4f29b90e3" |
16 | SRC_URI[sha256sum] = "7b98721e669be80284e9bbfeab02d2d0d54cd11172b72271e47a2fe875e2bde1" | 17 | SRC_URI[sha256sum] = "7b98721e669be80284e9bbfeab02d2d0d54cd11172b72271e47a2fe875e2bde1" |
17 | 18 | ||