]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
python-pylibftdi: new package
authorChristian Kellermann <christian.kellermann@solectrix.de>
Wed, 1 Mar 2017 16:18:39 +0000 (17:18 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 5 Mar 2017 20:38:45 +0000 (21:38 +0100)
Adds the python binding for libftdi to buildroot.

Signed-off-by: Christian Kellermann <christian.kellermann@solectrix.de>
Reviewed-by: Yegor Yefremov <yegorslists@googlemail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
DEVELOPERS
package/Config.in
package/python-pylibftdi/0001-do-not-use-find-library.patch [new file with mode: 0644]
package/python-pylibftdi/Config.in [new file with mode: 0644]
package/python-pylibftdi/python-libftdi.hash [new file with mode: 0644]
package/python-pylibftdi/python-libftdi.mk [new file with mode: 0644]

index de76a587259a75d3e94cdebf2b2c725fbb771500..16f05fb18bf59cbe7c6fc21909b4c8be34e8781f 100644 (file)
@@ -306,6 +306,9 @@ F:  package/micropython/
 F:     package/micropython-lib/
 F:     package/syslog-ng/
 
+N:     Christian Kellermann <christian.kellermann@solectrix.de>
+F:     package/python-pylibftdi/
+
 N:     Christian Stewart <christian@paral.in>
 F:     linux/linux-ext-aufs.mk
 F:     package/aufs/
index ff79fdf10be576cf2d6ff2064389b6c8768ff6e0..e1f08234702fcb42be47a8cc827f8b9b0638f74f 100644 (file)
@@ -768,6 +768,7 @@ menu "External python modules"
        source "package/python-pygments/Config.in"
        source "package/python-pyicu/Config.in"
        source "package/python-pyinotify/Config.in"
+       source "package/python-pylibftdi/Config.in"
        source "package/python-pylru/Config.in"
        source "package/python-pymysql/Config.in"
        source "package/python-pynacl/Config.in"
diff --git a/package/python-pylibftdi/0001-do-not-use-find-library.patch b/package/python-pylibftdi/0001-do-not-use-find-library.patch
new file mode 100644 (file)
index 0000000..ae8fe2d
--- /dev/null
@@ -0,0 +1,31 @@
+Hard code library loading
+
+Shortcut the search for the libraries in case the built in
+find_library is broken.
+
+As buildroot does not ship any of the external programs that the core
+procedure use to find libraries use the canonical name of the shared
+object and load it.
+
+In this case this affects loading libftdi and libusb.
+
+This should be reliable as we specify said libs as dependencies of
+this package.
+
+Signed-off-by: Christian Kellermann <christian.kellermann@solectrix.de>
+
+---
+diff -purN pylibftdi-0.15.0.orig/pylibftdi/driver.py pylibftdi-0.15.0/pylibftdi/driver.py
+--- pylibftdi-0.15.0.orig/pylibftdi/driver.py  2015-04-26 22:41:39.000000000 +0200
++++ pylibftdi-0.15.0/pylibftdi/driver.py       2017-02-27 13:08:56.502958000 +0100
+@@ -121,8 +121,8 @@ class Driver(object):
+                     lib = getattr(cdll, lib_path)
+                     break
+         if lib is None:
+-            raise LibraryMissingError('{} library not found (search: {})'.format(
+-                name, search_list))
++              return cdll.LoadLibrary(name + '.so')
++
+         return lib
+     @property
diff --git a/package/python-pylibftdi/Config.in b/package/python-pylibftdi/Config.in
new file mode 100644 (file)
index 0000000..f829071
--- /dev/null
@@ -0,0 +1,11 @@
+config BR2_PACKAGE_PYTHON_PYLIBFTDI
+       bool "python-pylibftdi"
+       select BR2_PACKAGE_LIBFTDI
+       depends on BR2_TOOLCHAIN_HAS_THREADS # libusb
+       help
+         This package contains the python language binding libftdi.
+
+         https://pypi.python.org/pypi/pylibftdi
+
+comment "python-pylibftdi needs a toolchain w/ threads"
+       depends on !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/python-pylibftdi/python-libftdi.hash b/package/python-pylibftdi/python-libftdi.hash
new file mode 100644 (file)
index 0000000..54b33a1
--- /dev/null
@@ -0,0 +1,3 @@
+# md5 from https://pypi.python.org/pypi/pylibftdi/json, sha256 locally computed
+md5  eaee7fb3a67f33a35a164a9628daaafe pylibftdi-0.15.0.tar.gz
+sha256  51ef08ebcc4ec3eaec2366e9648d3f8fa1b737ea507a7f3a374ac58abf148e77 pylibftdi-0.15.0.tar.gz
diff --git a/package/python-pylibftdi/python-libftdi.mk b/package/python-pylibftdi/python-libftdi.mk
new file mode 100644 (file)
index 0000000..b375abb
--- /dev/null
@@ -0,0 +1,15 @@
+################################################################################
+#
+# python-libftdi
+#
+################################################################################
+
+PYTHON_PYLIBFTDI_VERSION = 0.15.0
+PYTHON_PYLIBFTDI_SOURCE = pylibftdi-$(PYTHON_PYLIBFTDI_VERSION).tar.gz
+PYTHON_PYLIBFTDI_SITE = https://pypi.python.org/packages/e5/bb/d7a86dbd7685e3866ea75d21c6c726d01706fdc0aa5dc9051ce18ae65693
+PYTHON_PYLIBFTDI_LICENSE = MIT
+PYTHON_PYLIBFTDI_LICENSE_FILES = LICENSE.txt
+PYTHON_PYLIBFTDI_DEPENDENCIES = libftdi
+PYTHON_PYLIBFTDI_SETUP_TYPE = setuptools
+
+$(eval $(python-package))