diff mbox series

python3-pip: drop unused Windows distlib launcher templates

Message ID 20260309051826.45191-1-krkapate@cisco.com
State Under Review
Headers show
Series python3-pip: drop unused Windows distlib launcher templates | expand

Commit Message

krkapate@cisco.com March 9, 2026, 5:18 a.m. UTC
From: Krupal Ka Patel <krkapate@cisco.com>

pip vendors distlib which ships Windows launcher template binaries
(*.exe) under pip/_vendor/distlib. These files are only used on
Windows systems but are installed and packaged for target, native,
and nativesdk builds.

Remove the distlib *.exe templates when not building for a mingw
(mingw32/mingw64) host to avoid shipping unused Windows binaries and
reduce package noise.

Signed-off-by: Krupal Ka Patel <krkapate@cisco.com>
---
 meta/recipes-devtools/python/python3-pip_26.0.bb | 9 +++++++++
 1 file changed, 9 insertions(+)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-pip_26.0.bb b/meta/recipes-devtools/python/python3-pip_26.0.bb
index 0a284a1f6b..a1b2ba3350 100644
--- a/meta/recipes-devtools/python/python3-pip_26.0.bb
+++ b/meta/recipes-devtools/python/python3-pip_26.0.bb
@@ -28,6 +28,15 @@  SRC_URI += "file://no_shebang_mangling.patch"
 
 SRC_URI[sha256sum] = "3ce220a0a17915972fbf1ab451baae1521c4539e778b28127efa79b974aff0fa"
 
+do_install:append(){
+	# pip vendors distlib which ships Windows launcher templates (*.exe).
+	# Keep them only when building for a Windows (mingw) host.
+	case "${HOST_OS}" in
+		mingw32|mingw64) ;;
+		*) rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/pip/_vendor/distlib/*.exe ;;
+	esac
+}
+
 RDEPENDS:${PN} = "\
   python3-compile \
   python3-html \