Skip to contentSkip to conversation

python-pygame: fix _python_srcdir

PATCH New Danomi Manchego 2 participants 4 messages Oct 3, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 python-pygame: fix _python_srcdir

The previous expression for _python_srcdir forgot the dash between "python" and the version, so the path was actually non-existent. Change the expression to "$(PYTHON_DIR)", which is simpler, and matches python-crc16 and python-pyzmq.

---

I don't actually know if _python_srcdir needs to be there, but if it's there, then it shouldn't point to an invalid location.

---
 package/python-pygame/python-pygame.mk |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/python-pygame/python-pygame.mk +1 -1
index 739ba45..123b0eb 100644
@@ -86,7 +86,7 @@ define PYTHON_PYGAME_BUILD_CMDS
 		LDSHARED="$(TARGET_CROSS)gcc -shared" \
 		CROSS_COMPILING=yes \
 		_python_sysroot=$(STAGING_DIR) \
-		_python_srcdir=$(BUILD_DIR)/python$(PYTHON_VERSION) \
+		_python_srcdir=$(PYTHON_DIR) \
 		_python_prefix=/usr \
 		_python_exec_prefix=/usr \
 		$(HOST_DIR)/usr/bin/python setup.py build)
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 python-pygame: fix _python_srcdir

Dear Danomi Manchego,

package/python-pygame/python-pygame.mk define PYTHON_PYGAME_BUILD_CMDS · line 89

Quoted 3 lines · Danomi Manchego
package/python-pygame/python-pygame.mk +1 -1
 		_python_sysroot=$(STAGING_DIR) \
-		_python_srcdir=$(BUILD_DIR)/python$(PYTHON_VERSION) \
+		_python_srcdir=$(PYTHON_DIR) \

I'm just wondering, why do these packages need access to the Python *source* tree? What's missing from $(STAGING_DIR) to build those Python modules?

Normally, the source/build tree of each package are just temporary locations, we should *theoretically* be able of removing the source/build tree of a package once its build has completed (well, in practice, there are of course some exceptions, but it seems weird that all Python modules would need these exceptions).

Best regards,

Thomas Petazzoni

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

PATCH 1/1 python-pygame: fix _python_srcdir

Hi Thomas,

Quoted 12 lines · Thomas Petazzoni

Dear Danomi Manchego,

package/python-pygame/python-pygame.mk define PYTHON_PYGAME_BUILD_CMDS · line 89

Quoted 3 lines · Danomi Manchego
              _python_sysroot=$(STAGING_DIR) \
package/python-pygame/python-pygame.mk +1 -1
-             _python_srcdir=$(BUILD_DIR)/python$(PYTHON_VERSION) \
+             _python_srcdir=$(PYTHON_DIR) \

I'm just wondering, why do these packages need access to the Python *source* tree? What's missing from $(STAGING_DIR) to build those Python modules?

Quoted 5 lines

Normally, the source/build tree of each package are just temporary locations, we should *theoretically* be able of removing the source/build tree of a package once its build has completed (well, in practice, there are of course some exceptions, but it seems weird that all Python modules would need these exceptions).

Unfortunately, I have almost no experience with python, except for recently needing to install a proprietary python package at work - which caused me to look for examples, which led to noticing that the _python_srcdir paths in the two packages were invalid.

In my case, my module has to be buildable with both python and python3 (just one or the other in a given build), so dropping the _python_srcdir altogether simplified the .mk file, and worked just fine for both cases. (I modified the host-python3 install to create a "python" symlink to the host/usr/bin/python3 when python [2] wasn't selected, so that other packages can continue to call "python" in their build and install commands.)

I don't know if the people who made python-crc16, -pygame, -pyzmq had a reason for specifying the python src path, or if there was just a lot of copy/paste from a single source who just thought it seemed like a good idea at the time. The purpose of my two patches was to fix a path that was clearly wrong - out of a sense of civic duty to the community. Then, if someone more python-savvy comes along and decides that those params are not needed, at least they all look the same. (Better for grepping and sed and whatnot.)

Danomi -

#3 lore raw

PATCH 1/1 python-pygame: fix _python_srcdir

Dear Danomi Manchego,

Quoted 23 lines · Danomi Manchego
Quoted 9 lines

I'm just wondering, why do these packages need access to the Python *source* tree? What's missing from $(STAGING_DIR) to build those Python modules?

Normally, the source/build tree of each package are just temporary locations, we should *theoretically* be able of removing the source/build tree of a package once its build has completed (well, in practice, there are of course some exceptions, but it seems weird that all Python modules would need these exceptions).

Unfortunately, I have almost no experience with python, except for recently needing to install a proprietary python package at work - which caused me to look for examples, which led to noticing that the _python_srcdir paths in the two packages were invalid.

In my case, my module has to be buildable with both python and python3 (just one or the other in a given build), so dropping the _python_srcdir altogether simplified the .mk file, and worked just fine for both cases. (I modified the host-python3 install to create a "python" symlink to the host/usr/bin/python3 when python [2] wasn't selected, so that other packages can continue to call "python" in their build and install commands.)

Quoted 8 lines

I don't know if the people who made python-crc16, -pygame, -pyzmq had a reason for specifying the python src path, or if there was just a lot of copy/paste from a single source who just thought it seemed like a good idea at the time. The purpose of my two patches was to fix a path that was clearly wrong - out of a sense of civic duty to the community. Then, if someone more python-savvy comes along and decides that those params are not needed, at least they all look the same. (Better for grepping and sed and whatnot.)

Ok, so let's add a bunch of Python-savvy people in Cc and see what they have to say about _python_srcdir :-)

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com