python3: Fix building C extensions with setuptools
authorJeffery To <jeffery.to@gmail.com>
Mon, 30 Oct 2023 15:56:43 +0000 (23:56 +0800)
committerRosen Penev <rosenp@gmail.com>
Mon, 30 Oct 2023 20:33:07 +0000 (13:33 -0700)
commit624fb955619c0b4b368e2ac1880619f159e3b8d6
tree83b1dbf10387dc70c42c360bff4e19cda3d4f348
parent9ea2ec7cd1d9902352a67d6152107e9c452d6dbb
python3: Fix building C extensions with setuptools

setuptools provides a local copy of distutils and when building a C
extension, this distutils will add the target LIBDIR (/usr/lib) to the
list of library paths.

If the build system has a libpython3.11.so in /usr/lib, then the linker
will try to link to this shared library and fail.

This adapts 008-distutils-use-python-sysroot.patch for host setuptools
to add the correct library directory.

Fixes: https://github.com/openwrt/packages/issues/22330
Signed-off-by: Jeffery To <jeffery.to@gmail.com>
lang/python/python3-version.mk
lang/python/python3/patches-host-setuptools/0001-Adjust-library-header-paths-for-cross-compilation.patch [new file with mode: 0644]