diff mbox

package/reactcpp: new package

Message ID 20161206132643.27141-1-m.niestroj@grinn-global.com
State Changes Requested
Headers show

Commit Message

Marcin Niestroj Dec. 6, 2016, 1:26 p.m. UTC
Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
---
 package/Config.in                                  |  1 +
 ...akefile-Cleanup-compiler-and-linker-flags.patch | 82 ++++++++++++++++++++++
 package/reactcpp/Config.in                         | 14 ++++
 package/reactcpp/reactcpp.hash                     |  2 +
 package/reactcpp/reactcpp.mk                       | 34 +++++++++
 5 files changed, 133 insertions(+)
 create mode 100644 package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch
 create mode 100644 package/reactcpp/Config.in
 create mode 100644 package/reactcpp/reactcpp.hash
 create mode 100644 package/reactcpp/reactcpp.mk

Comments

Thomas Petazzoni Dec. 6, 2016, 3:31 p.m. UTC | #1
Hello,

Thanks for this contribution! See some comments below.

On Tue,  6 Dec 2016 14:26:43 +0100, Marcin Niestroj wrote:

> diff --git a/package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch b/package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch
> new file mode 100644
> index 0000000..a0b065a
> --- /dev/null
> +++ b/package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch
> @@ -0,0 +1,82 @@
> +From 583b934dbd712e661e7c4eb994174bf71d88690c Mon Sep 17 00:00:00 2001
> +From: Marcin Niestroj <m.niestroj@grinn-global.com>
> +Date: Tue, 15 Nov 2016 14:51:47 +0100
> +Subject: [PATCH] Makefile: Cleanup compiler and linker flags
> +
> +Cleanup compiler and linker flags, so the library can be easily
> +cross-compiled by overwriting CPPFLAGS, CXXFLAGS and LDFLAGS:
> +
> +* Rename CPP into CXX, as we use this command for compiling, not
> +  preprocessing.
> +* Remove separate LD usage, use CXX instead. This is to still launch
> +  compiler command when user overrides CXX and LD commands.
> +* Define MY_CXXFLAGS and MY_LDFLAGS, which should always take place and
> +  not get overridden by user.
> +* Define AR command, which can be overidden by user.
> +---
> + src/Makefile | 26 +++++++++++++-------------
> + 1 file changed, 13 insertions(+), 13 deletions(-)
> +
> +diff --git a/src/Makefile b/src/Makefile
> +index 54e938a..5fb9763 100644
> +--- a/src/Makefile
> ++++ b/src/Makefile
> +@@ -1,8 +1,8 @@
> +-CPP		= g++
> ++AR		= ar
> ++CXX		= g++
> + RM		= rm -f
> +-CPPFLAGS	= -Wall -MMD -c -I. -std=c++11
> +-LD		= g++
> +-LD_FLAGS	= -Wall -shared
> ++MY_CXXFLAGS	= -Wall -MMD -c -I. -std=c++11
> ++MY_LDFLAGS	= -Wall -shared

You can also do:

override CXXFLAGS += ...
override LDFLAGS += ...

> diff --git a/package/reactcpp/Config.in b/package/reactcpp/Config.in
> new file mode 100644
> index 0000000..f6989e5
> --- /dev/null
> +++ b/package/reactcpp/Config.in
> @@ -0,0 +1,14 @@
> +config BR2_PACKAGE_REACTCPP
> +	bool "reactcpp"
> +	depends on BR2_INSTALL_LIBSTDCPP
> +	depends on BR2_TOOLCHAIN_HAS_THREADS

You have two dependencies here.

> +	select BR2_PACKAGE_C_ARES
> +	select BR2_PACKAGE_LIBEV
> +	help
> +	  REACT-CPP is an event loop library that utilizes the new
> +	  C++11 lambda functions to notify you when there is activity
> +	  on a filedescriptor or on a timer. Internally, it is a wrapper
> +	  around the libev library, and does therefore also depend on
> +	  that library.
> +
> +	  https://github.com/CopernicaMarketingSoftware/REACT-CPP

So you need a Config.in comment here about those dependencies. Check
other packages and the Buildroot manual for details.

> diff --git a/package/reactcpp/reactcpp.hash b/package/reactcpp/reactcpp.hash
> new file mode 100644
> index 0000000..c30dab6
> --- /dev/null
> +++ b/package/reactcpp/reactcpp.hash
> @@ -0,0 +1,2 @@
> +# Locally calculated
> +sha256 4af5d6a535ff7d8835d05db3490f2b62d6d791a4968ab45f479023868d7acdc8  reactcpp-v1.0.3.tar.gz
> diff --git a/package/reactcpp/reactcpp.mk b/package/reactcpp/reactcpp.mk
> new file mode 100644
> index 0000000..e198c3d
> --- /dev/null
> +++ b/package/reactcpp/reactcpp.mk
> @@ -0,0 +1,34 @@
> +################################################################################
> +#
> +# reactcpp
> +#
> +################################################################################
> +
> +REACTCPP_VERSION_MAJOR = 1.0
> +REACTCPP_VERSION_RAW = $(REACTCPP_VERSION_MAJOR).3
> +REACTCPP_VERSION = v$(REACTCPP_VERSION_RAW)

Just define the version as v$(REACTCPP_VERSION_MAJOR).3

> +REACTCPP_SITE = $(call github,CopernicaMarketingSoftware,REACT-CPP,$(REACTCPP_VERSION))
> +REACTCPP_LICENSE = Apache-2.0
> +REACTCPP_LICENSE_FILES = LICENSE
> +REACTCPP_DEPENDENCIES = c-ares libev
> +REACTCPP_INSTALL_STAGING = YES
> +
> +define REACTCPP_BUILD_CMDS
> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)

Please pass $(TARGET_MAKE_ENV) in the environment.

> +endef
> +
> +define REACTCPP_INSTALL_STAGING_CMDS
> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) PREFIX=$(STAGING_DIR)/usr -C $(@D) install

Ditto.

> +endef
> +
> +REACTCPP_SO = libreactcpp.so.$(REACTCPP_VERSION_RAW)
> +
> +ifeq ($(BR2_STATIC_LIBS),)
> +define REACTCPP_INSTALL_TARGET_CMDS
> +	$(INSTALL) -D -m 0755 $(@D)/src/$(REACTCPP_SO) $(TARGET_DIR)/usr/lib/$(REACTCPP_SO)
> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so.$(REACTCPP_VERSION_MAJOR)
> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so
> +endef
> +endif

Why are you doing this instead of calling "make install" for
$(TARGET_DIR) ?

Thanks,

Thomas
Marcin Niestroj Dec. 7, 2016, 9:59 a.m. UTC | #2
Hi,

Thanks for fast review!

On 06.12.2016 16:31, Thomas Petazzoni wrote:
> Hello,
>
> Thanks for this contribution! See some comments below.
>
> On Tue,  6 Dec 2016 14:26:43 +0100, Marcin Niestroj wrote:
>
>> diff --git a/package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch b/package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch
>> new file mode 100644
>> index 0000000..a0b065a
>> --- /dev/null
>> +++ b/package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch
>> @@ -0,0 +1,82 @@
>> +From 583b934dbd712e661e7c4eb994174bf71d88690c Mon Sep 17 00:00:00 2001
>> +From: Marcin Niestroj <m.niestroj@grinn-global.com>
>> +Date: Tue, 15 Nov 2016 14:51:47 +0100
>> +Subject: [PATCH] Makefile: Cleanup compiler and linker flags
>> +
>> +Cleanup compiler and linker flags, so the library can be easily
>> +cross-compiled by overwriting CPPFLAGS, CXXFLAGS and LDFLAGS:
>> +
>> +* Rename CPP into CXX, as we use this command for compiling, not
>> +  preprocessing.
>> +* Remove separate LD usage, use CXX instead. This is to still launch
>> +  compiler command when user overrides CXX and LD commands.
>> +* Define MY_CXXFLAGS and MY_LDFLAGS, which should always take place and
>> +  not get overridden by user.
>> +* Define AR command, which can be overidden by user.
>> +---
>> + src/Makefile | 26 +++++++++++++-------------
>> + 1 file changed, 13 insertions(+), 13 deletions(-)
>> +
>> +diff --git a/src/Makefile b/src/Makefile
>> +index 54e938a..5fb9763 100644
>> +--- a/src/Makefile
>> ++++ b/src/Makefile
>> +@@ -1,8 +1,8 @@
>> +-CPP		= g++
>> ++AR		= ar
>> ++CXX		= g++
>> + RM		= rm -f
>> +-CPPFLAGS	= -Wall -MMD -c -I. -std=c++11
>> +-LD		= g++
>> +-LD_FLAGS	= -Wall -shared
>> ++MY_CXXFLAGS	= -Wall -MMD -c -I. -std=c++11
>> ++MY_LDFLAGS	= -Wall -shared
>
> You can also do:
>
> override CXXFLAGS += ...
> override LDFLAGS += ...

Thanks for pointing it. Didn't know that :)

>
>> diff --git a/package/reactcpp/Config.in b/package/reactcpp/Config.in
>> new file mode 100644
>> index 0000000..f6989e5
>> --- /dev/null
>> +++ b/package/reactcpp/Config.in
>> @@ -0,0 +1,14 @@
>> +config BR2_PACKAGE_REACTCPP
>> +	bool "reactcpp"
>> +	depends on BR2_INSTALL_LIBSTDCPP
>> +	depends on BR2_TOOLCHAIN_HAS_THREADS
>
> You have two dependencies here.
>
>> +	select BR2_PACKAGE_C_ARES
>> +	select BR2_PACKAGE_LIBEV
>> +	help
>> +	  REACT-CPP is an event loop library that utilizes the new
>> +	  C++11 lambda functions to notify you when there is activity
>> +	  on a filedescriptor or on a timer. Internally, it is a wrapper
>> +	  around the libev library, and does therefore also depend on
>> +	  that library.
>> +
>> +	  https://github.com/CopernicaMarketingSoftware/REACT-CPP
>
> So you need a Config.in comment here about those dependencies. Check
> other packages and the Buildroot manual for details.
>
>> diff --git a/package/reactcpp/reactcpp.hash b/package/reactcpp/reactcpp.hash
>> new file mode 100644
>> index 0000000..c30dab6
>> --- /dev/null
>> +++ b/package/reactcpp/reactcpp.hash
>> @@ -0,0 +1,2 @@
>> +# Locally calculated
>> +sha256 4af5d6a535ff7d8835d05db3490f2b62d6d791a4968ab45f479023868d7acdc8  reactcpp-v1.0.3.tar.gz
>> diff --git a/package/reactcpp/reactcpp.mk b/package/reactcpp/reactcpp.mk
>> new file mode 100644
>> index 0000000..e198c3d
>> --- /dev/null
>> +++ b/package/reactcpp/reactcpp.mk
>> @@ -0,0 +1,34 @@
>> +################################################################################
>> +#
>> +# reactcpp
>> +#
>> +################################################################################
>> +
>> +REACTCPP_VERSION_MAJOR = 1.0
>> +REACTCPP_VERSION_RAW = $(REACTCPP_VERSION_MAJOR).3
>> +REACTCPP_VERSION = v$(REACTCPP_VERSION_RAW)
>
> Just define the version as v$(REACTCPP_VERSION_MAJOR).3

I am using $(REACTCPP_VERSION_RAW) below to define $(REACTCPP_SO).

>
>> +REACTCPP_SITE = $(call github,CopernicaMarketingSoftware,REACT-CPP,$(REACTCPP_VERSION))
>> +REACTCPP_LICENSE = Apache-2.0
>> +REACTCPP_LICENSE_FILES = LICENSE
>> +REACTCPP_DEPENDENCIES = c-ares libev
>> +REACTCPP_INSTALL_STAGING = YES
>> +
>> +define REACTCPP_BUILD_CMDS
>> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
>
> Please pass $(TARGET_MAKE_ENV) in the environment.
>
>> +endef
>> +
>> +define REACTCPP_INSTALL_STAGING_CMDS
>> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) PREFIX=$(STAGING_DIR)/usr -C $(@D) install
>
> Ditto.
>
>> +endef
>> +
>> +REACTCPP_SO = libreactcpp.so.$(REACTCPP_VERSION_RAW)
>> +
>> +ifeq ($(BR2_STATIC_LIBS),)
>> +define REACTCPP_INSTALL_TARGET_CMDS
>> +	$(INSTALL) -D -m 0755 $(@D)/src/$(REACTCPP_SO) $(TARGET_DIR)/usr/lib/$(REACTCPP_SO)
>> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so.$(REACTCPP_VERSION_MAJOR)
>> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so
>> +endef
>> +endif
>
> Why are you doing this instead of calling "make install" for
> $(TARGET_DIR) ?

Because make install also copies header files and static library.

>
> Thanks,
>
> Thomas
>
Thomas Petazzoni Dec. 7, 2016, 10:24 a.m. UTC | #3
Hello,

On Wed, 7 Dec 2016 10:59:09 +0100, Marcin Niestroj wrote:

> > Just define the version as v$(REACTCPP_VERSION_MAJOR).3  
> 
> I am using $(REACTCPP_VERSION_RAW) below to define $(REACTCPP_SO).

Yes, but REACTCPP_SO is useless, see below.

> >> +ifeq ($(BR2_STATIC_LIBS),)
> >> +define REACTCPP_INSTALL_TARGET_CMDS
> >> +	$(INSTALL) -D -m 0755 $(@D)/src/$(REACTCPP_SO) $(TARGET_DIR)/usr/lib/$(REACTCPP_SO)
> >> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so.$(REACTCPP_VERSION_MAJOR)
> >> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so
> >> +endef
> >> +endif  
> >
> > Why are you doing this instead of calling "make install" for
> > $(TARGET_DIR) ?  
> 
> Because make install also copies header files and static library.

And that's perfectly fine. Just let "make install" install header files
and static library. Buildroot will clean them up at the end of the
build, in the "target-finalize" step.

It's much, much better (and future proof) to use the build system of the
package itself when possible, and rely on target-finalize to clean
things up at the end of the build.

Thanks,

Thomas
Marcin Niestroj Dec. 7, 2016, 10:55 a.m. UTC | #4
On 06.12.2016 16:31, Thomas Petazzoni wrote:
> Hello,
>
> Thanks for this contribution! See some comments below.
>

<snip>

>> diff --git a/package/reactcpp/reactcpp.mk b/package/reactcpp/reactcpp.mk
>> new file mode 100644
>> index 0000000..e198c3d
>> --- /dev/null
>> +++ b/package/reactcpp/reactcpp.mk
>> @@ -0,0 +1,34 @@
>> +################################################################################
>> +#
>> +# reactcpp
>> +#
>> +################################################################################
>> +
>> +REACTCPP_VERSION_MAJOR = 1.0
>> +REACTCPP_VERSION_RAW = $(REACTCPP_VERSION_MAJOR).3
>> +REACTCPP_VERSION = v$(REACTCPP_VERSION_RAW)
>
> Just define the version as v$(REACTCPP_VERSION_MAJOR).3
>
>> +REACTCPP_SITE = $(call github,CopernicaMarketingSoftware,REACT-CPP,$(REACTCPP_VERSION))
>> +REACTCPP_LICENSE = Apache-2.0
>> +REACTCPP_LICENSE_FILES = LICENSE
>> +REACTCPP_DEPENDENCIES = c-ares libev
>> +REACTCPP_INSTALL_STAGING = YES
>> +
>> +define REACTCPP_BUILD_CMDS
>> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
>
> Please pass $(TARGET_MAKE_ENV) in the environment.

Should I simply add $(TARGET_MAKE_ENV) before $(MAKE)?

Can you explain a little when I should use $(TARGET_MAKE_ENV), when
$(TARGET_CONFIGURE_OPTS) and when both? In Buildroot manual examples
they never exist together. And what I see in package/Makefile.in
$(TARGET_CONFIGURE_OPTS) contains $(TARGET_MAKE_ENV).

>
>> +endef
>> +
>> +define REACTCPP_INSTALL_STAGING_CMDS
>> +	$(MAKE) $(TARGET_CONFIGURE_OPTS) PREFIX=$(STAGING_DIR)/usr -C $(@D) install
>
> Ditto.
>
>> +endef
>> +
>> +REACTCPP_SO = libreactcpp.so.$(REACTCPP_VERSION_RAW)
>> +
>> +ifeq ($(BR2_STATIC_LIBS),)
>> +define REACTCPP_INSTALL_TARGET_CMDS
>> +	$(INSTALL) -D -m 0755 $(@D)/src/$(REACTCPP_SO) $(TARGET_DIR)/usr/lib/$(REACTCPP_SO)
>> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so.$(REACTCPP_VERSION_MAJOR)
>> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so
>> +endef
>> +endif
>
> Why are you doing this instead of calling "make install" for
> $(TARGET_DIR) ?
>
> Thanks,
>
> Thomas
>
Marcin Niestroj Dec. 7, 2016, 11:51 a.m. UTC | #5
On 07.12.2016 11:24, Thomas Petazzoni wrote:
> Hello,
>
> On Wed, 7 Dec 2016 10:59:09 +0100, Marcin Niestroj wrote:
>
>>> Just define the version as v$(REACTCPP_VERSION_MAJOR).3
>>
>> I am using $(REACTCPP_VERSION_RAW) below to define $(REACTCPP_SO).
>
> Yes, but REACTCPP_SO is useless, see below.
>
>>>> +ifeq ($(BR2_STATIC_LIBS),)
>>>> +define REACTCPP_INSTALL_TARGET_CMDS
>>>> +	$(INSTALL) -D -m 0755 $(@D)/src/$(REACTCPP_SO) $(TARGET_DIR)/usr/lib/$(REACTCPP_SO)
>>>> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so.$(REACTCPP_VERSION_MAJOR)
>>>> +	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so
>>>> +endef
>>>> +endif
>>>
>>> Why are you doing this instead of calling "make install" for
>>> $(TARGET_DIR) ?
>>
>> Because make install also copies header files and static library.
>
> And that's perfectly fine. Just let "make install" install header files
> and static library. Buildroot will clean them up at the end of the
> build, in the "target-finalize" step.

Ok, I was not aware cleaning header and *.a files in target-finalize.

I have used 'make install' and checked the target directory before and
after target-finalize. There was *.a symlink pointing to *.a.1.0.3.
After target-finalize only the symlink was removed. How should we fix
that?

>
> It's much, much better (and future proof) to use the build system of the
> package itself when possible, and rely on target-finalize to clean
> things up at the end of the build.
>
> Thanks,
>
> Thomas
>
Thomas Petazzoni Dec. 7, 2016, 1:02 p.m. UTC | #6
Hello,

On Wed, 7 Dec 2016 12:51:24 +0100, Marcin Niestroj wrote:

> > And that's perfectly fine. Just let "make install" install header files
> > and static library. Buildroot will clean them up at the end of the
> > build, in the "target-finalize" step.  
> 
> Ok, I was not aware cleaning header and *.a files in target-finalize.
> 
> I have used 'make install' and checked the target directory before and
> after target-finalize. There was *.a symlink pointing to *.a.1.0.3.
> After target-finalize only the symlink was removed. How should we fix
> that?

Then you can do a POST_INSTALL_TARGET_HOOKS to remove this additional
file.

It is very weird to create a static library file name with a version
number. Normally, static libraries are directly installed as
lib<foo>.a.

Thanks!

Thomas
Marcin Niestroj Dec. 9, 2016, 9:21 a.m. UTC | #7
Hi Thomas,

On 07.12.2016 11:55, Marcin Niestroj wrote:
>
> On 06.12.2016 16:31, Thomas Petazzoni wrote:
>> Hello,
>>
>> Thanks for this contribution! See some comments below.
>>
>
> <snip>
>
>>> diff --git a/package/reactcpp/reactcpp.mk b/package/reactcpp/reactcpp.mk
>>> new file mode 100644
>>> index 0000000..e198c3d
>>> --- /dev/null
>>> +++ b/package/reactcpp/reactcpp.mk
>>> @@ -0,0 +1,34 @@
>>> +################################################################################
>>>
>>> +#
>>> +# reactcpp
>>> +#
>>> +################################################################################
>>>
>>> +
>>> +REACTCPP_VERSION_MAJOR = 1.0
>>> +REACTCPP_VERSION_RAW = $(REACTCPP_VERSION_MAJOR).3
>>> +REACTCPP_VERSION = v$(REACTCPP_VERSION_RAW)
>>
>> Just define the version as v$(REACTCPP_VERSION_MAJOR).3
>>
>>> +REACTCPP_SITE = $(call
>>> github,CopernicaMarketingSoftware,REACT-CPP,$(REACTCPP_VERSION))
>>> +REACTCPP_LICENSE = Apache-2.0
>>> +REACTCPP_LICENSE_FILES = LICENSE
>>> +REACTCPP_DEPENDENCIES = c-ares libev
>>> +REACTCPP_INSTALL_STAGING = YES
>>> +
>>> +define REACTCPP_BUILD_CMDS
>>> +    $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
>>
>> Please pass $(TARGET_MAKE_ENV) in the environment.
>
> Should I simply add $(TARGET_MAKE_ENV) before $(MAKE)?
>
> Can you explain a little when I should use $(TARGET_MAKE_ENV), when
> $(TARGET_CONFIGURE_OPTS) and when both? In Buildroot manual examples
> they never exist together. And what I see in package/Makefile.in
> $(TARGET_CONFIGURE_OPTS) contains $(TARGET_MAKE_ENV).
>

Propably you missed my question above.

Regards,
Marcin

>>
>>> +endef
>>> +
>>> +define REACTCPP_INSTALL_STAGING_CMDS
>>> +    $(MAKE) $(TARGET_CONFIGURE_OPTS) PREFIX=$(STAGING_DIR)/usr -C
>>> $(@D) install
>>
>> Ditto.
>>
>>> +endef
>>> +
>>> +REACTCPP_SO = libreactcpp.so.$(REACTCPP_VERSION_RAW)
>>> +
>>> +ifeq ($(BR2_STATIC_LIBS),)
>>> +define REACTCPP_INSTALL_TARGET_CMDS
>>> +    $(INSTALL) -D -m 0755 $(@D)/src/$(REACTCPP_SO)
>>> $(TARGET_DIR)/usr/lib/$(REACTCPP_SO)
>>> +    ln -sf $(REACTCPP_SO)
>>> $(TARGET_DIR)/usr/lib/libreactcpp.so.$(REACTCPP_VERSION_MAJOR)
>>> +    ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so
>>> +endef
>>> +endif
>>
>> Why are you doing this instead of calling "make install" for
>> $(TARGET_DIR) ?
>>
>> Thanks,
>>
>> Thomas
>>
>
diff mbox

Patch

diff --git a/package/Config.in b/package/Config.in
index 664d0d9..27debdc 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -1355,6 +1355,7 @@  endif
 	source "package/protobuf-c/Config.in"
 	source "package/qhull/Config.in"
 	source "package/qlibc/Config.in"
+	source "package/reactcpp/Config.in"
 	source "package/shapelib/Config.in"
 	source "package/sphinxbase/Config.in"
 	source "package/startup-notification/Config.in"
diff --git a/package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch b/package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch
new file mode 100644
index 0000000..a0b065a
--- /dev/null
+++ b/package/reactcpp/0001-Makefile-Cleanup-compiler-and-linker-flags.patch
@@ -0,0 +1,82 @@ 
+From 583b934dbd712e661e7c4eb994174bf71d88690c Mon Sep 17 00:00:00 2001
+From: Marcin Niestroj <m.niestroj@grinn-global.com>
+Date: Tue, 15 Nov 2016 14:51:47 +0100
+Subject: [PATCH] Makefile: Cleanup compiler and linker flags
+
+Cleanup compiler and linker flags, so the library can be easily
+cross-compiled by overwriting CPPFLAGS, CXXFLAGS and LDFLAGS:
+
+* Rename CPP into CXX, as we use this command for compiling, not
+  preprocessing.
+* Remove separate LD usage, use CXX instead. This is to still launch
+  compiler command when user overrides CXX and LD commands.
+* Define MY_CXXFLAGS and MY_LDFLAGS, which should always take place and
+  not get overridden by user.
+* Define AR command, which can be overidden by user.
+---
+ src/Makefile | 26 +++++++++++++-------------
+ 1 file changed, 13 insertions(+), 13 deletions(-)
+
+diff --git a/src/Makefile b/src/Makefile
+index 54e938a..5fb9763 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -1,8 +1,8 @@
+-CPP		= g++
++AR		= ar
++CXX		= g++
+ RM		= rm -f
+-CPPFLAGS	= -Wall -MMD -c -I. -std=c++11
+-LD		= g++
+-LD_FLAGS	= -Wall -shared
++MY_CXXFLAGS	= -Wall -MMD -c -I. -std=c++11
++MY_LDFLAGS	= -Wall -shared
+ SHARED_LIB	= lib$(LIBRARY_NAME).so.$(VERSION)
+ STATIC_LIB	= lib$(LIBRARY_NAME).a.$(VERSION)
+ STATIC_FPIC_LIB = lib$(LIBRARY_NAME)_fpic.a
+@@ -11,12 +11,12 @@ DEPENDENCIES    = $(SOURCES:%.cpp=%.d)
+ SHARED_OBJECTS	= $(SOURCES:%.cpp=%.o)
+ STATIC_OBJECTS	= $(SOURCES:%.cpp=%.s.o)
+ 
+-all:	CPPFLAGS += -g
+-all:	LD_FLAGS += -g
++all:	CXXFLAGS = -g
++all:	LDFLAGS = -g
+ all:	shared static
+ 
+-release:	CPPFLAGS += -O2
+-release:	LD_FLAGS += -O2
++release:	CXXFLAGS = -O2
++release:	LDFLAGS = -O2
+ release:	shared static
+ 
+ -include ${DEPENDENCIES}
+@@ -28,20 +28,20 @@ static_fpic: ${SHARED_OBJECTS} ${STATIC_FPIC_LIB}
+ static:	${STATIC_OBJECTS} ${STATIC_LIB}
+ 
+ ${SHARED_LIB}: ${SHARED_OBJECTS}
+-	${LD} ${LD_FLAGS} -Wl,-soname,lib$(LIBRARY_NAME).so.$(SONAME) -o $@ ${SHARED_OBJECTS} -lev -lcares
++	${CXX} ${MY_LDFLAGS} ${LDFLAGS} -Wl,-soname,lib$(LIBRARY_NAME).so.$(SONAME) -o $@ ${SHARED_OBJECTS} -lev -lcares
+ 
+ ${STATIC_LIB}: ${STATIC_OBJECTS}
+-	ar rcs ${STATIC_LIB} ${STATIC_OBJECTS}
++	$(AR) rcs ${STATIC_LIB} ${STATIC_OBJECTS}
+ 
+ ${STATIC_FPIC_LIB}: ${SHARED_OBJECTS}
+-	ar rcs ${STATIC_FPIC_LIB} ${SHARED_OBJECTS}
++	$(AR) rcs ${STATIC_FPIC_LIB} ${SHARED_OBJECTS}
+ 
+ clean:
+ 	${RM} *.obj *~* ${SHARED_OBJECTS} ${STATIC_OBJECTS} ${SHARED_LIB} ${STATIC_LIB}
+ 
+ ${SHARED_OBJECTS}:
+-	${CPP} ${CPPFLAGS} -fpic -o $@ ${@:%.o=%.cpp}
++	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${MY_CXXFLAGS} -fpic -o $@ ${@:%.o=%.cpp}
+ 
+ ${STATIC_OBJECTS}:
+-	${CPP} ${CPPFLAGS} -o $@ ${@:%.s.o=%.cpp}
++	${CXX} ${CXXFLAGS} ${CPPFLAGS} ${MY_CXXFLAGS} -o $@ ${@:%.s.o=%.cpp}
+ 
+-- 
+2.10.2
+
diff --git a/package/reactcpp/Config.in b/package/reactcpp/Config.in
new file mode 100644
index 0000000..f6989e5
--- /dev/null
+++ b/package/reactcpp/Config.in
@@ -0,0 +1,14 @@ 
+config BR2_PACKAGE_REACTCPP
+	bool "reactcpp"
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS
+	select BR2_PACKAGE_C_ARES
+	select BR2_PACKAGE_LIBEV
+	help
+	  REACT-CPP is an event loop library that utilizes the new
+	  C++11 lambda functions to notify you when there is activity
+	  on a filedescriptor or on a timer. Internally, it is a wrapper
+	  around the libev library, and does therefore also depend on
+	  that library.
+
+	  https://github.com/CopernicaMarketingSoftware/REACT-CPP
diff --git a/package/reactcpp/reactcpp.hash b/package/reactcpp/reactcpp.hash
new file mode 100644
index 0000000..c30dab6
--- /dev/null
+++ b/package/reactcpp/reactcpp.hash
@@ -0,0 +1,2 @@ 
+# Locally calculated
+sha256 4af5d6a535ff7d8835d05db3490f2b62d6d791a4968ab45f479023868d7acdc8  reactcpp-v1.0.3.tar.gz
diff --git a/package/reactcpp/reactcpp.mk b/package/reactcpp/reactcpp.mk
new file mode 100644
index 0000000..e198c3d
--- /dev/null
+++ b/package/reactcpp/reactcpp.mk
@@ -0,0 +1,34 @@ 
+################################################################################
+#
+# reactcpp
+#
+################################################################################
+
+REACTCPP_VERSION_MAJOR = 1.0
+REACTCPP_VERSION_RAW = $(REACTCPP_VERSION_MAJOR).3
+REACTCPP_VERSION = v$(REACTCPP_VERSION_RAW)
+REACTCPP_SITE = $(call github,CopernicaMarketingSoftware,REACT-CPP,$(REACTCPP_VERSION))
+REACTCPP_LICENSE = Apache-2.0
+REACTCPP_LICENSE_FILES = LICENSE
+REACTCPP_DEPENDENCIES = c-ares libev
+REACTCPP_INSTALL_STAGING = YES
+
+define REACTCPP_BUILD_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D)
+endef
+
+define REACTCPP_INSTALL_STAGING_CMDS
+	$(MAKE) $(TARGET_CONFIGURE_OPTS) PREFIX=$(STAGING_DIR)/usr -C $(@D) install
+endef
+
+REACTCPP_SO = libreactcpp.so.$(REACTCPP_VERSION_RAW)
+
+ifeq ($(BR2_STATIC_LIBS),)
+define REACTCPP_INSTALL_TARGET_CMDS
+	$(INSTALL) -D -m 0755 $(@D)/src/$(REACTCPP_SO) $(TARGET_DIR)/usr/lib/$(REACTCPP_SO)
+	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so.$(REACTCPP_VERSION_MAJOR)
+	ln -sf $(REACTCPP_SO) $(TARGET_DIR)/usr/lib/libreactcpp.so
+endef
+endif
+
+$(eval $(generic-package))