[packages/websocketpp] - new, based on Fedora package + github patch for boost 1.70 compatibility

qboosh qboosh at pld-linux.org
Sat May 11 21:18:34 CEST 2019


commit 6313f9e602504d6c57a477e3ea1859febf888af3
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat May 11 21:18:58 2019 +0200

    - new, based on Fedora package + github patch for boost 1.70 compatibility

 websocketpp-boost.patch                            |  75 +++++++++++++++
 ...ocketpp-cmake-configversion-compatibility.patch |  23 +++++
 websocketpp-cmake_noarch.patch                     |  15 +++
 websocketpp-fix_version.patch                      |  22 +++++
 websocketpp-tests.patch                            |  49 ++++++++++
 websocketpp.pc                                     |   9 ++
 websocketpp.spec                                   | 106 +++++++++++++++++++++
 7 files changed, 299 insertions(+)
---
diff --git a/websocketpp.spec b/websocketpp.spec
new file mode 100644
index 0000000..676618b
--- /dev/null
+++ b/websocketpp.spec
@@ -0,0 +1,106 @@
+#
+# Conditional build:
+%bcond_without	tests	# unit tests
+
+Summary:	C++ WebSocket Protocol Library
+Summary(pl.UTF-8):	Biblioteka C++ do obsługi protokołu WebSocket
+Name:		websocketpp
+Version:	0.8.1
+Release:	1
+License:	BSD
+Group:		Development/Libraries
+#Source0Download: https://github.com/zaphoyd/websocketpp/releases
+Source0:	https://github.com/zaphoyd/websocketpp/archive/%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	75e96b15ba1cb3b37175d58352c3a7fb
+Source1:	websocketpp.pc
+Patch0:		%{name}-cmake_noarch.patch
+Patch1:		%{name}-cmake-configversion-compatibility.patch
+Patch2:		%{name}-tests.patch
+Patch3:		%{name}-fix_version.patch
+# from https://github.com/zaphoyd/websocketpp/pull/814/commits/c769c9238ad62178f506038178714a1c35aa2769.patch
+Patch4:		%{name}-boost.patch
+URL:		https://www.zaphoyd.com/websocketpp/
+BuildRequires:	boost-devel >= 1.39
+BuildRequires:	cmake >= 2.8.8
+BuildRequires:	libstdc++-devel >= 6:4.7
+# for tests
+BuildRequires:	openssl-devel
+BuildRequires:	zlib-devel
+BuildArch:	noarch
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+WebSocket++ is an open source (BSD license) 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.
+
+%description -l pl.UTF-8
+WebSocket++ to mająca otwarte źródła (na licencji BSD), składająca się
+z samych nagłówków biblioteka C++ będąca implementacją protokołu
+WebSocket (RFC6455). Pozwala na integrowanie funkcjonalności klienta i
+serwera WebSocket w programach w C++. Wykorzystuje wymienne moduły
+transportu sieciowego, w tym jeden oparty na iostreams z C++ i jeden
+oparty o Boost Asio.
+
+%package devel
+Summary:	C++ WebSocket Protocol Library
+Summary(pl.UTF-8):	Biblioteka C++ do obsługi protokołu WebSocket
+Group:		Development/Libraries
+Requires:	boost-devel >= 1.39
+Requires:	libstdc++-devel >= 6:4.7
+
+%description devel
+WebSocket++ is an open source (BSD license) 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.
+
+%description devel -l pl.UTF-8
+WebSocket++ to mająca otwarte źródła (na licencji BSD), składająca się
+z samych nagłówków biblioteka C++ będąca implementacją protokołu
+WebSocket (RFC6455). Pozwala na integrowanie funkcjonalności klienta i
+serwera WebSocket w programach w C++. Wykorzystuje wymienne moduły
+transportu sieciowego, w tym jeden oparty na iostreams z C++ i jeden
+oparty o Boost Asio.
+
+%prep
+%setup -q
+%patch0 -p1
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+
+%build
+install -d build
+cd build
+%cmake .. \
+	%{?with_tests:-DBUILD_TESTS:BOOL=ON}
+
+%{__make}
+
+%if %{with tests}
+%{__make} test
+%endif
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} -C build install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+install -d $RPM_BUILD_ROOT%{_npkgconfigdir}
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_npkgconfigdir}/websocketpp.pc
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files devel
+%defattr(644,root,root,755)
+%doc COPYING changelog.md readme.md roadmap.md
+%{_includedir}/websocketpp
+%{_datadir}/cmake/websocketpp
+%{_npkgconfigdir}/websocketpp.pc
diff --git a/websocketpp-boost.patch b/websocketpp-boost.patch
new file mode 100644
index 0000000..cfdcf9b
--- /dev/null
+++ b/websocketpp-boost.patch
@@ -0,0 +1,75 @@
+From c769c9238ad62178f506038178714a1c35aa2769 Mon Sep 17 00:00:00 2001
+From: Stefan Floeren <42731906+stefan-floeren at users.noreply.github.com>
+Date: Tue, 16 Apr 2019 08:38:01 +0200
+Subject: [PATCH] Replace make_shared with new in some cases
+
+Replace make_shared for asio types that take a lib::ref as a parameter.
+This should fix the ASIO change (boostorg/asio at 59066d8) for 1.70,
+while keeping it backwards compatible to older boost versions.
+---
+ websocketpp/transport/asio/connection.hpp    | 7 ++++---
+ websocketpp/transport/asio/endpoint.hpp      | 3 +--
+ websocketpp/transport/asio/security/none.hpp | 3 +--
+ websocketpp/transport/asio/security/tls.hpp  | 3 +--
+ 4 files changed, 7 insertions(+), 9 deletions(-)
+
+diff --git a/websocketpp/transport/asio/connection.hpp b/websocketpp/transport/asio/connection.hpp
+index 60f88a79..1ccda8f3 100644
+--- a/websocketpp/transport/asio/connection.hpp
++++ b/websocketpp/transport/asio/connection.hpp
+@@ -311,9 +311,10 @@ class connection : public config::socket_type::socket_con_type {
+      * needed.
+      */
+     timer_ptr set_timer(long duration, timer_handler callback) {
+-        timer_ptr new_timer = lib::make_shared<lib::asio::steady_timer>(
+-            lib::ref(*m_io_service),
+-            lib::asio::milliseconds(duration)
++        timer_ptr new_timer(
++            new lib::asio::steady_timer(
++                *m_io_service,
++                lib::asio::milliseconds(duration))
+         );
+ 
+         if (config::enable_multithreading) {
+diff --git a/websocketpp/transport/asio/endpoint.hpp b/websocketpp/transport/asio/endpoint.hpp
+index ddab2c74..4b719a97 100644
+--- a/websocketpp/transport/asio/endpoint.hpp
++++ b/websocketpp/transport/asio/endpoint.hpp
+@@ -195,8 +195,7 @@ class endpoint : public config::socket_type {
+ 
+         m_io_service = ptr;
+         m_external_io_service = true;
+-        m_acceptor = lib::make_shared<lib::asio::ip::tcp::acceptor>(
+-            lib::ref(*m_io_service));
++        m_acceptor.reset(new lib::asio::ip::tcp::acceptor(*m_io_service));
+ 
+         m_state = READY;
+         ec = lib::error_code();
+diff --git a/websocketpp/transport/asio/security/none.hpp b/websocketpp/transport/asio/security/none.hpp
+index 5c8293db..6c7d3524 100644
+--- a/websocketpp/transport/asio/security/none.hpp
++++ b/websocketpp/transport/asio/security/none.hpp
+@@ -168,8 +168,7 @@ class connection : public lib::enable_shared_from_this<connection> {
+             return socket::make_error_code(socket::error::invalid_state);
+         }
+ 
+-        m_socket = lib::make_shared<lib::asio::ip::tcp::socket>(
+-            lib::ref(*service));
++        m_socket.reset(new lib::asio::ip::tcp::socket(*service));
+ 
+         if (m_socket_init_handler) {
+             m_socket_init_handler(m_hdl, *m_socket);
+diff --git a/websocketpp/transport/asio/security/tls.hpp b/websocketpp/transport/asio/security/tls.hpp
+index c76fd9aa..04ac3790 100644
+--- a/websocketpp/transport/asio/security/tls.hpp
++++ b/websocketpp/transport/asio/security/tls.hpp
+@@ -193,8 +193,7 @@ class connection : public lib::enable_shared_from_this<connection> {
+         if (!m_context) {
+             return socket::make_error_code(socket::error::invalid_tls_context);
+         }
+-        m_socket = lib::make_shared<socket_type>(
+-            _WEBSOCKETPP_REF(*service),lib::ref(*m_context));
++        m_socket.reset(new socket_type(*service, *m_context));
+ 
+         if (m_socket_init_handler) {
+             m_socket_init_handler(m_hdl, get_socket());
diff --git a/websocketpp-cmake-configversion-compatibility.patch b/websocketpp-cmake-configversion-compatibility.patch
new file mode 100644
index 0000000..29868ed
--- /dev/null
+++ b/websocketpp-cmake-configversion-compatibility.patch
@@ -0,0 +1,23 @@
+websocketpp-0.8.1-cmake-configversion-compatibility-anynewerversion.patch from Fedora:
+# Switch from ExactVersion to AnyNewerVersion to improve compatibility
+# https://cmake.org/cmake/help/v3.0/module/CMakePackageConfigHelpers.html
+# Fixes build failure of tomahawk, which uses "find_package(websocketpp 0.2.99 REQUIRED)"
+# PR submitted upstream: https://github.com/zaphoyd/websocketpp/pull/740
+# Disable check for same 32/64bit-ness in websocketpp-configVersion.cmake by setting CMAKE_SIZEOF_VOID_P
+# PR submitted upstream: https://github.com/zaphoyd/websocketpp/pull/770
+
+--- a/CMakeLists.txt	2018-10-31 13:58:03.000000000 +0100
++++ b/CMakeLists.txt	2018-10-31 14:21:06.251424022 +0100
+@@ -266,9 +266,11 @@
+   INSTALL_DESTINATION "${INSTALL_CMAKE_DIR}"
+   NO_CHECK_REQUIRED_COMPONENTS_MACRO
+ )
++# disable check for same 32/64bit-ness in websocketpp-configVersion.cmake by setting CMAKE_SIZEOF_VOID_P
++set (CMAKE_SIZEOF_VOID_P "")
+ write_basic_package_version_file("${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/websocketpp-configVersion.cmake"
+   VERSION ${WEBSOCKETPP_VERSION}
+-  COMPATIBILITY ExactVersion)
++  COMPATIBILITY AnyNewerVersion)
+ 
+ # Install the websocketpp-config.cmake and websocketpp-configVersion.cmake
+ install (FILES
diff --git a/websocketpp-cmake_noarch.patch b/websocketpp-cmake_noarch.patch
new file mode 100644
index 0000000..f8e2911
--- /dev/null
+++ b/websocketpp-cmake_noarch.patch
@@ -0,0 +1,15 @@
+websocketpp-0.7.0-cmake_noarch.patch from Fedora
+# put cmake files in share/cmake instead of lib/cmake
+
+diff -up websocketpp-0.7.0/CMakeLists.txt.cmake_noarch websocketpp-0.7.0/CMakeLists.txt
+--- websocketpp-0.7.0/CMakeLists.txt.cmake_noarch	2016-02-22 07:30:10.000000000 -0600
++++ websocketpp-0.7.0/CMakeLists.txt	2016-09-15 13:05:59.012179625 -0500
+@@ -19,7 +19,7 @@ set(INSTALL_INCLUDE_DIR include CACHE PA
+ if (WIN32 AND NOT CYGWIN)
+   set (DEF_INSTALL_CMAKE_DIR cmake)
+ else ()
+-  set (DEF_INSTALL_CMAKE_DIR lib/cmake/websocketpp)
++  set (DEF_INSTALL_CMAKE_DIR share/cmake/websocketpp)
+ endif ()
+ set (INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Installation directory for CMake files")
+ 
diff --git a/websocketpp-fix_version.patch b/websocketpp-fix_version.patch
new file mode 100644
index 0000000..bc65efb
--- /dev/null
+++ b/websocketpp-fix_version.patch
@@ -0,0 +1,22 @@
+From 4bccfb04a264704ec9b80ba332ee1cf113ce7f1b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Wolfgang=20St=C3=B6ggl?= <c72578 at yahoo.de>
+Date: Thu, 1 Nov 2018 20:58:10 +0100
+Subject: [PATCH] Update version number in CMakeLists.txt to 0.8.1
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 2786aba9..2d13117b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -24,7 +24,7 @@ endif ()
+ ############ Project name and version
+ set (WEBSOCKETPP_MAJOR_VERSION 0)
+ set (WEBSOCKETPP_MINOR_VERSION 8)
+-set (WEBSOCKETPP_PATCH_VERSION 0)
++set (WEBSOCKETPP_PATCH_VERSION 1)
+ set (WEBSOCKETPP_VERSION ${WEBSOCKETPP_MAJOR_VERSION}.${WEBSOCKETPP_MINOR_VERSION}.${WEBSOCKETPP_PATCH_VERSION})
+ 
+ if(POLICY CMP0048)
diff --git a/websocketpp-tests.patch b/websocketpp-tests.patch
new file mode 100644
index 0000000..bc691fb
--- /dev/null
+++ b/websocketpp-tests.patch
@@ -0,0 +1,49 @@
+websocketpp-0.7.0-disable-test_transport-test_transport_asio_timers.patch from Fedora:
+# Disable the following tests, which fail occasionally: test_transport, test_transport_asio_timers
+
+--- a/test/transport/CMakeLists.txt
++++ b/test/transport/CMakeLists.txt
+@@ -1,24 +1,24 @@
+ if (OPENSSL_FOUND)
+ 
+-# Test transport integration
+-file (GLOB SOURCE integration.cpp)
+-
+-init_target (test_transport)
+-build_test (${TARGET_NAME} ${SOURCE})
+-link_boost ()
+-link_openssl()
+-final_target ()
+-set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test")
+-
+-# Test transport asio timers
+-file (GLOB SOURCE asio/timers.cpp)
+-
+-init_target (test_transport_asio_timers)
+-build_test (${TARGET_NAME} ${SOURCE})
+-link_boost ()
+-link_openssl()
+-final_target ()
+-set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test")
++## Test transport integration
++#file (GLOB SOURCE integration.cpp)
++#
++#init_target (test_transport)
++#build_test (${TARGET_NAME} ${SOURCE})
++#link_boost ()
++#link_openssl()
++#final_target ()
++#set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test")
++#
++## Test transport asio timers
++#file (GLOB SOURCE asio/timers.cpp)
++#
++#init_target (test_transport_asio_timers)
++#build_test (${TARGET_NAME} ${SOURCE})
++#link_boost ()
++#link_openssl()
++#final_target ()
++#set_target_properties(${TARGET_NAME} PROPERTIES FOLDER "test")
+ 
+ # Test transport asio security
+ file (GLOB SOURCE asio/security.cpp)
diff --git a/websocketpp.pc b/websocketpp.pc
new file mode 100644
index 0000000..58f7548
--- /dev/null
+++ b/websocketpp.pc
@@ -0,0 +1,9 @@
+prefix=/usr
+exec_prefix=${prefix}
+includedir=${prefix}/include
+
+Name: websocketpp
+Description: WebSocket API
+Version: 0.8.1
+URL: https://www.zaphoyd.com/websocketpp/
+Cflags: -I${includedir}/
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/websocketpp.git/commitdiff/6313f9e602504d6c57a477e3ea1859febf888af3



More information about the pld-cvs-commit mailing list