Skip to contentSkip to conversation

pyrex: new package

PATCH Superseded mlweber1 at rockwellcollins.com 3 participants 4 messages Mar 15, 2014 – Mar 31, 2014

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 pyrex: new package

From: Matt Weber <[email protected]>

Pyrex is a language that allows you to mix python and C code in a single .pyx description file. This file is then rendered into C code by the pyrexc host tool. That C file then can be used within an application build or as part of the normal distutils build process used to build a Python extension module. In my use case, I was using buildroot to build a python extension module.

I will be submitting the pypcap package as the application that uses this tool to generate an extension module for the libpcap library.

---
Changes v2 -> v3:
- Moved menu entry under host utilities menu (Suggested by Yann)
- Updated description and included a description above (Suggested by Yann)

Changes v1 -> v2:
- Converted to a host only pkg as this pkg provides generated C code that an application would use from a sysroot (not on target). (Suggested by Thomas)

---
 package/Config.in.host               |    1 +
 package/python-pyrex/Config.in.host  |   10 ++++++++++
 package/python-pyrex/python-pyrex.mk |   15 +++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 package/python-pyrex/Config.in.host
 create mode 100644 package/python-pyrex/python-pyrex.mk
package/Config.in.host +1 -0
index ac6091f..b8706cd 100644
@@ -12,6 +12,7 @@ source "package/mtools/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
 source "package/parted/Config.in.host"
+source "package/python-pyrex/Config.in.host"
 source "package/sam-ba/Config.in.host"
 source "package/squashfs/Config.in.host"
 source "package/sunxi-tools/Config.in.host"
package/python-pyrex/Config.in.host new file +10 -0
new file mode 100644
index 0000000..4edeb38
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_HOST_PYTHON_PYREX
+	bool "python-pyrex"
+	depends on BR2_PACKAGE_PYTHON
+	help
+	  Pyrex is a language for writing mixed Python and C
+	  extension modules.  This tool is invoked as part of
+	  the build process to generate C code from a .pyx
+	  description file.
+
+	  http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
package/python-pyrex/python-pyrex.mk new file +15 -0
new file mode 100644
index 0000000..73cb163
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-pyrex
+#
+################################################################################
+
+PYTHON_PYREX_VERSION = 0.9.9
+PYTHON_PYREX_SOURCE = Pyrex-$(PYTHON_PYREX_VERSION).tar.gz
+PYTHON_PYREX_SITE = http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/
+PYTHON_PYREX_DEPENDENCIES = host-python
+PYTHON_PYREX_LICENSE = Apache-v2
+PYTHON_PYREX_LICENSE_FILES = LICENSE.txt
+PYTHON_PYREX_SETUP_TYPE = distutils
+
+$(eval $(host-python-package))
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH v3 1/1 pyrex: new package

Matt, All,

On 2014-03-15 17:00 -0500, mlweber1 at rockwellcollins.com spake thusly:

Quoted 7 lines

From: Matt Weber <[email protected]>

Pyrex is a language that allows you to mix python and C code in a single .pyx description file. This file is then rendered into C code by the pyrexc host tool. That C file then can be used within an application build or as part of the normal distutils build process used to build a Python extension module.

Great description! Thanks! :-)

Quoted 5 lines

In my use case,
I was using buildroot to build a python extension module.

I will be submitting the pypcap package as the application that uses this tool to generate an extension module for the libpcap library.

The two sentences above do not really belong to a commit log. Personal experience may go after a --- line, if needed, as do plans about a future submission.

Quoted 36 lines

---
Changes v2 -> v3:
- Moved menu entry under host utilities menu (Suggested by Yann)
- Updated description and included a description above (Suggested by Yann)

Changes v1 -> v2:
- Converted to a host only pkg as this pkg provides generated C code that an application would use from a sysroot (not on target). (Suggested by Thomas)

---
 package/Config.in.host               |    1 +
 package/python-pyrex/Config.in.host  |   10 ++++++++++
 package/python-pyrex/python-pyrex.mk |   15 +++++++++++++++
 3 files changed, 26 insertions(+)
 create mode 100644 package/python-pyrex/Config.in.host
 create mode 100644 package/python-pyrex/python-pyrex.mk
package/Config.in.host +1 -0
index ac6091f..b8706cd 100644
@@ -12,6 +12,7 @@ source "package/mtools/Config.in.host"
 source "package/omap-u-boot-utils/Config.in.host"
 source "package/openocd/Config.in.host"
 source "package/parted/Config.in.host"
+source "package/python-pyrex/Config.in.host"
 source "package/sam-ba/Config.in.host"
 source "package/squashfs/Config.in.host"
 source "package/sunxi-tools/Config.in.host"
package/python-pyrex/Config.in.host new file +0 -0
new file mode 100644
index 0000000..4edeb38

package/python-pyrex/Config.in.host line 2

Quoted 2 lines
package/python-pyrex/Config.in.host new file +2 -0
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_HOST_PYTHON_PYREX
+	bool "python-pyrex"

Like for all other host utils we expose in that sub-menu, the prompt should start with 'host ' as I said in my previous mail. So that should be:
bool "host python-pyrex"

Otherwise, looks good. :-)

Care to re-send with that fixed (unless Peter beats you to it when he applies it) ?

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#2 lore raw

PATCH v3 1/1 pyrex: new package

In reply to mlweber1 at rockwellcollins.com

Matt,

package/python-pyrex/Config.in.host line 3

Quoted 9 lines · On Sat, 15 Mar 2014 17:00:30 -0500, mlweber1 at rockwellcollins.com wrote:
package/python-pyrex/Config.in.host new file +3 -0
new file mode 100644
index 0000000..4edeb38
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_HOST_PYTHON_PYREX
+	bool "python-pyrex"
+	depends on BR2_PACKAGE_PYTHON

Is it actually really needed to have this host package visible in menuconfig? python-pyrex is really a tool to generate code, so it should be used by other packages as a dependency, and does not necessarily need to be exposed in menuconfig.

To me, host-python-pyrex is a little bit like host-bison or host-flex:
useful as a dependency of another package, but not really useful as a visible host package in menuconfig.

Would you agree if I removed this option when applying your patch?

Best regards,

Thomas

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

PATCH v3 1/1 pyrex: new package

Thomas,

Thomas Petazzoni <[email protected]> wrote on 03/29/2014 06:03:25 AM:

Quoted 26 lines

From: Thomas Petazzoni <[email protected]>
To: mlweber1 at rockwellcollins.com
Cc: buildroot at busybox.net
Date: 03/29/2014 06:03 AM
Subject: Re: [Buildroot] [PATCH v3] pyrex: new package

Matt,

package/python-

Quoted 1 line · On Sat, 15 Mar 2014 17:00:30 -0500, mlweber1 at rockwellcollins.com wrote:
package/python- renamed from package/python-pyrex/Config.in.host +0 -0

pyrex/Config.in.host

package/python-pyrex/Config.in.host line 3

Quoted 8 lines

new file mode 100644
index 0000000..4edeb38

package/python-pyrex/Config.in.host new file +3 -0
@@ -0,0 +1,10 @@
+config BR2_PACKAGE_HOST_PYTHON_PYREX
+   bool "python-pyrex"
+   depends on BR2_PACKAGE_PYTHON

Is it actually really needed to have this host package visible in menuconfig? python-pyrex is really a tool to generate code, so it should be used by other packages as a dependency, and does not necessarily need to be exposed in menuconfig.

Quoted 5 lines

To me, host-python-pyrex is a little bit like host-bison or host-flex:
useful as a dependency of another package, but not really useful as a visible host package in menuconfig.

Would you agree if I removed this option when applying your patch?

Yeah that makes sense. I'll update the patch set.

Thanks for the feedback!
Matt