Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Stephen Arnold <stephen.arnold42@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [krogoth][meta-python]][PATCH] python-evdev: add setup.py patch to make sure it uses sysroot headers
Date: Wed,  5 Oct 2016 23:05:14 -0700	[thread overview]
Message-ID: <20161006060514.29293-1-stephen.arnold42@gmail.com> (raw)

From: Steve Arnold <stephen.arnold42@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.

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

Signed-off-by: Steve Arnold <stephen.arnold42@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



                 reply	other threads:[~2016-10-06  6:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161006060514.29293-1-stephen.arnold42@gmail.com \
    --to=stephen.arnold42@gmail.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox