Patchwork [14/14] zmqpp: new package

login
register
mail settings
Submitter Yann E. MORIN
Date March 24, 2013, 10:50 p.m.
Message ID <853f6c87c751efdc5392436322e223dc203a858d.1364165310.git.yann.morin.1998@free.fr>
Download mbox | patch
Permalink /patch/230525/
State Superseded
Headers show

Comments

Yann E. MORIN - March 24, 2013, 10:50 p.m.
From: Simon Dawson <spdawson@gmail.com>

Now that zeromq has been bumped to version 3.2.2, we need to provide the
C++ binding using a separate package. The zmqpp package provides a high-level
C++ wrapper library around the zeromq C API.

Signed-off-by: Simon Dawson <spdawson@gmail.com>
---
 package/Config.in                           |    1 +
 package/zmqpp/Config.in                     |   32 ++++++++++++++++
 package/zmqpp/zmqpp-fix-typos-in-code.patch |   46 +++++++++++++++++++++++
 package/zmqpp/zmqpp.mk                      |   54 +++++++++++++++++++++++++++
 4 files changed, 133 insertions(+), 0 deletions(-)
 create mode 100644 package/zmqpp/Config.in
 create mode 100644 package/zmqpp/zmqpp-fix-typos-in-code.patch
 create mode 100644 package/zmqpp/zmqpp.mk

Patch

diff --git a/package/Config.in b/package/Config.in
index 23c9bb3..77dc0d3 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -538,6 +538,7 @@  source "package/ortp/Config.in"
 source "package/slirp/Config.in"
 source "package/usbredir/Config.in"
 source "package/zeromq/Config.in"
+source "package/zmqpp/Config.in"
 endmenu
 
 menu "Other"
diff --git a/package/zmqpp/Config.in b/package/zmqpp/Config.in
new file mode 100644
index 0000000..7a12462
--- /dev/null
+++ b/package/zmqpp/Config.in
@@ -0,0 +1,32 @@ 
+config BR2_PACKAGE_ZMQPP
+	bool "zmqpp"
+	depends on !BR2_avr32 # compiler needs c++0x support
+	depends on BR2_INSTALL_LIBSTDCPP
+	depends on BR2_INET_IPV6 # zeromq
+	depends on BR2_LARGEFILE # util-linux
+	depends on BR2_USE_WCHAR # util-linux
+	select BR2_PACKAGE_ZEROMQ
+	help
+	  C++ binding for zeromq (ZeroMQ, 0MQ, zmq).
+
+	  This C++ binding is a 'high-level' library that hides most of the
+	  C-style interface core zeromq provides.
+
+	  http://github.com/benjamg/zmqpp
+
+comment "zmqpp requires a toolchain with C++, IPV6, LARGEFILE and WCHAR support"
+	depends on !(BR2_INSTALL_LIBSTDCPP && BR2_INET_IPV6 && BR2_LARGEFILE \
+		&& BR2_USE_WCHAR)
+
+config BR2_PACKAGE_ZMQPP_CLIENT
+	bool "zmqpp client"
+	depends on BR2_PACKAGE_ZMQPP
+	depends on BR2_TOOLCHAIN_HAS_THREADS # boost
+	select BR2_PACKAGE_BOOST
+	select BR2_PACKAGE_BOOST_PROGRAM_OPTIONS
+	help
+	  Build and install the zmqpp client, a command line tool that can be
+	  used to listen or send to zeromq sockets.
+
+comment "zmqpp client requires a toolchain with thread support"
+	depends on BR2_PACKAGE_ZMQPP && !BR2_TOOLCHAIN_HAS_THREADS
diff --git a/package/zmqpp/zmqpp-fix-typos-in-code.patch b/package/zmqpp/zmqpp-fix-typos-in-code.patch
new file mode 100644
index 0000000..a873de9
--- /dev/null
+++ b/package/zmqpp/zmqpp-fix-typos-in-code.patch
@@ -0,0 +1,46 @@ 
+Fix a couple of typos in the zmqpp source code.
+
+Signed-off-by: Simon Dawson <spdawson@gmail.com>
+
+diff -Nurp a/src/zmqpp/socket.cpp b/src/zmqpp/socket.cpp
+--- a/src/zmqpp/socket.cpp	2012-12-11 11:06:23.000000000 +0000
++++ b/src/zmqpp/socket.cpp	2013-03-18 17:32:01.464761776 +0000
+@@ -587,7 +587,7 @@ void socket::get(socket_option const& op
+ 	}
+ }
+ 
+-socket::socket(socket&& source) noexcept
++socket::socket(socket& source) noexcept
+ 	: _socket(source._socket)
+ 	, _type(source._type)
+ 	, _recv_buffer()
+@@ -601,7 +601,7 @@ socket::socket(socket&& source) noexcept
+ 	source._socket = nullptr;
+ }
+ 
+-socket& socket::operator=(socket&& source) noexcept
++socket& socket::operator=(socket& source) noexcept
+ {
+ 	_socket = source._socket;
+ 	source._socket = nullptr;
+diff -Nurp a/src/zmqpp/socket.hpp b/src/zmqpp/socket.hpp
+--- a/src/zmqpp/socket.hpp	2012-12-11 11:06:23.000000000 +0000
++++ b/src/zmqpp/socket.hpp	2013-03-18 17:31:53.556790457 +0000
+@@ -400,7 +400,7 @@ public:
+ 	 *
+ 	 * \param source target socket to steal internals from
+ 	 */
+-	socket(socket&& source) noexcept;
++	socket(socket& source) noexcept;
+ 
+ 	/*!
+ 	 * Move operator
+@@ -413,7 +413,7 @@ public:
+ 	 * \param source target socket to steal internals from
+ 	 * \return socket reference to this
+ 	 */
+-	socket& operator=(socket&& source) noexcept;
++	socket& operator=(socket& source) noexcept;
+ 
+ 	/*!
+ 	 * Check the socket is still valid
diff --git a/package/zmqpp/zmqpp.mk b/package/zmqpp/zmqpp.mk
new file mode 100644
index 0000000..c64b256
--- /dev/null
+++ b/package/zmqpp/zmqpp.mk
@@ -0,0 +1,54 @@ 
+#############################################################
+#
+# zmqpp
+#
+#############################################################
+
+ZMQPP_VERSION = 31220ca
+ZMQPP_SITE = git://github.com/benjamg/zmqpp.git
+ZMQPP_INSTALL_STAGING = YES
+ZMQPP_DEPENDENCIES = zeromq
+ZMQPP_LICENSE = MIT
+ZMQPP_LICENSE_FILES = LICENSE
+
+ZMQPP_MAKE_OPT = LD="$(TARGET_CXX)" BUILD_PATH=./build PREFIX=/usr
+
+ifeq ($(BR2_PACKAGE_ZMQPP_CLIENT),y)
+ZMQPP_DEPENDENCIES += boost
+endif
+
+define ZMQPP_BUILD_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+		$(ZMQPP_MAKE_OPT) $(if $(BR2_PACKAGE_ZMQPP_CLIENT),all) -C $(@D)
+endef
+
+define ZMQPP_INSTALL_TARGET_CMDS
+	$(INSTALL) -m 0755 -d $(TARGET_DIR)/usr/include/zmqpp
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+		$(ZMQPP_MAKE_OPT) DESTDIR=$(TARGET_DIR) install -C $(@D)
+endef
+
+define ZMQPP_UNINSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+		$(ZMQPP_MAKE_OPT) DESTDIR=$(TARGET_DIR) uninstall -C $(@D)
+	$(RM) $(TARGET_DIR)/usr/include/zmqpp
+endef
+
+define ZMQPP_INSTALL_STAGING_CMDS
+	$(INSTALL) -m 0755 -d $(STAGING_DIR)/usr/include/zmqpp
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+		$(ZMQPP_MAKE_OPT) DESTDIR=$(STAGING_DIR) install -C $(@D)
+endef
+
+define ZMQPP_UNINSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) \
+		$(ZMQPP_MAKE_OPT) DESTDIR=$(STAGING_DIR) uninstall -C $(@D)
+	$(RM) $(STAGING_DIR)/usr/include/zmqpp
+endef
+
+define ZMQPP_CLEAN_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) $(ZMQPP_MAKE_OPT) \
+		clean -C $(@D)
+endef
+
+$(eval $(generic-package))