Skip to contentSkip to conversation

evemu: disable python binding if not needed

PATCH Superseded Peter Seiderer 2 participants 12 messages Apr 28, 2014

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover evemu: disable python binding if not needed

[Patch 1/4] is a replacement for evemu-0002-disable-tests-patch, because I think it is nicer to add the evemu disable feature the same way as with the python binding (see [Patch 3/4]) and maybe this version is suitable for upstream...

[Patch 2/4] fixes host-python/host-python3 dependency

[Patch 3/4] enables python binding only for python2

[Patch 4/4] enables python binding for python3 (with two python3 related fixes), but something seems to be broken with the evemu-1.2.0/config-aux/py-compile script, I get no compile error and no compiled python binding files on the target.

Patch evemu-0008-python-fix-device-open-for-python3.patch fixed an python3 binding runtime failure from an earlier build (still with EVEMU_DEPENDENCIES += host-python), which leaves non compiled python source files in the site-packages/evemu directory...

Peter Seiderer (4):
evemu: disable tests via evemu configure option
evemu: fix host-python/host-python3 dependency
evemu: build python2 binding only if target python2 is enabled
evemu: enable python3 bindings

 ...-00008-python-fix-device-open-for-python3.patch | 35 ++++++++++++++++
 package/evemu/evemu-0002-disable-tests.patch       | 19 ---------
 ...005-configure.ac-add-disable-tests-option.patch | 44 +++++++++++++++++++++
 ...gure.ac-add-disable-python-binding-option.patch | 46 ++++++++++++++++++++++
 ...-fixes-the-syntax-for-raising-exceptions-.patch | 39 ++++++++++++++++++
 package/evemu/evemu.mk                             | 14 ++++++-
 6 files changed, 176 insertions(+), 21 deletions(-)
 create mode 100644 package/evemu/evemu-00008-python-fix-device-open-for-python3.patch
 delete mode 100644 package/evemu/evemu-0002-disable-tests.patch
 create mode 100644 package/evemu/evemu-0005-configure.ac-add-disable-tests-option.patch
 create mode 100644 package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch
 create mode 100644 package/evemu/evemu-0007-Description-fixes-the-syntax-for-raising-exceptions-.patch
Signature · 1 line
1.8.1.4
#1 lore raw

PATCH 1/4 evemu: disable tests via evemu configure option

---
 package/evemu/evemu-0002-disable-tests.patch       | 19 ----------
 ...005-configure.ac-add-disable-tests-option.patch | 44 ++++++++++++++++++++++
 package/evemu/evemu.mk                             |  3 ++
 3 files changed, 47 insertions(+), 19 deletions(-)
 delete mode 100644 package/evemu/evemu-0002-disable-tests.patch
 create mode 100644 package/evemu/evemu-0005-configure.ac-add-disable-tests-option.patch
package/evemu/evemu-0002-disable-tests.patch deleted +0 -19
deleted file mode 100644
index e545c91..0000000
@@ -1,19 +0,0 @@
-[PATCH] disable tests
-
-The tests need C++ support and add to build time, so disable them for BR.
-
-Signed-off-by: Peter Korsgaard <[email protected]>
----
- Makefile.am |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-Index: evemu-1.2.0/Makefile.am
-===================================================================
---- evemu-1.2.0.orig/Makefile.am
-+++ evemu-1.2.0/Makefile.am
-@@ -1,4 +1,4 @@
--SUBDIRS = src tools python test
-+SUBDIRS = src tools python
- 
- pkgconfigdir = $(libdir)/pkgconfig
- pkgconfig_DATA = evemu.pc
package/evemu/evemu-0005-configure.ac-add-disable-tests-option.patch new file +44 -0

44 lines not on this page · raw message

package/evemu/evemu.mk +3 -0
index 0f25f62..385a982 100644
@@ -18,6 +18,9 @@ EVEMU_CONF_ENV = ac_cv_path_ASCIIDOC=""
 # of host system version)
 EVEMU_MAKE_ENV = SYSROOT=$(STAGING_DIR)
 
+# disable tests generation because of C++ dependency
+EVEMU_CONF_OPT += --disable-tests
+
 # Uses PKG_CHECK_MODULES() in configure.ac
 EVEMU_DEPENDENCIES = host-pkgconf libevdev
 
Signature · 1 line
1.8.1.4
#2 lore raw

PATCH 1/4 evemu: disable tests via evemu configure option

Quoted 1 line · Peter Seiderer

It would have been nice to have used evemu-0002-... instead of
evemu-0005-.... It would also have been nice to avoid the [5/8] in the patch subject. But neither remark is critical.

Regards,
Arnout

Quoted 7 lines
---
 package/evemu/evemu-0002-disable-tests.patch       | 19 ----------
 ...005-configure.ac-add-disable-tests-option.patch | 44 ++++++++++++++++++++++
 package/evemu/evemu.mk                             |  3 ++
 3 files changed, 47 insertions(+), 19 deletions(-)
 delete mode 100644 package/evemu/evemu-0002-disable-tests.patch
 create mode 100644 package/evemu/evemu-0005-configure.ac-add-disable-tests-option.patch

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#3 lore raw

PATCH 1/4 evemu: disable tests via evemu configure option

Hello Arnout,

Quoted 6 lines

Gesendet: Montag, 28. April 2014 um 21:27 Uhr
Von: "Arnout Vandecappelle" <[email protected]>
An: "Peter Seiderer" <[email protected]>, buildroot at busybox.net
Cc: "Peter Korsgaard" <[email protected]>
Betreff: Re: [Buildroot] [PATCH 1/4] evemu: disable tests via evemu configure option

Quoted 9 lines
Quoted 1 line · Peter Seiderer

It would have been nice to have used evemu-0002-... instead of
evemu-0005-.... It would also have been nice to avoid the [5/8] in the patch subject. But neither remark is critical.

O.k. will fix both in next patch version...

Regards,
Peter

Quoted 20 lines

Regards,
Arnout

Quoted 7 lines
---
 package/evemu/evemu-0002-disable-tests.patch       | 19 ----------
 ...005-configure.ac-add-disable-tests-option.patch | 44 ++++++++++++++++++++++
 package/evemu/evemu.mk                             |  3 ++
 3 files changed, 47 insertions(+), 19 deletions(-)
 delete mode 100644 package/evemu/evemu-0002-disable-tests.patch
 create mode 100644 package/evemu/evemu-0005-configure.ac-add-disable-tests-option.patch

[snip]

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#4 lore raw

PATCH 2/4 evemu: fix host-python/host-python3 dependency

In reply to Peter Seiderer
---
 package/evemu/evemu.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/evemu/evemu.mk +2 -2
index 385a982..07ad6f6 100644
@@ -24,8 +24,8 @@ EVEMU_CONF_OPT += --disable-tests
 # Uses PKG_CHECK_MODULES() in configure.ac
 EVEMU_DEPENDENCIES = host-pkgconf libevdev
 
-# Needs Python to generate a wrapper
-EVEMU_DEPENDENCIES += host-python
+# Needs Python for header file generation
+EVEMU_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)
 
 # package source code coming from git, so it doesn't have generated
 # configure and Makefile.in
Signature · 1 line
1.8.1.4
#5 lore raw

PATCH 2/4 evemu: fix host-python/host-python3 dependency

Quoted 1 line · Peter Seiderer

Regards,
Arnout

Quoted 20 lines
---
 package/evemu/evemu.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/evemu/evemu.mk +2 -2
index 385a982..07ad6f6 100644
@@ -24,8 +24,8 @@ EVEMU_CONF_OPT += --disable-tests
 # Uses PKG_CHECK_MODULES() in configure.ac
 EVEMU_DEPENDENCIES = host-pkgconf libevdev
 
-# Needs Python to generate a wrapper
-EVEMU_DEPENDENCIES += host-python
+# Needs Python for header file generation
+EVEMU_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)
 
 # package source code coming from git, so it doesn't have generated
 # configure and Makefile.in
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#6 lore raw

PATCH 3/4 evemu: build python2 binding only if target python2 is enabled

In reply to Peter Seiderer
---
 ...gure.ac-add-disable-python-binding-option.patch | 46 ++++++++++++++++++++++
 package/evemu/evemu.mk                             |  8 ++++
 2 files changed, 54 insertions(+)
 create mode 100644 package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +46 -0
new file mode 100644
index 0000000..f100b2e
@@ -0,0 +1,46 @@
+From 44f42cfa6b58a256d3b89bce1043b0efed7eeaeb Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 27 Apr 2014 13:23:41 +0200
+Subject: [PATCH 6/8] configure.ac: add '--disable-python-binding' option
+
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ Makefile.am  |  2 +-
+ configure.ac | 11 +++++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a83b35f..446ec4c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = src tools python $(SUBDIR_TESTS)
++SUBDIRS = src tools $(SUBDIR_PYTHON_BINDING) $(SUBDIR_TESTS)
+ 
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = evemu.pc
+diff --git a/configure.ac b/configure.ac
+index 4e0c3b8..bb49bbc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,6 +52,17 @@ AS_IF([test "x$enable_tests" != "xno"], [
+ 
+ AC_SUBST([SUBDIR_TESTS])
+ 
++AC_ARG_ENABLE([python-binding],
++	AS_HELP_STRING([--disable-python-binding],
++		 [Disable generation of python binding]))
++
++AS_IF([test "x$enable_python_binding" != "xno"], [
++	SUBDIR_PYTHON_BINDING=python
++])
++
++AC_SUBST([SUBDIR_PYTHON_BINDING])
++
++
+ AC_SUBST(AM_CFLAGS,
+          "-Wall -Wextra -pedantic")
+ 
+-- 
+1.8.1.4
+
package/evemu/evemu.mk +8 -0
index 07ad6f6..44b8b89 100644
@@ -27,6 +27,14 @@ EVEMU_DEPENDENCIES = host-pkgconf libevdev
 # Needs Python for header file generation
 EVEMU_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)
 
+# Check for target python (python3 binding disabled because
+# of build/byte-compile problems)
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+	EVEMU_DEPENDENCIES += python
+else
+	EVEMU_CONF_OPT += --disable-python-binding
+endif
+
 # package source code coming from git, so it doesn't have generated
 # configure and Makefile.in
 EVEMU_AUTORECONF = YES
Signature · 1 line
1.8.1.4
#7 lore raw

PATCH 3/4 evemu: build python2 binding only if target python2 is enabled

Quoted 13 lines · Peter Seiderer
---
 ...gure.ac-add-disable-python-binding-option.patch | 46 ++++++++++++++++++++++
 package/evemu/evemu.mk                             |  8 ++++
 2 files changed, 54 insertions(+)
 create mode 100644 package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +0 -0
new file mode 100644
index 0000000..f100b2e

package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch line 4

Quoted 4 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +4 -0
@@ -0,0 +1,46 @@
+From 44f42cfa6b58a256d3b89bce1043b0efed7eeaeb Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 27 Apr 2014 13:23:41 +0200
+Subject: [PATCH 6/8] configure.ac: add '--disable-python-binding' option

Same remark about avoiding 6/8 (the reasoning is: if later on patches 7
and 8 disappear and patch 9 is added, it looks strange to have the /8 there).

Quoted 18 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +18 -0
+
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ Makefile.am  |  2 +-
+ configure.ac | 11 +++++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a83b35f..446ec4c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = src tools python $(SUBDIR_TESTS)
++SUBDIRS = src tools $(SUBDIR_PYTHON_BINDING) $(SUBDIR_TESTS)
+ 
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = evemu.pc
+diff --git a/configure.ac b/configure.ac

package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch line 32

Quoted 10 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +10 -0
+index 4e0c3b8..bb49bbc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,6 +52,17 @@ AS_IF([test "x$enable_tests" != "xno"], [
+ 
+ AC_SUBST([SUBDIR_TESTS])
+ 
++AC_ARG_ENABLE([python-binding],
++	AS_HELP_STRING([--disable-python-binding],
++		 [Disable generation of python binding]))

bindings is typically used in plural. And actually, most packages will
call it --enable-python or --with-python.

Quoted 19 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +14 -0
++
++AS_IF([test "x$enable_python_binding" != "xno"], [
++	SUBDIR_PYTHON_BINDING=python
++])
++
++AC_SUBST([SUBDIR_PYTHON_BINDING])
++
++
+ AC_SUBST(AM_CFLAGS,
+          "-Wall -Wextra -pedantic")
+ 
+-- 
+1.8.1.4
+
package/evemu/evemu.mk +0 -0
index 07ad6f6..44b8b89 100644

package/evemu/evemu.mk EVEMU_DEPENDENCIES = host-pkgconf libevdev · line 33

Quoted 7 lines
package/evemu/evemu.mk +4 -0
@@ -27,6 +27,14 @@ EVEMU_DEPENDENCIES = host-pkgconf libevdev
 # Needs Python for header file generation
 EVEMU_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)
 
+# Check for target python (python3 binding disabled because
+# of build/byte-compile problems)
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+	EVEMU_DEPENDENCIES += python

We normally put an explicit --enable-python-binding(s) here.

Also, we don't normally indent inside conditions in .mk files
(indentation is reserved for commands and for continuation lines of assignments).

Regards,
Arnout

Quoted 8 lines
package/evemu/evemu.mk +4 -0
+else
+	EVEMU_CONF_OPT += --disable-python-binding
+endif
+
 # package source code coming from git, so it doesn't have generated
 # configure and Makefile.in
 EVEMU_AUTORECONF = YES
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#8 lore raw

PATCH 3/4 evemu: build python2 binding only if target python2 is enabled

Hello Arnout,

Quoted 14 lines

Gesendet: Montag, 28. April 2014 um 21:48 Uhr
Von: "Arnout Vandecappelle" <[email protected]>
An: "Peter Seiderer" <[email protected]>, buildroot at busybox.net
Cc: "Peter Korsgaard" <[email protected]>
Betreff: Re: [Buildroot] [PATCH 3/4] evemu: build python2 binding only if target python2 is enabled

Quoted 7 lines · Peter Seiderer
---
 ...gure.ac-add-disable-python-binding-option.patch | 46 ++++++++++++++++++++++
 package/evemu/evemu.mk                             |  8 ++++
 2 files changed, 54 insertions(+)
 create mode 100644 package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch
Quoted 14 lines

package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch line 4

Quoted 10 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +4 -0
new file mode 100644
index 0000000..f100b2e
@@ -0,0 +1,46 @@
+From 44f42cfa6b58a256d3b89bce1043b0efed7eeaeb Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 27 Apr 2014 13:23:41 +0200
+Subject: [PATCH 6/8] configure.ac: add '--disable-python-binding' option

Same remark about avoiding 6/8 (the reasoning is: if later on patches 7
and 8 disappear and patch 9 is added, it looks strange to have the /8 there).

O.k, will fix...

Quoted 23 lines
Quoted 23 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +23 -0
+
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ Makefile.am  |  2 +-
+ configure.ac | 11 +++++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a83b35f..446ec4c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = src tools python $(SUBDIR_TESTS)
++SUBDIRS = src tools $(SUBDIR_PYTHON_BINDING) $(SUBDIR_TESTS)
+ 
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = evemu.pc
+diff --git a/configure.ac b/configure.ac
+index 4e0c3b8..bb49bbc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,6 +52,17 @@ AS_IF([test "x$enable_tests" != "xno"], [
+ 
Quoted 9 lines

package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch line 32

Quoted 5 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +5 -0
+ AC_SUBST([SUBDIR_TESTS])
+ 
++AC_ARG_ENABLE([python-binding],
++	AS_HELP_STRING([--disable-python-binding],
++		 [Disable generation of python binding]))

bindings is typically used in plural. And actually, most packages will
call it --enable-python or --with-python.

O.k, will fix the s/binding/bindings/. Used '--disable-python-binding' because of the analogy to '--disable-tests' and I did not want to change the default behaviour of the original evemu source package...

Quoted 23 lines
Quoted 23 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +14 -0
++
++AS_IF([test "x$enable_python_binding" != "xno"], [
++	SUBDIR_PYTHON_BINDING=python
++])
++
++AC_SUBST([SUBDIR_PYTHON_BINDING])
++
++
+ AC_SUBST(AM_CFLAGS,
+          "-Wall -Wextra -pedantic")
+ 
+-- 
+1.8.1.4
+
package/evemu/evemu.mk +0 -0
index 07ad6f6..44b8b89 100644
@@ -27,6 +27,14 @@ EVEMU_DEPENDENCIES = host-pkgconf libevdev
 # Needs Python for header file generation
 EVEMU_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)
 
Quoted 6 lines

package/evemu/evemu.mk EVEMU_DEPENDENCIES = host-pkgconf libevdev · line 33

Quoted 4 lines
package/evemu/evemu.mk +4 -0
+# Check for target python (python3 binding disabled because
+# of build/byte-compile problems)
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+	EVEMU_DEPENDENCIES += python

We normally put an explicit --enable-python-binding(s) here.

... see above, enabled is the default....

Quoted 4 lines

Also, we don't normally indent inside conditions in .mk files
(indentation is reserved for commands and for continuation lines of assignments).

O.k, will fix...

Regards,
Peter

Quoted 22 lines

Regards,
Arnout

Quoted 8 lines
package/evemu/evemu.mk +4 -0
+else
+	EVEMU_CONF_OPT += --disable-python-binding
+endif
+
 # package source code coming from git, so it doesn't have generated
 # configure and Makefile.in
 EVEMU_AUTORECONF = YES
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#9 lore raw

PATCH 3/4 evemu: build python2 binding only if target python2 is enabled

Quoted 66 lines · Peter Seiderer

Hello Arnout,

Quoted 14 lines

Gesendet: Montag, 28. April 2014 um 21:48 Uhr
Von: "Arnout Vandecappelle" <[email protected]>
An: "Peter Seiderer" <[email protected]>, buildroot at busybox.net
Cc: "Peter Korsgaard" <[email protected]>
Betreff: Re: [Buildroot] [PATCH 3/4] evemu: build python2 binding only if target python2 is enabled

Quoted 7 lines · Peter Seiderer
---
 ...gure.ac-add-disable-python-binding-option.patch | 46 ++++++++++++++++++++++
 package/evemu/evemu.mk                             |  8 ++++
 2 files changed, 54 insertions(+)
 create mode 100644 package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch
Quoted 14 lines

package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch line 4

Quoted 10 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +4 -0
new file mode 100644
index 0000000..f100b2e
@@ -0,0 +1,46 @@
+From 44f42cfa6b58a256d3b89bce1043b0efed7eeaeb Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 27 Apr 2014 13:23:41 +0200
+Subject: [PATCH 6/8] configure.ac: add '--disable-python-binding' option

Same remark about avoiding 6/8 (the reasoning is: if later on patches 7
and 8 disappear and patch 9 is added, it looks strange to have the /8 there).

O.k, will fix...

Quoted 23 lines
Quoted 23 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +23 -0
+
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ Makefile.am  |  2 +-
+ configure.ac | 11 +++++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a83b35f..446ec4c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = src tools python $(SUBDIR_TESTS)
++SUBDIRS = src tools $(SUBDIR_PYTHON_BINDING) $(SUBDIR_TESTS)
+ 
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = evemu.pc
+diff --git a/configure.ac b/configure.ac
+index 4e0c3b8..bb49bbc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,6 +52,17 @@ AS_IF([test "x$enable_tests" != "xno"], [
+ 
Quoted 9 lines

package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch line 32

Quoted 5 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +5 -0
+ AC_SUBST([SUBDIR_TESTS])
+ 
++AC_ARG_ENABLE([python-binding],
++	AS_HELP_STRING([--disable-python-binding],
++		 [Disable generation of python binding]))

bindings is typically used in plural. And actually, most packages will
call it --enable-python or --with-python.

Quoted 3 lines

O.k, will fix the s/binding/bindings/. Used '--disable-python-binding' because of the analogy to '--disable-tests' and I did not want to change the default behaviour of the original evemu source package...

Sorry, I didn't formulate that correctly. I meant --disable-python or
--without-python, i.e. most packages don't add -bindings to it. Though I have to say, it's probably more correct with the -bindings.

Quoted 24 lines
Quoted 24 lines
Quoted 24 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +14 -0
++
++AS_IF([test "x$enable_python_binding" != "xno"], [
++	SUBDIR_PYTHON_BINDING=python
++])
++
++AC_SUBST([SUBDIR_PYTHON_BINDING])
++
++
+ AC_SUBST(AM_CFLAGS,
+          "-Wall -Wextra -pedantic")
+ 
+-- 
+1.8.1.4
+
package/evemu/evemu.mk +0 -0
index 07ad6f6..44b8b89 100644
@@ -27,6 +27,14 @@ EVEMU_DEPENDENCIES = host-pkgconf libevdev
 # Needs Python for header file generation
 EVEMU_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)
 
Quoted 8 lines
Quoted 6 lines

package/evemu/evemu.mk EVEMU_DEPENDENCIES = host-pkgconf libevdev · line 33

Quoted 4 lines
package/evemu/evemu.mk +4 -0
+# Check for target python (python3 binding disabled because
+# of build/byte-compile problems)
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+	EVEMU_DEPENDENCIES += python

We normally put an explicit --enable-python-binding(s) here.

... see above, enabled is the default....

Even though it is the default, we add it explicitly. This makes it
easier to keep things consistent if e.g. the default behaviour changes after an upgrade.

Regards,
Arnout

Quoted 33 lines
Quoted 5 lines

Also, we don't normally indent inside conditions in .mk files
(indentation is reserved for commands and for continuation lines of assignments).

O.k, will fix...

Regards,
Peter

Quoted 22 lines

Regards,
Arnout

Quoted 8 lines
package/evemu/evemu.mk +4 -0
+else
+	EVEMU_CONF_OPT += --disable-python-binding
+endif
+
 # package source code coming from git, so it doesn't have generated
 # configure and Makefile.in
 EVEMU_AUTORECONF = YES
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#10 lore raw

PATCH 3/4 evemu: build python2 binding only if target python2 is enabled

Hello Arnout,

Quoted 112 lines

Gesendet: Montag, 28. April 2014 um 23:01 Uhr
Von: "Arnout Vandecappelle" <[email protected]>
An: "Peter Seiderer" <[email protected]>
Cc: buildroot at busybox.net, "Peter Korsgaard" <[email protected]>
Betreff: Re: Aw: Re: [Buildroot] [PATCH 3/4] evemu: build python2 binding only if target python2 is enabled

Quoted 66 lines · Peter Seiderer

Hello Arnout,

Quoted 14 lines

Gesendet: Montag, 28. April 2014 um 21:48 Uhr
Von: "Arnout Vandecappelle" <[email protected]>
An: "Peter Seiderer" <[email protected]>, buildroot at busybox.net
Cc: "Peter Korsgaard" <[email protected]>
Betreff: Re: [Buildroot] [PATCH 3/4] evemu: build python2 binding only if target python2 is enabled

Quoted 7 lines · Peter Seiderer
---
 ...gure.ac-add-disable-python-binding-option.patch | 46 ++++++++++++++++++++++
 package/evemu/evemu.mk                             |  8 ++++
 2 files changed, 54 insertions(+)
 create mode 100644 package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch
Quoted 14 lines

package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch line 4

Quoted 10 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +4 -0
new file mode 100644
index 0000000..f100b2e
@@ -0,0 +1,46 @@
+From 44f42cfa6b58a256d3b89bce1043b0efed7eeaeb Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 27 Apr 2014 13:23:41 +0200
+Subject: [PATCH 6/8] configure.ac: add '--disable-python-binding' option

Same remark about avoiding 6/8 (the reasoning is: if later on patches 7
and 8 disappear and patch 9 is added, it looks strange to have the /8 there).

O.k, will fix...

Quoted 23 lines
Quoted 23 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +23 -0
+
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ Makefile.am  |  2 +-
+ configure.ac | 11 +++++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/Makefile.am b/Makefile.am
+index a83b35f..446ec4c 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,4 +1,4 @@
+-SUBDIRS = src tools python $(SUBDIR_TESTS)
++SUBDIRS = src tools $(SUBDIR_PYTHON_BINDING) $(SUBDIR_TESTS)
+ 
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = evemu.pc
+diff --git a/configure.ac b/configure.ac
+index 4e0c3b8..bb49bbc 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -52,6 +52,17 @@ AS_IF([test "x$enable_tests" != "xno"], [
+ 
Quoted 9 lines

package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch line 32

Quoted 5 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +5 -0
+ AC_SUBST([SUBDIR_TESTS])
+ 
++AC_ARG_ENABLE([python-binding],
++	AS_HELP_STRING([--disable-python-binding],
++		 [Disable generation of python binding]))

bindings is typically used in plural. And actually, most packages will
call it --enable-python or --with-python.

Quoted 3 lines

O.k, will fix the s/binding/bindings/. Used '--disable-python-binding' because of the analogy to '--disable-tests' and I did not want to change the default behaviour of the original evemu source package...

Sorry, I didn't formulate that correctly. I meant --disable-python or
--without-python, i.e. most packages don't add -bindings to it. Though I have to say, it's probably more correct with the -bindings.

Quoted 31 lines
Quoted 30 lines
Quoted 21 lines
package/evemu/evemu-0006-configure.ac-add-disable-python-binding-option.patch new file +14 -0
++
++AS_IF([test "x$enable_python_binding" != "xno"], [
++	SUBDIR_PYTHON_BINDING=python
++])
++
++AC_SUBST([SUBDIR_PYTHON_BINDING])
++
++
+ AC_SUBST(AM_CFLAGS,
+          "-Wall -Wextra -pedantic")
+ 
+-- 
+1.8.1.4
+
package/evemu/evemu.mk +0 -0
index 07ad6f6..44b8b89 100644

package/evemu/evemu.mk EVEMU_DEPENDENCIES = host-pkgconf libevdev · line 33

Quoted 7 lines
package/evemu/evemu.mk +4 -0
@@ -27,6 +27,14 @@ EVEMU_DEPENDENCIES = host-pkgconf libevdev
 # Needs Python for header file generation
 EVEMU_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)
 
+# Check for target python (python3 binding disabled because
+# of build/byte-compile problems)
+ifeq ($(BR2_PACKAGE_PYTHON),y)
+	EVEMU_DEPENDENCIES += python

We normally put an explicit --enable-python-binding(s) here.

Quoted 6 lines
Quoted 1 line

... see above, enabled is the default....

Even though it is the default, we add it explicitly. This makes it
easier to keep things consistent if e.g. the default behaviour changes after an upgrade.

O.k., will fix...

Regards,
Peter

Quoted 47 lines

Regards,
Arnout

Quoted 33 lines
Quoted 5 lines

Also, we don't normally indent inside conditions in .mk files
(indentation is reserved for commands and for continuation lines of assignments).

O.k, will fix...

Regards,
Peter

Quoted 22 lines

Regards,
Arnout

Quoted 8 lines
package/evemu/evemu.mk +4 -0
+else
+	EVEMU_CONF_OPT += --disable-python-binding
+endif
+
 # package source code coming from git, so it doesn't have generated
 # configure and Makefile.in
 EVEMU_AUTORECONF = YES
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#11 lore raw

PATCH 4/4 evemu: enable python3 bindings

In reply to Peter Seiderer

Add evemu/python3 related patches:
- fix python/evemu/base.py for python3 (add patch from [1])
- fix python3 binding runtime failure

[1] http://ftp.de.debian.org/debian/pool/main/e/evemu/evemu_1.2.0-2.debian.tar.xz

---
 ...-fixes-the-syntax-for-raising-exceptions-.patch | 39 ++++++++++++++++++++++
 ...u-0008-python-fix-device-open-for-python3.patch | 35 +++++++++++++++++++
 package/evemu/evemu.mk                             |  7 ++--
 3 files changed, 77 insertions(+), 4 deletions(-)
 create mode 100644 package/evemu/evemu-0007-Description-fixes-the-syntax-for-raising-exceptions-.patch
 create mode 100644 package/evemu/evemu-0008-python-fix-device-open-for-python3.patch
package/evemu/evemu-0007-Description-fixes-the-syntax-for-raising-exceptions-.patch new file +39 -0
new file mode 100644
index 0000000..ea9dfaf
@@ -0,0 +1,39 @@
+From 1730ff58181b872a752b9f5428061b59874f063c Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 27 Apr 2014 00:18:40 +0200
+Subject: [PATCH 7/8] Description: fixes the syntax for raising exceptions to
+ be Python2 and Python3 acceptable.
+
+Author: Stephen M. Webb
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=706155
+---
+ python/evemu/base.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/python/evemu/base.py b/python/evemu/base.py
+index 84e0306..f972182 100644
+--- a/python/evemu/base.py
++++ b/python/evemu/base.py
+@@ -19,15 +19,15 @@ class EvEmuBase(object):
+     def _call0(self, api_call, *parameters):
+         result = api_call(*parameters)
+         if result == 0 and self.get_c_errno() != 0:
+-            raise exception.ExecutionError, "%s: %s" % (
+-                api_call.__name__, self.get_c_error())
++            raise exception.ExecutionError("%s: %s" % (
++                api_call.__name__, self.get_c_error()))
+         return result
+ 
+     def _call(self, api_call, *parameters):
+         result = api_call(*parameters)
+         if result < 0 and self.get_c_errno() != 0:
+-            raise exception.ExecutionError, "%s: %s" % (
+-                api_call.__name__, self.get_c_error())
++            raise exception.ExecutionError("%s: %s" % (
++                api_call.__name__, self.get_c_error()))
+         return result
+ 
+     def get_c_errno(self):
+-- 
+1.8.1.4
+
package/evemu/evemu-0008-python-fix-device-open-for-python3.patch new file +35 -0
new file mode 100644
index 0000000..da5a73c
@@ -0,0 +1,35 @@
+From 1ff2dc1f7603588e73090d27437c56dbd4b7e8e1 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 27 Apr 2014 01:16:16 +0200
+Subject: [PATCH 8/8] python: fix device open for python3
+
+- use 'rb' instead of 'r+b', fixes:
+
+>>> import evemu
+>>> evemu.Device('/dev/input/event0')
+Traceback (most recent call last):
+  File "<stdin>", line 1, in <module>
+  File "/usr/lib/python3.4/site-packages/evemu/__init__.py", line 50, in __init__
+io.UnsupportedOperation: File or stream is not seekable.
+
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ python/evemu/__init__.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/python/evemu/__init__.py b/python/evemu/__init__.py
+index abdbf7e..aa73871 100644
+--- a/python/evemu/__init__.py
++++ b/python/evemu/__init__.py
+@@ -47,7 +47,7 @@ class Device(object):
+         """
+ 
+         if type(f).__name__ == 'str':
+-            self._file = open(f, 'r+b')
++            self._file = open(f, 'rb')
+         elif type(f).__name__ == 'file':
+             self._file = f
+         else:
+-- 
+1.8.1.4
+
package/evemu/evemu.mk +3 -4
index 44b8b89..0cf4c76 100644
@@ -27,10 +27,9 @@ EVEMU_DEPENDENCIES = host-pkgconf libevdev
 # Needs Python for header file generation
 EVEMU_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),host-python3,host-python)
 
-# Check for target python (python3 binding disabled because
-# of build/byte-compile problems)
-ifeq ($(BR2_PACKAGE_PYTHON),y)
-	EVEMU_DEPENDENCIES += python
+# Check for target python
+ifeq ($(BR2_PACKAGE_PYTHON)$(BR2_PACKAGE_PYTHON3),y)
+	EVEMU_DEPENDENCIES += $(if $(BR2_PACKAGE_PYTHON3),python3,python)
 else
 	EVEMU_CONF_OPT += --disable-python-binding
 endif
Signature · 1 line
1.8.1.4