mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
From: Ian Abbott <abbotti@mev.co.uk>
To: ptxdist@pengutronix.de
Cc: Ian Abbott <abbotti@mev.co.uk>
Subject: [ptxdist] [PATCH v2 1/2] libwebsockets: new package
Date: Mon, 13 May 2024 11:36:58 +0100	[thread overview]
Message-ID: <20240513103808.21385-2-abbotti@mev.co.uk> (raw)
In-Reply-To: <20240513103808.21385-1-abbotti@mev.co.uk>

Includes the C library from the Libwebsockets (LWS) project, with
options for adding TLS (SSL) support, and options the adding various
event loop libraries that are dynamically loaded as plug-ins.

Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
---
v2: Get sources from github instead of libwebsockets.org's own git
server due to unreliable, on-the-fly generated tarballs from the latter.
---
 rules/libwebsockets.in   | 56 ++++++++++++++++++++++++++
 rules/libwebsockets.make | 85 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 141 insertions(+)
 create mode 100644 rules/libwebsockets.in
 create mode 100644 rules/libwebsockets.make

diff --git a/rules/libwebsockets.in b/rules/libwebsockets.in
new file mode 100644
index 000000000..e10413604
--- /dev/null
+++ b/rules/libwebsockets.in
@@ -0,0 +1,56 @@
+## SECTION=networking
+
+menuconfig LIBWEBSOCKETS
+	tristate
+	select HOST_CMAKE
+	select ZLIB
+	select LIBCAP
+	select OPENSSL		if LIBWEBSOCKETS_TLS
+	select LIBEV		if LIBWEBSOCKETS_LIBEV
+	select LIBUV		if LIBWEBSOCKETS_LIBUV
+	select LIBEVENT		if LIBWEBSOCKETS_LIBEVENT
+	select GLIB		if LIBWEBSOCKETS_GLIB
+	prompt "libwebsockets                 "
+	help
+	  Libwebsockets is a lightweight pure C library for both
+	  websockets clients and servers built to use minimal CPU
+	  and memory resources and provide fast throughput in both
+	  directions.
+
+if LIBWEBSOCKETS
+
+config LIBWEBSOCKETS_TLS
+	bool
+	prompt "TLS (SSL) support"
+	help
+	  Turn on to include TLS (SSL) support.
+
+menuconfig LIBWEBSOCKETS_EVLIB
+	bool
+	prompt "Event library options          "
+	help
+	  Turn on to enable various event library plug-ins.
+
+if LIBWEBSOCKETS_EVLIB
+
+config LIBWEBSOCKETS_LIBEV
+	bool
+	prompt "compile with support for libev"
+
+config LIBWEBSOCKETS_LIBUV
+	bool
+	prompt "compile with support for libuv"
+
+config LIBWEBSOCKETS_LIBEVENT
+	bool
+	prompt "compile with support for libevent"
+
+config LIBWEBSOCKETS_GLIB
+	bool
+	prompt "compile with support for glib event loop"
+
+endif
+
+endif
+
+# vim: ft=kconfig noet tw=72
diff --git a/rules/libwebsockets.make b/rules/libwebsockets.make
new file mode 100644
index 000000000..9203b308d
--- /dev/null
+++ b/rules/libwebsockets.make
@@ -0,0 +1,85 @@
+# -*-makefile-*-
+#
+# Copyright (C) 2024 by Ian Abbott <abbotti@mev.co.uk>
+#
+# For further information about the PTXdist project and license conditions
+# see the README file.
+#
+
+#
+# We provide this package
+#
+PACKAGES-$(PTXCONF_LIBWEBSOCKETS) += libwebsockets
+
+#
+# Paths and names
+#
+LIBWEBSOCKETS_VERSION		:= 4.3.3
+LIBWEBSOCKETS_MD5		:= c078b08b712316f6302f54a9d05273ae
+LIBWEBSOCKETS			:= libwebsockets-$(LIBWEBSOCKETS_VERSION)
+LIBWEBSOCKETS_SUFFIX		:= tar.gz
+LIBWEBSOCKETS_URL		:= https://github.com/warmcat/libwebsockets/archive/refs/tags/v$(LIBWEBSOCKETS_VERSION).$(LIBWEBSOCKETS_SUFFIX)
+LIBWEBSOCKETS_SOURCE		:= $(SRCDIR)/$(LIBWEBSOCKETS).$(LIBWEBSOCKETS_SUFFIX)
+LIBWEBSOCKETS_DIR		:= $(BUILDDIR)/$(LIBWEBSOCKETS)
+LIBWEBSOCKETS_LICENSE		:= MIT AND BSD-2-Clause AND BSD-3-Clause
+LIBWEBSOCKETS_LICENSE_FILES	:= file://LICENSE;md5=382bfdf329e774859fd401eaf850d29b
+
+# ----------------------------------------------------------------------------
+# Prepare
+# ----------------------------------------------------------------------------
+
+#
+# cmake
+#
+LIBWEBSOCKETS_CONF_TOOL	:= cmake
+LIBWEBSOCKETS_CONF_OPT	:=  \
+	$(CROSS_CMAKE_USR) \
+	-DLWS_WITHOUT_DAEMONIZE=OFF \
+	-DLWS_WITH_ZLIB=ON \
+	-DLWS_WITH_SSL=$(call ptx/onoff, PTXCONF_LIBWEBSOCKETS_TLS) \
+	-DLWS_WITH_LIBEV=$(call ptx/onoff, PTXCONF_LIBWEBSOCKETS_LIBEV) \
+	-DLWS_WITH_LIBUV=$(call ptx/onoff, PTXCONF_LIBWEBSOCKETS_LIBUV) \
+	-DLWS_WITH_LIBEVENT=$(call ptx/onoff, PTXCONF_LIBWEBSOCKETS_LIBEVENT) \
+	-DLWS_WITH_GLIB=$(call ptx/onoff, PTXCONF_LIBWEBSOCKETS_GLIB) \
+	-DLWS_WITHOUT_TESTAPPS=ON \
+	-DLWS_WITHOUT_TEST_PING=ON \
+	-DLWS_WITHOUT_TEST_CLIENT=ON \
+	-DLWS_WITHOUT_EXTENSIONS=OFF \
+	-DLWS_WITH_EXTERNAL_POLL=ON \
+	-DLWS_IPV6=$(call ptx/onoff, PTXCONF_GLOBAL_IPV6)
+
+# ----------------------------------------------------------------------------
+# Target-Install
+# ----------------------------------------------------------------------------
+
+$(STATEDIR)/libwebsockets.targetinstall:
+	@$(call targetinfo)
+
+	@$(call install_init, libwebsockets)
+	@$(call install_fixup, libwebsockets,PRIORITY,optional)
+	@$(call install_fixup, libwebsockets,SECTION,base)
+	@$(call install_fixup, libwebsockets,AUTHOR,"Ian Abbott <abbotti@mev.co.uk>")
+	@$(call install_fixup, libwebsockets,DESCRIPTION,missing)
+
+#	libraries
+	@$(call install_lib, libwebsockets, 0, 0, 0644, libwebsockets)
+
+#	plug-in libraries
+ifdef PTXCONF_LIBWEBSOCKETS_LIBEV
+	@$(call install_lib, libwebsockets, 0, 0, 0644, libwebsockets-evlib_ev)
+endif
+ifdef PTXCONF_LIBWEBSOCKETS_LIBUV
+	@$(call install_lib, libwebsockets, 0, 0, 0644, libwebsockets-evlib_uv)
+endif
+ifdef PTXCONF_LIBWEBSOCKETS_LIBEVENT
+	@$(call install_lib, libwebsockets, 0, 0, 0644, libwebsockets-evlib_event)
+endif
+ifdef PTXCONF_LIBWEBSOCKETS_GLIB
+	@$(call install_lib, libwebsockets, 0, 0, 0644, libwebsockets-evlib_glib)
+endif
+
+	@$(call install_finish, libwebsockets)
+
+	@$(call touch)
+
+# vim: syntax=make
-- 
2.43.0




  reply	other threads:[~2024-05-13 10:38 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-10  8:58 [ptxdist] [PATCH 0/2] Add WebSocket support to Mosquitto Ian Abbott
2024-05-10  8:58 ` [ptxdist] [PATCH 1/2] libwebsockets: new package Ian Abbott
2024-05-13  9:11   ` Michael Olbrich
2024-05-13  9:20     ` Ian Abbott
2024-05-10  8:58 ` [ptxdist] [PATCH 2/2] mosquitto: Add optional WebSocket support Ian Abbott
2024-05-13 10:36 ` [ptxdist] [PATCH v2 0/2] Add WebSocket support to Mosquitto Ian Abbott
2024-05-13 10:36   ` Ian Abbott [this message]
2024-05-31  6:08     ` [ptxdist] [APPLIED] libwebsockets: new package Michael Olbrich
2024-05-13 10:36   ` [ptxdist] [PATCH v2 2/2] mosquitto: Add optional WebSocket support Ian Abbott
2024-05-31  6:08     ` [ptxdist] [APPLIED] " Michael Olbrich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240513103808.21385-2-abbotti@mev.co.uk \
    --to=abbotti@mev.co.uk \
    --cc=ptxdist@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox