[packages/wslay] - new

qboosh qboosh at pld-linux.org
Fri Jul 17 17:40:19 CEST 2026


commit 6cfcfa27629070c659407121384d4a583b3a80f5
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Fri Jul 17 17:40:17 2026 +0200

    - new

 wslay-nettle4.patch |  72 ++++++++++++++++++++++++++++++++++
 wslay.spec          | 110 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 182 insertions(+)
---
diff --git a/wslay.spec b/wslay.spec
new file mode 100644
index 0000000..9423063
--- /dev/null
+++ b/wslay.spec
@@ -0,0 +1,110 @@
+#
+# Conditional build:
+%bcond_without	static_libs	# static library
+#
+Summary:	Low-level WebSockets library
+Summary(pl.UTF-8):	Niskopoziomowa biblioteka WebSockets
+Name:		wslay
+Version:	1.1.1
+Release:	1
+License:	MIT
+Group:		Libraries
+#Source0Download: https://github.com/tatsuhiro-t/wslay/releases
+Source0:	https://github.com/tatsuhiro-t/wslay/releases/download/release-%{version}/%{name}-%{version}.tar.xz
+# Source0-md5:	bae6bc36d5808e5486110f4ac0128892
+Patch0:		%{name}-nettle4.patch
+URL:		https://github.com/tatsuhiro-t/wslay
+BuildRequires:	nettle-devel >= 2.4
+BuildRequires:	pkgconfig >= 1:0.20
+BuildRequires:	sphinx-pdg
+BuildRequires:	tar >= 1:1.22
+BuildRequires:	xz
+BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+
+%description
+Wslay is a WebSocket library written in C. It implements the protocol
+version 13 described in RFC 6455. This library offers 2 levels of API:
+event-based API and frame-based low-level API. For event-based API, it
+is suitable for non-blocking reactor pattern style. You can set
+callbacks in various events. For frame-based API, you can send
+WebSocket frame directly. Wslay only supports data transfer part of
+WebSocket protocol and does not perform opening handshake in HTTP.
+ 
+%description -l pl.UTF-8
+Wslay to biblioteka WebSocket napisana w C. Imlementuje wersję 13
+protokołu, opisaną w RFC 6455. Oferuje dwa poziomy API: oparte na
+zdarzeniach oraz niskopoziomowe, oparte na ramkach. API oparte na
+zdarzeniach nadaje się do wzorca nieblokujących reakcji. API oparte na
+ramkach pozwala wysyłać bezpośrednio ramki WebSocket. Wslay obsługuje
+tylko część protokołu WebSocket odpowiadającą za przesyłanie danych,
+nie wykonuje otwierającego powitania HTTP.
+
+%package devel
+Summary:	Header files for Wslay library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki Wslay
+Group:		Development/Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description devel
+Header files for Wslay library.
+
+%description devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki Wslay.
+
+%package static
+Summary:	Static Wslay library
+Summary(pl.UTF-8):	Statyczna biblioteka Wslay
+Group:		Development/Libraries
+Requires:	%{name}-devel = %{version}-%{release}
+
+%description static
+Static Wslay library.
+
+%description static -l pl.UTF-8
+Statyczna biblioteka Wslay.
+
+%prep
+%setup -q
+%patch -P0 -p1
+
+%build
+%configure \
+	%{!?with_static_libs:--disable-static}
+%{__make}
+
+%install
+rm -rf $RPM_BUILD_ROOT
+
+%{__make} install \
+	DESTDIR=$RPM_BUILD_ROOT
+
+# examples
+%{__rm} $RPM_BUILD_ROOT%{_bindir}/{echoserv,fork-echoserv,testclient}
+
+# no external dependencies, obsoleted by pkg-config
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libwslay.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%post	-p /sbin/ldconfig
+%postun	-p /sbin/ldconfig
+
+%files
+%defattr(644,root,root,755)
+%doc AUTHORS COPYING ChangeLog NEWS
+%{_libdir}/libwslay.so.*.*.*
+%ghost %{_libdir}/libwslay.so.0
+
+%files devel
+%defattr(644,root,root,755)
+%{_libdir}/libwslay.so
+%{_includedir}/wslay
+%{_pkgconfigdir}/libwslay.pc
+%{_mandir}/man3/wslay_event_*.3*
+
+%if %{with static_libs}
+%files static
+%defattr(644,root,root,755)
+%{_libdir}/libwslay.a
+%endif
diff --git a/wslay-nettle4.patch b/wslay-nettle4.patch
new file mode 100644
index 0000000..6c67d42
--- /dev/null
+++ b/wslay-nettle4.patch
@@ -0,0 +1,72 @@
+--- wslay-1.1.1/examples/fork-echoserv.c.orig	2020-06-20 09:00:03.000000000 +0200
++++ wslay-1.1.1/examples/fork-echoserv.c	2026-07-17 06:26:27.894066340 +0200
+@@ -53,7 +53,8 @@
+ #include <ctype.h>
+ 
+ #include <nettle/base64.h>
+-#include <nettle/sha.h>
++#include <nettle/sha1.h>
++#include <nettle/version.h>
+ #include <wslay/wslay.h>
+ 
+ /*
+@@ -127,7 +128,11 @@ void sha1(uint8_t *dst, const uint8_t *s
+   struct sha1_ctx ctx;
+   sha1_init(&ctx);
+   sha1_update(&ctx, src_length, src);
++#if NETTLE_VERSION_MAJOR >= 4
++  sha1_digest(&ctx, dst);
++#else
+   sha1_digest(&ctx, SHA1_DIGEST_SIZE, dst);
++#endif
+ }
+ 
+ /*
+--- wslay-1.1.1/examples/echoserv.cc.orig	2020-06-20 09:00:03.000000000 +0200
++++ wslay-1.1.1/examples/echoserv.cc	2026-07-17 06:27:26.007084848 +0200
+@@ -50,7 +50,8 @@
+ #include <fstream>
+ 
+ #include <nettle/base64.h>
+-#include <nettle/sha.h>
++#include <nettle/sha1.h>
++#include <nettle/version.h>
+ #include <wslay/wslay.h>
+ 
+ int create_listen_socket(const char *service)
+@@ -112,7 +113,11 @@ std::string sha1(const std::string& src)
+   sha1_init(&ctx);
+   sha1_update(&ctx, src.size(), reinterpret_cast<const uint8_t*>(src.c_str()));
+   uint8_t temp[SHA1_DIGEST_SIZE];
++#if NETTLE_VERSION_MAJOR >= 4
++  sha1_digest(&ctx, temp);
++#else
+   sha1_digest(&ctx, SHA1_DIGEST_SIZE, temp);
++#endif
+   std::string res(&temp[0], &temp[SHA1_DIGEST_SIZE]);
+   return res;
+ }
+--- wslay-1.1.1/examples/testclient.cc.orig	2020-06-20 09:00:03.000000000 +0200
++++ wslay-1.1.1/examples/testclient.cc	2026-07-17 06:28:22.583445014 +0200
+@@ -49,7 +49,8 @@
+ #include <fstream>
+ 
+ #include <nettle/base64.h>
+-#include <nettle/sha.h>
++#include <nettle/sha1.h>
++#include <nettle/version.h>
+ #include <wslay/wslay.h>
+ 
+ int connect_to(const char *host, const char *service)
+@@ -103,7 +104,11 @@ std::string sha1(const std::string& src)
+   sha1_init(&ctx);
+   sha1_update(&ctx, src.size(), reinterpret_cast<const uint8_t*>(src.c_str()));
+   uint8_t temp[SHA1_DIGEST_SIZE];
++#if NETTLE_VERSION_MAJOR >= 4
++  sha1_digest(&ctx, temp);
++#else
+   sha1_digest(&ctx, SHA1_DIGEST_SIZE, temp);
++#endif
+   std::string res(&temp[0], &temp[SHA1_DIGEST_SIZE]);
+   return res;
+ }
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/wslay.git/commitdiff/6cfcfa27629070c659407121384d4a583b3a80f5



More information about the pld-cvs-commit mailing list