][PATCH] bluepy: add it
The bluepy can let us programming bluetooth le application in python.
--- recipes-devtools/bluepy/bluepy_git.bb | 48 ++++++++++++++++++++++ ...compiling-get-the-cross-compiler-from-env.patch | 28 +++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 recipes-devtools/bluepy/bluepy_git.bb create mode 100644 recipes-devtools/bluepy/files/0001-When-cross-compiling-get-the-cross-compiler-from-env.patch
recipes-devtools/bluepy/bluepy_git.bb new file +48 -0
@@ -0,0 +1,48 @@ +SUMMARY = "Python module for interfacing with BLE devices through Bluez" +HOMEPAGE = "https://github.com/IanHarvey/bluepy" +# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is +# your responsibility to verify that the values are complete and correct. +# +# The following license files were not able to be identified and are +# represented as "Unknown" below, you will need to check them yourself: +# LICENSE.txt +# bluez-5.29/COPYING.LIB +# +# NOTE: multiple licenses have been detected; they have been separated with & +# in the LICENSE value for now since it is a reasonable assumption that all +# of the licenses apply. If instead there is a choice between the multiple +# licenses then you should change the value to separate the licenses with | +# instead of &. If there is any doubt, check the accompanying documentation +# to determine which situation is applicable. +LICENSE = "Unknown & GPLv2" +LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=59e0d45ea684dda215889aa1b5acd001 \ + file://bluez-5.29/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ + file://bluez-5.29/COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09" + +SRC_URI = "git://github.com/IanHarvey/bluepy.git;protocol=https \ + file://0001-When-cross-compiling-get-the-cross-compiler-from-env.patch \ +" + +# Modify these as desired +PV = "1.1.2+git${SRCPV}" +SRCREV = "b1178fba2729692532e02d95e7368c742814f725" + +S = "${WORKDIR}/git" + +inherit setuptools + +DEPENDS += " glib-2.0" + +# WARNING: the following rdepends are determined through basic analysis of the +# python sources, and might not be 100% accurate. +RDEPENDS_${PN} += "python-argparse python-core python-io python-json python-subprocess" + +# WARNING: We were unable to map the following python package/module +# dependencies to the bitbake packages which include them: +# bluepy +# bluepy.btle +# bs4 +# requests + +INHIBIT_PACKAGE_STRIP = "1" +INSANE_SKIP_${PN} += "ldflags"
recipes-devtools/bluepy/files/0001-When-cross-compiling-get-the-cross-compiler-from-env.patch new file +28 -0
@@ -0,0 +1,28 @@ +From abf880ff4c276134564e1f1e63a3b6699060da7f Mon Sep 17 00:00:00 2001 +From: Dengke Du <[email protected]> +Date: Mon, 27 Nov 2017 03:48:16 -0500 +Subject: [PATCH] When cross compiling, get the cross compiler from environment + +Signed-off-by: Dengke Du <[email protected]> +--- + bluepy/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/bluepy/Makefile b/bluepy/Makefile +index 76bafec..42f145b 100644 +--- a/bluepy/Makefile ++++ b/bluepy/Makefile +@@ -9,8 +9,8 @@ BLUEZ_SRCS += src/shared/io-glib.c src/shared/timeout-glib.c + IMPORT_SRCS = $(addprefix $(BLUEZ_PATH)/, $(BLUEZ_SRCS)) + LOCAL_SRCS = bluepy-helper.c + +-CC = gcc +-CFLAGS = -Os -g -Wall # -Werror ++CC ?= gcc ++CFLAGS ?= -Os -g -Wall # -Werror + + CPPFLAGS = -DHAVE_CONFIG_H + ifneq ($(DEBUGGING),) +-- +2.8.1 +
Signature · 1 line
2.8.1
Quoted 23 lines · Dengke Du
The bluepy can let us programming bluetooth le application in python.
Signed-off-by Dengke Du <[email protected]>--- recipes-devtools/bluepy/bluepy_git.bb | 48 ++++++++++++++++++++++ ...compiling-get-the-cross-compiler-from-env.patch | 28 +++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 recipes-devtools/bluepy/bluepy_git.bb create mode 100644 recipes-devtools/bluepy/files/0001-When-cross-compiling-get-the-cross-compiler-from-env.patchrecipes-devtools/bluepy/bluepy_git.bb new file +7
-0@@ -0,0 +1,48 @@ +SUMMARY = "Python module for interfacing with BLE devices through Bluez" +HOMEPAGE = "https://github.com/IanHarvey/bluepy" +# WARNING: the following LICENSE and LIC_FILES_CHKSUM values are best guesses - it is +# your responsibility to verify that the values are complete and correct. +# +# The following license files were not able to be identified and are +# represented as "Unknown" below, you will need to check them yourself:
recipes-devtools/bluepy/bluepy_git.bb line 17
Quoted 10 lines
recipes-devtools/bluepy/bluepy_git.bb new file +10
-0+# LICENSE.txt +# bluez-5.29/COPYING.LIB +# +# NOTE: multiple licenses have been detected; they have been separated with & +# in the LICENSE value for now since it is a reasonable assumption that all +# of the licenses apply. If instead there is a choice between the multiple +# licenses then you should change the value to separate the licenses with | +# instead of &. If there is any doubt, check the accompanying documentation +# to determine which situation is applicable. +LICENSE = "Unknown & GPLv2"
You'll need to fix this as explained in the comment above (which the recipe generator has added) and then drop the comment.
recipes-devtools/bluepy/bluepy_git.bb line 26
Quoted 9 lines
recipes-devtools/bluepy/bluepy_git.bb new file +9
-0+LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=59e0d45ea684dda215889aa1b5acd001 \ + file://bluez-5.29/COPYING;md5=12f884d2ae1ff87c09e5b7ccc2c4ca7e \ + file://bluez-5.29/COPYING.LIB;md5=fb504b67c50331fc78734fed90fb0e09" + +SRC_URI = "git://github.com/IanHarvey/bluepy.git;protocol=https \ + file://0001-When-cross-compiling-get-the-cross-compiler-from-env.patch \ +" + +# Modify these as desired
You can drop this comment.
recipes-devtools/bluepy/bluepy_git.bb line 28
Quoted 2 lines
recipes-devtools/bluepy/bluepy_git.bb new file +2
-0+PV = "1.1.2+git${SRCPV}" +SRCREV = "b1178fba2729692532e02d95e7368c742814f725"
Is there any reason for using this commit from git rather than the latest version on pypi (https://pypi.python.org/pypi/bluepy)? You can look at the recipe for rpi-gpio to see how to use the pypi bbclass to simplify fetching from pypi.
recipes-devtools/bluepy/bluepy_git.bb line 37
Quoted 9 lines
recipes-devtools/bluepy/bluepy_git.bb new file +9
-0+ +S = "${WORKDIR}/git" + +inherit setuptools + +DEPENDS += " glib-2.0" + +# WARNING: the following rdepends are determined through basic analysis of the +# python sources, and might not be 100% accurate.
You can drop this comment if you've checked the RDEPENDS.
recipes-devtools/bluepy/bluepy_git.bb line 45
Quoted 8 lines
recipes-devtools/bluepy/bluepy_git.bb new file +8
-0+RDEPENDS_${PN} += "python-argparse python-core python-io python-json python-subprocess" + +# WARNING: We were unable to map the following python package/module +# dependencies to the bitbake packages which include them: +# bluepy +# bluepy.btle +# bs4 +# requests
You can drop this comment if you've reviewed those modules and ensured that whatever provides them is in the dependencies.
recipes-devtools/bluepy/bluepy_git.bb line 48
Quoted 3 lines
recipes-devtools/bluepy/bluepy_git.bb new file +3
-0+ +INHIBIT_PACKAGE_STRIP = "1" +INSANE_SKIP_${PN} += "ldflags"
It's probably worth adding a couple of comments to say why these 2 lines are needed.
recipes-devtools/bluepy/files/0001-When-cross-compiling-get-the-cross-compiler-from-env.patch line 6
Quoted 12 lines
recipes-devtools/bluepy/files/0001-When-cross-compiling-get-the-cross-compiler-from-env.patch new file +6
-0@@ -0,0 +1,28 @@ +From abf880ff4c276134564e1f1e63a3b6699060da7f Mon Sep 17 00:00:00 2001 +From: Dengke Du <[email protected]> +Date: Mon, 27 Nov 2017 03:48:16 -0500 +Subject: [PATCH] When cross compiling, get the cross compiler from environment + +Signed-off-by: Dengke Du <[email protected]>
Please include an "Upstream-status" line as described in
https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines#Patch_Header_Recommendations.
Quoted 12 lines
recipes-devtools/bluepy/files/0001-When-cross-compiling-get-the-cross-compiler-from-env.patch new file +12
-0+--- + bluepy/Makefile | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/bluepy/Makefile b/bluepy/Makefile +index 76bafec..42f145b 100644 +--- a/bluepy/Makefile ++++ b/bluepy/Makefile +@@ -9,8 +9,8 @@ BLUEZ_SRCS += src/shared/io-glib.c src/shared/timeout-glib.c + IMPORT_SRCS = $(addprefix $(BLUEZ_PATH)/, $(BLUEZ_SRCS)) + LOCAL_SRCS = bluepy-helper.c +
recipes-devtools/bluepy/files/0001-When-cross-compiling-get-the-cross-compiler-from-env.patch line 28
Quoted 10 lines
recipes-devtools/bluepy/files/0001-When-cross-compiling-get-the-cross-compiler-from-env.patch new file +10
-0+-CC = gcc +-CFLAGS = -Os -g -Wall # -Werror ++CC ?= gcc ++CFLAGS ?= -Os -g -Wall # -Werror + + CPPFLAGS = -DHAVE_CONFIG_H + ifneq ($(DEBUGGING),) +-- +2.8.1 +
You might not need this patch. You can pass extra arguments to make by giving an EXTRA_OEMAKE value in the recipe - see the recipe for wiringpi for an example of how this can be used. I can't exactly remember the details of make assignment precedence so I'm not guaranteeing that will work, if it does work it would be the preferred approach though.
Once you've addressed these comments you'll need to submit this as a pull request on github (https://github.com/agherzan/meta-raspberrypi).
Thanks,
Signature · 2 lines
Paul Barker Togán Labs Ltd