diff mbox

[v2] python-pylibftdi: new package

Message ID 1488373403-30766-1-git-send-email-christian.kellermann@solectrix.de
State Superseded
Headers show

Commit Message

Christian Kellermann March 1, 2017, 1:03 p.m. UTC
Adds the python binding for libftdi to buildroot.

Signed-off-by: Christian Kellermann <christian.kellermann@solectrix.de>
---
Changes:

v1 -> v2:
  - Formatting
  - Removed unneeded dependency
  - Use setuptools as SETUP_TYPE

Signed-off-by: Christian Kellermann <christian.kellermann@solectrix.de>
---
 package/Config.in                                         |  1 +
 .../python-pylibftdi/0001-do-not-use-find-library.patch   | 14 ++++++++++++++
 package/python-pylibftdi/Config.in                        | 11 +++++++++++
 package/python-pylibftdi/python-libftdi.hash              |  3 +++
 package/python-pylibftdi/python-libftdi.mk                | 15 +++++++++++++++
 5 files changed, 44 insertions(+)
 create mode 100644 package/python-pylibftdi/0001-do-not-use-find-library.patch
 create mode 100644 package/python-pylibftdi/Config.in
 create mode 100644 package/python-pylibftdi/python-libftdi.hash
 create mode 100644 package/python-pylibftdi/python-libftdi.mk

Comments

Thomas Petazzoni March 1, 2017, 2:34 p.m. UTC | #1
Hello,

On Wed,  1 Mar 2017 14:03:23 +0100, Christian Kellermann wrote:

>  package/Config.in                                         |  1 +
>  .../python-pylibftdi/0001-do-not-use-find-library.patch   | 14 ++++++++++++++
>  package/python-pylibftdi/Config.in                        | 11 +++++++++++
>  package/python-pylibftdi/python-libftdi.hash              |  3 +++
>  package/python-pylibftdi/python-libftdi.mk                | 15 +++++++++++++++

Please add yourself to the DEVELOPERS file for this package.

> 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
> index 0000000..2f17dc6
> --- /dev/null
> +++ b/package/python-pylibftdi/0001-do-not-use-find-library.patch
> @@ -0,0 +1,14 @@
> +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

I think Yegor mentioned it in his review of your previous iteration:
there must be a description of the patch here + a Signed-off-by. See
the Buildroot manual for details, and other patches in the tree. See
for
example ./package/lttng-libust/0001-lttng-ust-elf.c-define-NT_GNU_BUILD_ID-if-not-define.patch.

If this project is using Git as its version control system, then we
really prefer if the patch is produced by "git format-patch".

> diff --git a/package/python-pylibftdi/Config.in b/package/python-pylibftdi/Config.in
> new file mode 100644
> index 0000000..2ab066c
> --- /dev/null
> +++ b/package/python-pylibftdi/Config.in
> @@ -0,0 +1,11 @@
> +config BR2_PACKAGE_PYTHON_PYLIBFTDI
> +	bool "python-pylibftdi"
> +	select BR2_PACKAGE_LIBFTDI
> +        depends on BR2_TOOLCHAIN_HAS_THREADS # libusb

Indentation should be one tab.

> +	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

> +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

Missing space after = sign.

Thanks,

Thomas
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 26893e5..8248331 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -769,6 +769,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
index 0000000..2f17dc6
--- /dev/null
+++ b/package/python-pylibftdi/0001-do-not-use-find-library.patch
@@ -0,0 +1,14 @@ 
+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
index 0000000..2ab066c
--- /dev/null
+++ b/package/python-pylibftdi/Config.in
@@ -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
index 0000000..54b33a1
--- /dev/null
+++ b/package/python-pylibftdi/python-libftdi.hash
@@ -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
index 0000000..210655d
--- /dev/null
+++ b/package/python-pylibftdi/python-libftdi.mk
@@ -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))