Skip to contentSkip to conversation

New package: python-setuptools

PATCH New yegorslists at googlemail.com 2 participants 4 messages Dec 21, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 New package: python-setuptools

From: Yegor Yefremov <[email protected]>

---
 package/python-setuptools/Config.in            |    9 +++++++++
 package/python-setuptools/python-setuptools.mk |   24 ++++++++++++++++++++++++
 package/python/Config.in                       |    2 ++
 3 files changed, 35 insertions(+), 0 deletions(-)
 create mode 100644 package/python-setuptools/Config.in
 create mode 100644 package/python-setuptools/python-setuptools.mk
package/python-setuptools/Config.in new file +9 -0
new file mode 100644
index 0000000..365470e
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_SETUPTOOLS
+	bool "python-setuptools"
+	depends on BR2_PACKAGE_PYTHON
+	help
+	  Download, build, install, upgrade, and uninstall Python packages.
+
+	  http://pypi.python.org/pypi/setuptools
+
+
package/python-setuptools/python-setuptools.mk new file +24 -0
new file mode 100644
index 0000000..1103717
@@ -0,0 +1,24 @@
+#############################################################
+#
+# python-setuptools
+#
+#############################################################
+
+PYTHON_SETUPTOOLS_VERSION = 0.6c11
+PYTHON_SETUPTOOLS_SOURCE  = setuptools-$(PYTHON_SETUPTOOLS_VERSION).tar.gz
+PYTHON_SETUPTOOLS_SITE    = http://pypi.python.org/packages/source/s/setuptools
+PYTHON_INSTALL_STAGING = YES
+PYTHON_SETUPTOOLS_DEPENDENCIES = python
+
+define HOST_PYTHON_SETUPTOOLS_BUILD_CMDS
+	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
+endef
+
+define HOST_PYTHON_SETUPTOOLS_INSTALL_CMDS
+	(cd $(@D); PYTHONPATH="$(HOST_DIR)/usr/lib/python2.7/site-packages"\
+	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
+endef
+
+$(eval $(call GENTARGETS))
+$(eval $(call GENTARGETS,host))
+
package/python/Config.in +2 -0
index 11aa267..c48496a 100644
@@ -93,6 +93,8 @@ config BR2_PACKAGE_PYTHON_ZLIB
 	help
 	  zlib support in Python
 
+source "package/python-setuptools/Config.in"
+
 endmenu
 
 endif
Signature · 1 line
1.7.1.1
#1 lore raw

PATCH 1/1 New package: python-setuptools

Quoted 68 lines · On Wed, Dec 21, 2011 at 11:52 AM, <[email protected]> wrote:

From: Yegor Yefremov <[email protected]>

---

?package/python-setuptools/Config.in ? ? ? ? ? ?| ? ?9 +++++++++
?package/python-setuptools/python-setuptools.mk | ? 24 ++++++++++++++++++++++++
?package/python/Config.in ? ? ? ? ? ? ? ? ? ? ? | ? ?2 ++

?3 files changed, 35 insertions(+), 0 deletions(-) ?create mode 100644 package/python-setuptools/Config.in ?create mode 100644 package/python-setuptools/python-setuptools.mk

package/python-setuptools/Config.in new file +9 -0
new file mode 100644
index 0000000..365470e
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_SETUPTOOLS
+ ? ? ? bool "python-setuptools"
+ ? ? ? depends on BR2_PACKAGE_PYTHON
+ ? ? ? help
+ ? ? ? ? Download, build, install, upgrade, and uninstall Python packages.
+
+ ? ? ? ? http://pypi.python.org/pypi/setuptools
+
+
package/python-setuptools/python-setuptools.mk new file +24 -0
new file mode 100644
index 0000000..1103717
@@ -0,0 +1,24 @@
+#############################################################
+#
+# python-setuptools
+#
+#############################################################
+
+PYTHON_SETUPTOOLS_VERSION = 0.6c11
+PYTHON_SETUPTOOLS_SOURCE ?= setuptools-$(PYTHON_SETUPTOOLS_VERSION).tar.gz
+PYTHON_SETUPTOOLS_SITE ? ?= http://pypi.python.org/packages/source/s/setuptools
+PYTHON_INSTALL_STAGING = YES
+PYTHON_SETUPTOOLS_DEPENDENCIES = python
+
+define HOST_PYTHON_SETUPTOOLS_BUILD_CMDS
+ ? ? ? (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
+endef
+
+define HOST_PYTHON_SETUPTOOLS_INSTALL_CMDS
+ ? ? ? (cd $(@D); PYTHONPATH="$(HOST_DIR)/usr/lib/python2.7/site-packages"\
+ ? ? ? $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
+endef
+
+$(eval $(call GENTARGETS))
+$(eval $(call GENTARGETS,host))
+
package/python/Config.in +0 -0
index 11aa267..c48496a 100644
@@ -93,6 +93,8 @@ config BR2_PACKAGE_PYTHON_ZLIB

? ? ? ?help
? ? ? ? ?zlib support in Python

package/python/Config.in +2 -0
+source "package/python-setuptools/Config.in"
+

?endmenu

Quoted 4 lines

?endif
--
1.7.1.1

I have some questions regarding host packages. How do I tell BR to build it as host package? I've already defined HOST_PYTHON_SETUPTOOLS_BUILD_CMDS and HOST_PYTHON_SETUPTOOLS_INSTALL_CMDS but ir doesn't seem to matter. What am I missing?

Do we need this package in staging and or target?

Yegor

#2 lore raw

PATCH 1/1 New package: python-setuptools

Le Wed, 21 Dec 2011 11:58:08 +0100,
Yegor Yefremov <[email protected]> a ?crit :

Quoted 2 lines

I have some questions regarding host packages. How do I tell BR to build it as host package?

You need to have another package that depends on host-python-setuptools.

Quoted 1 line

Do we need this package in staging and or target?

No. What you did looks good. Just create a package that depends on host-python-setuptools.

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

PATCH 1/1 New package: python-setuptools

In reply to yegorslists at googlemail.com

Le Wed, 21 Dec 2011 11:52:55 +0100,
yegorslists at googlemail.com a ?crit :

Quoted 1 line

+PYTHON_INSTALL_STAGING = YES

Your .mk file does not contain the build and install commands for a target version of this package, so this line is useless.

Quoted 1 line

+PYTHON_SETUPTOOLS_DEPENDENCIES = python

Again, this won't be used since you have defined only a host variant for your package. What you need is:

HOST_PYTHON_SETUPTOOLS_DEPENDENCIES = host-python

package/python-setuptools/python-setuptools.mk line 18

Quoted 1 line
package/python-setuptools/python-setuptools.mk new file +1 -0
+	(cd $(@D); PYTHONPATH="$(HOST_DIR)/usr/lib/python2.7/site-packages"\

Use $(PYTHON_VERSION_MAJOR) instead of hardcoding 2.7.

Quoted 1 line

+$(eval $(call GENTARGETS))

Remove this line this you haven't implemented a target variant for this package.

Quoted 1 line

+source "package/python-setuptools/Config.in"

And remove the Config.in file altogether as you haven't implemented a target variant for this package.

Of course, if you intend to also support building setuptools for the target, keep the Config.in file and the $(eval $(call GENTARGETS)) line, but remember to implement the BUILD_CMDS and INSTALL_*_CMDS as well.

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com