Skip to contentSkip to conversation

websocketpp: new package

PATCH New Pieter De Gendt 4 participants 7 messages Sep 2, 2016 – Sep 17, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 websocketpp: new package

---
 package/Config.in                                  |  1 +
 .../websocketpp/0001-Fix-cmake-cross-compile.patch | 42 ++++++++++++++++++++++
 package/websocketpp/Config.in                      | 14 ++++++++
 package/websocketpp/websocketpp.hash               |  1 +
 package/websocketpp/websocketpp.mk                 | 15 ++++++++
 5 files changed, 73 insertions(+)
 create mode 100644 package/websocketpp/0001-Fix-cmake-cross-compile.patch
 create mode 100644 package/websocketpp/Config.in
 create mode 100644 package/websocketpp/websocketpp.hash
 create mode 100644 package/websocketpp/websocketpp.mk
package/Config.in +1 -0
index 1e51a45..3fe55b4 100644
@@ -1242,6 +1242,7 @@ menu "Networking"
 	source "package/sofia-sip/Config.in"
 	source "package/thrift/Config.in"
 	source "package/usbredir/Config.in"
+	source "package/websocketpp/Config.in"
 	source "package/wvstreams/Config.in"
 	source "package/zeromq/Config.in"
 	source "package/zmqpp/Config.in"
package/websocketpp/0001-Fix-cmake-cross-compile.patch new file +42 -0

42 lines not on this page · raw message

package/websocketpp/Config.in new file +14 -0
new file mode 100644
index 0000000..97df9fd
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_WEBSOCKETPP
+	bool "websocketpp"
+	select BR2_PACKAGE_ZLIB
+	depends on BR2_PACKAGE_BOOST
+	depends on BR2_PACKAGE_BOOST_SYSTEM
+	depends on BR2_PACKAGE_BOOST_RANDOM
+	help
+	  WebSocket++ is a header only C++ library that implements
+	  RFC6455 The WebSocket Protocol. It allows integrating
+	  WebSocket client and server functionality into C++ programs.
+	  It uses interchangeable network transport modules including
+	  one based on C++ iostreams and one based on Boost Asio.
+
+	  http://www.zaphoyd.com/websocketpp
package/websocketpp/websocketpp.hash new file +1 -0
new file mode 100644
index 0000000..49496ca
@@ -0,0 +1 @@
+sha256  07b3364ad30cda022d91759d4b83ff902e1ebadb796969e58b59caa535a03923    websocketpp-0.7.0.tar.gz
package/websocketpp/websocketpp.mk new file +15 -0
new file mode 100644
index 0000000..e4f729b
@@ -0,0 +1,15 @@
+################################################################################
+#
+# websocketpp
+#
+################################################################################
+
+WEBSOCKETPP_VERSION = 0.7.0
+WEBSOCKETPP_SITE = $(call github,zaphoyd,websocketpp,$(WEBSOCKETPP_VERSION))
+WEBSOCKETPP_LICENSE = BSD
+WEBSOCKETPP_LICENSE_FILES = COPYING
+WEBSOCKETPP_DEPENDENCIES = zlib
+WEBSOCKETPP_INSTALL_STAGING = YES
+WEBSOCKETPP_DEPENDENCIES = host-pkgconf boost
+
+$(eval $(cmake-package))
Signature · 1 line
2.9.3
#1 lore raw

PATCH 2/2 cpprestsdk: new package

---
 package/Config.in                  |  1 +
 package/cpprestsdk/Config.in       | 27 +++++++++++++++++++++++++++
 package/cpprestsdk/cpprestsdk.hash |  1 +
 package/cpprestsdk/cpprestsdk.mk   | 25 +++++++++++++++++++++++++
 4 files changed, 54 insertions(+)
 create mode 100644 package/cpprestsdk/Config.in
 create mode 100644 package/cpprestsdk/cpprestsdk.hash
 create mode 100644 package/cpprestsdk/cpprestsdk.mk
package/Config.in +1 -0
index 3fe55b4..f0f8401 100644
@@ -1156,6 +1156,7 @@ menu "Networking"
 	source "package/c-ares/Config.in"
 	source "package/canfestival/Config.in"
 	source "package/cgic/Config.in"
+    source "package/cpprestsdk/Config.in"
 	source "package/cppzmq/Config.in"
 	source "package/czmq/Config.in"
 	source "package/filemq/Config.in"
package/cpprestsdk/Config.in new file +27 -0
new file mode 100644
index 0000000..7b95d31
@@ -0,0 +1,27 @@
+config BR2_PACKAGE_CPPRESTSDK
+        bool "cpprestsdk"
+        depends on BR2_INSTALL_LIBSTDCPP
+        depends on BR2_USE_WCHAR
+        depends on BR2_TOOLCHAIN_HAS_THREADS
+        select BR2_PACKAGE_BOOST
+        select BR2_PACKAGE_BOOST_CHRONO
+        select BR2_PACKAGE_BOOST_FILESYSTEM
+        select BR2_PACKAGE_BOOST_RANDOM
+        select BR2_PACKAGE_BOOST_REGEX
+        select BR2_PACKAGE_BOOST_SYSTEM
+        select BR2_PACKAGE_BOOST_THREAD
+        select BR2_PACKAGE_OPENSSL
+        select BR2_PACKAGE_PKGCONF
+        select BR2_PACKAGE_ZLIB
+        help
+          The C++ REST SDK is a Microsoft project for 
+          cloud-based client-server communication in 
+          native code using a modern asynchronous C++ API 
+          design. This project aims to help C++ developers 
+          connect to and interact with services.
+          
+          https://github.com/Microsoft/cpprestsdk
+
+comment "clogics needs a toolchain w/ C++, wchar, threads"
+        depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR
+
package/cpprestsdk/cpprestsdk.hash new file +1 -0
new file mode 100644
index 0000000..200f05a
@@ -0,0 +1 @@
+sha256  3d1c38aa7ef34b3d3e9a6e84d3866554fe48c3d9d9977896d18a7cfb80d5a4ea    cpprestsdk-v2.8.0.tar.gz
package/cpprestsdk/cpprestsdk.mk new file +25 -0
new file mode 100644
index 0000000..d7509f8
@@ -0,0 +1,25 @@
+################################################################################
+#
+## cpprestsdk
+#
+#################################################################################
+
+CPPRESTSDK_VERSION = v2.8.0
+CPPRESTSDK_SITE = $(call github,Microsoft,cpprestsdk,$(CPPRESTSDK_VERSION))
+CPPRESTSDK_INSTALL_STAGING = YES
+
+CPPRESTSDK_DEPENDENCIES = boost openssl zlib
+
+ifeq ($(BR2_PACKAGE_WEBSOCKETPP),y)
+	CPPRESTSDK_DEPENDENCIES += websocketpp
+else
+	CPPRESTSDK_CONF_OPTS = -DCPPREST_EXCLUDE_WEBSOCKETS=ON
+endif
+
+
+CPPRESTSDK_SUBDIR = Release
+
+CPPRESTSDK_CONF_OPTS += -DBUILD_SAMPLES=OFF
+
+$(eval $(cmake-package))
+
Signature · 1 line
2.9.3
#2 lore raw

PATCH 2/2 cpprestsdk: new package

Le 02/09/2016 ? 15:42, Pieter De Gendt a ?crit :

Quoted 16 lines
---
 package/Config.in                  |  1 +
 package/cpprestsdk/Config.in       | 27 +++++++++++++++++++++++++++
 package/cpprestsdk/cpprestsdk.hash |  1 +
 package/cpprestsdk/cpprestsdk.mk   | 25 +++++++++++++++++++++++++
 4 files changed, 54 insertions(+)
 create mode 100644 package/cpprestsdk/Config.in
 create mode 100644 package/cpprestsdk/cpprestsdk.hash
 create mode 100644 package/cpprestsdk/cpprestsdk.mk
package/Config.in +0 -0
index 3fe55b4..f0f8401 100644

package/Config.in menu "Networking" · line 1159

Quoted 4 lines
package/Config.in +1 -0
@@ -1156,6 +1156,7 @@ menu "Networking"
 	source "package/c-ares/Config.in"
 	source "package/canfestival/Config.in"
 	source "package/cgic/Config.in"
+    source "package/cpprestsdk/Config.in"

indent issue

Quoted 53 lines
package/Config.in +0 -0
 	source "package/cppzmq/Config.in"
 	source "package/czmq/Config.in"
 	source "package/filemq/Config.in"
package/cpprestsdk/Config.in new file +27 -0
new file mode 100644
index 0000000..7b95d31
@@ -0,0 +1,27 @@
+config BR2_PACKAGE_CPPRESTSDK
+        bool "cpprestsdk"
+        depends on BR2_INSTALL_LIBSTDCPP
+        depends on BR2_USE_WCHAR
+        depends on BR2_TOOLCHAIN_HAS_THREADS
+        select BR2_PACKAGE_BOOST
+        select BR2_PACKAGE_BOOST_CHRONO
+        select BR2_PACKAGE_BOOST_FILESYSTEM
+        select BR2_PACKAGE_BOOST_RANDOM
+        select BR2_PACKAGE_BOOST_REGEX
+        select BR2_PACKAGE_BOOST_SYSTEM
+        select BR2_PACKAGE_BOOST_THREAD
+        select BR2_PACKAGE_OPENSSL
+        select BR2_PACKAGE_PKGCONF
+        select BR2_PACKAGE_ZLIB
+        help
+          The C++ REST SDK is a Microsoft project for 
+          cloud-based client-server communication in 
+          native code using a modern asynchronous C++ API 
+          design. This project aims to help C++ developers 
+          connect to and interact with services.
+          
+          https://github.com/Microsoft/cpprestsdk
+
+comment "clogics needs a toolchain w/ C++, wchar, threads"
+        depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR
+
package/cpprestsdk/cpprestsdk.hash new file +1 -0
new file mode 100644
index 0000000..200f05a
@@ -0,0 +1 @@
+sha256  3d1c38aa7ef34b3d3e9a6e84d3866554fe48c3d9d9977896d18a7cfb80d5a4ea    cpprestsdk-v2.8.0.tar.gz
package/cpprestsdk/cpprestsdk.mk new file +4 -0
new file mode 100644
index 0000000..d7509f8
@@ -0,0 +1,25 @@
+################################################################################
+#
+## cpprestsdk
+#

package/cpprestsdk/cpprestsdk.mk line 14

Quoted 10 lines
package/cpprestsdk/cpprestsdk.mk new file +10 -0
+#################################################################################
+
+CPPRESTSDK_VERSION = v2.8.0
+CPPRESTSDK_SITE = $(call github,Microsoft,cpprestsdk,$(CPPRESTSDK_VERSION))
+CPPRESTSDK_INSTALL_STAGING = YES
+
+CPPRESTSDK_DEPENDENCIES = boost openssl zlib
+
+ifeq ($(BR2_PACKAGE_WEBSOCKETPP),y)
+	CPPRESTSDK_DEPENDENCIES += websocketpp

no need to indent

Add CPPRESTSDK_CONF_OPTS = -DCPPREST_EXCLUDE_WEBSOCKETS=OFF

package/cpprestsdk/cpprestsdk.mk line 17

Quoted 3 lines
package/cpprestsdk/cpprestsdk.mk new file +3 -0
+else
+	CPPRESTSDK_CONF_OPTS = -DCPPREST_EXCLUDE_WEBSOCKETS=ON
+endif

cpprestsdk doesn't build with musl due to missing xlocale.h. Care to take a look ?

Best regards,
Romain

Quoted 9 lines
package/cpprestsdk/cpprestsdk.mk new file +8 -0
+
+
+CPPRESTSDK_SUBDIR = Release
+
+CPPRESTSDK_CONF_OPTS += -DBUILD_SAMPLES=OFF
+
+$(eval $(cmake-package))
+
#3 lore raw

PATCH 2/2 cpprestsdk: new package

In reply to Pieter De Gendt

Pieter, All,

Besides comments by Romain, here are mines:

On 2016-09-02 15:42 +0200, Pieter De Gendt spake thusly:

Quoted 1 line

[--SNIP--]

package/cpprestsdk/Config.in line 5

Quoted 11 lines
package/cpprestsdk/Config.in new file +5 -0
new file mode 100644
index 0000000..7b95d31
@@ -0,0 +1,27 @@
+config BR2_PACKAGE_CPPRESTSDK
+        bool "cpprestsdk"
+        depends on BR2_INSTALL_LIBSTDCPP
+        depends on BR2_USE_WCHAR
+        depends on BR2_TOOLCHAIN_HAS_THREADS

Are those three dependencies needed for cpprestsdk itself, or are they inherited from the boost dependencies?

Is the latter, then you need to say so:

depends on BR2_INSTALL_LIBSTDCPP # boost
depends on BR2_USE_WCHAR # boost
depends on BR2_TOOLCHAIN_HAS_THREADS # boost

If not, then that's OK the way you did.

package/cpprestsdk/Config.in line 14

Quoted 9 lines
package/cpprestsdk/Config.in new file +9 -0
+        select BR2_PACKAGE_BOOST
+        select BR2_PACKAGE_BOOST_CHRONO
+        select BR2_PACKAGE_BOOST_FILESYSTEM
+        select BR2_PACKAGE_BOOST_RANDOM
+        select BR2_PACKAGE_BOOST_REGEX
+        select BR2_PACKAGE_BOOST_SYSTEM
+        select BR2_PACKAGE_BOOST_THREAD
+        select BR2_PACKAGE_OPENSSL
+        select BR2_PACKAGE_PKGCONF

Do you mean that pkgconf is needed on the target at runtime?

I doubt it is. What is needed is only the host variant, no?

package/cpprestsdk/Config.in line 23

Quoted 9 lines
package/cpprestsdk/Config.in new file +9 -0
+        select BR2_PACKAGE_ZLIB
+        help
+          The C++ REST SDK is a Microsoft project for 
+          cloud-based client-server communication in 
+          native code using a modern asynchronous C++ API 
+          design. This project aims to help C++ developers 
+          connect to and interact with services.
+          
+          https://github.com/Microsoft/cpprestsdk

Incorrect indentation: it should one leading TAB for all keywords (bool, depends on, select, help) and a TAB plus two spaces for the help text itself.

package/cpprestsdk/Config.in line 26

Quoted 2 lines
package/cpprestsdk/Config.in new file +2 -0
+comment "clogics needs a toolchain w/ C++, wchar, threads"
+        depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR

Ditto, indentation.

Quoted 13 lines
package/cpprestsdk/cpprestsdk.hash new file +1 -0
new file mode 100644
index 0000000..200f05a
@@ -0,0 +1 @@
+sha256  3d1c38aa7ef34b3d3e9a6e84d3866554fe48c3d9d9977896d18a7cfb80d5a4ea    cpprestsdk-v2.8.0.tar.gz
package/cpprestsdk/cpprestsdk.mk new file +0 -0
new file mode 100644
index 0000000..d7509f8

package/cpprestsdk/cpprestsdk.mk line 9

Quoted 9 lines
package/cpprestsdk/cpprestsdk.mk new file +9 -0
@@ -0,0 +1,25 @@
+################################################################################
+#
+## cpprestsdk
+#
+#################################################################################
+
+CPPRESTSDK_VERSION = v2.8.0
+CPPRESTSDK_SITE = $(call github,Microsoft,cpprestsdk,$(CPPRESTSDK_VERSION))
+CPPRESTSDK_INSTALL_STAGING = YES

License and licen files? Again, it does not look like it is easy:

CPPRESTSDK_LICENSE = Apache 2.0, OpenSSL License, BSD-3c, Boost Software License 1.0 CPPRESTSDK_LICENSE_FILES = license.txt ThirdPartyNotices.txt

package/cpprestsdk/cpprestsdk.mk line 11

Quoted 1 line
package/cpprestsdk/cpprestsdk.mk new file +1 -0
+CPPRESTSDK_DEPENDENCIES = boost openssl zlib

You also need to depend on host-pkgconf, since it is used to find websocketpp.

package/cpprestsdk/cpprestsdk.mk line 22

Quoted 9 lines
package/cpprestsdk/cpprestsdk.mk new file +8 -0
+ifeq ($(BR2_PACKAGE_WEBSOCKETPP),y)
+	CPPRESTSDK_DEPENDENCIES += websocketpp
+else
+	CPPRESTSDK_CONF_OPTS = -DCPPREST_EXCLUDE_WEBSOCKETS=ON
+endif
 
+CPPRESTSDK_SUBDIR = Release
+
+CPPRESTSDK_CONF_OPTS += -DBUILD_SAMPLES=OFF

Usually, we try to have the non-conditional options go first, then the conditional ones:

    CPPRESTSDK_CONF_OPTS = -DBUILD_SAMPLES=OFF

    ifeq ($(BR2_PACKAGE_WEBSOCKETPP),y) 
    CPPRESTSDK_DEPENDENCIES += websocketpp
    else
    CPPRESTSDK_CONF_OPTS += -DCPPREST_EXCLUDE_WEBSOCKETS=ON
    endif

Regards,
Yann E. MORIN.

Quoted 9 lines

+$(eval $(cmake-package))
+

Signature · 6 lines
2.9.3

_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/2 websocketpp: new package

In reply to Pieter De Gendt

Hi Pieter,

Le 02/09/2016 ? 15:42, Pieter De Gendt a ?crit :

Quoted 79 lines
---
 package/Config.in                                  |  1 +
 .../websocketpp/0001-Fix-cmake-cross-compile.patch | 42 ++++++++++++++++++++++
 package/websocketpp/Config.in                      | 14 ++++++++
 package/websocketpp/websocketpp.hash               |  1 +
 package/websocketpp/websocketpp.mk                 | 15 ++++++++
 5 files changed, 73 insertions(+)
 create mode 100644 package/websocketpp/0001-Fix-cmake-cross-compile.patch
 create mode 100644 package/websocketpp/Config.in
 create mode 100644 package/websocketpp/websocketpp.hash
 create mode 100644 package/websocketpp/websocketpp.mk
package/Config.in +1 -0
index 1e51a45..3fe55b4 100644
@@ -1242,6 +1242,7 @@ menu "Networking"
 	source "package/sofia-sip/Config.in"
 	source "package/thrift/Config.in"
 	source "package/usbredir/Config.in"
+	source "package/websocketpp/Config.in"
 	source "package/wvstreams/Config.in"
 	source "package/zeromq/Config.in"
 	source "package/zmqpp/Config.in"
package/websocketpp/0001-Fix-cmake-cross-compile.patch new file +42 -0
new file mode 100644
index 0000000..cbaa9e9
@@ -0,0 +1,42 @@
+From 1be867f214cf86d48be13603511dafe75afe8d8e Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Fri, 2 Sep 2016 14:44:55 +0200
+Subject: [PATCH] cmake: install correct .cmake files
+
+Currently, we install a .cmake file (so that other packages can find us)
+that sets the include path to /usr/include.
+
+This does not work in cross-compilation, as it points to the build
+machine headers, so is not correct for cross-compilation, for two
+reasons:
+  - websocketpp might not be installed on the build machine,
+  - it might be installed as a different version.
+
+Thus, we need to let cmake find the correct include path.
+
+We do so by searching the include directory that contains a specific
+file of our own; we choose websocketpp/version.h as the file to look
+for.
+
+This then properly sets the include path, which is even often uneeded
+as it will be the standard search path (either /usr/include for native
+builds, or .../sysroot/usr/include for cross builds).
+
+Thanks to Samuel for hinting me at find_path(). :-)
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+Cc: Samuel Martin <[email protected]>
+---
+ websocketpp-config.cmake.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/websocketpp-config.cmake.in b/websocketpp-config.cmake.in
+index 6afe569..4c4ed5f 100644
+--- a/websocketpp-config.cmake.in
++++ b/websocketpp-config.cmake.in
+@@ -4,4 +4,4 @@
+ #  WEBSOCKETPP_INCLUDE_DIR - include directories
+ 
+ set(WEBSOCKETPP_FOUND TRUE)
+-set(WEBSOCKETPP_INCLUDE_DIR "@INSTALL_INCLUDE_DIR@")
++find_path(WEBSOCKETPP_INCLUDE_DIR "websocketpp/version.hpp")
package/websocketpp/Config.in new file +0 -0
new file mode 100644
index 0000000..97df9fd

package/websocketpp/Config.in line 6

Quoted 6 lines
package/websocketpp/Config.in new file +6 -0
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_WEBSOCKETPP
+	bool "websocketpp"
+	select BR2_PACKAGE_ZLIB
+	depends on BR2_PACKAGE_BOOST
+	depends on BR2_PACKAGE_BOOST_SYSTEM
+	depends on BR2_PACKAGE_BOOST_RANDOM

Like gnuradio package, you can use "select" instead of "depends on" for boost package dependecy.

Add select BR2_BOOST_THREAD maybe ?
websocketpp/common/thread.hpp: #include <boost/thread.hpp>
Add select BR2_BOOST_CHRONO maybe ?
websocketpp/common/chrono.hpp: #include <boost/chrono.hpp>

But it seems these dependency are required only if the toolchains doesn't have C++11 support. Otherwise the C++11 chrono/thread header is preferred over the boost one.

// If we've determined that we're in full C++11 mode and the user hasn't // explicitly disabled the use of C++11 functional header, then prefer it to // boost.

#if defined _WEBSOCKETPP_CPP11_INTERNAL_ && !defined _WEBSOCKETPP_NO_CPP11_CHRONO_
    #ifndef _WEBSOCKETPP_CPP11_CHRONO_
        #define _WEBSOCKETPP_CPP11_CHRONO_
    #endif

#endif

[...]

#ifdef _WEBSOCKETPP_CPP11_CHRONO_
    #include <chrono>
#else
    #include <boost/chrono.hpp>

#endif

So, websocket package should take into account BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 or BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 for C++11 dependencies.

Quoted 21 lines
package/websocketpp/Config.in new file +8 -0
+	help
+	  WebSocket++ is a header only C++ library that implements
+	  RFC6455 The WebSocket Protocol. It allows integrating
+	  WebSocket client and server functionality into C++ programs.
+	  It uses interchangeable network transport modules including
+	  one based on C++ iostreams and one based on Boost Asio.
+
+	  http://www.zaphoyd.com/websocketpp
package/websocketpp/websocketpp.hash new file +1 -0
new file mode 100644
index 0000000..49496ca
@@ -0,0 +1 @@
+sha256  07b3364ad30cda022d91759d4b83ff902e1ebadb796969e58b59caa535a03923    websocketpp-0.7.0.tar.gz
package/websocketpp/websocketpp.mk new file +0 -0
new file mode 100644
index 0000000..e4f729b

package/websocketpp/websocketpp.mk line 9

Quoted 9 lines
package/websocketpp/websocketpp.mk new file +9 -0
@@ -0,0 +1,15 @@
+################################################################################
+#
+# websocketpp
+#
+################################################################################
+
+WEBSOCKETPP_VERSION = 0.7.0
+WEBSOCKETPP_SITE = $(call github,zaphoyd,websocketpp,$(WEBSOCKETPP_VERSION))
+WEBSOCKETPP_LICENSE = BSD

websocketpp use several license like MIT as noticed by Manuel Gro? in
http://patchwork.ozlabs.org/patch/659477

package/websocketpp/websocketpp.mk line 11

Quoted 2 lines
package/websocketpp/websocketpp.mk new file +2 -0
+WEBSOCKETPP_LICENSE_FILES = COPYING
+WEBSOCKETPP_DEPENDENCIES = zlib

websocketpp doesn't build anything (header only package), there is no need to add zlib as build dependency.

package/websocketpp/websocketpp.mk line 13

Quoted 2 lines
package/websocketpp/websocketpp.mk new file +2 -0
+WEBSOCKETPP_INSTALL_STAGING = YES
+WEBSOCKETPP_DEPENDENCIES = host-pkgconf boost
                            ^^

Use += here otherwise zlib dependency is dropped.

I don't see where pkg-config is used in the Buildsystem, I think it's not needed.

Like for zlib, I beleve that boost build dependency can be removed here. Boost and zlib should be added to the package using websocketpp headers.

Best regards,
Romain

Quoted 3 lines
package/websocketpp/websocketpp.mk new file +2 -0
+
+$(eval $(cmake-package))
#5 lore raw

PATCH 1/2 websocketpp: new package

Romain, Pieter, All,

On 2016-09-03 19:43 +0200, Romain Naour spake thusly:

Quoted 2 lines

Le 02/09/2016 ? 15:42, Pieter De Gendt a ?crit :

Quoted 1 line

[--SNIP--]

Quoted 27 lines
Quoted 27 lines
package/websocketpp/0001-Fix-cmake-cross-compile.patch new file +21 -0
new file mode 100644
index 0000000..cbaa9e9
@@ -0,0 +1,42 @@
+From 1be867f214cf86d48be13603511dafe75afe8d8e Mon Sep 17 00:00:00 2001
+From: "Yann E. MORIN" <[email protected]>
+Date: Fri, 2 Sep 2016 14:44:55 +0200
+Subject: [PATCH] cmake: install correct .cmake files
+
+Currently, we install a .cmake file (so that other packages can find us)
+that sets the include path to /usr/include.
+
+This does not work in cross-compilation, as it points to the build
+machine headers, so is not correct for cross-compilation, for two
+reasons:
+  - websocketpp might not be installed on the build machine,
+  - it might be installed as a different version.
+
+Thus, we need to let cmake find the correct include path.
+
+We do so by searching the include directory that contains a specific
+file of our own; we choose websocketpp/version.h as the file to look
+for.
+
+This then properly sets the include path, which is even often uneeded
Quoted 8 lines

package/websocketpp/0001-Fix-cmake-cross-compile.patch line 29

Quoted 8 lines
package/websocketpp/0001-Fix-cmake-cross-compile.patch new file +8 -0
+as it will be the standard search path (either /usr/include for native
+builds, or .../sysroot/usr/include for cross builds).
+
+Thanks to Samuel for hinting me at find_path(). :-)
+
+Signed-off-by: "Yann E. MORIN" <[email protected]>
+Cc: Samuel Martin <[email protected]>
+---

Here, you should add a pointer to the upstream merge-request on github, for reference.

Quoted 11 lines

package/websocketpp/Config.in line 5

Quoted 11 lines
package/websocketpp/Config.in new file +5 -0
new file mode 100644
index 0000000..97df9fd
@@ -0,0 +1,14 @@
+config BR2_PACKAGE_WEBSOCKETPP
+	bool "websocketpp"
+	select BR2_PACKAGE_ZLIB
+	depends on BR2_PACKAGE_BOOST
+	depends on BR2_PACKAGE_BOOST_SYSTEM

Why do you absolutely need BR2_PACKAGE_BOOST_SYSTEM?

Quoted 4 lines

package/websocketpp/Config.in line 6

Quoted 1 line
package/websocketpp/Config.in new file +1 -0
+	depends on BR2_PACKAGE_BOOST_RANDOM

Like gnuradio package, you can use "select" instead of "depends on" for boost package dependecy.

Unfortunately, if the "system" layout is required, you can not select Boost and depend on the system option, or you'd get a circular dependency.

So what Pieter did (assuming the "system" layout is mandatory) is correct.

Quoted 8 lines

Add select BR2_BOOST_THREAD maybe ?
websocketpp/common/thread.hpp: #include <boost/thread.hpp>
Add select BR2_BOOST_CHRONO maybe ?
websocketpp/common/chrono.hpp: #include <boost/chrono.hpp>

But it seems these dependency are required only if the toolchains doesn't have C++11 support. Otherwise the C++11 chrono/thread header is preferred over the boost one.

Even so, it is better to just require these two dependencies.

Boost is a (almost) headers-only stuff, so adding more would not enlarge the rootfs (at least not by much, if at all).

Quoted 11 lines

// If we've determined that we're in full C++11 mode and the user hasn't // explicitly disabled the use of C++11 functional header, then prefer it to // boost.

#if defined _WEBSOCKETPP_CPP11_INTERNAL_ && !defined _WEBSOCKETPP_NO_CPP11_CHRONO_
    #ifndef _WEBSOCKETPP_CPP11_CHRONO_
        #define _WEBSOCKETPP_CPP11_CHRONO_
    #endif

#endif

[...]

Quoted 8 lines
#ifdef _WEBSOCKETPP_CPP11_CHRONO_
    #include <chrono>
#else
    #include <boost/chrono.hpp>

#endif

So, websocket package should take into account BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 or BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 for C++11 dependencies.

Or maybe not: if gcc is recent enough, websocketpp will use C++11 stuff, and fallback to Boost if C++11 is not available. No?

[--SNIP--]

Quoted 10 lines
Quoted 10 lines
package/websocketpp/websocketpp.mk new file +4 -0
new file mode 100644
index 0000000..e4f729b
@@ -0,0 +1,15 @@
+################################################################################
+#
+# websocketpp
+#
Quoted 8 lines

package/websocketpp/websocketpp.mk line 9

Quoted 5 lines
package/websocketpp/websocketpp.mk new file +5 -0
+################################################################################
+
+WEBSOCKETPP_VERSION = 0.7.0
+WEBSOCKETPP_SITE = $(call github,zaphoyd,websocketpp,$(WEBSOCKETPP_VERSION))
+WEBSOCKETPP_LICENSE = BSD

websocketpp use several license like MIT as noticed by Manuel Gro? in
http://patchwork.ozlabs.org/patch/659477

So, this is more than that, as seen in the COPYING file:

WEBSOCKETPP_LICENSE = BSD-3c, MIT, zlib license

Quoted 5 lines

package/websocketpp/websocketpp.mk line 11

Quoted 2 lines
package/websocketpp/websocketpp.mk new file +2 -0
+WEBSOCKETPP_LICENSE_FILES = COPYING
+WEBSOCKETPP_DEPENDENCIES = zlib

websocketpp doesn't build anything (header only package), there is no need to add zlib as build dependency.

Not sure, see below...

Quoted 1 line

package/websocketpp/websocketpp.mk line 12

Quoted 1 line
package/websocketpp/websocketpp.mk new file +1 -0
+WEBSOCKETPP_INSTALL_STAGING = YES

Since it only installs headers:

# Only installs headers
WEBSOCKETPP_INSTALL_TARGET = NO

Quoted 3 lines

package/websocketpp/websocketpp.mk line 13

Quoted 1 line
package/websocketpp/websocketpp.mk new file +1 -0
+WEBSOCKETPP_DEPENDENCIES = host-pkgconf boost
                            ^^

Use += here otherwise zlib dependency is dropped.

And there should be only one dependency line, as there's nothing conditional here:

WEBSOCKETPP_DEPENDENCIES = host-pkgconf boost zlib

However, I would say that, if a package needs websocketpp but does not need zilb, that package should not need to add a dependency on zlib. Yet, zlib must be built before that pacakge.

So I would say that the depednency on zlib and boost is correct. They are not needed at build =time (there's actually no build), but that's
irrelevant: they need to be available in staging as soon as websocketpp is.

Quoted 1 line

I don't see where pkg-config is used in the Buildsystem, I think it's not needed.

Line 205 in CMakeList.txt:

    205  find_package (Boost 1.39.0 COMPONENTS "${WEBSOCKETPP_BOOST_LIBS}")

(find_package() is the pkg-config stuff in cmake, right?)

Quoted 2 lines

Like for zlib, I beleve that boost build dependency can be removed here. Boost and zlib should be added to the package using websocketpp headers.

I don't think so; see above.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 1/2 websocketpp: new package

In reply to Pieter De Gendt

Hello Pieter,

Quoted 1 line · Pieter De Gendt

You received lots of review and comments on your two patches, adding websocketpp and cpprestsdk. Consequently, I've marked them as "Changes Requested" in our patch tracking system, which means we will no longer see them in our TODO list of patches to apply. Therefore, it would be great if you could submit an updated version of those patches with the changes suggested by the reviewers.

Thanks!

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com