Skip to contentSkip to conversation

Python infrastructure and package conversion

PATCH New Thomas Petazzoni 5 participants 58 messages Dec 8, 2013 – Dec 11, 2013

lore
Share & tools
lore
#0 lore raw

cover Python infrastructure and package conversion

Hello,

This set of patches add a new infrastructure for Python packages, which support both distutils and setuptools based packages. It also converts all the current Python packages to this infrastructure, and adds a bunch of new Python packages that have been sitting in patchwork for a while.

Thanks to this infrastructure, the vast majority of Python packages no longer need to write any <something>_CMDS. All they need to do is to explicitly say, through the <pkg>_SETUP_TYPE variable, whether the setup.py of the package is distutils-based or setuptools-based.

When it's setuptools-based, then the infrastructure will automatically build host-setuptools an host-distutilscross.

A short overview of the patches:

* Patches 1 and 2 make relatively unrelated fixes to the dialog package, which were found while doing the Python conversion of python-dialog.

* Patch 3 adds the Python infrastructure itself.

* Patches 4 to 25 convert all the existing Python packages to use the new infrastructure.

* Patches 26 to 38 add new Python packages that have been sitting on patchwork for some time, including some contributed by Ryan Barnett, who did rebase them on the Python infrastructure.

This complete set of patches is available on a Git branch at:

http://git.free-electrons.com/users/thomas-petazzoni/buildroot/log/?h=python-pkg

I have already started working on making the infrastructure work with Python 3 as well, and I have a bunch of patches that do this. However, they are not completely ready yet, and since Python modules anyway can't be used today with Python 3, merging this Python 2 only package infrastructure is not a regression.

Of course, testing is more than welcome.

Thanks a lot!

Thomas

Ludovic Desroches (4):
python-versiontools: new package
python-keyring: new package
python-simplejson: new package
python-json-schema-validator: new package

Ryan Barnett (6):
python-tornado: new package
python-pyasn: new package
python-pycrypto: new package
python-pysnmp: new package
python-pysnmp-apps: new package
python-pysnmp-mibs: new package

Thomas Petazzoni (25):
dialog: add missing comment when thread support is missing
dialog: remove useless POST_CLEAN command
package: introduce Python package infrastructure
python-bottle: convert to the Python package infrastructure
python-crc16: convert to the Python package infrastructure
python-dpkt: convert to the Python package infrastructure
python-id3: convert to the Python package infrastructure
python-ipy: convert to the Python package infrastructure
python-m2crypto: convert to the Python package infrastructure
python-mad: convert to the Python package infrastructure
python-meld3: convert to the Python package infrastructure
python-nfc: convert to the Python package infrastructure
python-protobuf: convert to the Python package infrastructure
python-pygame: convert to the Python package infrastructure
python-pyparsing: convert to the Python package infrastructure
python-pyro: convert to the Python package infrastructure
python-pyzmq: convert to the Python package infrastructure
python-serial: convert to the Python package infrastructure
python-setuptools: convert to the Python package infrastructure
scons: convert to the Python package infrastructure
python-netifaces: convert to the Python package infrastructure
supervisor: convert to the Python package infrastructure
python-distutilscross: convert to the Python package infrastructure
python-thrift: convert to the Python package infrastructure
python-dialog: convert to the Python package infrastructure

Wojciech M. Zabolotny (2):
python-pyusb: new package
python-msgpack: new package

Zoltan Gyarmati (1):
python-configobj: new package

 docs/manual/adding-packages-python.txt             | 136 +++++++++++++
 docs/manual/adding-packages.txt                    |   2 +
 package/Config.in                                  |  13 ++
 package/Makefile.in                                |   1 +
 package/dialog/Config.in                           |   4 +
 package/dialog/dialog.mk                           |   5 -
 package/pkg-python.mk                              | 219 +++++++++++++++++++++
 package/python-bottle/python-bottle.mk             |  12 +-
 package/python-configobj/Config.in                 |  10 +
 package/python-configobj/python-configobj.mk       |  14 ++
 package/python-crc16/python-crc16.mk               |  25 +--
 package/python-dialog/python-dialog.mk             |  14 +-
 .../python-distutilscross/python-distutilscross.mk |  13 +-
 package/python-dpkt/python-dpkt.mk                 |  13 +-
 package/python-id3/python-id3.mk                   |  13 +-
 package/python-ipy/python-ipy.mk                   |  17 +-
 package/python-json-schema-validator/Config.in     |   8 +
 .../python-json-schema-validator.mk                |  15 ++
 package/python-keyring/Config.in                   |   8 +
 package/python-keyring/python-keyring.mk           |  19 ++
 package/python-m2crypto/python-m2crypto.mk         |  20 +-
 package/python-mad/python-mad.mk                   |  20 +-
 package/python-meld3/python-meld3.mk               |  12 +-
 package/python-msgpack/Config.in                   |  16 ++
 package/python-msgpack/python-msgpack.mk           |  15 ++
 package/python-netifaces/Config.in                 |   1 -
 package/python-netifaces/python-netifaces.mk       |  19 +-
 package/python-nfc/python-nfc.mk                   |  13 +-
 package/python-protobuf/python-protobuf.mk         |  20 +-
 package/python-pyasn/Config.in                     |  13 ++
 package/python-pyasn/python-pyasn.mk               |  19 ++
 package/python-pycrypto/Config.in                  |   9 +
 package/python-pycrypto/python-pycrypto.mk         |  35 ++++
 package/python-pygame/python-pygame.mk             |  25 +--
 package/python-pyparsing/python-pyparsing.mk       |  28 +--
 package/python-pyro/python-pyro.mk                 |   8 +-
 package/python-pysnmp-apps/Config.in               |  13 ++
 package/python-pysnmp-apps/python-pysnmp-apps.mk   |  16 ++
 package/python-pysnmp-mibs/Config.in               |  13 ++
 package/python-pysnmp-mibs/python-pysnmp-mibs.mk   |  16 ++
 package/python-pysnmp/Config.in                    |  14 ++
 package/python-pysnmp/python-pysnmp.mk             |  17 ++
 package/python-pyusb/Config.in                     |  14 ++
 package/python-pyusb/python-pyusb.mk               |  14 ++
 package/python-pyzmq/python-pyzmq.mk               |  26 +--
 package/python-serial/python-serial.mk             |  13 +-
 package/python-setuptools/python-setuptools.mk     |  28 +--
 package/python-simplejson/Config.in                |   7 +
 package/python-simplejson/python-simplejson.mk     |  14 ++
 package/python-thrift/python-thrift.mk             |  26 +--
 package/python-tornado/Config.in                   |   8 +
 package/python-tornado/python-tornado.mk           |  13 ++
 package/python-versiontools/Config.in              |   7 +
 package/python-versiontools/python-versiontools.mk |  13 ++
 package/scons/scons.mk                             |  13 +-
 package/supervisor/Config.in                       |   1 -
 package/supervisor/supervisor.mk                   |  22 +--
 57 files changed, 810 insertions(+), 332 deletions(-)
 create mode 100644 docs/manual/adding-packages-python.txt
 create mode 100644 package/pkg-python.mk
 create mode 100644 package/python-configobj/Config.in
 create mode 100644 package/python-configobj/python-configobj.mk
 create mode 100644 package/python-json-schema-validator/Config.in
 create mode 100644 package/python-json-schema-validator/python-json-schema-validator.mk
 create mode 100644 package/python-keyring/Config.in
 create mode 100644 package/python-keyring/python-keyring.mk
 create mode 100644 package/python-msgpack/Config.in
 create mode 100644 package/python-msgpack/python-msgpack.mk
 create mode 100644 package/python-pyasn/Config.in
 create mode 100644 package/python-pyasn/python-pyasn.mk
 create mode 100644 package/python-pycrypto/Config.in
 create mode 100644 package/python-pycrypto/python-pycrypto.mk
 create mode 100644 package/python-pysnmp-apps/Config.in
 create mode 100644 package/python-pysnmp-apps/python-pysnmp-apps.mk
 create mode 100644 package/python-pysnmp-mibs/Config.in
 create mode 100644 package/python-pysnmp-mibs/python-pysnmp-mibs.mk
 create mode 100644 package/python-pysnmp/Config.in
 create mode 100644 package/python-pysnmp/python-pysnmp.mk
 create mode 100644 package/python-pyusb/Config.in
 create mode 100644 package/python-pyusb/python-pyusb.mk
 create mode 100644 package/python-simplejson/Config.in
 create mode 100644 package/python-simplejson/python-simplejson.mk
 create mode 100644 package/python-tornado/Config.in
 create mode 100644 package/python-tornado/python-tornado.mk
 create mode 100644 package/python-versiontools/Config.in
 create mode 100644 package/python-versiontools/python-versiontools.mk
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/38 dialog: add missing comment when thread support is missing

This was noticed when reviewing the packaging for the python-dialog package.

---
 package/dialog/Config.in | 4 ++++
 1 file changed, 4 insertions(+)
package/dialog/Config.in +4 -0
index b3efd8d..c7cd8a4 100644
@@ -10,3 +10,7 @@ config BR2_PACKAGE_DIALOG
 	  This application provides a method of displaying several different
 	  types of dialog boxes from shell scripts.  This allows a developer
 	  of a script to interact with the user in a much friendlier manner.
+
+comment "dialog needs a toolchain w/ threads"
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
+	depends on BR2_USE_MMU
Signature · 1 line
1.8.1.2
#2 lore raw

PATCH 1/38 dialog: add missing comment when thread support is missing

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

This was noticed when reviewing the packaging for the python-dialog package.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#3 lore raw

PATCH 2/38 dialog: remove useless POST_CLEAN command

In reply to Thomas Petazzoni

For some reason, the dialog package has a DIALOG_POST_CLEAN variable, which doesn't match any of the variables understood by the infrastructure. This commit gets rid of it.

This was noticed while reviewing the packaging of python-dialog.

---
 package/dialog/dialog.mk | 5 -----
 1 file changed, 5 deletions(-)
package/dialog/dialog.mk +0 -5
index 06379f2..9846fd3 100644
@@ -21,9 +21,4 @@ define DIALOG_INSTALL_TARGET_CMDS
 	install -c $(@D)/dialog $(TARGET_DIR)/usr/bin/dialog
 endef
 
-define DIALOG_POST_CLEAN
-	-$(MAKE) -C $(@D) clean
-	rm -f $(TARGET_DIR)/usr/bin/dialog
-endef
-
 $(eval $(autotools-package))
Signature · 1 line
1.8.1.2
#4 lore raw

PATCH 2/38 dialog: remove useless POST_CLEAN command

Quoted 9 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

For some reason, the dialog package has a DIALOG_POST_CLEAN variable, which doesn't match any of the variables understood by the infrastructure. This commit gets rid of it.

This was noticed while reviewing the packaging of python-dialog.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw

PATCH 3/38 package: introduce Python package infrastructure

In reply to Thomas Petazzoni
---
 docs/manual/adding-packages-python.txt | 136 ++++++++++++++++++++
 docs/manual/adding-packages.txt        |   2 +
 package/Makefile.in                    |   1 +
 package/pkg-python.mk                  | 219 +++++++++++++++++++++++++++++++++
 4 files changed, 358 insertions(+)
 create mode 100644 docs/manual/adding-packages-python.txt
 create mode 100644 package/pkg-python.mk
docs/manual/adding-packages-python.txt new file +136 -0
new file mode 100644
index 0000000..9b5876f
@@ -0,0 +1,136 @@
+// -*- mode:doc; -*-
+// vim: set syntax=asciidoc:
+
+Infrastructure for Python packages
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This infrastructure applies to Python packages that use the standard
+Python setuptools mechanism as their build system, generally
+recognizable as the usage of a +setup.py+ script.
+
+[[python-package-tutorial]]
+
++python-package+ tutorial
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+First, let's see how to write a +.mk+ file for a Python package,
+with an example :
+
+------------------------
+01: ################################################################################
+02: #
+03: # python-foo
+04: #
+05: ################################################################################
+06:
+07: PYTHON_FOO_VERSION = 1.0
+08: PYTHON_FOO_SOURCE = python-foo-$(LIBFOO_VERSION).tar.xz
+09: PYTHON_FOO_SITE = http://www.foosoftware.org/download
+10: PYTHON_FOO_LICENSE = BSD-3c
+11: PYTHON_FOO_LICENSE_FILES = LICENSE
+12: PYTHON_FOO_ENV = SOME_VAR=1
+13: PYTHON_FOO_DEPENDENCIES = libmad
+14: PYTHON_FOO_SETUP_TYPE = distutils
+15:
+16: $(eval $(python-package))
+------------------------
+
+On line 7, we declare the version of the package.
+
+On line 8 and 9, we declare the name of the tarball (xz-ed tarball
+recommended) and the location of the tarball on the Web. Buildroot
+will automatically download the tarball from this location.
+
+On line 10 and 11, we give licensing details about the package (its
+license on line 10, and the file containing the license text on line
+11).
+
+On line 12, we tell Buildroot to pass custom options to the Python
++setup.py+ script when it is configuring the package.
+
+On line 13, we declare our dependencies, so that they are built
+before the build process of our package starts.
+
+On line 14, we declare the specific Python build system being used. In
+this case the +distutils+ Python build system is used. The two
+supported ones are +distutils+ and +setuptools+.
+
+Finally, on line line 16, we invoke the +python-package+ macro that
+generates all the Makefile rules that actually allows the package to
+be built.
+
+[[python-package-reference]]
+
++python-package+ reference
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The main macro of the Python package infrastructure is
++python-package+. It is similar to the +generic-package+ macro. The
+ability to have Python host packages is also available, with the
++host-python-package+ macro.
+
+Just like the generic infrastructure, the Python infrastructure works
+by defining a number of variables before calling the +python-package+
+or +host-python-package+ macros.
+
+First, all the package metadata information variables that exist in
+the generic infrastructure also exist in the Python infrastructure:
++PYTHON_FOO_VERSION+, +PYTHON_FOO_SOURCE+, +PYTHON_FOO_PATCH+,
++PYTHON_FOO_SITE+, +PYTHON_FOO_SUBDIR+, +PYTHON_FOO_DEPENDENCIES+,
++PYTHON_FOO_LICENSE+, +PYTHON_FOO_LICENSE_FILES+, etc.
+
+Note however that setting +PYTHON_FOO_INSTALL_STAGING+ to +YES+ has no
+effect (unless a +PYTHON_FOO_INSTALL_STAGING_CMDS+ variable is
+defined), since Python modules generally don't need to be installed to
+the staging directory.
+
+For Python packages, one specific variable is mandatory:
+
+* +PYTHON_FOO_BUILD_TYPE+, to define which Python build system is used
+  by the package. The two supported values are +distutils+ and
+  +setuptools+. If you don't know which one is used in your package,
+  look at the +setup.py+ file in your package source code, and see
+  whether it imports things from the +distutils+ module or the
+  +setuptools+ module.
+
+A few additional variables, specific to the Python infrastructure, can
+also optionaly be defined, depending on the needs. Many of them are
+only useful in very specific cases, typical packages will therefore
+only use a few of them.
+
+* +PYTHON_FOO_ENV+, to specify additional environment variables to
+  pass to the Python +setup.py+ script (for both the build and install
+  steps). Note that the infrastructure is automatically passing
+  several standard variables: defined in +PKG_PYTHON_DISTUTILS_ENV+
+  (for distutils target packages), +HOST_PKG_PYTHON_DISTUTILS_ENV+
+  (for distutils host packages), +PKG_PYTHON_SETUPTOOLS_ENV+ (for
+  setuptools target packages) and +HOST_PKG_PYTHON_SETUPTOOLS_ENV+
+  (for setuptools host packages).
+
+* +PYTHON_FOO_BUILD_OPT+, to specify additional options to pass to the
+  Python +setup.py+ script during the build step. For target distutils
+  packages, the +PKG_PYTHON_DISTUTILS_BUILD_OPT+ options are already
+  passed automatically by the infrastructure.
+
+* +PYTHON_FOO_INSTALL_OPT+, to specify additional options to pass to
+  the Python +setup.py+ script during the installation step. Note that
+  the infrastructure is automatically passing some options, defined in
+  +PKG_PYTHON_DISTUTILS_INSTALL_OPT+ (for target distutils packages),
+  +HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPT+ (for host distutils
+  packages), +PKG_PYTHON_SETUPTOOLS_INSTALL_OPT+ (for target
+  setuptools packages) and +HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPT+
+  (for host setuptools packages).
+
+With the Python infrastructure, all the steps required to build and
+install the packages are already defined, and they generally work well
+for most Python-based packages. However, when required, it is still
+possible to customize what is done in any particular step:
+
+* By adding a post-operation hook (after extract, patch, configure,
+  build or install). See xref:hooks[] for details.
+
+* By overriding one of the steps. For example, even if the Python
+  infrastructure is used, if the package +.mk+ file defines its own
+  +PYTHON_FOO_BUILD_CMDS+ variable, it will be used instead of the
+  default Python one. However, using this method should be restricted
+  to very specific cases. Do not use it in the general case.
docs/manual/adding-packages.txt +2 -0
index ae76e74..01277d8 100644
@@ -18,6 +18,8 @@ include::adding-packages-autotools.txt[]
 
 include::adding-packages-cmake.txt[]
 
+include::adding-packages-python.txt[]
+
 include::adding-packages-hooks.txt[]
 
 include::adding-packages-gettext.txt[]
package/Makefile.in +1 -0
index 7bc0606..f5d6289 100644
@@ -371,4 +371,5 @@ include package/pkg-utils.mk
 include package/pkg-download.mk
 include package/pkg-autotools.mk
 include package/pkg-cmake.mk
+include package/pkg-python.mk
 include package/pkg-generic.mk
package/pkg-python.mk new file +219 -0

219 lines not on this page · raw message

Signature · 1 line
1.8.1.2
#6 lore raw

PATCH 3/38 package: introduce Python package infrastructure

Hi Thomas,

Quoted 16 lines · Thomas Petazzoni
---
 docs/manual/adding-packages-python.txt | 136 ++++++++++++++++++++
 docs/manual/adding-packages.txt        |   2 +
 package/Makefile.in                    |   1 +
 package/pkg-python.mk                  | 219 +++++++++++++++++++++++++++++++++
 4 files changed, 358 insertions(+)
 create mode 100644 docs/manual/adding-packages-python.txt
 create mode 100644 package/pkg-python.mk
docs/manual/adding-packages-python.txt new file +0 -0
new file mode 100644
index 0000000..9b5876f

docs/manual/adding-packages-python.txt line 9

Quoted 9 lines
docs/manual/adding-packages-python.txt new file +9 -0
@@ -0,0 +1,136 @@
+// -*- mode:doc; -*-
+// vim: set syntax=asciidoc:
+
+Infrastructure for Python packages
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+This infrastructure applies to Python packages that use the standard
+Python setuptools mechanism as their build system, generally
+recognizable as the usage of a +setup.py+ script.

I would rather say: 'recognizable by'

Quoted 23 lines
docs/manual/adding-packages-python.txt new file +23 -0
+
+[[python-package-tutorial]]
+
++python-package+ tutorial
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+First, let's see how to write a +.mk+ file for a Python package,
+with an example :
+
+------------------------
+01: ################################################################################
+02: #
+03: # python-foo
+04: #
+05: ################################################################################
+06:
+07: PYTHON_FOO_VERSION = 1.0
+08: PYTHON_FOO_SOURCE = python-foo-$(LIBFOO_VERSION).tar.xz
+09: PYTHON_FOO_SITE = http://www.foosoftware.org/download
+10: PYTHON_FOO_LICENSE = BSD-3c
+11: PYTHON_FOO_LICENSE_FILES = LICENSE
+12: PYTHON_FOO_ENV = SOME_VAR=1
+13: PYTHON_FOO_DEPENDENCIES = libmad

docs/manual/adding-packages-python.txt line 42

Quoted 10 lines
docs/manual/adding-packages-python.txt new file +10 -0
+14: PYTHON_FOO_SETUP_TYPE = distutils
+15:
+16: $(eval $(python-package))
+------------------------
+
+On line 7, we declare the version of the package.
+
+On line 8 and 9, we declare the name of the tarball (xz-ed tarball
+recommended) and the location of the tarball on the Web. Buildroot
+will automatically download the tarball from this location.

Should we clarify here that if the tarball is .gz, it shouldn't be specified because it's currently the default?

Quoted 6 lines
docs/manual/adding-packages-python.txt new file +6 -0
+
+On line 10 and 11, we give licensing details about the package (its
+license on line 10, and the file containing the license text on line
+11).
+
+On line 12, we tell Buildroot to pass custom options to the Python

docs/manual/adding-packages-python.txt line 58

Quoted 10 lines
docs/manual/adding-packages-python.txt new file +10 -0
++setup.py+ script when it is configuring the package.
+
+On line 13, we declare our dependencies, so that they are built
+before the build process of our package starts.
+
+On line 14, we declare the specific Python build system being used. In
+this case the +distutils+ Python build system is used. The two
+supported ones are +distutils+ and +setuptools+.
+
+Finally, on line line 16, we invoke the +python-package+ macro that

line line

docs/manual/adding-packages-python.txt line 59

Quoted 1 line
docs/manual/adding-packages-python.txt new file +1 -0
+generates all the Makefile rules that actually allows the package to

allow

Quoted 7 lines
docs/manual/adding-packages-python.txt new file +7 -0
+be built.
+
+[[python-package-reference]]
+
++python-package+ reference
+^^^^^^^^^^^^^^^^^^^^^^^^^
+

docs/manual/adding-packages-python.txt line 76

Quoted 10 lines
docs/manual/adding-packages-python.txt new file +10 -0
+The main macro of the Python package infrastructure is
++python-package+. It is similar to the +generic-package+ macro. The
+ability to have Python host packages is also available, with the
++host-python-package+ macro.
+
+Just like the generic infrastructure, the Python infrastructure works
+by defining a number of variables before calling the +python-package+
+or +host-python-package+ macros.
+
+First, all the package metadata information variables that exist in

The word First sounds odd to me here. I would rather use 'To start with,' or 'First of all,'.

docs/manual/adding-packages-python.txt line 87

Quoted 11 lines
docs/manual/adding-packages-python.txt new file +11 -0
+the generic infrastructure also exist in the Python infrastructure:
++PYTHON_FOO_VERSION+, +PYTHON_FOO_SOURCE+, +PYTHON_FOO_PATCH+,
++PYTHON_FOO_SITE+, +PYTHON_FOO_SUBDIR+, +PYTHON_FOO_DEPENDENCIES+,
++PYTHON_FOO_LICENSE+, +PYTHON_FOO_LICENSE_FILES+, etc.
+
+Note however that setting +PYTHON_FOO_INSTALL_STAGING+ to +YES+ has no
+effect (unless a +PYTHON_FOO_INSTALL_STAGING_CMDS+ variable is
+defined), since Python modules generally don't need to be installed to
+the staging directory.
+
+For Python packages, one specific variable is mandatory:

Is it needed to say 'For Python packages' here?

docs/manual/adding-packages-python.txt line 97

Quoted 10 lines
docs/manual/adding-packages-python.txt new file +10 -0
+
+* +PYTHON_FOO_BUILD_TYPE+, to define which Python build system is used
+  by the package. The two supported values are +distutils+ and
+  +setuptools+. If you don't know which one is used in your package,
+  look at the +setup.py+ file in your package source code, and see
+  whether it imports things from the +distutils+ module or the
+  +setuptools+ module.
+
+A few additional variables, specific to the Python infrastructure, can
+also optionaly be defined, depending on the needs. Many of them are

* I would remove 'also' here.
* optionally (two l's)
* The 'depending on the needs' sounds odd to me, suggestions:
"depending on the needs of the package" or "depending on the package's needs".

docs/manual/adding-packages-python.txt line 104

Quoted 7 lines
docs/manual/adding-packages-python.txt new file +7 -0
+only useful in very specific cases, typical packages will therefore
+only use a few of them.
+
+* +PYTHON_FOO_ENV+, to specify additional environment variables to
+  pass to the Python +setup.py+ script (for both the build and install
+  steps). Note that the infrastructure is automatically passing
+  several standard variables: defined in +PKG_PYTHON_DISTUTILS_ENV+

Is the colon needed here? After a colon I would have expected a list of variables that are automatically passed; however what follows is rather in which containers these variables are put. So I'd replace the colon with a comma, as you did for INSTALL_OPT.

Quoted 37 lines
docs/manual/adding-packages-python.txt new file +32 -0
+  (for distutils target packages), +HOST_PKG_PYTHON_DISTUTILS_ENV+
+  (for distutils host packages), +PKG_PYTHON_SETUPTOOLS_ENV+ (for
+  setuptools target packages) and +HOST_PKG_PYTHON_SETUPTOOLS_ENV+
+  (for setuptools host packages).
+
+* +PYTHON_FOO_BUILD_OPT+, to specify additional options to pass to the
+  Python +setup.py+ script during the build step. For target distutils
+  packages, the +PKG_PYTHON_DISTUTILS_BUILD_OPT+ options are already
+  passed automatically by the infrastructure.
+
+* +PYTHON_FOO_INSTALL_OPT+, to specify additional options to pass to
+  the Python +setup.py+ script during the installation step. Note that
+  the infrastructure is automatically passing some options, defined in
+  +PKG_PYTHON_DISTUTILS_INSTALL_OPT+ (for target distutils packages),
+  +HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPT+ (for host distutils
+  packages), +PKG_PYTHON_SETUPTOOLS_INSTALL_OPT+ (for target
+  setuptools packages) and +HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPT+
+  (for host setuptools packages).
+
+With the Python infrastructure, all the steps required to build and
+install the packages are already defined, and they generally work well
+for most Python-based packages. However, when required, it is still
+possible to customize what is done in any particular step:
+
+* By adding a post-operation hook (after extract, patch, configure,
+  build or install). See xref:hooks[] for details.
+
+* By overriding one of the steps. For example, even if the Python
+  infrastructure is used, if the package +.mk+ file defines its own
+  +PYTHON_FOO_BUILD_CMDS+ variable, it will be used instead of the
+  default Python one. However, using this method should be restricted
+  to very specific cases. Do not use it in the general case.
docs/manual/adding-packages.txt +0 -0
index ae76e74..01277d8 100644

docs/manual/adding-packages.txt include::adding-packages-autotools.txt[] · line 25

Quoted 8 lines
docs/manual/adding-packages.txt +2 -0
@@ -18,6 +18,8 @@ include::adding-packages-autotools.txt[]
 
 include::adding-packages-cmake.txt[]
 
+include::adding-packages-python.txt[]
+
 include::adding-packages-hooks.txt[]
 
 include::adding-packages-gettext.txt[]

What I have not yet seen in the documentation is a naming policy for python packages. I understood that we expect them all to be named python-foo, right, so maybe this could be added in the new python section of the manual?

Quoted 44 lines
package/Makefile.in +1 -0
index 7bc0606..f5d6289 100644
@@ -371,4 +371,5 @@ include package/pkg-utils.mk
 include package/pkg-download.mk
 include package/pkg-autotools.mk
 include package/pkg-cmake.mk
+include package/pkg-python.mk
 include package/pkg-generic.mk
package/pkg-python.mk new file +28 -0
new file mode 100644
index 0000000..4556843
@@ -0,0 +1,219 @@
+################################################################################
+# Python package infrastructure
+#
+# This file implements an infrastructure that eases development of
+# package .mk files for Python packages. It should be used for all
+# packages that use Python setup.py/setuptools as their build system.
+#
+# See the Buildroot documentation for details on the usage of this
+# infrastructure
+#
+# In terms of implementation, this Python infrastructure requires the
+# .mk file to only specify metadata informations about the package:
+# name, version, download URL, etc.
+#
+# We still allow the package .mk file to override what the different
+# steps are doing, if needed. For example, if <PKG>_BUILD_CMDS is
+# already defined, it is used as the list of commands to perform to
+# build the package, instead of the default Python behaviour. The
+# package can also define some post operation hooks.
+#
+################################################################################
+
+# Passed in the environment of build and install steps of target
+# distutils based packages.
+PKG_PYTHON_DISTUTILS_ENV = \
+       PATH="$(TARGET_PATH)" \
+       CC="$(TARGET_CC)" \
+       CFLAGS="$(TARGET_CFLAGS)" \

package/pkg-python.mk line 38

Quoted 10 lines
package/pkg-python.mk new file +10 -0
+       LDFLAGS="$(TARGET_LDFLAGS)" \
+       LDSHARED="$(TARGET_CROSS)gcc -shared" \
+       CROSS_COMPILING=yes \
+       _python_sysroot=$(STAGING_DIR) \
+       _python_srcdir=$(PYTHON_DIR) \
+       _python_prefix=/usr \
+       _python_exec_prefix=/usr
+
+# Passed as options of the build step of target distutils based
+# packages.

This is probably personal, but I don't feel this comment explains more than the variable name already does.
Moreover, to repeat the text 'of target distutils based packages' for each of the ENV, BUILD_OPT, INSTALL_OPT variables seems redundant too. What about a structure like:

# target distutils-based packages
PKG_PYTHON_DISTUTILS_ENV = ...
PKG_PYTHON_DISTUTILS_BUILD_OPT = ...
PKG_PYTHON_DISTUTIRS_INSTALL_OPT = ...
# host distutils-based packages
....
# target setuptools-based packages
...
# host setuptools-based packages
...
Quoted 95 lines
package/pkg-python.mk new file +95 -0
+PKG_PYTHON_DISTUTILS_BUILD_OPT = \
+       --executable=/usr/bin/python
+
+# Passed as options of the install step of target distutils based
+# packages.
+PKG_PYTHON_DISTUTILS_INSTALL_OPT = \
+       --prefix=$(TARGET_DIR)/usr
+
+# Passed in the environment of build and install steps of host
+# distutils based packages.
+HOST_PKG_PYTHON_DISTUTILS_ENV = \
+       PATH="$(HOST_PATH)"
+
+# Passed as options of the install step of host distutils based
+# packages.
+HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPT = \
+       --prefix=$(HOST_DIR)/usr
+
+# Passed in the environment of the build and install steps of
+# setuptools based packages.
+PKG_PYTHON_SETUPTOOLS_ENV = \
+       PATH="$(TARGET_PATH)" \
+       PYTHONPATH="$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
+       PYTHONXCPREFIX="$(STAGING_DIR)/usr/"
+
+# Passed in the environment of the build and install steps of
+# setuptools based packages built for the host.
+HOST_PKG_PYTHON_SETUPTOOLS_ENV = \
+       PATH="$(HOST_PATH)" \
+       PYTHONXCPREFIX="$(HOST_DIR)/usr/"
+
+# Passed as options of the install of setuptools based packages.
+PKG_PYTHON_SETUPTOOLS_INSTALL_OPT = \
+       --prefix=$(TARGET_DIR)/usr \
+       --executable=/usr/bin/python \
+       --single-version-externally-managed \
+       --root=/
+
+# Passed as options of the install of setuptools based packages built
+# for the host.
+HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPT = \
+       --prefix=$(HOST_DIR)/usr
+
+################################################################################
+# inner-python-package -- defines how the configuration, compilation
+# and installation of a Python package should be done, implements a
+# few hooks to tune the build process and calls the generic package
+# infrastructure to generate the necessary make targets
+#
+#  argument 1 is the lowercase package name
+#  argument 2 is the uppercase package name, including an HOST_ prefix
+#             for host packages
+#  argument 3 is the uppercase package name, without the HOST_ prefix
+#             for host packages
+#  argument 4 is the package directory prefix
+#  argument 5 is the type (target or host)
+################################################################################
+
+define inner-python-package
+
+$(2)_SRCDIR    = $$($(2)_DIR)/$($(2)_SUBDIR)
+$(2)_BUILDDIR  = $$($(2)_SRCDIR)
+
+$(2)_ENV         ?=
+$(2)_BUILD_OPT   ?=
+$(2)_INSTALL_OPT ?=
+
+ifndef $(2)_SETUP_TYPE
+ ifdef $(3)_SETUP_TYPE
+  $(2)_SETUP_TYPE = $($(3)_SETUP_TYPE)
+ else
+  $$(error "$(1): Unknown or undefined <pkg>_SETUP_TYPE")
+ endif
+endif
+
+# Distutils
+ifeq ($$($(2)_SETUP_TYPE),distutils)
+ifeq ($(5),target)
+$(2)_BASE_ENV         = $$(PKG_PYTHON_DISTUTILS_ENV)
+$(2)_BASE_BUILD_TGT   = build
+$(2)_BASE_BUILD_OPT   = $$(PKG_PYTHON_DISTUTILS_BUILD_OPT)
+$(2)_BASE_INSTALL_OPT = $$(PKG_PYTHON_DISTUTILS_INSTALL_OPT)
+else
+$(2)_BASE_ENV         = $$(HOST_PKG_PYTHON_DISTUTILS_ENV)
+$(2)_BASE_BUILD_TGT   = build
+$(2)_BASE_BUILD_OPT   =
+$(2)_BASE_INSTALL_OPT = $$(HOST_PKG_PYTHON_DISTUTILS_INSTALL_OPT)
+endif
+# Setuptools
+else ifeq ($$($(2)_SETUP_TYPE),setuptools)
+ifeq ($(5),target)
+$(2)_BASE_ENV         = $$(PKG_PYTHON_SETUPTOOLS_ENV)
+$(2)_BASE_BUILD_TGT   = build -x
+$(2)_BASE_BUILD_OPT   =
+$(2)_BASE_INSTALL_OPT = $$(PKG_PYTHON_SETUPTOOLS_INSTALL_OPT)

package/pkg-python.mk line 143

Quoted 10 lines
package/pkg-python.mk new file +10 -0
+else
+$(2)_BASE_ENV         = $$(HOST_PKG_PYTHON_SETUPTOOLS_ENV)
+$(2)_BASE_BUILD_TGT   = build
+$(2)_BASE_BUILD_OPT   =
+$(2)_BASE_INSTALL_OPT = $$(HOST_PKG_PYTHON_SETUPTOOLS_INSTALL_OPT)
+endif
+endif
+
+# This must be repeated from inner-generic-package, and we need to
+# exclude the packages added above in various situations, otherwise

Do you mean 'as we need to' ?

added below

and what do you mean with 'in various situations' here?

Quoted 67 lines
package/pkg-python.mk new file +67 -0
+# they get automatically added in the dependencies of the host package
+# when present in the dependency of the target package, which we do
+# not necessarily want, especially for host-python-distutilscross.
+$(2)_DEPENDENCIES ?= $(filter-out host-python host-python-setuptools host-python-distutilscross $(1),$(patsubst host-host-%,host-%,$(addprefix host-,$($(3)_DEPENDENCIES))))
+
+# Target packages need both the python interpreter on the target (for
+# runtime) and the python interpreter on the host (for
+# compilation). However, host packages only need the python
+# interpreter on the host.
+ifeq ($(5),target)
+$(2)_DEPENDENCIES += host-python python
+else
+$(2)_DEPENDENCIES += host-python
+endif
+
+ifeq ($$($(2)_SETUP_TYPE),setuptools)
+ifneq ($(2),HOST_PYTHON_SETUPTOOLS)
+$(2)_DEPENDENCIES += host-python-setuptools
+ifeq ($(5),target)
+$(2)_DEPENDENCIES += host-python-distutilscross
+endif
+endif
+endif
+
+#
+# Build step. Only define it if not already defined by the package .mk
+# file.
+#
+ifndef $(2)_BUILD_CMDS
+define $(2)_BUILD_CMDS
+       (cd $$($$(PKG)_BUILDDIR)/; \
+               $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \
+               $(HOST_DIR)/usr/bin/python setup.py \
+               $$($$(PKG)_BASE_BUILD_TGT) \
+               $$($$(PKG)_BASE_BUILD_OPT) $$($$(PKG)_BUILD_OPT))
+endef
+endif
+
+#
+# Host installation step. Only define it if not already defined by the
+# package .mk file.
+#
+ifndef $(2)_INSTALL_CMDS
+define $(2)_INSTALL_CMDS
+       (cd $$($$(PKG)_BUILDDIR)/; \
+               $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \
+               $(HOST_DIR)/usr/bin/python setup.py install \
+               $$($$(PKG)_BASE_INSTALL_OPT) $$($$(PKG)_INSTALL_OPT))
+endef
+endif
+
+#
+# Target installation step. Only define it if not already defined by
+# the package .mk file.
+#
+ifndef $(2)_INSTALL_TARGET_CMDS
+define $(2)_INSTALL_TARGET_CMDS
+       (cd $$($$(PKG)_BUILDDIR)/; \
+               $$($$(PKG)_BASE_ENV) $$($$(PKG)_ENV) \
+               $(HOST_DIR)/usr/bin/python setup.py install \
+               $$($$(PKG)_BASE_INSTALL_OPT) $$($$(PKG)_INSTALL_OPT))
+endef
+endif
+
+# Call the generic package infrastructure to generate the necessary
+# make targets
+$(call inner-generic-package,$(1),$(2),$(3),$(4),$(5))

package/pkg-python.mk

Quoted 10 lines
package/pkg-python.mk new file +9 -1
+
+endef
+
+################################################################################
+# python-package -- the target generator macro for Python packages
+################################################################################
+
+python-package = $(call inner-python-package,$(call pkgname),$(call UPPERCASE,$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),target)
+host-python-package = $(call inner-python-package,host-$(call pkgname),$(call UPPERCASE,host-$(call pkgname)),$(call UPPERCASE,$(call pkgname)),$(call pkgparentdir),host)
--

Best regards,
Thomas

#7 lore raw

PATCH 3/38 package: introduce Python package infrastructure

Dear Thomas De Schampheleire,

Only replying to your comments that required a reply. I have already taken into account all the typos.

Quoted 6 lines · Thomas De Schampheleire

docs/manual/adding-packages-python.txt line 42

Quoted 3 lines
docs/manual/adding-packages-python.txt new file +3 -0
+On line 8 and 9, we declare the name of the tarball (xz-ed tarball
+recommended) and the location of the tarball on the Web. Buildroot
+will automatically download the tarball from this location.

Should we clarify here that if the tarball is .gz, it shouldn't be specified because it's currently the default?

I decided not to do this, because in the case of the Python modules, it is very often not possible to rely on the default value of <pkg>_SOURCE, because the upstream tarball is named <foo>-<version>.tar.gz, but we call the package python-<foo> in Buildroot.

Quoted 4 lines

What I have not yet seen in the documentation is a naming policy for python packages. I understood that we expect them all to be named python-foo, right, so maybe this could be added in the new python section of the manual?

I've added some details about this. However, note that not *all* Python packages should be named python-<foo>. Only Python modules should be named as such. Packages such as scons and supervisor, which use a Python-based setup.py, and therefore use the python-package infrastructure, are not Python modules, and therefore do not have to be named python-scons and python-supervisor.

Quoted 8 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+# Passed as options of the build step of target distutils based
+# packages.

This is probably personal, but I don't feel this comment explains more than the variable name already does.
Moreover, to repeat the text 'of target distutils based packages' for each of the ENV, BUILD_OPT, INSTALL_OPT variables seems redundant too. What about a structure like:

Ok, fixed.

Quoted 8 lines

package/pkg-python.mk line 143

Quoted 2 lines
package/pkg-python.mk new file +2 -0
+# This must be repeated from inner-generic-package, and we need to
+# exclude the packages added above in various situations, otherwise

Do you mean 'as we need to' ?

added below

and what do you mean with 'in various situations' here?

I've added a much more detailed explanations about this, it will be in the v2.

Thanks!

Thomas

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

PATCH 4/38 python-bottle: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-bottle/python-bottle.mk | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
package/python-bottle/python-bottle.mk +2 -10
index db71512..58c51f9 100644
@@ -7,16 +7,8 @@
 PYTHON_BOTTLE_VERSION = 0.11.6
 PYTHON_BOTTLE_SOURCE = bottle-$(PYTHON_BOTTLE_VERSION).tar.gz
 PYTHON_BOTTLE_SITE = http://pypi.python.org/packages/source/b/bottle
-PYTHON_BOTTLE_DEPENDENCIES = python
 PYTHON_BOTTLE_LICENSE = MIT
 # README.rst refers to the file "LICENSE" but it's not included
+PYTHON_BOTTLE_SETUP_TYPE = distutils
 
-define PYTHON_BOTTLE_BUILD_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build --executable=/usr/bin/python)
-endef
-
-define PYTHON_BOTTLE_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#9 lore raw

PATCH 5/38 python-crc16: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-crc16/python-crc16.mk | 25 ++-----------------------
 1 file changed, 2 insertions(+), 23 deletions(-)
package/python-crc16/python-crc16.mk +2 -23
index adfdcc6..9dd09ae 100644
@@ -9,27 +9,6 @@ PYTHON_CRC16_SOURCE = crc16-$(PYTHON_CRC16_VERSION).tar.gz
 PYTHON_CRC16_SITE = http://pycrc16.googlecode.com/files/
 PYTHON_CRC16_LICENSE = LGPLv3+
 PYTHON_CRC16_LICENSE_FILES = COPYING.txt
-PYTHON_CRC16_DEPENDENCIES = python host-python
+PYTHON_CRC16_SETUP_TYPE = distutils
 
-PYTHON_CRC16_PARAMS = CC="$(TARGET_CC)" \
-		CFLAGS="$(TARGET_CFLAGS)" \
-		LDSHARED="$(TARGET_CC) -shared" \
-		LDFLAGS="$(TARGET_LDFLAGS) -L$(STAGING_DIR)/usr/lib" \
-		CROSS_COMPILING=yes \
-		_python_sysroot=$(STAGING_DIR) \
-		_python_srcdir=$(PYTHON_DIR) \
-		_python_prefix=/usr \
-		_python_exec_prefix=/usr
-
-define PYTHON_CRC16_BUILD_CMDS
-	(cd $(@D); $(PYTHON_CRC16_PARAMS) \
-		$(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define PYTHON_CRC16_INSTALL_TARGET_CMDS
-	(cd $(@D); $(PYTHON_CRC16_PARAMS) \
-		$(HOST_DIR)/usr/bin/python setup.py install \
-		--prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#10 lore raw

PATCH 6/38 python-dpkt: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-dpkt/python-dpkt.mk | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
package/python-dpkt/python-dpkt.mk +2 -11
index 314415c..0b3dc11 100644
@@ -7,15 +7,6 @@
 PYTHON_DPKT_VERSION = 1.7
 PYTHON_DPKT_SOURCE  = dpkt-$(PYTHON_DPKT_VERSION).tar.gz
 PYTHON_DPKT_SITE    = http://dpkt.googlecode.com/files
+PYTHON_DPKT_SETUP_TYPE = distutils
 
-PYTHON_DPKT_DEPENDENCIES = python
-
-define PYTHON_DPKT_BUILD_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define PYTHON_DPKT_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#11 lore raw

PATCH 7/38 python-id3: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-id3/python-id3.mk | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
package/python-id3/python-id3.mk +2 -11
index 9328a0f..5957f64 100644
@@ -7,15 +7,6 @@
 PYTHON_ID3_VERSION = 1.2
 PYTHON_ID3_SOURCE = id3-py_$(PYTHON_ID3_VERSION).tar.gz
 PYTHON_ID3_SITE = http://downloads.sourceforge.net/project/id3-py/id3-py/$(PYTHON_ID3_VERSION)
+PYTHON_ID3_SETUP_TYPE = distutils
 
-PYTHON_ID3_DEPENDENCIES = python
-
-define PYTHON_ID3_BUILD_CMDS
-    (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define PYTHON_ID3_INSTALL_TARGET_CMDS
-    (cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#12 lore raw

PATCH 8/38 python-ipy: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-ipy/python-ipy.mk | 17 ++---------------
 1 file changed, 2 insertions(+), 15 deletions(-)
package/python-ipy/python-ipy.mk +2 -15
index c03f91f..6e05ee9 100644
@@ -6,21 +6,8 @@
 
 PYTHON_IPY_VERSION = IPy-0.75
 PYTHON_IPY_SITE    = $(call github,haypo,python-ipy,$(PYTHON_IPY_VERSION))
-PYTHON_IPY_DEPENDENCIES = host-python python
 PYTHON_IPY_LICENSE = BSD-3c
 PYTHON_IPY_LICENSE_FILES = COPYING
+PYTHON_IPY_SETUP_TYPE = distutils
 
-define PYTHON_IPY_BUILD_CMDS
-	(cd $(@D); \
-		$(TARGET_CONFIGURE_OPTS) \
-		$(HOST_DIR)/usr/bin/python setup.py build_ext \
-		--include-dirs=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR) \
-	)
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define PYTHON_IPY_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#13 lore raw

PATCH 9/38 python-m2crypto: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-m2crypto/python-m2crypto.mk | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)
package/python-m2crypto/python-m2crypto.mk +8 -12
index 1c0efbd..dd0f77e 100644
@@ -7,20 +7,16 @@
 PYTHON_M2CRYPTO_VERSION = 0.21.1
 PYTHON_M2CRYPTO_SITE = http://pypi.python.org/packages/source/M/M2Crypto
 PYTHON_M2CRYPTO_SOURCE = M2Crypto-$(PYTHON_M2CRYPTO_VERSION).tar.gz
-HOST_PYTHON_M2CRYPTO_DEPENDENCIES = host-openssl host-python host-python-setuptools host-swig
+PYTHON_M2CRYPTO_SETUP_TYPE = setuptools
+HOST_PYTHON_M2CRYPTO_DEPENDENCIES = host-openssl host-swig
 
+# We need to override the build commands to be able to use build_ext,
+# which accepts the --openssl option.
 define HOST_PYTHON_M2CRYPTO_BUILD_CMDS
 	(cd $(@D); \
-	$(HOST_CONFIGURE_OPTS) \
-	PYTHONXCPREFIX="$(HOST_DIR)/usr/" \
-	LDFLAGS="-L$(HOST_DIR)/lib -L$(HOST_DIR)/usr/lib" \
-	$(HOST_DIR)/usr/bin/python setup.py build_ext --openssl=$(HOST_DIR)/usr)
+		$(HOST_PKG_PYTHON_SETUPTOOLS_ENV) \
+		$(HOST_DIR)/usr/bin/python setup.py build_ext \
+			--openssl=$(HOST_DIR)/usr)
 endef
 
-define HOST_PYTHON_M2CRYPTO_INSTALL_CMDS
-	(cd $(@D); \
-	PYTHONPATH=$(HOST_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
-	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
-endef
-
-$(eval $(host-generic-package))
+$(eval $(host-python-package))
Signature · 1 line
1.8.1.2
#14 lore raw

PATCH 10/38 python-mad: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-mad/python-mad.mk | 20 +++-----------------
 1 file changed, 3 insertions(+), 17 deletions(-)
package/python-mad/python-mad.mk +3 -17
index eaa1fae..1b3cb75 100644
@@ -7,8 +7,9 @@
 PYTHON_MAD_VERSION = 0.6
 PYTHON_MAD_SOURCE  = pymad-$(PYTHON_MAD_VERSION).tar.gz
 PYTHON_MAD_SITE    = http://spacepants.org/src/pymad/download/
+PYTHON_MAD_SETUP_TYPE = distutils
 
-PYTHON_MAD_DEPENDENCIES = python libmad
+PYTHON_MAD_DEPENDENCIES = libmad
 
 ifeq ($(BR2_ENDIAN),"LITTLE")
 PYTHON_MAD_ENDIAN=little
@@ -23,19 +24,4 @@ define PYTHON_MAD_CONFIGURE_CMDS
 	echo "mad_include_dir = $(STAGING_DIR)/usr/include" >> $(@D)/Setup
 endef
 
-define PYTHON_MAD_BUILD_CMDS
-	(cd $(@D); \
-		CC="$(TARGET_CC)"		\
-		CFLAGS="$(TARGET_CFLAGS)" 	\
-		LDSHARED="$(TARGET_CC) -shared" \
-		LDFLAGS="$(TARGET_LDFLAGS)" 	\
-	$(HOST_DIR)/usr/bin/python setup.py build_ext \
-	--include-dirs=$(STAGING_DIR)/usr/include/python$(PYTHON_VERSION_MAJOR))
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define PYTHON_MAD_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#15 lore raw

PATCH 11/38 python-meld3: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-meld3/python-meld3.mk | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)
package/python-meld3/python-meld3.mk +2 -10
index 27da9c8..cb8dec0 100644
@@ -7,16 +7,8 @@
 PYTHON_MELD3_VERSION = 0.6.8
 PYTHON_MELD3_SOURCE = meld3-$(PYTHON_MELD3_VERSION).tar.gz
 PYTHON_MELD3_SITE = http://pypi.python.org/packages/source/m/meld3/
-PYTHON_MELD3_DEPENDENCIES = python
 PYTHON_MELD3_LICENSE = ZPLv2.1
 PYTHON_MELD3_LICENSE_FILES = COPYRIGHT.txt LICENSE.txt
+PYTHON_MELD3_SETUP_TYPE = distutils
 
-define PYTHON_MELD3_BUILD_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define PYTHON_MELD3_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#16 lore raw

PATCH 12/38 python-nfc: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-nfc/python-nfc.mk | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)
package/python-nfc/python-nfc.mk +3 -10
index f406e2a..5f486d9 100644
@@ -7,14 +7,7 @@
 PYTHON_NFC_VERSION = 142
 PYTHON_NFC_SITE = https://launchpad.net/nfcpy
 PYTHON_NFC_SITE_METHOD = bzr
-PYTHON_NFC_DEPENDENCIES = python libusb libusb-compat
+PYTHON_NFC_DEPENDENCIES = libusb libusb-compat
+PYTHON_NFC_SETUP_TYPE = distutils
 
-define PYTHON_NFC_BUILD_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define PYTHON_NFC_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#17 lore raw

PATCH 13/38 python-protobuf: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-protobuf/python-protobuf.mk | 20 ++++----------------
 1 file changed, 4 insertions(+), 16 deletions(-)
package/python-protobuf/python-protobuf.mk +4 -16
index dcf67c2..36ab644 100644
@@ -9,20 +9,8 @@ PYTHON_PROTOBUF_SOURCE  = $(PROTOBUF_SOURCE)
 PYTHON_PROTOBUF_SITE    = $(PROTOBUF_SITE)
 PYTHON_PROTOBUF_LICENSE = BSD-3c
 PYTHON_PROTOBUF_LICENSE_FILES = COPYING.txt
+PYTHON_PROTOBUF_DEPENDENCIES = host-protobuf
+PYTHON_PROTOBUF_SETUP_TYPE = setuptools
+PYTHON_PROTOBUF_SUBDIR = python
 
-PYTHON_PROTOBUF_DEPENDENCIES = python host-python-setuptools \
-        host-python-distutilscross host-protobuf
-
-define PYTHON_PROTOBUF_BUILD_CMDS
-	(cd $(@D)/python; \
-		PYTHONXCPREFIX="$(STAGING_DIR)/usr/" \
-		PATH=$(HOST_PATH) \
-	$(HOST_DIR)/usr/bin/python setup.py build -x)
-endef
-
-define PYTHON_PROTOBUF_INSTALL_TARGET_CMDS
-	(cd $(@D)/python; PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
-	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#18 lore raw

PATCH 14/38 python-pygame: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-pygame/python-pygame.mk | 25 ++++++++-----------------
 1 file changed, 8 insertions(+), 17 deletions(-)
package/python-pygame/python-pygame.mk +8 -17
index 9db5a3f..681b36c 100644
@@ -10,6 +10,7 @@ PYTHON_PYGAME_VERSION = f0bb4a4b365d
 PYTHON_PYGAME_SOURCE  = pygame-$(PYTHON_PYGAME_VERSION).tar.gz
 PYTHON_PYGAME_SITE = https://bitbucket.org/pygame/pygame
 PYTHON_PYGAME_SITE_METHOD = hg
+PYTHON_PYGAME_SETUP_TYPE = distutils
 
 ifeq ($(BR2_PACKAGE_PYTHON_PYGAME_IMAGE),y)
 PYTHON_PYGAME_OPT_DEPENDS += sdl_image
@@ -23,7 +24,7 @@ ifeq ($(BR2_PACKAGE_PYTHON_PYGAME_MIXER),y)
 PYTHON_PYGAME_OPT_DEPENDS += sdl_mixer
 endif
 
-PYTHON_PYGAME_DEPENDENCIES = python sdl $(PYTHON_PYGAME_OPT_DEPENDS)
+PYTHON_PYGAME_DEPENDENCIES = sdl $(PYTHON_PYGAME_OPT_DEPENDS)
 
 ifneq ($(BR2_PACKAGE_PYTHON_PYGAME_IMAGE),y)
 define PYTHON_PYGAME_UNCONFIGURE_IMAGE
@@ -81,28 +82,18 @@ define PYTHON_PYGAME_CONFIGURE_CMDS
 	$(PYTHON_PYGAME_UNCONFIGURE_SCRAP)
 endef
 
-define PYTHON_PYGAME_BUILD_CMDS
-	(cd $(@D); CC="$(TARGET_CC)" CFLAGS="$(TARGET_CFLAGS)" \
-		LDSHARED="$(TARGET_CROSS)gcc -shared" \
-		CROSS_COMPILING=yes \
-		_python_sysroot=$(STAGING_DIR) \
-		_python_srcdir=$(BUILD_DIR)/python$(PYTHON_VERSION) \
-		_python_prefix=/usr \
-		_python_exec_prefix=/usr \
-		$(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
 ifneq ($(BR2_HAVE_DOCUMENTATION),y)
 define PYTHON_PYGAME_REMOVE_DOC
 	rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/pygame/docs
 endef
+
+PYTHON_PYGAME_POST_INSTALL_TARGET_HOOKS += PYTHON_PYGAME_REMOVE_DOC
 endif
 
-define PYTHON_PYGAME_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install \
-		--prefix=$(TARGET_DIR)/usr)
+define PYTHON_PYGAME_REMOVE_TESTS
 	rm -rf $(TARGET_DIR)/usr/lib/python*/site-packages/pygame/tests
-	$(PYTHON_PYGAME_REMOVE_DOC)
 endef
 
-$(eval $(generic-package))
+PYTHON_PYGAME_POST_INSTALL_TARGET_HOOKS += PYTHON_PYGAME_REMOVE_TESTS
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#19 lore raw

PATCH 15/38 python-pyparsing: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-pyparsing/python-pyparsing.mk | 28 ++--------------------------
 1 file changed, 2 insertions(+), 26 deletions(-)
package/python-pyparsing/python-pyparsing.mk +2 -26
index 7814ce3..07dda58 100644
@@ -9,30 +9,6 @@ PYTHON_PYPARSING_SOURCE          = pyparsing-$(PYTHON_PYPARSING_VERSION).tar.gz
 PYTHON_PYPARSING_SITE            = http://downloads.sourceforge.net/project/pyparsing/pyparsing/pyparsing-$(PYTHON_PYPARSING_VERSION)
 PYTHON_PYPARSING_LICENSE         = MIT
 PYTHON_PYPARSING_LICENSE_FILES   = LICENSE
-PYTHON_PYPARSING_INSTALL_STAGING = YES
-PYTHON_PYPARSING_DEPENDENCIES    = python
+PYTHON_PYPARSING_SETUP_TYPE      = distutils
 
-# Shamelessly vampirised from python-pygame ;-)
-define PYTHON_PYPARSING_BUILD_CMDS
-	(cd $(@D);                                              \
-	 CC="$(TARGET_CC)"                                      \
-	 CFLAGS="$(TARGET_CFLAGS)"                              \
-	 LDSHARED="$(TARGET_CROSS)gcc -shared"                  \
-	 CROSS_COMPILING=yes                                    \
-	 _python_sysroot=$(STAGING_DIR)                         \
-	 _python_srcdir=$(BUILD_DIR)/python$(PYTHON_VERSION)    \
-	 _python_prefix=/usr                                    \
-	 _python_exec_prefix=/usr                               \
-	 $(HOST_DIR)/usr/bin/python setup.py build              \
-	)
-endef
-
-# Shamelessly vampirised from python-pygame ;-)
-define PYTHON_PYPARSING_INSTALL_TARGET_CMDS
-	(cd $(@D);                                              \
-	 $(HOST_DIR)/usr/bin/python setup.py install            \
-	                            --prefix=$(TARGET_DIR)/usr  \
-	)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#20 lore raw

PATCH 16/38 python-pyro: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-pyro/python-pyro.mk | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
package/python-pyro/python-pyro.mk +2 -6
index 67aabc6..6f118ba 100644
@@ -9,10 +9,6 @@ PYTHON_PYRO_SOURCE  = Pyro-$(PYTHON_PYRO_VERSION).tar.gz
 PYTHON_PYRO_SITE    = https://pypi.python.org/packages/source/P/Pyro/
 PYTHON_PYRO_LICENSE = MIT
 PYTHON_PYRO_LICENSE_FILES = LICENSE
-PYTHON_PYRO_DEPENDENCIES = python
+PYTHON_PYRO_SETUP_TYPE = distutils
 
-define PYTHON_PYRO_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#21 lore raw

PATCH 17/38 python-pyzmq: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-pyzmq/python-pyzmq.mk | 26 +++-----------------------
 1 file changed, 3 insertions(+), 23 deletions(-)
package/python-pyzmq/python-pyzmq.mk +3 -23
index e9702fc..b3a8f9d 100644
@@ -10,7 +10,8 @@ PYTHON_PYZMQ_SITE = http://pypi.python.org/packages/source/p/pyzmq/
 PYTHON_PYZMQ_LICENSE = LGPLv3+ BSD-3c Apache License Version 2.0
 # Apache license only online: http://www.apache.org/licenses/LICENSE-2.0
 PYTHON_PYZMQ_LICENSE_FILES = COPYING.LESSER COPYING.BSD
-PYTHON_PYZMQ_DEPENDENCIES = zeromq python host-python
+PYTHON_PYZMQ_DEPENDENCIES = zeromq
+PYTHON_PYZMQ_SETUP_TYPE = distutils
 
 # Due to issues with cross-compiling, hardcode to the zeromq in BR
 define PYTHON_PYZMQ_PATCH_ZEROMQ_VERSION
@@ -20,25 +21,4 @@ endef
 
 PYTHON_PYZMQ_POST_PATCH_HOOKS += PYTHON_PYZMQ_PATCH_ZEROMQ_VERSION
 
-PYTHON_PYZMQ_PARAMS = CC="$(TARGET_CC)" \
-		CFLAGS="$(TARGET_CFLAGS)" \
-		LDSHARED="$(TARGET_CC) -shared" \
-		CROSS_COMPILING=yes \
-		_python_sysroot=$(STAGING_DIR) \
-		_python_srcdir=$(PYTHON_DIR) \
-		_python_prefix=/usr \
-		_python_exec_prefix=/usr
-
-define PYTHON_PYZMQ_CONFIGURE_CMDS
-	(cd $(@D); $(PYTHON_PYZMQ_PARAMS) \
-		$(HOST_DIR)/usr/bin/python setup.py configure \
-		--zmq=$(STAGING_DIR)/usr)
-endef
-
-define PYTHON_PYZMQ_INSTALL_TARGET_CMDS
-	(cd $(@D); $(PYTHON_PYZMQ_PARAMS) \
-		$(HOST_DIR)/usr/bin/python setup.py install \
-		--prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#22 lore raw

PATCH 18/38 python-serial: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-serial/python-serial.mk | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
package/python-serial/python-serial.mk +2 -11
index e00577b..a44d799 100644
@@ -7,15 +7,6 @@
 PYTHON_SERIAL_VERSION = 2.6
 PYTHON_SERIAL_SOURCE  = pyserial-$(PYTHON_SERIAL_VERSION).tar.gz
 PYTHON_SERIAL_SITE    = http://pypi.python.org/packages/source/p/pyserial
+PYTHON_SERIAL_SETUP_TYPE = distutils
 
-PYTHON_SERIAL_DEPENDENCIES = python
-
-define PYTHON_SERIAL_BUILD_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build --executable=/usr/bin/python)
-endef
-
-define PYTHON_SERIAL_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#23 lore raw

PATCH 19/38 python-setuptools: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-setuptools/python-setuptools.mk | 28 +++-----------------------
 1 file changed, 3 insertions(+), 25 deletions(-)
package/python-setuptools/python-setuptools.mk +3 -25
index 73c819f..13df448 100644
@@ -12,29 +12,7 @@
 PYTHON_SETUPTOOLS_VERSION = 0.6.36
 PYTHON_SETUPTOOLS_SOURCE  = distribute-$(PYTHON_SETUPTOOLS_VERSION).tar.gz
 PYTHON_SETUPTOOLS_SITE    = http://pypi.python.org/packages/source/d/distribute
-PYTHON_SETUPTOOLS_DEPENDENCIES = python
+PYTHON_SETUPTOOLS_SETUP_TYPE = setuptools
 
-define HOST_PYTHON_SETUPTOOLS_BUILD_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define PYTHON_SETUPTOOLS_BUILD_CMDS
-	(cd $(@D); \
-	PYTHONPATH="$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
-	$(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define HOST_PYTHON_SETUPTOOLS_INSTALL_CMDS
-	(cd $(@D); \
-	$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
-endef
-
-define PYTHON_SETUPTOOLS_INSTALL_TARGET_CMDS
-	(cd $(@D); \
-	PYTHONPATH="$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages" \
-	$(HOST_DIR)/usr/bin/python setup.py install --executable=/usr/bin/python \
-	--single-version-externally-managed --root=/ --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
-$(eval $(host-generic-package))
+$(eval $(python-package))
+$(eval $(host-python-package))
Signature · 1 line
1.8.1.2
#24 lore raw

PATCH 20/38 scons: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/scons/scons.mk | 13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)
package/scons/scons.mk +4 -9
index a7747d5..e3fad1b 100644
@@ -8,17 +8,12 @@ SCONS_VERSION = 2.3.0
 SCONS_SITE = http://downloads.sourceforge.net/project/scons/scons/$(SCONS_VERSION)
 SCONS_LICENSE = MIT
 SCONS_LICENSE_FILES = LICENSE.txt
+SCONS_SETUP_TYPE = distutils
 
-define HOST_SCONS_BUILD_CMDS
-	(cd $(@D); python setup.py build)
-endef
+HOST_SCONS_INSTALL_OPT = \
+	--install-lib=$(HOST_DIR)/usr/lib/scons-$(SCONS_VERSION)
 
-define HOST_SCONS_INSTALL_CMDS
-	(cd $(@D); python setup.py install --prefix=$(HOST_DIR)/usr \
-		--install-lib=$(HOST_DIR)/usr/lib/scons-$(SCONS_VERSION))
-endef
-
-$(eval $(host-generic-package))
+$(eval $(host-python-package))
 
 # variables used by other packages
 SCONS = $(HOST_DIR)/usr/bin/scons
Signature · 1 line
1.8.1.2
#25 lore raw

PATCH 21/38 python-netifaces: convert to the Python package infrastructure

In reply to Thomas Petazzoni

Also, remove the "select BR2_PACKAGE_PYTHON_SETUPTOOLS", since setuptools is a host dependency (needed to built the package), not a target dependency.

---
 package/python-netifaces/Config.in           |  1 -
 package/python-netifaces/python-netifaces.mk | 19 ++-----------------
 2 files changed, 2 insertions(+), 18 deletions(-)
package/python-netifaces/Config.in +0 -1
index b9d66d8..29f9fc3 100644
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_PYTHON_NETIFACES
 	bool "python-netifaces"
 	depends on BR2_PACKAGE_PYTHON
-	select BR2_PACKAGE_PYTHON_SETUPTOOLS
 	help
 	  Portable access to network interfaces from Python.
 
package/python-netifaces/python-netifaces.mk +2 -17
index 1570fd1..faa39bd 100644
@@ -7,21 +7,6 @@
 PYTHON_NETIFACES_VERSION = 0.7
 PYTHON_NETIFACES_SOURCE  = netifaces-$(PYTHON_NETIFACES_VERSION).tar.gz
 PYTHON_NETIFACES_SITE    = http://alastairs-place.net/projects/netifaces
+PYTHON_NETIFACES_SETUP_TYPE = setuptools
 
-PYTHON_NETIFACES_DEPENDENCIES = python host-python-setuptools host-python-distutilscross
-
-define PYTHON_NETIFACES_BUILD_CMDS
-	(cd $(@D); \
-		PYTHONXCPREFIX="$(STAGING_DIR)/usr/" \
-		LDFLAGS="-L$(STAGING_DIR)/lib -L$(STAGING_DIR)/usr/lib" \
-	$(HOST_DIR)/usr/bin/python setup.py build -x)
-endef
-
-define PYTHON_NETIFACES_INSTALL_TARGET_CMDS
-	(cd $(@D); \
-	PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
-	$(HOST_DIR)/usr/bin/python setup.py install \
-	--single-version-externally-managed --root=/ --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#26 lore raw

PATCH 22/38 supervisor: convert to the Python package infrastructure

In reply to Thomas Petazzoni

Remove the select of BR2_PACKAGE_PYTHON_SETUPTOOLS, since what is really needed is host-setuptools (as can be seen from the original .mk file), and not setuptools for the target.

Also, remove the manging of the Python shebang, since it's now done by passing the --executable= option at install time (done in the Python package infrastructure).

Finally, convert the package to use <pkg>_INSTALL_INIT_SYSV.

---
 package/supervisor/Config.in     |  1 -
 package/supervisor/supervisor.mk | 22 +++++++++++-----------
 2 files changed, 11 insertions(+), 12 deletions(-)
package/supervisor/Config.in +0 -1
index 5340181..c511dd8 100644
@@ -1,7 +1,6 @@
 config BR2_PACKAGE_SUPERVISOR
 	bool "supervisor"
 	depends on BR2_PACKAGE_PYTHON
-	select BR2_PACKAGE_PYTHON_SETUPTOOLS
 	select BR2_PACKAGE_PYTHON_MELD3
 	help
 	  A client/server system that allows its users to control a
package/supervisor/supervisor.mk +11 -11
index 40ad8ce..d2d58e2 100644
@@ -7,19 +7,19 @@
 SUPERVISOR_VERSION = 3.0a12
 SUPERVISOR_SITE = http://pypi.python.org/packages/source/s/supervisor/
 SUPERVISOR_LICENSE_FILES = LICENSES.txt
+SUPERVISOR_SETUP_TYPE = setuptools
 
-SUPERVISOR_DEPENDENCIES = python host-python-setuptools
-
-define SUPERVISOR_BUILD_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
+define SUPERVISOR_INSTALL_CONF_FILES
+	$(INSTALL) -d -m 755 $(TARGET_DIR)/etc/supervisor.d
+	$(INSTALL) -D -m 644 package/supervisor/supervisord.conf \
+		$(TARGET_DIR)/etc/supervisord.conf
 endef
 
-define SUPERVISOR_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=/usr --root=$(TARGET_DIR))
-	sed -i '1s|#!.*python.*|#!/usr/bin/env python|' $(TARGET_DIR)/usr/bin/{echo_supervisord_conf,pidproxy,supervisorctl,supervisord}
-	$(INSTALL) -d -m 755 $(TARGET_DIR)/etc/supervisor.d
-	$(INSTALL) -D -m 644 package/supervisor/supervisord.conf $(TARGET_DIR)/etc/supervisord.conf
-	$(INSTALL) -m 755 package/supervisor/S99supervisord $(TARGET_DIR)/etc/init.d/S99supervisord
+SUPERVISOR_POST_INSTALL_TARGET_HOOKS += SUPERVISOR_INSTALL_CONF_FILES
+
+define SUPERVISOR_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 755 package/supervisor/S99supervisord \
+		$(TARGET_DIR)/etc/init.d/S99supervisord
 endef
 
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#27 lore raw

PATCH 22/38 supervisor: convert to the Python package infrastructure

Quoted 5 lines · Thomas Petazzoni

Remove the select of BR2_PACKAGE_PYTHON_SETUPTOOLS, since what is really needed is host-setuptools (as can be seen from the original .mk file), and not setuptools for the target.

Also, remove the manging of the Python shebang, since it's now done by

mangling

(and don't go to urbandictionary to search for the meaning of manging or munging because it's sickening)

#28 lore raw

PATCH 23/38 python-distutilscross: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-distutilscross/python-distutilscross.mk | 13 ++-----------
 1 file changed, 2 insertions(+), 11 deletions(-)
package/python-distutilscross/python-distutilscross.mk +2 -11
index df12f97..cfe2811 100644
@@ -7,15 +7,6 @@
 PYTHON_DISTUTILSCROSS_VERSION = 0.1
 PYTHON_DISTUTILSCROSS_SOURCE  = distutilscross-$(PYTHON_DISTUTILSCROSS_VERSION).tar.gz
 PYTHON_DISTUTILSCROSS_SITE    = http://pypi.python.org/packages/source/d/distutilscross
+PYTHON_DISTUTILSCROSS_SETUP_TYPE = setuptools
 
-HOST_PYTHON_DISTUTILSCROSS_DEPENDENCIES = host-python host-python-setuptools
-
-define HOST_PYTHON_DISTUTILSCROSS_BUILD_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define HOST_PYTHON_DISTUTILSCROSS_INSTALL_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(HOST_DIR)/usr)
-endef
-
-$(eval $(host-generic-package))
+$(eval $(host-python-package))
Signature · 1 line
1.8.1.2
#29 lore raw

PATCH 24/38 python-thrift: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-thrift/python-thrift.mk | 26 +++-----------------------
 1 file changed, 3 insertions(+), 23 deletions(-)
package/python-thrift/python-thrift.mk +3 -23
index 91e14e5..8abad48 100644
@@ -9,27 +9,7 @@ PYTHON_THRIFT_SOURCE = thrift-$(PYTHON_THRIFT_VERSION).tar.gz
 PYTHON_THRIFT_SITE = http://www.us.apache.org/dist/thrift/$(PYTHON_THRIFT_VERSION)
 PYTHON_THRIFT_LICENSE = Apache-2.0
 PYTHON_THRIFT_LICENSE_FILES = LICENSE
-PYTHON_THRIFT_DEPENDENCIES = python
+PYTHON_THRIFT_SETUP_TYPE = setuptools
+PYTHON_THRIFT_SUBDIR = lib/py
 
-define PYTHON_THRIFT_BUILD_CMDS
-	(cd $(@D)/lib/py; \
-		CC="$(TARGET_CC)" \
-		CFLAGS="$(TARGET_CFLAGS)" \
-		LDSHARED="$(TARGET_CROSS)gcc -shared" \
-		CROSS_COMPILING=yes \
-		_python_sysroot=$(STAGING_DIR) \
-		_python_srcdir=$(BUILD_DIR)/python$(PYTHON_VERSION) \
-		_python_prefix=/usr \
-		_python_exec_prefix=/usr \
-		$(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-# host-distutilscross, if it has been installed before, will check that
-# the installation directory is in python's load path. For host-python,
-# it is not, so add it explicitly while installing to target.
-define PYTHON_THRIFT_INSTALL_TARGET_CMDS
-	(cd $(@D)/lib/py; PYTHONPATH=$(TARGET_DIR)/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages \
-		$(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#30 lore raw

PATCH 25/38 python-dialog: convert to the Python package infrastructure

In reply to Thomas Petazzoni
---
 package/python-dialog/python-dialog.mk | 14 +++-----------
 1 file changed, 3 insertions(+), 11 deletions(-)
package/python-dialog/python-dialog.mk +3 -11
index fa496de..e6887c9 100644
@@ -9,15 +9,7 @@ PYTHON_DIALOG_SOURCE  = python2-pythondialog-$(PYTHON_DIALOG_VERSION).tar.bz2
 PYTHON_DIALOG_SITE    = http://downloads.sourceforge.net/project/pythondialog/pythondialog/$(PYTHON_DIALOG_VERSION)
 PYTHON_DIALOG_LICENSE = LGPLv2.1+
 PYTHON_DIALOG_LICENSE_FILES = COPYING
+PYTHON_DIALOG_SETUP_TYPE = distutils
+PYTHON_DIALOG_DEPENDENCIES = dialog
 
-PYTHON_DIALOG_DEPENDENCIES = python dialog
-
-define PYTHON_DIALOG_BUILD_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py build)
-endef
-
-define PYTHON_DIALOG_INSTALL_TARGET_CMDS
-	(cd $(@D); $(HOST_DIR)/usr/bin/python setup.py install --prefix=$(TARGET_DIR)/usr)
-endef
-
-$(eval $(generic-package))
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#31 lore raw

PATCH 26/38 python-pyusb: new package

In reply to Thomas Petazzoni

From: "Wojciech M. Zabolotny" <[email protected]>

[Thomas: converted to the Python package infrastructure, added missing libusb dependency in the .mk file, added missing newline in the Config.in file]

---
 package/Config.in                    |  1 +
 package/python-pyusb/Config.in       | 14 ++++++++++++++
 package/python-pyusb/python-pyusb.mk | 14 ++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 package/python-pyusb/Config.in
 create mode 100644 package/python-pyusb/python-pyusb.mk
package/Config.in +1 -0
index aa928ec..d7dcbd0 100644
@@ -398,6 +398,7 @@ source "package/python-protobuf/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
+source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
package/python-pyusb/Config.in new file +14 -0
new file mode 100644
index 0000000..8e17714
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PYTHON_PYUSB
+	bool "python-pyusb"
+	depends on BR2_PACKAGE_PYTHON
+	depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+	select BR2_PACKAGE_LIBUSB
+	help
+	  The PyUSB module provides for Python easy access to the host
+	  machine's Universal Serial Bus (USB) system.
+
+	  http://sourceforge.net/apps/trac/pyusb/
+
+comment "python-pyusb needs a toolchain w/ threads"
+	depends on BR2_PACKAGE_PYTHON
+	depends on !BR2_TOOLCHAIN_HAS_THREADS
package/python-pyusb/python-pyusb.mk new file +14 -0
new file mode 100644
index 0000000..3fcc864
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-pyusb
+#
+################################################################################
+
+PYTHON_PYUSB_VERSION = 0546cad8980783c39f96db717005a550059b730f
+PYTHON_PYUSB_SITE    = $(call github,walac,pyusb,$(PYTHON_PYUSB_VERSION))
+PYTHON_PYUSB_LICENSE = BSD-3c
+PYTHON_PYUSB_LICENSE_FILES = LICENSE
+PYTHON_PYUSB_SETUP_TYPE = distutils
+PYTHON_PYUSB_DEPENDENCIES = libusb
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#32 lore raw

PATCH 26/38 python-pyusb: new package

Quoted 34 lines · Thomas Petazzoni

From: "Wojciech M. Zabolotny" <[email protected]>

[Thomas: converted to the Python package infrastructure, added missing libusb dependency in the .mk file, added missing newline in the Config.in file]

---
 package/Config.in                    |  1 +
 package/python-pyusb/Config.in       | 14 ++++++++++++++
 package/python-pyusb/python-pyusb.mk | 14 ++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 package/python-pyusb/Config.in
 create mode 100644 package/python-pyusb/python-pyusb.mk
package/Config.in +1 -0
index aa928ec..d7dcbd0 100644
@@ -398,6 +398,7 @@ source "package/python-protobuf/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
+source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
package/python-pyusb/Config.in new file +0 -0
new file mode 100644
index 0000000..8e17714

package/python-pyusb/Config.in line 8

Quoted 8 lines
package/python-pyusb/Config.in new file +8 -0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PYTHON_PYUSB
+       bool "python-pyusb"
+       depends on BR2_PACKAGE_PYTHON
+       depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+       select BR2_PACKAGE_LIBUSB
+       help
+         The PyUSB module provides for Python easy access to the host
+         machine's Universal Serial Bus (USB) system.

The structure of this sentence is slightly odd.
The website says: "PyUSB aims to provide easy USB access to the Python language." which we could use, or alternatively a rewritten version of the original sentence:

The PyUSB module provides easy access to the Universal Serial Bus (USB) from Python.

#33 lore raw

PATCH 26/38 python-pyusb: new package

Quoted 50 lines · Thomas De Schampheleire
Quoted 34 lines · Thomas Petazzoni

From: "Wojciech M. Zabolotny" <[email protected]>

[Thomas: converted to the Python package infrastructure, added missing libusb dependency in the .mk file, added missing newline in the Config.in file]

---
 package/Config.in                    |  1 +
 package/python-pyusb/Config.in       | 14 ++++++++++++++
 package/python-pyusb/python-pyusb.mk | 14 ++++++++++++++
 3 files changed, 29 insertions(+)
 create mode 100644 package/python-pyusb/Config.in
 create mode 100644 package/python-pyusb/python-pyusb.mk
package/Config.in +1 -0
index aa928ec..d7dcbd0 100644
@@ -398,6 +398,7 @@ source "package/python-protobuf/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
+source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
package/python-pyusb/Config.in new file +0 -0
new file mode 100644
index 0000000..8e17714

package/python-pyusb/Config.in line 8

Quoted 8 lines
package/python-pyusb/Config.in new file +8 -0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PYTHON_PYUSB
+       bool "python-pyusb"
+       depends on BR2_PACKAGE_PYTHON
+       depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+       select BR2_PACKAGE_LIBUSB
+       help
+         The PyUSB module provides for Python easy access to the host
+         machine's Universal Serial Bus (USB) system.

The structure of this sentence is slightly odd.
The website says: "PyUSB aims to provide easy USB access to the Python language." which we could use, or alternatively a rewritten version of the original sentence:

Quoted 2 lines

The PyUSB module provides easy access to the Universal Serial Bus (USB) from Python.

I agree with the last version. (Well, I'm not a native speaker).

Regards,
Wojtek

Signature · 4 lines
Wojciech M. Zabo?otny
My GPG/PGP keys:
standard: B191 ACF0 7909 83FA 3F9B  450C 407E 3C4B 4569 D119
confidential: 2BF3 F90F 6EA8 7D35 59FD  5080 78ED 33DE 1312 D8F8
#34 lore raw

PATCH 27/38 python-msgpack: new package

In reply to Thomas Petazzoni

From: "Wojciech M. Zabolotny" <[email protected]>

[Thomas: convert to the Python package infrastructure, added missing dependency on C++, inherited from msgpack.]

---
 package/Config.in                        |  1 +
 package/python-msgpack/Config.in         | 16 ++++++++++++++++
 package/python-msgpack/python-msgpack.mk | 15 +++++++++++++++
 3 files changed, 32 insertions(+)
 create mode 100644 package/python-msgpack/Config.in
 create mode 100644 package/python-msgpack/python-msgpack.mk
package/Config.in +1 -0
index d7dcbd0..283b5f6 100644
@@ -392,6 +392,7 @@ source "package/python-id3/Config.in"
 source "package/python-ipy/Config.in"
 source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
+source "package/python-msgpack/Config.in"
 source "package/python-netifaces/Config.in"
 source "package/python-nfc/Config.in"
 source "package/python-protobuf/Config.in"
package/python-msgpack/Config.in new file +16 -0
new file mode 100644
index 0000000..2075ee6
@@ -0,0 +1,16 @@
+config BR2_PACKAGE_PYTHON_MSGPACK
+	bool "python-msgpack"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_MSGPACK
+	depends on BR2_INSTALL_LIBSTDCPP # msgpack
+	help
+	  MessagePack (http://msgpack.org/) is a fast, compact binary
+	  serialization format, suitable for similar data to JSON.
+	  This package provides CPython bindings for reading and
+	  writing MessagePack data.
+
+	  https://pypi.python.org/pypi/msgpack-python/
+
+comment "python-msgpack needs a toolchain w/ C++"
+	depends on BR2_PACKAGE_PYTHON
+	depends on !BR2_INSTALL_LIBSTDCPP
package/python-msgpack/python-msgpack.mk new file +15 -0
new file mode 100644
index 0000000..2a7c384
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-msgpack
+#
+################################################################################
+
+PYTHON_MSGPACK_VERSION = 0.4.0
+PYTHON_MSGPACK_SOURCE = msgpack-python-$(PYTHON_MSGPACK_VERSION).tar.gz
+PYTHON_MSGPACK_SITE = https://pypi.python.org/packages/source/m/msgpack-python/
+PYTHON_MSGPACK_LICENSE = Apache License, Version 2.0
+PYTHON_MSGPACK_LICENSE_FILES = COPYING
+PYTHON_MSGPACK_SETUP_TYPE = setuptools
+PYTHON_MSGPACK_DEPENDENCIES = msgpack
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#35 lore raw

PATCH 28/38 python-configobj: new package

In reply to Thomas Petazzoni

From: Zoltan Gyarmati <[email protected]>

[Thomas: convert to the Python package infrastructure.]

---
 package/Config.in                            |  1 +
 package/python-configobj/Config.in           | 10 ++++++++++
 package/python-configobj/python-configobj.mk | 14 ++++++++++++++
 3 files changed, 25 insertions(+)
 create mode 100644 package/python-configobj/Config.in
 create mode 100644 package/python-configobj/python-configobj.mk
package/Config.in +1 -0
index 283b5f6..42c5fc8 100644
@@ -385,6 +385,7 @@ source "package/python/Config.in"
 if BR2_PACKAGE_PYTHON
 menu "external python modules"
 source "package/python-bottle/Config.in"
+source "package/python-configobj/Config.in"
 source "package/python-crc16/Config.in"
 source "package/python-dialog/Config.in"
 source "package/python-dpkt/Config.in"
package/python-configobj/Config.in new file +10 -0
new file mode 100644
index 0000000..fc57e26
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_PYTHON_CONFIGOBJ
+	bool "python-configobj"
+	depends on BR2_PACKAGE_PYTHON
+	help
+	  ConfigObj is a simple but powerful config file reader and
+	  writer: an ini file round tripper. Its main feature is that
+	  it is very easy to use, with a straightforward programmer's
+	  interface and a simple syntax for config files.
+
+	  http://www.voidspace.org.uk/python/configobj.html
package/python-configobj/python-configobj.mk new file +14 -0
new file mode 100644
index 0000000..5211b1d
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-configobj
+#
+################################################################################
+
+PYTHON_CONFIGOBJ_VERSION = 4.7.2
+PYTHON_CONFIGOBJ_SOURCE = configobj-$(PYTHON_CONFIGOBJ_VERSION).tar.gz
+PYTHON_CONFIGOBJ_SITE = http://pypi.python.org/packages/source/c/configobj
+PYTHON_CONFIGOBJ_LICENSE = BSD-3c
+# License only mentioned in the source
+PYTHON_CONFIGOBJ_SETUP_TYPE = distutils
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#36 lore raw

PATCH 29/38 python-versiontools: new package

In reply to Thomas Petazzoni

From: Ludovic Desroches <[email protected]>

[Thomas: convert to the Python package infrastructure, added license informations.]

---
 package/Config.in                                  |  1 +
 package/python-versiontools/Config.in              |  7 +++++++
 package/python-versiontools/python-versiontools.mk | 13 +++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 package/python-versiontools/Config.in
 create mode 100644 package/python-versiontools/python-versiontools.mk
package/Config.in +1 -0
index 42c5fc8..5f29c54 100644
@@ -405,6 +405,7 @@ source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
 source "package/python-thrift/Config.in"
+source "package/python-versiontools/Config.in"
 endmenu
 endif
 source "package/python3/Config.in"
package/python-versiontools/Config.in new file +7 -0
new file mode 100644
index 0000000..cb260c1
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PYTHON_VERSIONTOOLS
+	bool "python-versiontools"
+	depends on BR2_PACKAGE_PYTHON
+	help
+	  Smart replacement for plain tuple used in __version__.
+
+	  https://pypi.python.org/pypi/versiontools
package/python-versiontools/python-versiontools.mk new file +13 -0
new file mode 100644
index 0000000..72a1d43
@@ -0,0 +1,13 @@
+################################################################################
+#
+# python-versiontools
+#
+################################################################################
+
+PYTHON_VERSIONTOOLS_VERSION = 1.9.1
+PYTHON_VERSIONTOOLS_SOURCE  = versiontools-$(PYTHON_VERSIONTOOLS_VERSION).tar.gz
+PYTHON_VERSIONTOOLS_SITE    = http://pypi.python.org/packages/source/v/versiontools/
+PYTHON_VERSIONTOOLS_SETUP_TYPE = setuptools
+PYTHON_VERSIONTOOLS_LICENSE = LGPLv3
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#37 lore raw

PATCH 29/38 python-versiontools: new package

Quoted 45 lines · Thomas Petazzoni

From: Ludovic Desroches <[email protected]>

[Thomas: convert to the Python package infrastructure, added license informations.]

---
 package/Config.in                                  |  1 +
 package/python-versiontools/Config.in              |  7 +++++++
 package/python-versiontools/python-versiontools.mk | 13 +++++++++++++
 3 files changed, 21 insertions(+)
 create mode 100644 package/python-versiontools/Config.in
 create mode 100644 package/python-versiontools/python-versiontools.mk
package/Config.in +1 -0
index 42c5fc8..5f29c54 100644
@@ -405,6 +405,7 @@ source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
 source "package/python-thrift/Config.in"
+source "package/python-versiontools/Config.in"
 endmenu
 endif
 source "package/python3/Config.in"
package/python-versiontools/Config.in new file +7 -0
new file mode 100644
index 0000000..cb260c1
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PYTHON_VERSIONTOOLS
+       bool "python-versiontools"
+       depends on BR2_PACKAGE_PYTHON
+       help
+         Smart replacement for plain tuple used in __version__.
+
+         https://pypi.python.org/pypi/versiontools
package/python-versiontools/python-versiontools.mk new file +0 -0
new file mode 100644
index 0000000..72a1d43

package/python-versiontools/python-versiontools.mk line 9

Quoted 9 lines
package/python-versiontools/python-versiontools.mk new file +9 -0
@@ -0,0 +1,13 @@
+################################################################################
+#
+# python-versiontools
+#
+################################################################################
+
+PYTHON_VERSIONTOOLS_VERSION = 1.9.1
+PYTHON_VERSIONTOOLS_SOURCE  = versiontools-$(PYTHON_VERSIONTOOLS_VERSION).tar.gz
+PYTHON_VERSIONTOOLS_SITE    = http://pypi.python.org/packages/source/v/versiontools/

Same comment about extra spaces for alignment.

#38 lore raw

PATCH 30/38 python-keyring: new package

In reply to Thomas Petazzoni

From: Ludovic Desroches <[email protected]>

[Thomas: convert to the Python package infrastructure, improved the .zip handling, added license informations.]

---
 package/Config.in                        |  1 +
 package/python-keyring/Config.in         |  8 ++++++++
 package/python-keyring/python-keyring.mk | 19 +++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/python-keyring/Config.in
 create mode 100644 package/python-keyring/python-keyring.mk
package/Config.in +1 -0
index 5f29c54..4f7c9cd 100644
@@ -391,6 +391,7 @@ source "package/python-dialog/Config.in"
 source "package/python-dpkt/Config.in"
 source "package/python-id3/Config.in"
 source "package/python-ipy/Config.in"
+source "package/python-keyring/Config.in"
 source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
 source "package/python-msgpack/Config.in"
package/python-keyring/Config.in new file +8 -0
new file mode 100644
index 0000000..6a5c4c5
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PYTHON_KEYRING
+	bool "python-keyring"
+	depends on BR2_PACKAGE_PYTHON
+	help
+	  The Python keyring lib provides a easy way to access the system
+	  keyring service from python.
+
+	  https://pypi.python.org/pypi/keyring
package/python-keyring/python-keyring.mk new file +19 -0
new file mode 100644
index 0000000..ead5184
@@ -0,0 +1,19 @@
+################################################################################
+#
+# python-keyring
+#
+################################################################################
+
+PYTHON_KEYRING_VERSION = 3.0.5
+PYTHON_KEYRING_SOURCE  = keyring-$(PYTHON_KEYRING_VERSION).zip
+PYTHON_KEYRING_SITE    = http://pypi.python.org/packages/source/k/keyring/
+PYTHON_KEYRING_SETUP_TYPE = setuptools
+PYTHON_KEYRING_LICENSE    = python software foundation license
+
+define PYTHON_KEYRING_EXTRACT_CMDS
+	unzip -d $(@D) $(DL_DIR)/$(PYTHON_KEYRING_SOURCE)
+	mv $(@D)/keyring-$(PYTHON_KEYRING_VERSION)/* $(@D)
+	$(RM) -r $(@D)/keyring-$(PYTHON_KEYRING_VERSION)
+endef
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#39 lore raw

PATCH 30/38 python-keyring: new package

Quoted 33 lines · Thomas Petazzoni

From: Ludovic Desroches <[email protected]>

[Thomas: convert to the Python package infrastructure, improved the .zip handling, added license informations.]

---
 package/Config.in                        |  1 +
 package/python-keyring/Config.in         |  8 ++++++++
 package/python-keyring/python-keyring.mk | 19 +++++++++++++++++++
 3 files changed, 28 insertions(+)
 create mode 100644 package/python-keyring/Config.in
 create mode 100644 package/python-keyring/python-keyring.mk
package/Config.in +1 -0
index 5f29c54..4f7c9cd 100644
@@ -391,6 +391,7 @@ source "package/python-dialog/Config.in"
 source "package/python-dpkt/Config.in"
 source "package/python-id3/Config.in"
 source "package/python-ipy/Config.in"
+source "package/python-keyring/Config.in"
 source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
 source "package/python-msgpack/Config.in"
package/python-keyring/Config.in new file +0 -0
new file mode 100644
index 0000000..6a5c4c5

package/python-keyring/Config.in line 5

Quoted 5 lines
package/python-keyring/Config.in new file +5 -0
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PYTHON_KEYRING
+       bool "python-keyring"
+       depends on BR2_PACKAGE_PYTHON
+       help
+         The Python keyring lib provides a easy way to access the system

an easy way

package/python-keyring/Config.in line 6

Quoted 1 line
package/python-keyring/Config.in new file +1 -0
+         keyring service from python.

Inconsistent capitalization of python/Python in this same sentence. Not sure which strategy to follow. For Lua we used capital L because it is explicitly requested on the Lua website. We could follow this strategy for Python too in help texts, but I have no strong opinion here.

Quoted 9 lines
package/python-keyring/Config.in new file +2 -0
+
+         https://pypi.python.org/pypi/keyring
package/python-keyring/python-keyring.mk new file +1 -0
new file mode 100644
index 0000000..ead5184
@@ -0,0 +1,19 @@
+################################################################################

package/python-keyring/python-keyring.mk line 11

Quoted 10 lines
package/python-keyring/python-keyring.mk new file +10 -0
+#
+# python-keyring
+#
+################################################################################
+
+PYTHON_KEYRING_VERSION = 3.0.5
+PYTHON_KEYRING_SOURCE  = keyring-$(PYTHON_KEYRING_VERSION).zip
+PYTHON_KEYRING_SITE    = http://pypi.python.org/packages/source/k/keyring/
+PYTHON_KEYRING_SETUP_TYPE = setuptools
+PYTHON_KEYRING_LICENSE    = python software foundation license

Same comment about spaces.

#40 lore raw

PATCH 31/38 python-simplejson: new package

In reply to Thomas Petazzoni

From: Ludovic Desroches <[email protected]>

[Thomas: convert to the Python package infrastructure, drop the setuptools dependency since the package uses distutils.]

---
 package/Config.in                              |  1 +
 package/python-simplejson/Config.in            |  7 +++++++
 package/python-simplejson/python-simplejson.mk | 14 ++++++++++++++
 3 files changed, 22 insertions(+)
 create mode 100644 package/python-simplejson/Config.in
 create mode 100644 package/python-simplejson/python-simplejson.mk
package/Config.in +1 -0
index 4f7c9cd..d4819cf 100644
@@ -405,6 +405,7 @@ source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
+source "package/python-simplejson/Config.in"
 source "package/python-thrift/Config.in"
 source "package/python-versiontools/Config.in"
 endmenu
package/python-simplejson/Config.in new file +7 -0
new file mode 100644
index 0000000..be0ee8f
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PYTHON_SIMPLEJSON
+	bool "python-simplejson"
+	depends on BR2_PACKAGE_PYTHON
+	help
+	  Simple, fast, extensible JSON encoder/decoder for Python
+
+	  https://pypi.python.org/pypi/simplejson/
package/python-simplejson/python-simplejson.mk new file +14 -0
new file mode 100644
index 0000000..e222651
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-simplejson
+#
+################################################################################
+
+PYTHON_SIMPLEJSON_VERSION = 3.3.1
+PYTHON_SIMPLEJSON_SOURCE  = simplejson-$(PYTHON_SIMPLEJSON_VERSION).tar.gz
+PYTHON_SIMPLEJSON_SITE = http://pypi.python.org/packages/source/s/simplejson/
+PYTHON_SIMPLEJSON_LICENSE = MIT
+PYTHON_SIMPLEJSON_LICENSE_FILES = LICENSE.txt
+PYTHON_SIMPLEJSON_SETUP_TYPE    = distutils
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#41 lore raw

PATCH 31/38 python-simplejson: new package

Quoted 46 lines · Thomas Petazzoni

From: Ludovic Desroches <[email protected]>

[Thomas: convert to the Python package infrastructure, drop the setuptools dependency since the package uses distutils.]

---
 package/Config.in                              |  1 +
 package/python-simplejson/Config.in            |  7 +++++++
 package/python-simplejson/python-simplejson.mk | 14 ++++++++++++++
 3 files changed, 22 insertions(+)
 create mode 100644 package/python-simplejson/Config.in
 create mode 100644 package/python-simplejson/python-simplejson.mk
package/Config.in +1 -0
index 4f7c9cd..d4819cf 100644
@@ -405,6 +405,7 @@ source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
+source "package/python-simplejson/Config.in"
 source "package/python-thrift/Config.in"
 source "package/python-versiontools/Config.in"
 endmenu
package/python-simplejson/Config.in new file +7 -0
new file mode 100644
index 0000000..be0ee8f
@@ -0,0 +1,7 @@
+config BR2_PACKAGE_PYTHON_SIMPLEJSON
+       bool "python-simplejson"
+       depends on BR2_PACKAGE_PYTHON
+       help
+         Simple, fast, extensible JSON encoder/decoder for Python
+
+         https://pypi.python.org/pypi/simplejson/
package/python-simplejson/python-simplejson.mk new file +0 -0
new file mode 100644
index 0000000..e222651

package/python-simplejson/python-simplejson.mk line 8

Quoted 8 lines
package/python-simplejson/python-simplejson.mk new file +8 -0
@@ -0,0 +1,14 @@
+################################################################################
+#
+# python-simplejson
+#
+################################################################################
+
+PYTHON_SIMPLEJSON_VERSION = 3.3.1
+PYTHON_SIMPLEJSON_SOURCE  = simplejson-$(PYTHON_SIMPLEJSON_VERSION).tar.gz

Extra whitespace before =

package/python-simplejson/python-simplejson.mk line 12

Quoted 4 lines
package/python-simplejson/python-simplejson.mk new file +4 -0
+PYTHON_SIMPLEJSON_SITE = http://pypi.python.org/packages/source/s/simplejson/
+PYTHON_SIMPLEJSON_LICENSE = MIT
+PYTHON_SIMPLEJSON_LICENSE_FILES = LICENSE.txt
+PYTHON_SIMPLEJSON_SETUP_TYPE    = distutils

Same here, we typically don't do such alignments.

#42 lore raw

PATCH 32/38 python-json-schema-validator: new package

In reply to Thomas Petazzoni

From: Ludovic Desroches <[email protected]>

[Thomas: convert to the Python package infrastructure, fix license informations.]

---
 package/Config.in                                         |  1 +
 package/python-json-schema-validator/Config.in            |  8 ++++++++
 .../python-json-schema-validator.mk                       | 15 +++++++++++++++
 3 files changed, 24 insertions(+)
 create mode 100644 package/python-json-schema-validator/Config.in
 create mode 100644 package/python-json-schema-validator/python-json-schema-validator.mk
package/Config.in +1 -0
index d4819cf..1f45ea0 100644
@@ -391,6 +391,7 @@ source "package/python-dialog/Config.in"
 source "package/python-dpkt/Config.in"
 source "package/python-id3/Config.in"
 source "package/python-ipy/Config.in"
+source "package/python-json-schema-validator/Config.in"
 source "package/python-keyring/Config.in"
 source "package/python-mad/Config.in"
 source "package/python-meld3/Config.in"
package/python-json-schema-validator/Config.in new file +8 -0
new file mode 100644
index 0000000..6ae1eb1
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PYTHON_JSON_SCHEMA_VALIDATOR
+	bool "python-json-schema-validator"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON_VERSIONTOOLS
+	help
+	  JSON Schema Validator
+
+	  https://pypi.python.org/pypi/json-schema-validator
package/python-json-schema-validator/python-json-schema-validator.mk new file +15 -0
new file mode 100644
index 0000000..55afcce
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-json-schema-validator
+#
+################################################################################
+
+PYTHON_JSON_SCHEMA_VALIDATOR_VERSION = 2.3
+PYTHON_JSON_SCHEMA_VALIDATOR_SOURCE  = json-schema-validator-$(PYTHON_JSON_SCHEMA_VALIDATOR_VERSION).tar.gz
+PYTHON_JSON_SCHEMA_VALIDATOR_SITE = http://pypi.python.org/packages/source/j/json-schema-validator/
+PYTHON_JSON_SCHEMA_VALIDATOR_LICENSE = LGPLv3
+PYTHON_JSON_SCHEMA_VALIDATOR_LICENSE_FILES = LICENSE.txt
+PYTHON_JSON_SCHEMA_VALIDATOR_SETUP_TYPE = setuptools
+PYTHON_JSON_SCHEMA_VALIDATOR_DEPENDENCIES = python-versiontools
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#43 lore raw

PATCH 33/38 python-tornado: new package

In reply to Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                        |  1 +
 package/python-tornado/Config.in         |  8 ++++++++
 package/python-tornado/python-tornado.mk | 13 +++++++++++++
 3 files changed, 22 insertions(+)
 create mode 100644 package/python-tornado/Config.in
 create mode 100644 package/python-tornado/python-tornado.mk
package/Config.in +1 -0
index 1f45ea0..269ac5a 100644
@@ -408,6 +408,7 @@ source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
 source "package/python-simplejson/Config.in"
 source "package/python-thrift/Config.in"
+source "package/python-tornado/Config.in"
 source "package/python-versiontools/Config.in"
 endmenu
 endif
package/python-tornado/Config.in new file +8 -0
new file mode 100644
index 0000000..c127d0e
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PYTHON_TORNADO
+	bool "python-tornado"
+	depends on BR2_PACKAGE_PYTHON
+	help
+	  Tornado is a Python web framework and asynchronous networking
+	  library, originally developed at FriendFeed.
+
+	  http://www.tornadoweb.org
package/python-tornado/python-tornado.mk new file +13 -0
new file mode 100644
index 0000000..0aeef86
@@ -0,0 +1,13 @@
+################################################################################
+#
+# python-tornado
+#
+################################################################################
+
+PYTHON_TORNADO_VERSION = 3.1.1
+PYTHON_TORNADO_SOURCE  = tornado-$(PYTHON_TORNADO_VERSION).tar.gz
+PYTHON_TORNADO_SITE    = https://pypi.python.org/packages/source/t/tornado
+PYTHON_TORNADO_LICENSE = Apache-v2
+PYTHON_TORNADO_SETUP_TYPE = setuptools
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#44 lore raw

PATCH 33/38 python-tornado: new package

Quoted 45 lines · Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                        |  1 +
 package/python-tornado/Config.in         |  8 ++++++++
 package/python-tornado/python-tornado.mk | 13 +++++++++++++
 3 files changed, 22 insertions(+)
 create mode 100644 package/python-tornado/Config.in
 create mode 100644 package/python-tornado/python-tornado.mk
package/Config.in +1 -0
index 1f45ea0..269ac5a 100644
@@ -408,6 +408,7 @@ source "package/python-serial/Config.in"
 source "package/python-setuptools/Config.in"
 source "package/python-simplejson/Config.in"
 source "package/python-thrift/Config.in"
+source "package/python-tornado/Config.in"
 source "package/python-versiontools/Config.in"
 endmenu
 endif
package/python-tornado/Config.in new file +8 -0
new file mode 100644
index 0000000..c127d0e
@@ -0,0 +1,8 @@
+config BR2_PACKAGE_PYTHON_TORNADO
+       bool "python-tornado"
+       depends on BR2_PACKAGE_PYTHON
+       help
+         Tornado is a Python web framework and asynchronous networking
+         library, originally developed at FriendFeed.
+
+         http://www.tornadoweb.org
package/python-tornado/python-tornado.mk new file +1 -0
new file mode 100644
index 0000000..0aeef86
@@ -0,0 +1,13 @@
+################################################################################

package/python-tornado/python-tornado.mk line 11

Quoted 10 lines
package/python-tornado/python-tornado.mk new file +10 -0
+#
+# python-tornado
+#
+################################################################################
+
+PYTHON_TORNADO_VERSION = 3.1.1
+PYTHON_TORNADO_SOURCE  = tornado-$(PYTHON_TORNADO_VERSION).tar.gz
+PYTHON_TORNADO_SITE    = https://pypi.python.org/packages/source/t/tornado
+PYTHON_TORNADO_LICENSE = Apache-v2
+PYTHON_TORNADO_SETUP_TYPE = setuptools

Seems Ludovic is not the only one adding these spaces. I won't repeat this comment on each patch then, but of course it applies on all of them.

#45 lore raw

PATCH 34/38 python-pyasn: new package

In reply to Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                    |  1 +
 package/python-pyasn/Config.in       | 13 +++++++++++++
 package/python-pyasn/python-pyasn.mk | 19 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 package/python-pyasn/Config.in
 create mode 100644 package/python-pyasn/python-pyasn.mk
package/Config.in +1 -0
index 269ac5a..2081a8d 100644
@@ -399,6 +399,7 @@ source "package/python-msgpack/Config.in"
 source "package/python-netifaces/Config.in"
 source "package/python-nfc/Config.in"
 source "package/python-protobuf/Config.in"
+source "package/python-pyasn/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
package/python-pyasn/Config.in new file +13 -0
new file mode 100644
index 0000000..828c699
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PYTHON_PYASN
+	bool "python-pyasn"
+	depends on BR2_PACKAGE_PYTHON
+	depends on BR2_INSTALL_LIBSTDCPP
+	help
+	  PyASN is a Python extension module that enables you to
+	  perform very fast IP address to Autonomous System Number
+	  lookups.
+
+	  https://code.google.com/p/pyasn/
+
+comment "python-pyasn needs toolchain w/ C++"
+        depends on !BR2_INSTALL_LIBSTDCPP
package/python-pyasn/python-pyasn.mk new file +19 -0
new file mode 100644
index 0000000..84062bd
@@ -0,0 +1,19 @@
+################################################################################
+#
+# python-pyasn
+#
+################################################################################
+
+PYTHON_PYASN_VERSION = 1.2
+PYTHON_PYASN_SOURCE  = PyASN-$(PYTHON_PYASN_VERSION).zip
+PYTHON_PYASN_SITE    = https://pyasn.googlecode.com/files
+PYTHON_PYASN_LICENSE = LGPL
+PYTHON_PYASN_SETUP_TYPE = distutils
+
+define PYTHON_PYASN_EXTRACT_CMDS
+	unzip -d $(@D) $(DL_DIR)/$(PYTHON_PYASN_SOURCE)
+	mv $(@D)/PyASN-$(PYTHON_PYASN_VERSION)/* $(@D)
+	$(RM) -r $(@D)/PyASN-$(PYTHON_PYASN_VERSION)
+endef
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#46 lore raw

PATCH 34/38 python-pyasn: new package

Quoted 32 lines · Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                    |  1 +
 package/python-pyasn/Config.in       | 13 +++++++++++++
 package/python-pyasn/python-pyasn.mk | 19 +++++++++++++++++++
 3 files changed, 33 insertions(+)
 create mode 100644 package/python-pyasn/Config.in
 create mode 100644 package/python-pyasn/python-pyasn.mk
package/Config.in +1 -0
index 269ac5a..2081a8d 100644
@@ -399,6 +399,7 @@ source "package/python-msgpack/Config.in"
 source "package/python-netifaces/Config.in"
 source "package/python-nfc/Config.in"
 source "package/python-protobuf/Config.in"
+source "package/python-pyasn/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
package/python-pyasn/Config.in new file +2 -0
new file mode 100644
index 0000000..828c699
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PYTHON_PYASN
+       bool "python-pyasn"

package/python-pyasn/Config.in line 12

Quoted 10 lines
package/python-pyasn/Config.in new file +10 -0
+       depends on BR2_PACKAGE_PYTHON
+       depends on BR2_INSTALL_LIBSTDCPP
+       help
+         PyASN is a Python extension module that enables you to
+         perform very fast IP address to Autonomous System Number
+         lookups.
+
+         https://code.google.com/p/pyasn/
+
+comment "python-pyasn needs toolchain w/ C++"

needs a toolchain

#47 lore raw

PATCH 35/38 python-pycrypto: new package

In reply to Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                          |  1 +
 package/python-pycrypto/Config.in          |  9 ++++++++
 package/python-pycrypto/python-pycrypto.mk | 35 ++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)
 create mode 100644 package/python-pycrypto/Config.in
 create mode 100644 package/python-pycrypto/python-pycrypto.mk
package/Config.in +1 -0
index 2081a8d..426f55e 100644
@@ -400,6 +400,7 @@ source "package/python-netifaces/Config.in"
 source "package/python-nfc/Config.in"
 source "package/python-protobuf/Config.in"
 source "package/python-pyasn/Config.in"
+source "package/python-pycrypto/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
package/python-pycrypto/Config.in new file +9 -0
new file mode 100644
index 0000000..60a3446
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_PYCRYPTO
+	bool "python-pycrypto"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_GMP
+	help
+	  PyCrypto is a collection of cryptographic algorithms and
+	  protocols, implemented for use from Python.
+
+	  http://www.pycrypto.org/
package/python-pycrypto/python-pycrypto.mk new file +35 -0
new file mode 100644
index 0000000..b84099b
@@ -0,0 +1,35 @@
+################################################################################
+#
+# python-pycrypto
+#
+################################################################################
+
+PYTHON_PYCRYPTO_VERSION = 2.6
+PYTHON_PYCRYPTO_SOURCE  = pycrypto-$(PYTHON_PYCRYPTO_VERSION).tar.gz
+PYTHON_PYCRYPTO_SITE    = http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto
+PYTHON_PYCRYPTO_SETUP_TYPE = distutils
+
+PYTHON_PYCRYPTO_LICENSE = Public Domain, Python 2.2 License (HMAC.py, setup.py)
+PYTHON_PYCRYPTO_LICENSE_FILES = COPYRIGHT LEGAL/copy/LICENSE.libtom \
+		LEGAL/copy/LICENSE.orig LEGAL/copy/LICENSE.python-2.2
+
+PYTHON_PYCRYPTO_DEPENDENCIES =  gmp
+
+# The configure step needs to be run outside of the setup.py since it isn't
+# run correctly for cross-compiling
+define PYTHON_PYCRYPTO_CONFIGURE_CMDS
+	(cd $(@D) && \
+	$(TARGET_CONFIGURE_OPTS) \
+	$(TARGET_CONFIGURE_ARGS) \
+	./configure \
+		--target=$(GNU_TARGET_NAME) \
+		--host=$(GNU_TARGET_NAME) \
+		--build=$(GNU_HOST_NAME) \
+		--prefix=/usr \
+		--exec-prefix=/usr \
+		--sysconfdir=/etc \
+		--program-prefix="" \
+	)
+endef
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#48 lore raw

PATCH 35/38 python-pycrypto: new package

Quoted 51 lines · Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                          |  1 +
 package/python-pycrypto/Config.in          |  9 ++++++++
 package/python-pycrypto/python-pycrypto.mk | 35 ++++++++++++++++++++++++++++++
 3 files changed, 45 insertions(+)
 create mode 100644 package/python-pycrypto/Config.in
 create mode 100644 package/python-pycrypto/python-pycrypto.mk
package/Config.in +1 -0
index 2081a8d..426f55e 100644
@@ -400,6 +400,7 @@ source "package/python-netifaces/Config.in"
 source "package/python-nfc/Config.in"
 source "package/python-protobuf/Config.in"
 source "package/python-pyasn/Config.in"
+source "package/python-pycrypto/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
package/python-pycrypto/Config.in new file +9 -0
new file mode 100644
index 0000000..60a3446
@@ -0,0 +1,9 @@
+config BR2_PACKAGE_PYTHON_PYCRYPTO
+       bool "python-pycrypto"
+       depends on BR2_PACKAGE_PYTHON
+       select BR2_PACKAGE_GMP
+       help
+         PyCrypto is a collection of cryptographic algorithms and
+         protocols, implemented for use from Python.
+
+         http://www.pycrypto.org/
package/python-pycrypto/python-pycrypto.mk new file +6 -0
new file mode 100644
index 0000000..b84099b
@@ -0,0 +1,35 @@
+################################################################################
+#
+# python-pycrypto
+#
+################################################################################
+

package/python-pycrypto/python-pycrypto.mk line 16

Quoted 10 lines
package/python-pycrypto/python-pycrypto.mk new file +10 -0
+PYTHON_PYCRYPTO_VERSION = 2.6
+PYTHON_PYCRYPTO_SOURCE  = pycrypto-$(PYTHON_PYCRYPTO_VERSION).tar.gz
+PYTHON_PYCRYPTO_SITE    = http://ftp.dlitz.net/pub/dlitz/crypto/pycrypto
+PYTHON_PYCRYPTO_SETUP_TYPE = distutils
+
+PYTHON_PYCRYPTO_LICENSE = Public Domain, Python 2.2 License (HMAC.py, setup.py)
+PYTHON_PYCRYPTO_LICENSE_FILES = COPYRIGHT LEGAL/copy/LICENSE.libtom \
+               LEGAL/copy/LICENSE.orig LEGAL/copy/LICENSE.python-2.2
+
+PYTHON_PYCRYPTO_DEPENDENCIES =  gmp

I'll explicitly mention this double spacing because it could be easily overlooked...

#49 lore raw

PATCH 36/38 python-pysnmp: new package

In reply to Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                      |  1 +
 package/python-pysnmp/Config.in        | 14 ++++++++++++++
 package/python-pysnmp/python-pysnmp.mk | 17 +++++++++++++++++
 3 files changed, 32 insertions(+)
 create mode 100644 package/python-pysnmp/Config.in
 create mode 100644 package/python-pysnmp/python-pysnmp.mk
package/Config.in +1 -0
index 426f55e..601054f 100644
@@ -404,6 +404,7 @@ source "package/python-pycrypto/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
+source "package/python-pysnmp/Config.in"
 source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
package/python-pysnmp/Config.in new file +14 -0
new file mode 100644
index 0000000..e81df3d
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PYTHON_PYSNMP
+	bool "python-pysnmp"
+	depends on BR2_PACKAGE_PYTHON
+	depends on BR2_INSTALL_LIBSTDCPP # pyasn
+	select BR2_PACKAGE_PYTHON_PYASN
+	select BR2_PACKAGE_PYTHON_PYCRYPTO
+	help
+	  PySNMP is a cross-platform, pure-Python SNMP engine
+	  implementation.
+
+	  http://pysnmp.sf.net
+
+comment "python-pysnmp needs toolchain w/ C++"
+        depends on !BR2_INSTALL_LIBSTDCPP
package/python-pysnmp/python-pysnmp.mk new file +17 -0
new file mode 100644
index 0000000..6932214
@@ -0,0 +1,17 @@
+################################################################################
+#
+# python-pysnmp
+#
+################################################################################
+
+PYTHON_PYSNMP_VERSION = 4.2.4
+PYTHON_PYSNMP_SOURCE  = pysnmp-$(PYTHON_PYSNMP_VERSION).tar.gz
+PYTHON_PYSNMP_SITE    = https://pypi.python.org/packages/source/p/pysnmp
+PYTHON_PYSNMP_SETUP_TYPE = setuptools
+
+PYTHON_PYSNMP_LICENSE = BSD-3c
+PYTHON_PYSNMP_LICENSE_FILES = LICENSE
+
+PYTHON_PYSNMP_DEPENDENCIES = python-pyasn python-pycrypto
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#50 lore raw

PATCH 36/38 python-pysnmp: new package

Quoted 33 lines · Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                      |  1 +
 package/python-pysnmp/Config.in        | 14 ++++++++++++++
 package/python-pysnmp/python-pysnmp.mk | 17 +++++++++++++++++
 3 files changed, 32 insertions(+)
 create mode 100644 package/python-pysnmp/Config.in
 create mode 100644 package/python-pysnmp/python-pysnmp.mk
package/Config.in +1 -0
index 426f55e..601054f 100644
@@ -404,6 +404,7 @@ source "package/python-pycrypto/Config.in"
 source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
+source "package/python-pysnmp/Config.in"
 source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
package/python-pysnmp/Config.in new file +3 -0
new file mode 100644
index 0000000..e81df3d
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_PYTHON_PYSNMP
+       bool "python-pysnmp"
+       depends on BR2_PACKAGE_PYTHON

package/python-pysnmp/Config.in line 13

Quoted 10 lines
package/python-pysnmp/Config.in new file +10 -0
+       depends on BR2_INSTALL_LIBSTDCPP # pyasn
+       select BR2_PACKAGE_PYTHON_PYASN
+       select BR2_PACKAGE_PYTHON_PYCRYPTO
+       help
+         PySNMP is a cross-platform, pure-Python SNMP engine
+         implementation.
+
+         http://pysnmp.sf.net
+
+comment "python-pysnmp needs toolchain w/ C++"

needs a toolchain

#51 lore raw

PATCH 37/38 python-pysnmp-apps: new package

In reply to Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                                |  1 +
 package/python-pysnmp-apps/Config.in             | 13 +++++++++++++
 package/python-pysnmp-apps/python-pysnmp-apps.mk | 16 ++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 package/python-pysnmp-apps/Config.in
 create mode 100644 package/python-pysnmp-apps/python-pysnmp-apps.mk
package/Config.in +1 -0
index 601054f..2e3b289 100644
@@ -405,6 +405,7 @@ source "package/python-pygame/Config.in"
 source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
 source "package/python-pysnmp/Config.in"
+source "package/python-pysnmp-apps/Config.in"
 source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
package/python-pysnmp-apps/Config.in new file +13 -0
new file mode 100644
index 0000000..0a1d98b
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PYTHON_PYSNMP_APPS
+	bool "python-pysnmp-apps"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON_PYSNMP
+	depends on BR2_INSTALL_LIBSTDCPP # pysnmp -> pyasn
+	help
+	  PySNMP MIBs is a set of IETF & IANA MIBs pre-compiled and
+	  packaged to simplify their use with the PySNMP library.
+
+	  http://pysnmp.sf.net
+
+comment "python-pysnmp-apps needs toolchain w/ C++"
+        depends on !BR2_INSTALL_LIBSTDCPP
package/python-pysnmp-apps/python-pysnmp-apps.mk new file +16 -0
new file mode 100644
index 0000000..a88c7c8
@@ -0,0 +1,16 @@
+################################################################################
+#
+# python-pysnmp-apps
+#
+################################################################################
+
+PYTHON_PYSNMP_APPS_VERSION = 0.3.3
+PYTHON_PYSNMP_APPS_SOURCE  = pysnmp-apps-$(PYTHON_PYSNMP_APPS_VERSION).tar.gz
+PYTHON_PYSNMP_APPS_SITE    = https://pypi.python.org/packages/source/p/pysnmp-apps
+PYTHON_PYSNMP_APPS_SETUP_TYPE = setuptools
+PYTHON_PYSNMP_APPS_LICENSE = BSD-3c
+PYTHON_PYSNMP_APPS_LICENSE_FILES = LICENSE
+
+PYTHON_PYSNMP_APPS_DEPENDENCIES = python-pysnmp
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#52 lore raw

PATCH 37/38 python-pysnmp-apps: new package

Thomas,

Thomas Petazzoni <[email protected]> wrote on 12/08/2013 04:15:06 PM:

[...]

Review

Quoted 1 line
(quoted diff) +0 -0

b/package/python-pysnmp-apps/Config.in

package/python-pysnmp-apps/Config.in line 8

Quoted 13 lines

new file mode 100644
index 0000000..0a1d98b

package/python-pysnmp-apps/Config.in new file +8 -0
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PYTHON_PYSNMP_APPS
+   bool "python-pysnmp-apps"
+   depends on BR2_PACKAGE_PYTHON
+   select BR2_PACKAGE_PYTHON_PYSNMP
+   depends on BR2_INSTALL_LIBSTDCPP # pysnmp -> pyasn
+   help
+     PySNMP MIBs is a set of IETF & IANA MIBs pre-compiled and
+     packaged to simplify their use with the PySNMP library.

Looks like I have a copy and paste error. Please update the description to be the following:

A collection of command-line tools for SNMP management purposes built on top of PySNMP package.

package/python-pysnmp-apps/Config.in line 13

Quoted 5 lines
package/python-pysnmp-apps/Config.in new file +5 -0
+
+     http://pysnmp.sf.net
+
+comment "python-pysnmp-apps needs toolchain w/ C++"
+        depends on !BR2_INSTALL_LIBSTDCPP

[...]

Thanks,
-Ryan

#53 lore raw

PATCH 37/38 python-pysnmp-apps: new package

Quoted 26 lines · Ryan Barnett

Thomas,

Thomas Petazzoni <[email protected]> wrote on 12/08/2013 04:15:06 PM:

[...]

Review

Quoted 1 line
(quoted diff) +0 -0

b/package/python-pysnmp-apps/Config.in

package/python-pysnmp-apps/Config.in line 8

Quoted 13 lines

new file mode 100644
index 0000000..0a1d98b

package/python-pysnmp-apps/Config.in new file +8 -0
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PYTHON_PYSNMP_APPS
+   bool "python-pysnmp-apps"
+   depends on BR2_PACKAGE_PYTHON
+   select BR2_PACKAGE_PYTHON_PYSNMP
+   depends on BR2_INSTALL_LIBSTDCPP # pysnmp -> pyasn
+   help
+     PySNMP MIBs is a set of IETF & IANA MIBs pre-compiled and
+     packaged to simplify their use with the PySNMP library.

Looks like I have a copy and paste error. Please update the description to be the following:

Quoted 2 lines

A collection of command-line tools for SNMP management purposes built on top of PySNMP package.

I'd either say 'on top of the PySNMP package' or 'on top of PySNMP'.

Quoted 5 lines

package/python-pysnmp-apps/Config.in line 12

Quoted 5 lines
package/python-pysnmp-apps/Config.in new file +4 -0
+
+     http://pysnmp.sf.net
+
+comment "python-pysnmp-apps needs toolchain w/ C++"

needs a toolchain

#54 lore raw

PATCH 38/38 python-pysnmp-mibs: new package

In reply to Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                                |  1 +
 package/python-pysnmp-mibs/Config.in             | 13 +++++++++++++
 package/python-pysnmp-mibs/python-pysnmp-mibs.mk | 16 ++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 package/python-pysnmp-mibs/Config.in
 create mode 100644 package/python-pysnmp-mibs/python-pysnmp-mibs.mk
package/Config.in +1 -0
index 2e3b289..4dc417f 100644
@@ -406,6 +406,7 @@ source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
 source "package/python-pysnmp/Config.in"
 source "package/python-pysnmp-apps/Config.in"
+source "package/python-pysnmp-mibs/Config.in"
 source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
package/python-pysnmp-mibs/Config.in new file +13 -0
new file mode 100644
index 0000000..0512502
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PYTHON_PYSNMP_MIBS
+	bool "python-pysnmp-mibs"
+	depends on BR2_PACKAGE_PYTHON
+	select BR2_PACKAGE_PYTHON_PYSNMP
+	depends on BR2_INSTALL_LIBSTDCPP # pysnmp -> pyasn
+	help
+	  PySNMP MIBs is a set of IETF & IANA MIBs pre-compiled and
+	  packaged to simplify their use with the PySNMP library.
+
+	  http://pysnmp.sf.net
+
+comment "python-pysnmp-libs needs toolchain w/ C++"
+        depends on !BR2_INSTALL_LIBSTDCPP
package/python-pysnmp-mibs/python-pysnmp-mibs.mk new file +16 -0
new file mode 100644
index 0000000..faf1293
@@ -0,0 +1,16 @@
+################################################################################
+#
+# python-pysnmp-mibs
+#
+################################################################################
+
+PYTHON_PYSNMP_MIBS_VERSION = 0.1.4
+PYTHON_PYSNMP_MIBS_SOURCE  = pysnmp-mibs-$(PYTHON_PYSNMP_MIBS_VERSION).tar.gz
+PYTHON_PYSNMP_MIBS_SITE    = https://pypi.python.org/packages/source/p/pysnmp-mibs
+PYTHON_PYSNMP_MIBS_SETUP_TYPE = setuptools
+PYTHON_PYSNMP_MIBS_LICENSE = BSD-3c
+PYTHON_PYSNMP_MIBS_LICENSE_FILES = LICENSE
+
+PYTHON_PYSNMP_MIBS_DEPENDENCIES = python-pysnmp
+
+$(eval $(python-package))
Signature · 1 line
1.8.1.2
#55 lore raw

PATCH 38/38 python-pysnmp-mibs: new package

Quoted 32 lines · Thomas Petazzoni

From: Ryan Barnett <[email protected]>

---
 package/Config.in                                |  1 +
 package/python-pysnmp-mibs/Config.in             | 13 +++++++++++++
 package/python-pysnmp-mibs/python-pysnmp-mibs.mk | 16 ++++++++++++++++
 3 files changed, 30 insertions(+)
 create mode 100644 package/python-pysnmp-mibs/Config.in
 create mode 100644 package/python-pysnmp-mibs/python-pysnmp-mibs.mk
package/Config.in +1 -0
index 2e3b289..4dc417f 100644
@@ -406,6 +406,7 @@ source "package/python-pyparsing/Config.in"
 source "package/python-pyro/Config.in"
 source "package/python-pysnmp/Config.in"
 source "package/python-pysnmp-apps/Config.in"
+source "package/python-pysnmp-mibs/Config.in"
 source "package/python-pyusb/Config.in"
 source "package/python-pyzmq/Config.in"
 source "package/python-serial/Config.in"
package/python-pysnmp-mibs/Config.in new file +2 -0
new file mode 100644
index 0000000..0512502
@@ -0,0 +1,13 @@
+config BR2_PACKAGE_PYTHON_PYSNMP_MIBS
+       bool "python-pysnmp-mibs"

package/python-pysnmp-mibs/Config.in line 12

Quoted 10 lines
package/python-pysnmp-mibs/Config.in new file +10 -0
+       depends on BR2_PACKAGE_PYTHON
+       select BR2_PACKAGE_PYTHON_PYSNMP
+       depends on BR2_INSTALL_LIBSTDCPP # pysnmp -> pyasn
+       help
+         PySNMP MIBs is a set of IETF & IANA MIBs pre-compiled and
+         packaged to simplify their use with the PySNMP library.
+
+         http://pysnmp.sf.net
+
+comment "python-pysnmp-libs needs toolchain w/ C++"

needs a toolchain

#56 lore raw

cover Python infrastructure and package conversion

In reply to Thomas Petazzoni

Hi Thomas,

Quoted 35 lines · Thomas Petazzoni

Hello,

This set of patches add a new infrastructure for Python packages, which support both distutils and setuptools based packages. It also converts all the current Python packages to this infrastructure, and adds a bunch of new Python packages that have been sitting in patchwork for a while.

Thanks to this infrastructure, the vast majority of Python packages no longer need to write any <something>_CMDS. All they need to do is to explicitly say, through the <pkg>_SETUP_TYPE variable, whether the setup.py of the package is distutils-based or setuptools-based.

When it's setuptools-based, then the infrastructure will automatically build host-setuptools an host-distutilscross.

A short overview of the patches:

* Patches 1 and 2 make relatively unrelated fixes to the dialog package, which were found while doing the Python conversion of python-dialog.

* Patch 3 adds the Python infrastructure itself.

* Patches 4 to 25 convert all the existing Python packages to use the new infrastructure.

* Patches 26 to 38 add new Python packages that have been sitting on patchwork for some time, including some contributed by Ryan Barnett, who did rebase them on the Python infrastructure.

This complete set of patches is available on a Git branch at:

http://git.free-electrons.com/users/thomas-petazzoni/buildroot/log/?h=python-pkg

Quoted 8 lines

I have already started working on making the infrastructure work with Python 3 as well, and I have a bunch of patches that do this. However, they are not completely ready yet, and since Python modules anyway can't be used today with Python 3, merging this Python 2 only package infrastructure is not a regression.

Of course, testing is more than welcome.

I must say I'm very happy with this Python infrastructure for buildroot. It removes quite some code and creates better consistency. It's also great that you incorporated the pending Python patches from patchwork! I did a basic review of your patches and provided some minor comments, but nothing big.

What kind of testing did you already do? Did you compile-test all touched packages?

Thankas,
Thomas

#57 lore raw

cover Python infrastructure and package conversion

Dear Thomas De Schampheleire,

Quoted 5 lines · Thomas De Schampheleire

I must say I'm very happy with this Python infrastructure for buildroot. It removes quite some code and creates better consistency. It's also great that you incorporated the pending Python patches from patchwork! I did a basic review of your patches and provided some minor comments, but nothing big.

Thanks for review, very useful, as usual!

Quoted 2 lines

What kind of testing did you already do? Did you compile-test all touched packages?

I did compile test all of them, yes. For all the existing packages, I also did a comparison between a build before the patch series, and after the patch series. The list of installed files are similar, except for python-thrift and python-protobuf (see
http://code.bulix.org/panul0-85169?raw), but these differences are not important apparently, which Gustavo confirmed on IRC. Also, I verified that all the native libraries (.so files) are properly built for ARM, to at least verify that some native compilation hasn't sneaked into the build.

Best regards,

Thomas

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