python3-setuptools: drop Windows launcher executables on non-mingw builds

setuptools installs Windows launcher executables (cli*.exe, gui*.exe)
into site-packages. These binaries are only used on Windows platforms
but are packaged for target, native, and nativesdk builds.

Remove the Windows launcher executables when not building for a mingw
(mingw32/mingw64) host to avoid shipping unused Windows binaries.

(From OE-Core rev: a618c504ba69d20eec08944c577b15a48b1ac578)

Signed-off-by: Krupal Ka Patel <krkapate@cisco.com>
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit cf7c79f3962f2be99cfda47e8cc730091e6a18cb)
Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
Signed-off-by: Paul Barker <paul@pbarker.dev>
This commit is contained in:
Krupal Ka Patel
2026-03-08 22:19:33 -07:00
committed by Paul Barker
parent ba6c5d8069
commit 8acfa6cc83

View File

@@ -19,6 +19,15 @@ SRC_URI += " \
SRC_URI[sha256sum] = "5c0806c7d9af348e6dd3777b4f4dbb42c7ad85b190104837488eab9a7c945cf8"
do_install:append() {
# setuptools ships Windows launcher executables (cli*.exe, gui*.exe).
# Keep them only when building for a Windows (mingw) host.
case "${HOST_OS}" in
mingw32|mingw64) ;;
*) rm -f ${D}${PYTHON_SITEPACKAGES_DIR}/setuptools/*.exe ;;
esac
}
DEPENDS += "python3"
RDEPENDS:${PN} = "\