Skip to contentSkip to conversation

package/pkg-python: fix headers install

PATCH In review Fabrice Fontaine 2 participants 2 messages Feb 18, 2022 – Mar 7, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/pkg-python: fix headers install

For an unknown reason, installation of headers is broken since commit 7c1bb5c2bfdc9d726c41a66b30b7aa8e759c6596 which sets _PYTHON_PROJECT_BASE

As _PYTHON_PROJECT_BASE value seems correct and fix its own build failures, use --install-headers to set install path for headers and avoid the following build failure with python-greenlet or python-pygame:

python-greenlet: installs files in /home/peko/autobuild/instance-0/output-1/target//home/peko/autobuild/instance-0/output-1

python-pygame: installs files in /home/peko/autobuild/instance-1/output-1/target//home/peko/autobuild/instance-1/output-1

Fixes:
- http://autobuild.buildroot.org/results/f5b52dee7e72f0a1f72b9f87723bc585743c7b31
- http://autobuild.buildroot.org/results/9eb2685d32756864000e1b38f8a183b57f6ea528

---
 package/pkg-python.mk | 4 ++++
 1 file changed, 4 insertions(+)
package/pkg-python.mk +4 -0
index b8dc9cd9e5..c4e590bd70 100644
@@ -51,10 +51,12 @@ PKG_PYTHON_DISTUTILS_BUILD_OPTS = \
 	--executable=/usr/bin/python
 
 PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS = \
+	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
 	--prefix=/usr \
 	--root=$(TARGET_DIR)
 
 PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \
+	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
 	--prefix=/usr \
 	--root=$(STAGING_DIR)
 
@@ -81,12 +83,14 @@ PKG_PYTHON_SETUPTOOLS_ENV = \
 	_python_exec_prefix=/usr
 
 PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS = \
+	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
 	--prefix=/usr \
 	--executable=/usr/bin/python \
 	--single-version-externally-managed \
 	--root=$(TARGET_DIR)
 
 PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \
+	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
 	--prefix=/usr \
 	--executable=/usr/bin/python \
 	--single-version-externally-managed \
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw
Quoted 2 lines · Fabrice Fontaine

For an unknown reason, installation of headers is broken since commit 7c1bb5c2bfdc9d726c41a66b30b7aa8e759c6596 which sets _PYTHON_PROJECT_BASE

I've been trying to understand and I don't really understand what is going on
either.

Quoted 1 line

As _PYTHON_PROJECT_BASE value seems correct and fix its own build

This still looks fishy to me though :-(

Still, we need to fix this somehow and this patch indeed fixes the issue.
Therefore, applied to master, thanks.

Regards,
Arnout

Quoted 38 lines

failures, use --install-headers to set install path for headers and avoid the following build failure with python-greenlet or python-pygame:

python-greenlet: installs files in /home/peko/autobuild/instance-0/output-1/target//home/peko/autobuild/instance-0/output-1

python-pygame: installs files in /home/peko/autobuild/instance-1/output-1/target//home/peko/autobuild/instance-1/output-1

Fixes:
- http://autobuild.buildroot.org/results/f5b52dee7e72f0a1f72b9f87723bc585743c7b31
- http://autobuild.buildroot.org/results/9eb2685d32756864000e1b38f8a183b57f6ea528

---
  package/pkg-python.mk | 4 ++++
  1 file changed, 4 insertions(+)
package/pkg-python.mk +3 -0
index b8dc9cd9e5..c4e590bd70 100644
@@ -51,10 +51,12 @@ PKG_PYTHON_DISTUTILS_BUILD_OPTS = \
  	--executable=/usr/bin/python
 
  PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS = \
+	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
  	--prefix=/usr \
  	--root=$(TARGET_DIR)
 
  PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \
+	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
  	--prefix=/usr \
  	--root=$(STAGING_DIR)
 
@@ -81,12 +83,14 @@ PKG_PYTHON_SETUPTOOLS_ENV = \
  	_python_exec_prefix=/usr
 
  PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS = \
+	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \

package/pkg-python.mk PKG_PYTHON_SETUPTOOLS_ENV = \ · line 96

Quoted 10 lines
package/pkg-python.mk +1 -0
  	--prefix=/usr \
  	--executable=/usr/bin/python \
  	--single-version-externally-managed \
  	--root=$(TARGET_DIR)
 
  PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \
+	--install-headers=/usr/include/python$(PYTHON3_VERSION_MAJOR) \
  	--prefix=/usr \
  	--executable=/usr/bin/python \
  	--single-version-externally-managed \

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot