[OE-core] [krogoth][meta-python]][PATCH v2] python-evdev: add setup.py patch

Stephen Arnold stephen.arnold42 at gmail.com
Thu Oct 6 06:22:39 UTC 2016


From: Steve Arnold <stephen.arnold42 at gmail.com>

This currently works (randomly) when BUILD_HOST headers are a close
enough match, but fails as soon as they differ, due to static header
include paths in setup.py.  This patch adds a path check for the
STAGING_INC dir and makes it use the right headers.

Upstream-Status: Inappropriate, bitbake configuration-specific (upstream
needs a generic cross-compile fix).

Also includes DEPENDS/RDEPENDS from Tim and small doc package instead of
empty dev package.

Signed-off-by: Steve Arnold <stephen.arnold42 at gmail.com>
---
 .../python/python-evdev/use-sysroot-headers.patch  | 24 +++++++++++++++++++
 .../recipes-devtools/python/python-evdev_0.6.0.bb  | 28 ++++++++++++++++++----
 2 files changed, 48 insertions(+), 4 deletions(-)
 create mode 100644 meta-python/recipes-devtools/python/python-evdev/use-sysroot-headers.patch

diff --git a/meta-python/recipes-devtools/python/python-evdev/use-sysroot-headers.patch b/meta-python/recipes-devtools/python/python-evdev/use-sysroot-headers.patch
new file mode 100644
index 0000000..ce62bfc
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python-evdev/use-sysroot-headers.patch
@@ -0,0 +1,24 @@
+--- a/setup.py	2016-10-01 10:00:11.491758891 -0700
++++ b/setup.py	2016-10-01 10:01:45.045089476 -0700
+@@ -65,10 +65,17 @@
+ 
+ #-----------------------------------------------------------------------------
+ def create_ecodes():
+-    headers = [
+-        '/usr/include/linux/input.h',
+-        '/usr/include/linux/input-event-codes.h',
+-    ]
++
++    if not os.path.lexists(os.path.expandvars('$STAGING_INCDIR')):
++        headers = [
++            '/usr/include/linux/input.h',
++            '/usr/include/linux/input-event-codes.h',
++        ]
++    else:
++        headers = [
++            os.path.expandvars('$STAGING_INCDIR/linux/input.h'),
++            os.path.expandvars('$STAGING_INCDIR/linux/input-event-codes.h'),   
++        ]
+ 
+     headers = [header for header in headers if os.path.isfile(header)]
+     if not headers:
diff --git a/meta-python/recipes-devtools/python/python-evdev_0.6.0.bb b/meta-python/recipes-devtools/python/python-evdev_0.6.0.bb
index e555552..152206a 100644
--- a/meta-python/recipes-devtools/python/python-evdev_0.6.0.bb
+++ b/meta-python/recipes-devtools/python/python-evdev_0.6.0.bb
@@ -4,9 +4,29 @@ SECTION = "devel/python"
 LICENSE = "BSD"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=18debddbb3f52c661a129724a883a8e2"
 
-SRC_URI = "https://github.com/gvalkov/python-evdev/archive/v${PV}.zip"
+SRC_URI = "file://use-sysroot-headers.patch"
 
-SRC_URI[md5sum] = "24e4ffa98e338b535eae44d91d609005"
-SRC_URI[sha256sum] = "61f6893d80da87a995e5781c74d22a39448b1b32004ffac2f31817017709be04"
+SRC_URI[md5sum] = "294ac2997bd419d56b9451511536f9f4"
+SRC_URI[sha256sum] = "c0e1410cc88eaa6a016baeafb2acb1274d36a057944143b59e94f36bb4aaaa82"
 
-inherit setuptools
+inherit pypi setuptools
+
+DEPENDS_${PN} += "\
+    ${PYTHON_PN}-ctypes \
+"
+
+RDEPENDS_${PN} += "\
+    ${PYTHON_PN}-ctypes \
+    ${PYTHON_PN}-fcntl \
+    ${PYTHON_PN}-io \
+    ${PYTHON_PN}-shell \
+    ${PYTHON_PN}-stringold \
+"
+
+do_install_append() {
+    # note the full docs require Sphinx to build them
+    install -d ${D}${datadir}/doc/${BPN}/
+    install -m 0644 ${S}/README.rst ${D}${datadir}/doc/${PN}/
+}
+
+PACKAGES = "${PN}-doc ${PN} ${PN}-dbg"
-- 
2.9.3




More information about the Openembedded-core mailing list