xref: /OK3568_Linux_fs/buildroot/package/python-pylibftdi/0001-do-not-use-find-library.patch (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1Hard code library loading
2
3Shortcut the search for the libraries in case the built in
4find_library is broken.
5
6As buildroot does not ship any of the external programs that the core
7procedure use to find libraries use the canonical name of the shared
8object and load it.
9
10In this case this affects loading libftdi and libusb.
11
12This should be reliable as we specify said libs as dependencies of
13this package.
14
15Signed-off-by: Christian Kellermann <christian.kellermann@solectrix.de>
16
17---
18diff -purN pylibftdi-0.15.0.orig/pylibftdi/driver.py pylibftdi-0.15.0/pylibftdi/driver.py
19--- pylibftdi-0.15.0.orig/pylibftdi/driver.py	2015-04-26 22:41:39.000000000 +0200
20+++ pylibftdi-0.15.0/pylibftdi/driver.py	2017-02-27 13:08:56.502958000 +0100
21@@ -121,8 +121,8 @@ class Driver(object):
22                     lib = getattr(cdll, lib_path)
23                     break
24         if lib is None:
25-            raise LibraryMissingError('{} library not found (search: {})'.format(
26-                name, search_list))
27+            return cdll.LoadLibrary(name + '.so')
28+
29         return lib
30
31     @property
32