diff options
Diffstat (limited to 'meta-python')
6 files changed, 144 insertions, 145 deletions
diff --git a/meta-python/recipes-devtools/python/python3-matplotlib/0001-Change-types-for-width-height-to-match-definitions-i.patch b/meta-python/recipes-devtools/python/python3-matplotlib/0001-Change-types-for-width-height-to-match-definitions-i.patch new file mode 100644 index 0000000000..bf73bf9a22 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-matplotlib/0001-Change-types-for-width-height-to-match-definitions-i.patch | |||
@@ -0,0 +1,45 @@ | |||
1 | From b19715aeafcf8440466553d01717924add1eabf4 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 9 Apr 2025 23:17:12 -0700 | ||
4 | Subject: [PATCH] Change types for width/height to match definitions in | ||
5 | BufferRegion | ||
6 | |||
7 | This is found with clang | ||
8 | |||
9 | Fixes | ||
10 | ../matplotlib-3.10.1/src/_backend_agg_wrapper.cpp:253:17: error: non-constant-expression cannot be narrowed from type 'unsigned int' to 'int' in initializer list [-Wc++11-narrowing] | ||
11 | |||
12 | Upstream-Status: Submitted [https://github.com/matplotlib/matplotlib/pull/29894] | ||
13 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
14 | --- | ||
15 | src/_backend_agg.h | 6 +++--- | ||
16 | 1 file changed, 3 insertions(+), 3 deletions(-) | ||
17 | |||
18 | diff --git a/src/_backend_agg.h b/src/_backend_agg.h | ||
19 | index 0e33d38dfd..dcbd7e1496 100644 | ||
20 | --- a/src/_backend_agg.h | ||
21 | +++ b/src/_backend_agg.h | ||
22 | @@ -131,12 +131,12 @@ class RendererAgg | ||
23 | |||
24 | virtual ~RendererAgg(); | ||
25 | |||
26 | - unsigned int get_width() | ||
27 | + int get_width() | ||
28 | { | ||
29 | return width; | ||
30 | } | ||
31 | |||
32 | - unsigned int get_height() | ||
33 | + int get_height() | ||
34 | { | ||
35 | return height; | ||
36 | } | ||
37 | @@ -206,7 +206,7 @@ class RendererAgg | ||
38 | void restore_region(BufferRegion ®); | ||
39 | void restore_region(BufferRegion ®ion, int xx1, int yy1, int xx2, int yy2, int x, int y); | ||
40 | |||
41 | - unsigned int width, height; | ||
42 | + int width, height; | ||
43 | double dpi; | ||
44 | size_t NUMBYTES; // the number of bytes in buffer | ||
45 | |||
diff --git a/meta-python/recipes-devtools/python/python3-matplotlib/0001-Do-not-download-external-dependency-tarballs-via-mes.patch b/meta-python/recipes-devtools/python/python3-matplotlib/0001-Do-not-download-external-dependency-tarballs-via-mes.patch new file mode 100644 index 0000000000..144bfac185 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-matplotlib/0001-Do-not-download-external-dependency-tarballs-via-mes.patch | |||
@@ -0,0 +1,47 @@ | |||
1 | From a6b0bc129de493f57bf79005c48a8d4ca0df68c2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Wed, 9 Apr 2025 17:34:55 -0700 | ||
4 | Subject: [PATCH] Do not download external dependency tarballs via meson | ||
5 | |||
6 | They are fetched by bitbake fetcher already | ||
7 | |||
8 | Upstream-Status: Inappropriate [ OE-Specific ] | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | subprojects/freetype-2.6.1.wrap | 7 +------ | ||
13 | subprojects/qhull.wrap | 9 ++------- | ||
14 | 2 files changed, 3 insertions(+), 13 deletions(-) | ||
15 | |||
16 | diff --git a/subprojects/freetype-2.6.1.wrap b/subprojects/freetype-2.6.1.wrap | ||
17 | index 763362b..74ecb13 100644 | ||
18 | --- a/subprojects/freetype-2.6.1.wrap | ||
19 | +++ b/subprojects/freetype-2.6.1.wrap | ||
20 | @@ -1,10 +1,5 @@ | ||
21 | [wrap-file] | ||
22 | -source_url = https://download.savannah.gnu.org/releases/freetype/freetype-old/freetype-2.6.1.tar.gz | ||
23 | -source_fallback_url = https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz | ||
24 | -source_filename = freetype-2.6.1.tar.gz | ||
25 | -source_hash = 0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014 | ||
26 | - | ||
27 | -patch_directory = freetype-2.6.1-meson | ||
28 | +directory = freetype-2.6.1 | ||
29 | |||
30 | [provide] | ||
31 | freetype-2.6.1 = freetype_dep | ||
32 | diff --git a/subprojects/qhull.wrap b/subprojects/qhull.wrap | ||
33 | index c52b07d..30b6904 100644 | ||
34 | --- a/subprojects/qhull.wrap | ||
35 | +++ b/subprojects/qhull.wrap | ||
36 | @@ -1,9 +1,4 @@ | ||
37 | [wrap-file] | ||
38 | -# Also bump the cache key in `.circleci/config.yml`. | ||
39 | -# Also update the docs in `docs/devel/dependencies.rst`. | ||
40 | -directory = qhull-8.0.2 | ||
41 | -source_url = https://github.com/qhull/qhull/archive/v8.0.2/qhull-8.0.2.tar.gz | ||
42 | -source_filename = qhull-8.0.2.tgz | ||
43 | -source_hash = 8774e9a12c70b0180b95d6b0b563c5aa4bea8d5960c15e18ae3b6d2521d64f8b | ||
44 | +directory = qhull-2020.2 | ||
45 | |||
46 | -patch_directory = qhull-8.0.2 | ||
47 | +patch_directory = qhull-2020.2 | ||
diff --git a/meta-python/recipes-devtools/python/python3-matplotlib/matplotlib-disable-download.patch b/meta-python/recipes-devtools/python/python3-matplotlib/matplotlib-disable-download.patch deleted file mode 100644 index aea8f62ea7..0000000000 --- a/meta-python/recipes-devtools/python/python3-matplotlib/matplotlib-disable-download.patch +++ /dev/null | |||
@@ -1,75 +0,0 @@ | |||
1 | Disable automatic downloading of components! | ||
2 | |||
3 | Upstream-Status: Inappropriate [disable feature] | ||
4 | |||
5 | Signed-off-by: Mark Hatle <mark.hatle@xilinx.com> | ||
6 | |||
7 | Update patch to fit on 3.7.2. | ||
8 | |||
9 | Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | ||
10 | |||
11 | diff --git a/setup.py b/setup.py | ||
12 | index 0bea13fa6f..f39d8fc871 100644 | ||
13 | --- a/setup.py | ||
14 | +++ b/setup.py | ||
15 | @@ -327,13 +327,7 @@ setup( # Finally, pass this all along to setuptools to do the heavy lifting. | ||
16 | "pillow>=6.2.0", | ||
17 | "pyparsing>=2.3.1,<3.1", | ||
18 | "python-dateutil>=2.7", | ||
19 | - ] + ( | ||
20 | - # Installing from a git checkout that is not producing a wheel. | ||
21 | - ["setuptools_scm>=7"] if ( | ||
22 | - Path(__file__).with_name(".git").exists() and | ||
23 | - os.environ.get("CIBUILDWHEEL", "0") != "1" | ||
24 | - ) else [] | ||
25 | - ), | ||
26 | + ], | ||
27 | extras_require={ | ||
28 | ':python_version<"3.10"': [ | ||
29 | "importlib-resources>=3.2.0", | ||
30 | diff --git a/setupext.py b/setupext.py | ||
31 | index a898d642d6..474172ff8f 100644 | ||
32 | --- a/setupext.py | ||
33 | +++ b/setupext.py | ||
34 | @@ -66,40 +66,7 @@ def get_from_cache_or_download(url, sha): | ||
35 | BytesIO | ||
36 | The file loaded into memory. | ||
37 | """ | ||
38 | - cache_dir = _get_xdg_cache_dir() | ||
39 | - | ||
40 | - if cache_dir is not None: # Try to read from cache. | ||
41 | - try: | ||
42 | - data = (cache_dir / sha).read_bytes() | ||
43 | - except IOError: | ||
44 | - pass | ||
45 | - else: | ||
46 | - if _get_hash(data) == sha: | ||
47 | - return BytesIO(data) | ||
48 | - | ||
49 | - # jQueryUI's website blocks direct downloads from urllib.request's | ||
50 | - # default User-Agent, but not (for example) wget; so I don't feel too | ||
51 | - # bad passing in an empty User-Agent. | ||
52 | - with urllib.request.urlopen( | ||
53 | - urllib.request.Request(url, headers={"User-Agent": ""}), | ||
54 | - context=_get_ssl_context()) as req: | ||
55 | - data = req.read() | ||
56 | - | ||
57 | - file_sha = _get_hash(data) | ||
58 | - if file_sha != sha: | ||
59 | - raise Exception( | ||
60 | - f"The downloaded file does not match the expected sha. {url} was " | ||
61 | - f"expected to have {sha} but it had {file_sha}") | ||
62 | - | ||
63 | - if cache_dir is not None: # Try to cache the downloaded file. | ||
64 | - try: | ||
65 | - cache_dir.mkdir(parents=True, exist_ok=True) | ||
66 | - with open(cache_dir / sha, "xb") as fout: | ||
67 | - fout.write(data) | ||
68 | - except IOError: | ||
69 | - pass | ||
70 | - | ||
71 | - return BytesIO(data) | ||
72 | + raise IOError(f"Automatic downloading is disabled.") | ||
73 | |||
74 | |||
75 | def get_and_extract_tarball(urls, sha, dirname): | ||
diff --git a/meta-python/recipes-devtools/python/python3-matplotlib/run-ptest b/meta-python/recipes-devtools/python/python3-matplotlib/run-ptest new file mode 100644 index 0000000000..e99c96b342 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-matplotlib/run-ptest | |||
@@ -0,0 +1,3 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | pytest --automake --pyargs matplotlib | ||
diff --git a/meta-python/recipes-devtools/python/python3-matplotlib_3.10.1.bb b/meta-python/recipes-devtools/python/python3-matplotlib_3.10.1.bb new file mode 100644 index 0000000000..d6523e7770 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-matplotlib_3.10.1.bb | |||
@@ -0,0 +1,49 @@ | |||
1 | SUMMARY = "matplotlib: plotting with Python" | ||
2 | DESCRIPTION = "\ | ||
3 | Matplotlib is a Python 2D plotting library which produces \ | ||
4 | publication-quality figures in a variety of hardcopy formats \ | ||
5 | and interactive environments across platforms." | ||
6 | HOMEPAGE = "https://github.com/matplotlib/matplotlib" | ||
7 | SECTION = "devel/python" | ||
8 | LICENSE = "PSF-2.0" | ||
9 | LIC_FILES_CHKSUM = "\ | ||
10 | file://LICENSE/LICENSE;md5=afec61498aa5f0c45936687da9a53d74 \ | ||
11 | " | ||
12 | |||
13 | DEPENDS = "\ | ||
14 | freetype \ | ||
15 | libpng \ | ||
16 | python3-pybind11 \ | ||
17 | qhull \ | ||
18 | " | ||
19 | |||
20 | SRC_URI += "file://run-ptest \ | ||
21 | file://0001-Do-not-download-external-dependency-tarballs-via-mes.patch \ | ||
22 | file://0001-Change-types-for-width-height-to-match-definitions-i.patch \ | ||
23 | " | ||
24 | SRC_URI[sha256sum] = "e8d2d0e3881b129268585bf4765ad3ee73a4591d77b9a18c214ac7e3a79fb2ba" | ||
25 | |||
26 | inherit pypi pkgconfig python3targetconfig meson ptest-python-pytest | ||
27 | |||
28 | EXTRA_OEMESON += "-Dsystem-freetype=true -Dsystem-qhull=true" | ||
29 | |||
30 | # LTO with clang needs lld | ||
31 | LDFLAGS:append:toolchain-clang = " -fuse-ld=lld" | ||
32 | |||
33 | FILES:${PN}-ptest += "${PYTHON_SITEPACKAGES_DIR}/matplotlib/tests" | ||
34 | FILES:${PN} += "${PYTHON_SITEPACKAGES_DIR}/" | ||
35 | |||
36 | RDEPENDS:${PN} = "\ | ||
37 | freetype \ | ||
38 | libpng \ | ||
39 | python3-numpy \ | ||
40 | python3-pyparsing \ | ||
41 | python3-cycler \ | ||
42 | python3-dateutil \ | ||
43 | python3-kiwisolver \ | ||
44 | python3-pytz \ | ||
45 | python3-pillow \ | ||
46 | python3-packaging \ | ||
47 | " | ||
48 | |||
49 | BBCLASSEXTEND = "native" | ||
diff --git a/meta-python/recipes-devtools/python/python3-matplotlib_3.7.2.bb b/meta-python/recipes-devtools/python/python3-matplotlib_3.7.2.bb deleted file mode 100644 index 72c369100a..0000000000 --- a/meta-python/recipes-devtools/python/python3-matplotlib_3.7.2.bb +++ /dev/null | |||
@@ -1,70 +0,0 @@ | |||
1 | SUMMARY = "matplotlib: plotting with Python" | ||
2 | DESCRIPTION = "\ | ||
3 | Matplotlib is a Python 2D plotting library which produces \ | ||
4 | publication-quality figures in a variety of hardcopy formats \ | ||
5 | and interactive environments across platforms." | ||
6 | HOMEPAGE = "https://github.com/matplotlib/matplotlib" | ||
7 | SECTION = "devel/python" | ||
8 | LICENSE = "PSF-2.0" | ||
9 | LIC_FILES_CHKSUM = "\ | ||
10 | file://setup.py;beginline=293;endline=293;md5=20e7ab4d2b2b1395a0e4ab800181eb96 \ | ||
11 | file://LICENSE/LICENSE;md5=afec61498aa5f0c45936687da9a53d74 \ | ||
12 | " | ||
13 | |||
14 | DEPENDS = "\ | ||
15 | freetype \ | ||
16 | libpng \ | ||
17 | python3-numpy-native \ | ||
18 | python3-pip-native \ | ||
19 | python3-dateutil-native \ | ||
20 | python3-pytz-native \ | ||
21 | python3-certifi-native \ | ||
22 | python3-setuptools-scm-native \ | ||
23 | python3-pybind11-native \ | ||
24 | " | ||
25 | SRC_URI[sha256sum] = "a8cdb91dddb04436bd2f098b8fdf4b81352e68cf4d2c6756fcc414791076569b" | ||
26 | |||
27 | inherit pypi setuptools3 pkgconfig | ||
28 | |||
29 | # Stop the component from attempting to download when it detects a missing | ||
30 | # dependency | ||
31 | SRC_URI += "file://matplotlib-disable-download.patch \ | ||
32 | " | ||
33 | |||
34 | # This python module requires a full copy of freetype-2.6.1 | ||
35 | SRC_URI += "https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz;name=freetype;subdir=matplotlib-${PV}/build" | ||
36 | SRC_URI[freetype.sha256sum] = "0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014" | ||
37 | |||
38 | # This python module requires a full copy of 'qhull-2020' | ||
39 | SRC_URI += "http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz;name=qhull;subdir=matplotlib-${PV}/build" | ||
40 | SRC_URI[qhull.sha256sum] = "b5c2d7eb833278881b952c8a52d20179eab87766b00b865000469a45c1838b7e" | ||
41 | |||
42 | # LTO with clang needs lld | ||
43 | LDFLAGS:append:toolchain-clang = " -fuse-ld=lld" | ||
44 | LDFLAGS:remove:toolchain-clang:mips = "-fuse-ld=lld" | ||
45 | LDFLAGS:remove:toolchain-clang:riscv64 = "-fuse-ld=lld" | ||
46 | LDFLAGS:remove:toolchain-clang:riscv32 = "-fuse-ld=lld" | ||
47 | RDEPENDS:${PN} = "\ | ||
48 | freetype \ | ||
49 | libpng \ | ||
50 | python3-numpy \ | ||
51 | python3-pyparsing \ | ||
52 | python3-cycler \ | ||
53 | python3-dateutil \ | ||
54 | python3-kiwisolver \ | ||
55 | python3-pytz \ | ||
56 | python3-pillow \ | ||
57 | python3-packaging \ | ||
58 | " | ||
59 | |||
60 | ENABLELTO:toolchain-clang:riscv64 = "echo enable_lto = False >> ${S}/mplsetup.cfg" | ||
61 | ENABLELTO:toolchain-clang:riscv32 = "echo enable_lto = False >> ${S}/mplsetup.cfg" | ||
62 | ENABLELTO:toolchain-clang:mips = "echo enable_lto = False >> ${S}/mplsetup.cfg" | ||
63 | |||
64 | do_compile:prepend() { | ||
65 | echo [libs] > ${S}/mplsetup.cfg | ||
66 | echo system_freetype = True >> ${S}/mplsetup.cfg | ||
67 | ${ENABLELTO} | ||
68 | } | ||
69 | |||
70 | BBCLASSEXTEND = "native" | ||