summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/recipes-devtools/python/python3-matplotlib/0001-removed-RandomNumberGenerator-class-included-random-.patch59
-rw-r--r--meta-python/recipes-devtools/python/python3-matplotlib_3.6.3.bb5
2 files changed, 63 insertions, 1 deletions
diff --git a/meta-python/recipes-devtools/python/python3-matplotlib/0001-removed-RandomNumberGenerator-class-included-random-.patch b/meta-python/recipes-devtools/python/python3-matplotlib/0001-removed-RandomNumberGenerator-class-included-random-.patch
new file mode 100644
index 0000000000..1f9b8cdeaf
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-matplotlib/0001-removed-RandomNumberGenerator-class-included-random-.patch
@@ -0,0 +1,59 @@
1From 3eb9987b02cc10b93e09219ddc86aa6be5f10177 Mon Sep 17 00:00:00 2001
2From: tybeller <ty.c.beller@gmail.com>
3Date: Fri, 30 Sep 2022 16:13:41 -0400
4Subject: [PATCH] removed RandomNumberGenerator class, included <random>,
5 replaced random_shuffle with shuffle and used mersenne twister engine to
6 generate uniform random bit generator for the shuffle.
7
8Upstream-Status: Backport [https://github.com/matplotlib/matplotlib/commit/601d92a8850]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/tri/_tri.cpp | 20 ++++----------------
12 1 file changed, 4 insertions(+), 16 deletions(-)
13
14diff --git a/src/tri/_tri.cpp b/src/tri/_tri.cpp
15index b7a87783de..6e639eea44 100644
16--- a/src/tri/_tri.cpp
17+++ b/src/tri/_tri.cpp
18@@ -12,6 +12,7 @@
19
20 #include <algorithm>
21 #include <set>
22+#include <random>
23
24
25 TriEdge::TriEdge()
26@@ -1465,8 +1466,8 @@ TrapezoidMapTriFinder::initialize()
27 _tree->assert_valid(false);
28
29 // Randomly shuffle all edges other than first 2.
30- RandomNumberGenerator rng(1234);
31- std::random_shuffle(_edges.begin()+2, _edges.end(), rng);
32+ std::mt19937 rng(1234);
33+ std::shuffle(_edges.begin()+2, _edges.end(), rng);
34
35 // Add edges, one at a time, to tree.
36 size_t nedges = _edges.size();
37@@ -2055,17 +2056,4 @@ TrapezoidMapTriFinder::Trapezoid::set_upper_right(Trapezoid* upper_right_)
38 upper_right = upper_right_;
39 if (upper_right != 0)
40 upper_right->upper_left = this;
41-}
42-
43-
44-
45-RandomNumberGenerator::RandomNumberGenerator(unsigned long seed)
46- : _m(21870), _a(1291), _c(4621), _seed(seed % _m)
47-{}
48-
49-unsigned long
50-RandomNumberGenerator::operator()(unsigned long max_value)
51-{
52- _seed = (_seed*_a + _c) % _m;
53- return (_seed*max_value) / _m;
54-}
55+}
56\ No newline at end of file
57--
582.39.0
59
diff --git a/meta-python/recipes-devtools/python/python3-matplotlib_3.6.3.bb b/meta-python/recipes-devtools/python/python3-matplotlib_3.6.3.bb
index 809f9425ba..fa0a78d6a9 100644
--- a/meta-python/recipes-devtools/python/python3-matplotlib_3.6.3.bb
+++ b/meta-python/recipes-devtools/python/python3-matplotlib_3.6.3.bb
@@ -27,7 +27,8 @@ inherit pypi setuptools3 pkgconfig
27 27
28# Stop the component from attempting to download when it detects a missing 28# Stop the component from attempting to download when it detects a missing
29# dependency 29# dependency
30SRC_URI += "file://matplotlib-disable-download.patch" 30SRC_URI += "file://matplotlib-disable-download.patch \
31 file://0001-removed-RandomNumberGenerator-class-included-random-.patch"
31 32
32# This python module requires a full copy of freetype-2.6.1 33# This python module requires a full copy of freetype-2.6.1
33SRC_URI += "https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz;name=freetype;subdir=matplotlib-${PV}/build" 34SRC_URI += "https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz;name=freetype;subdir=matplotlib-${PV}/build"
@@ -40,6 +41,8 @@ SRC_URI[qhull.sha256sum] = "b5c2d7eb833278881b952c8a52d20179eab87766b00b86500046
40# LTO with clang needs lld 41# LTO with clang needs lld
41LDFLAGS:append:toolchain-clang = " -fuse-ld=lld" 42LDFLAGS:append:toolchain-clang = " -fuse-ld=lld"
42LDFLAGS:remove:toolchain-clang:mips = "-fuse-ld=lld" 43LDFLAGS:remove:toolchain-clang:mips = "-fuse-ld=lld"
44LDFLAGS:remove:toolchain-clang:riscv64 = "-fuse-ld=lld"
45LDFLAGS:remove:toolchain-clang:riscv32 = "-fuse-ld=lld"
43RDEPENDS:${PN} = "\ 46RDEPENDS:${PN} = "\
44 freetype \ 47 freetype \
45 libpng \ 48 libpng \