diff mbox series

[scarthgap,meta-python] python3-matplotlib: fix build

Message ID 20260702094420.3122055-1-anuj.mittal@oss.qualcomm.com
State New
Headers show
Series [scarthgap,meta-python] python3-matplotlib: fix build | expand

Commit Message

Anuj Mittal July 2, 2026, 9:44 a.m. UTC
From: Anuj Mittal <anuj.mittal@oss.qualcomm.com>

Changes in oe-core commit a0151ab56cf3 (setuptools3: clean the build
directory in configure) cause the build directory to be cleared during
configure step. To avoid the downloaded sources from getting cleaned,
pre-fetch them to a separate downloads/ directory and patch source to
look there.

Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
---
 .../matplotlib-disable-download.patch         | 34 +++++++++++++++++--
 .../python/python3-matplotlib_3.7.2.bb        |  4 +--
 2 files changed, 34 insertions(+), 4 deletions(-)
diff mbox series

Patch

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
index aea8f62ea7..461f2d9d06 100644
--- a/meta-python/recipes-devtools/python/python3-matplotlib/matplotlib-disable-download.patch
+++ b/meta-python/recipes-devtools/python/python3-matplotlib/matplotlib-disable-download.patch
@@ -8,8 +8,11 @@  Update patch to fit on 3.7.2.
 
 Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
 
+Update to look for downloads in downloads/ directoory instead of build.
+Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
+
 diff --git a/setup.py b/setup.py
-index 0bea13fa6f..f39d8fc871 100644
+index 0bea13f..f39d8fc 100644
 --- a/setup.py
 +++ b/setup.py
 @@ -327,13 +327,7 @@ setup(  # Finally, pass this all along to setuptools to do the heavy lifting.
@@ -28,7 +31,7 @@  index 0bea13fa6f..f39d8fc871 100644
          ':python_version<"3.10"': [
              "importlib-resources>=3.2.0",
 diff --git a/setupext.py b/setupext.py
-index a898d642d6..474172ff8f 100644
+index a898d64..9a4bb85 100644
 --- a/setupext.py
 +++ b/setupext.py
 @@ -66,40 +66,7 @@ def get_from_cache_or_download(url, sha):
@@ -73,3 +76,30 @@  index a898d642d6..474172ff8f 100644
  
  
  def get_and_extract_tarball(urls, sha, dirname):
+@@ -117,7 +84,7 @@ def get_and_extract_tarball(urls, sha, dirname):
+     dirname : path-like
+         Directory where the tarball is extracted.
+     """
+-    toplevel = Path("build", dirname)
++    toplevel = Path("downloads", dirname)
+     if not toplevel.exists():  # Download it or load it from cache.
+         try:
+             import certifi  # noqa
+@@ -677,7 +644,7 @@ class FreeType(SetupPackage):
+             else:
+                 msbuild_platform = 'Win32'
+             base_path = Path(
+-                f"build/freetype-{LOCAL_FREETYPE_VERSION}/builds/windows"
++                f"downloads/freetype-{LOCAL_FREETYPE_VERSION}/builds/windows"
+             )
+             vc = 'vc2010'
+             sln_path = base_path / vc / "freetype.sln"
+@@ -775,7 +742,7 @@ class Qhull(SetupPackage):
+         shutil.copyfile(toplevel / "COPYING.txt", "LICENSE/LICENSE_QHULL")
+ 
+         for ext in self._extensions_to_update:
+-            qhull_path = Path(f'build/qhull-{LOCAL_QHULL_VERSION}/src')
++            qhull_path = Path(f'downloads/qhull-{LOCAL_QHULL_VERSION}/src')
+             ext.include_dirs.insert(0, str(qhull_path))
+             ext.sources.extend(
+                 map(str, sorted(qhull_path.glob('libqhull_r/*.c'))))
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
index 72c369100a..991352e1e7 100644
--- a/meta-python/recipes-devtools/python/python3-matplotlib_3.7.2.bb
+++ b/meta-python/recipes-devtools/python/python3-matplotlib_3.7.2.bb
@@ -32,11 +32,11 @@  SRC_URI += "file://matplotlib-disable-download.patch \
 "
 
 # This python module requires a full copy of freetype-2.6.1
-SRC_URI += "https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz;name=freetype;subdir=matplotlib-${PV}/build"
+SRC_URI += "https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz;name=freetype;subdir=matplotlib-${PV}/downloads"
 SRC_URI[freetype.sha256sum] = "0a3c7dfbda6da1e8fce29232e8e96d987ababbbf71ebc8c75659e4132c367014"
 
 # This python module requires a full copy of 'qhull-2020'
-SRC_URI += "http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz;name=qhull;subdir=matplotlib-${PV}/build"
+SRC_URI += "http://www.qhull.org/download/qhull-2020-src-8.0.2.tgz;name=qhull;subdir=matplotlib-${PV}/downloads"
 SRC_URI[qhull.sha256sum] = "b5c2d7eb833278881b952c8a52d20179eab87766b00b865000469a45c1838b7e"
 
 # LTO with clang needs lld