[Buildroot] [PATCH v2] mraa: new package

Samuel Martin s.martin49 at gmail.com
Wed Jan 6 12:56:39 UTC 2016


Hi Pieterjan,

On Tue, Jan 5, 2016 at 9:11 PM, Pieterjan Camerlynck
<pieterjan.camerlynck at gmail.com> wrote:
> mraa provides a unified interface for IO on Galileo, Edison,
> Raspberry Pi and others
> ---
> Changes v1->v2:
> - rename libmraa to mraa
> - remove C++ compiler dependency
> - depend on BR2_arm instead of BR2_ARM_CPU_ARMV7A
>
> Signed-off-by: Pieterjan Camerlynck <pieterjan.camerlynck at gmail.com>
> ---
>  package/Config.in                                  |  1 +
>  .../mraa/0001-do-not-require-cpp-compiler.patch    | 28 ++++++++++++++++++++++
>  package/mraa/Config.in                             | 15 ++++++++++++
>  package/mraa/mraa.mk                               | 22 +++++++++++++++++
>  4 files changed, 66 insertions(+)
>  create mode 100644 package/mraa/0001-do-not-require-cpp-compiler.patch
>  create mode 100644 package/mraa/Config.in
>  create mode 100644 package/mraa/mraa.mk
>
> diff --git a/package/Config.in b/package/Config.in
> index 442021f..06ed4a8 100644
> --- a/package/Config.in
> +++ b/package/Config.in
> @@ -946,6 +946,7 @@ menu "Hardware handling"
>         source "package/libusb-compat/Config.in"
>         source "package/libv4l/Config.in"
>         source "package/libxkbcommon/Config.in"
> +       source "package/mraa/Config.in"
>         source "package/mtdev/Config.in"
>         source "package/ne10/Config.in"
>         source "package/neardal/Config.in"
> diff --git a/package/mraa/0001-do-not-require-cpp-compiler.patch b/package/mraa/0001-do-not-require-cpp-compiler.patch
> new file mode 100644
> index 0000000..fe58a26
> --- /dev/null
> +++ b/package/mraa/0001-do-not-require-cpp-compiler.patch
> @@ -0,0 +1,28 @@
> +From f490cf66dbbbdb80de20d8bb5c8cf5d663feb3c5 Mon Sep 17 00:00:00 2001
> +From: Pieterjan Camerlynck <pieterjan.camerlynck at gmail.com>
> +Date: Tue, 5 Jan 2016 19:36:55 +0100
> +Subject: [PATCH 1/1] do not require a C++ compiler
> +
> +By default, CMake assumes both a C and C++ compiler are required.
> +This is not needed for mraa because it only provides C++ header
> +files.
> +
> +Signed-off-by: Pieterjan Camerlynck <pieterjan.camerlynck at gmail.com>

Please indicate the status with upstream of the patch
(submitted/merged/etc) and a ref. to the submission/discussion if any.
This  way, it will make easier bumping the package and this patch.

> +---
> + CMakeLists.txt | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/CMakeLists.txt b/CMakeLists.txt
> +index 9860556..34d8e16 100644
> +--- a/CMakeLists.txt
> ++++ b/CMakeLists.txt
> +@@ -1,5 +1,5 @@
> + cmake_minimum_required (VERSION 2.8)
> +-project (mraa)
> ++project (mraa C)
> +
> + FIND_PACKAGE (Threads REQUIRED)
> +
> +--
> +1.9.1
> +
> diff --git a/package/mraa/Config.in b/package/mraa/Config.in
> new file mode 100644
> index 0000000..9e8918a
> --- /dev/null
> +++ b/package/mraa/Config.in
> @@ -0,0 +1,15 @@
> +config BR2_PACKAGE_MRAA
> +       bool "mraa"
> +       depends on BR2_TOOLCHAIN_HAS_THREADS
> +       depends on !BR2_STATIC_LIBS

Looping back with upstream [1], it seems there is no real reason to
only build shared object libs.
Consider dropping this "depends on" and picking up [2]. ;-)

> +       depends on BR2_arm || BR2_i386 || BR2_x86_64
> +       help
> +         mraa is a C/C++ library with bindings to javascript & python
> +         to interface with the IO on Galileo, Edison & other platforms,
> +         with a structured and sane API where port names/numbering matches
> +         the board that you are on.
> +
> +         http://iotdk.intel.com/docs/master/mraa
> +
> +comment "mraa needs a toolchain w/ threads, dynamic library"
> +       depends on !BR2_TOOLCHAIN_HAS_THREADS || BR2_STATIC_LIBS

... and don't forget to update the comment ;)

> diff --git a/package/mraa/mraa.mk b/package/mraa/mraa.mk
> new file mode 100644
> index 0000000..9f3b953
> --- /dev/null
> +++ b/package/mraa/mraa.mk
> @@ -0,0 +1,22 @@
> +################################################################################
> +#
> +# mraa
> +#
> +################################################################################
> +
> +MRAA_VERSION = v0.9.0
> +MRAA_SITE = $(call github,intel-iot-devkit,mraa,$(MRAA_VERSION))
> +MRAA_LICENSE = MIT
> +MRAA_LICENSE_FILES = COPYING
> +MRAA_INSTALL_STAGING = YES
> +
> +MRAA_CONF_OPTS += \
> +       -DBUILDSWIG=OFF \
> +       -DUSBPLAT=OFF \
> +       -DFTDI4222=OFF \
> +       -DIPK=OFF \
> +       -DRPM=OFF \
> +       -DENABLEEXAMPLES=OFF \
> +       -DTESTS=OFF
> +
> +$(eval $(cmake-package))
> --
> 1.9.1
>

[1] https://github.com/intel-iot-devkit/mraa/commit/d1ceeae4e3d830a4867da560b8da3ad5fa7fa8fb#commitcomment-15275905
[2] https://github.com/intel-iot-devkit/mraa/commit/86a0e10c037e5c069c48012f169f9e8e2587a0ef

> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

Regards,

-- 
Samuel


More information about the buildroot mailing list