Skip to contentSkip to conversation

owfs: install python bindings in the correct location

PATCH New Arnout Vandecappelle (Essensium/Mind) 2 participants 5 messages Nov 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 owfs: install python bindings in the correct location

The owfs build system has a pretty complicated way of configuring the Python bindings. It ends up with setting PYSITEDIR to the host-python site-packages path, and it still prepends DESTDIR to that.

As a simple fix, override PYSITEDIR with the correct value on the make command line.

Fixes:
http://autobuild.buildroot.net/results/200/200846650641494290aa67d28ea6fb2c9351d4dc
http://autobuild.buildroot.net/results/99c/99c00248dd8b00071bcdbc73336cc276c68a4c16
and many more

---
 package/owfs/owfs.mk | 9 +++++++++
 1 file changed, 9 insertions(+)
package/owfs/owfs.mk +9 -0
index 83614af..7ee8915 100644
@@ -66,6 +66,15 @@ OWFS_MAKE_ENV += \
 	_python_prefix=/usr \
 	_python_exec_prefix=/usr
 OWFS_DEPENDENCIES += python host-swig
+# The configure scripts finds PYSITEDIR as the python_lib directory of
+# host-python, and then prepends DESTDIR in front of it. So we end up
+# installing things in $(TARGET_DIR)/$(HOST_DIR)/usr/lib/python which is
+# clearly wrong.
+# Patching owfs to do the right thing is not trivial, it's much easier to
+# override the PYSITEDIR variable in make. That, in turn, is easier to do by
+# setting OWFS_MAKE, otherwise both OWFS_INSTALL_STAGING_OPTS and
+# OWFS_INSTALL_TARGET_OPTS would have to be overridden
+OWFS_MAKE = $(MAKE) PYSITEDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
 else
 OWFS_CONF_OPTS += --disable-owpython --without-python
 endif
Signature · 1 line
2.9.3
#1 lore raw

PATCH 1/1 owfs: install python bindings in the correct location

Hello,

package/owfs/owfs.mk OWFS_MAKE_ENV += \ · line 77

Quoted 9 lines · Arnout Vandecappelle (Essensium/Mind)
package/owfs/owfs.mk +9 -0
+# The configure scripts finds PYSITEDIR as the python_lib directory of
+# host-python, and then prepends DESTDIR in front of it. So we end up
+# installing things in $(TARGET_DIR)/$(HOST_DIR)/usr/lib/python which is
+# clearly wrong.
+# Patching owfs to do the right thing is not trivial, it's much easier to
+# override the PYSITEDIR variable in make. That, in turn, is easier to do by
+# setting OWFS_MAKE, otherwise both OWFS_INSTALL_STAGING_OPTS and
+# OWFS_INSTALL_TARGET_OPTS would have to be overridden
+OWFS_MAKE = $(MAKE) PYSITEDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages

Could we instead introduce a OWFS_MAKE_OPTS variable? Yes, that's a slightly larger change, but it's our usual pattern to handle such situations, so I'd prefer to have it handled like this in owfs as well.

Thanks,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#2 lore raw

PATCH 1/1 owfs: install python bindings in the correct location

Quoted 5 lines · Thomas Petazzoni

Hello,

On Tue, 1 Nov 2016 15:14:48 +0100, Arnout Vandecappelle (Essensium/Mind) wrote:

Quoted 13 lines

package/owfs/owfs.mk OWFS_MAKE_ENV += \ · line 77

Quoted 9 lines
package/owfs/owfs.mk +9 -0
+# The configure scripts finds PYSITEDIR as the python_lib directory of
+# host-python, and then prepends DESTDIR in front of it. So we end up
+# installing things in $(TARGET_DIR)/$(HOST_DIR)/usr/lib/python which is
+# clearly wrong.
+# Patching owfs to do the right thing is not trivial, it's much easier to
+# override the PYSITEDIR variable in make. That, in turn, is easier to do by
+# setting OWFS_MAKE, otherwise both OWFS_INSTALL_STAGING_OPTS and
+# OWFS_INSTALL_TARGET_OPTS would have to be overridden
+OWFS_MAKE = $(MAKE) PYSITEDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages

Could we instead introduce a OWFS_MAKE_OPTS variable? Yes, that's a slightly larger change, but it's our usual pattern to handle such situations, so I'd prefer to have it handled like this in owfs as well.

You mean:

OWFS_MAKE_OPTS += PYSITEDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages

and then outside of the condition:

OWFS_MAKE = $(MAKE) $(OWFS_MAKE_OPTS)

?

Regards,
Arnout

Quoted 5 lines

Thanks,

Thomas

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#3 lore raw

PATCH 1/1 owfs: install python bindings in the correct location

Hello,

Quoted 11 lines · Arnout Vandecappelle
Quoted 3 lines

Could we instead introduce a OWFS_MAKE_OPTS variable? Yes, that's a slightly larger change, but it's our usual pattern to handle such situations, so I'd prefer to have it handled like this in owfs as well.

You mean:

OWFS_MAKE_OPTS += PYSITEDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages

and then outside of the condition:

OWFS_MAKE = $(MAKE) $(OWFS_MAKE_OPTS)

Yes, considering what we have in the autotools package infrastructure right now.

However, I find our usage of those variables in the infrastructure a bit weird:

- We use <pkg>_MAKE_OPTS only during the build

- We use <pkg>_INSTALL_{TARGET,STAGING}_OPTS at install time, with a default value of DESTDIR=$(..._DIR) install, which has sometimes caused some issues as people forgot about it.

Maybe we should use <pkg>_MAKE_OPTS also at install time?

Best regards,

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
#4 lore raw

PATCH 1/1 owfs: install python bindings in the correct location

In reply to Arnout Vandecappelle
Quoted 22 lines · Arnout Vandecappelle
Quoted 5 lines · Thomas Petazzoni

Hello,

On Tue, 1 Nov 2016 15:14:48 +0100, Arnout Vandecappelle (Essensium/Mind) wrote:

Quoted 13 lines

package/owfs/owfs.mk OWFS_MAKE_ENV += \ · line 77

Quoted 9 lines
package/owfs/owfs.mk +9 -0
+# The configure scripts finds PYSITEDIR as the python_lib directory of
+# host-python, and then prepends DESTDIR in front of it. So we end up
+# installing things in $(TARGET_DIR)/$(HOST_DIR)/usr/lib/python which is
+# clearly wrong.
+# Patching owfs to do the right thing is not trivial, it's much easier to
+# override the PYSITEDIR variable in make. That, in turn, is easier to do by
+# setting OWFS_MAKE, otherwise both OWFS_INSTALL_STAGING_OPTS and
+# OWFS_INSTALL_TARGET_OPTS would have to be overridden
+OWFS_MAKE = $(MAKE) PYSITEDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages

Could we instead introduce a OWFS_MAKE_OPTS variable? Yes, that's a slightly larger change, but it's our usual pattern to handle such situations, so I'd prefer to have it handled like this in owfs as well.

Quoted 7 lines

You mean:

OWFS_MAKE_OPTS += PYSITEDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages

and then outside of the condition:

OWFS_MAKE = $(MAKE) $(OWFS_MAKE_OPTS)

It'll have to be something different from _MAKE_OPTS though, because _MAKE_OPTS
is already taken by the autotools package infra.

Ideally, _MAKE_OPTS would be used in the autotools install commands as well.
However, _MAKE_OPTS is sometimes used to specify the target (e.g. SETSERIAL_MAKE_OPTS = setserial) and sometimes to specify additional options (e.g. TN5250_MAKE_OPTS = CPPFLAGS=""). So it'd have to be split up into a _MAKE_OPTS and _MAKE_TARGET (and the existing _INSTALL_STAGING/TARGET_OPTS would have to becom _TARGET as well).

In short, what you're asking is not a trivial change :-)

Regards,
Arnout

Quoted 13 lines

?

Regards,
Arnout

Quoted 5 lines

Thanks,

Thomas

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF