summaryrefslogtreecommitdiffstats
path: root/package/python-pyudev/0001-Workaround-finding-libudev-on-systems-without-ldconf.patch
diff options
context:
space:
mode:
authorYegor Yefremov <yegorslists@googlemail.com>2015-12-10 09:40:40 +0100
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2015-12-13 16:03:26 +0100
commit27d6deb449fdb3b7662059a83212787ae568c76e (patch)
tree560384f7258d0eca5d47ed7311f2e6c4410229e1 /package/python-pyudev/0001-Workaround-finding-libudev-on-systems-without-ldconf.patch
parent6ea683df76fbafd506257a78a6df47c5446fe41f (diff)
downloadbuildroot-27d6deb449fdb3b7662059a83212787ae568c76e.tar.gz
buildroot-27d6deb449fdb3b7662059a83212787ae568c76e.zip
python-pyudev: new package
Add a patch, that fixes find_library() issue on the systems without library cache. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package/python-pyudev/0001-Workaround-finding-libudev-on-systems-without-ldconf.patch')
-rw-r--r--package/python-pyudev/0001-Workaround-finding-libudev-on-systems-without-ldconf.patch47
1 files changed, 47 insertions, 0 deletions
diff --git a/package/python-pyudev/0001-Workaround-finding-libudev-on-systems-without-ldconf.patch b/package/python-pyudev/0001-Workaround-finding-libudev-on-systems-without-ldconf.patch
new file mode 100644
index 0000000000..93b9568593
--- /dev/null
+++ b/package/python-pyudev/0001-Workaround-finding-libudev-on-systems-without-ldconf.patch
@@ -0,0 +1,47 @@
+From e86a1c199d45c9751da67f947af202927dee07f8 Mon Sep 17 00:00:00 2001
+From: Yegor Yefremov <yegorslists@googlemail.com>
+Date: Thu, 10 Dec 2015 08:44:55 +0100
+Subject: [PATCH] Workaround finding libudev on systems without ldconf
+
+This patch tries to load libudev.so directly without relying on
+Python's find_library(). find_library() fails on systems
+without library cache mechanism.
+
+Taken from pyudev issue 117 discussion:
+https://github.com/pyudev/pyudev/pull/117
+
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+---
+ src/pyudev/_libudev.py | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/pyudev/_libudev.py b/src/pyudev/_libudev.py
+index a0de8fb..1348d17 100644
+--- a/src/pyudev/_libudev.py
++++ b/src/pyudev/_libudev.py
+@@ -30,7 +30,7 @@
+ from __future__ import (print_function, division, unicode_literals,
+ absolute_import)
+
+-from ctypes import (CDLL, Structure, POINTER,
++from ctypes import (cdll, CDLL, Structure, POINTER,
+ c_char, c_char_p, c_int, c_uint, c_ulonglong)
+ from ctypes.util import find_library
+
+@@ -265,10 +265,10 @@ def load_udev_library():
+
+ Raise :exc:`~exceptions.ImportError`, if the udev library was not found.
+ """
+- udev_library_name = find_library('udev')
+- if not udev_library_name:
++ try:
++ libudev = cdll.LoadLibrary('libudev.so')
++ except OSError:
+ raise ImportError('No library named udev')
+- libudev = CDLL(udev_library_name, use_errno=True)
+ # context function signature
+ for namespace, members in SIGNATURES.items():
+ for funcname in members:
+--
+2.1.4
+
OpenPOWER on IntegriCloud