Skip to contentSkip to conversation

package/pkg-python: fixing wrong root an prefix

PATCH New Angelo Compagnucci 2 participants 2 messages Nov 24, 2018 – Nov 25, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/pkg-python: fixing wrong root an prefix

Some python software refers to setuptool/distutils options to install files in python root directory (like data_files option). To use this type of option, python root should point to the real python root in buildroot folder and not to the guest os /.
Prefix path is always built starting from the python root, so it should be simply /usr.

---
 package/pkg-python.mk | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
package/pkg-python.mk +8 -6
index f57e486dad..38c5941777 100644
@@ -42,10 +42,12 @@ PKG_PYTHON_DISTUTILS_BUILD_OPTS = \
 	--executable=/usr/bin/python
 
 PKG_PYTHON_DISTUTILS_INSTALL_TARGET_OPTS = \
-	--prefix=$(TARGET_DIR)/usr
+	--prefix=/usr \
+	--root=$(TARGET_DIR) \
 
 PKG_PYTHON_DISTUTILS_INSTALL_STAGING_OPTS = \
-	--prefix=$(STAGING_DIR)/usr
+	--prefix=/usr \
+	--root=$(STAGING_DIR)
 
 # Host distutils-based packages
 HOST_PKG_PYTHON_DISTUTILS_ENV = \
@@ -66,16 +68,16 @@ PKG_PYTHON_SETUPTOOLS_ENV = \
 	_python_exec_prefix=/usr
 
 PKG_PYTHON_SETUPTOOLS_INSTALL_TARGET_OPTS = \
-	--prefix=$(TARGET_DIR)/usr \
+	--prefix=/usr \
 	--executable=/usr/bin/python \
 	--single-version-externally-managed \
-	--root=/
+	--root=$(TARGET_DIR)
 
 PKG_PYTHON_SETUPTOOLS_INSTALL_STAGING_OPTS = \
-	--prefix=$(STAGING_DIR)/usr \
+	--prefix=/usr \
 	--executable=/usr/bin/python \
 	--single-version-externally-managed \
-	--root=/
+	--root=$(STAGING_DIR)
 
 # Host setuptools-based packages
 HOST_PKG_PYTHON_SETUPTOOLS_ENV = \
Signature · 1 line
2.17.1
#1 lore raw

PATCH 1/1 package/pkg-python: fixing wrong root an prefix

Hello,

Quoted 11 lines · Angelo Compagnucci

Some python software refers to setuptool/distutils options to install files in python root directory (like data_files option). To use this type of option, python root should point to the real python root in buildroot folder and not to the guest os /.
Prefix path is always built starting from the python root, so it should be simply /usr.

---
 package/pkg-python.mk | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Even though this is really a fix, it's quite late to apply this to master, so close to the release. So I erred on the same side, and applied it to the next branch. If everything goes well, we can still put it back on master before or after the release.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com