# Maintainer: Jelle van der Waa <jelle@archlinux.org>
# Contributor: David Runge <dvzrv@archlinux.org>
# Contributor: Jingbei Li <i@jingbei.li>
pkgname=libwebsockets
pkgver=4.3.3
pkgrel=2
pkgdesc="C library for websocket clients and servers"
arch=(x86_64 'armv7h')
url="https://libwebsockets.org"
license=(MIT)
depends=(glibc openssl libuv libev zlib libcap)
makedepends=(cmake glib2)
provides=(libwebsockets.so)
source=($pkgname-$pkgver.tar.gz::https://github.com/warmcat/$pkgname/archive/v$pkgver.tar.gz)
sha512sums=('2ffd248ddf283369725097ca7410f947fe0389c360b329c76f0754afab4ba87c20a0687c5e7b8bd991b157f9d20c6faa3049757b3398e66d08662c3aa7ff9658')
b2sums=('24393e0238160767e77a428b1db8430ae5c6efa715e9d917a3fc64c8272e92c8617031c50a75adea4199d678f5ba752f49c24a5d9214aaf43d4e2349c03494ca')
build() {
# this uses malloc_usable_size, which is incompatible with fortification level 3
# https://github.com/warmcat/libwebsockets/pull/2977
# export CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
# export CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}"
cmake -D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=None \
-D DISABLE_WERROR=ON \
-D LWS_IPV6=ON \
-D LWS_LINK_TESTAPPS_DYNAMIC=ON \
-D LWS_WITH_ACME=ON \
-D LWS_WITH_DISKCACHE=ON \
-D LWS_WITH_EXTERNAL_POLL=ON \
-D LWS_WITH_FTS=ON \
-D LWS_WITH_GLIB=ON \
-D LWS_WITH_HTTP2=ON \
-D LWS_WITH_HTTP_PROXY=ON \
-D LWS_WITH_LIBEV=ON \
-D LWS_WITH_LIBEVENT=OFF \
-D LWS_WITH_LIBUV=ON \
-D LWS_WITH_LWSAC=ON \
-D LWS_WITH_RANGES=ON \
-D LWS_WITH_SOCKS5=ON \
-D LWS_WITH_STATIC=OFF \
-D LWS_WITH_THREADPOOL=ON \
-D LWS_WITH_ZIP_FOPS=ON \
-D LWS_WITHOUT_BUILTIN_GETIFADDRS=ON \
-D LWS_WITHOUT_BUILTIN_SHA1=ON \
-D LWS_WITHOUT_CLIENT=OFF \
-D LWS_WITHOUT_SERVER=OFF \
-D LWS_WITHOUT_TESTAPPS=ON \
-D LWS_WITHOUT_TEST_CLIENT=ON \
-D LWS_WITHOUT_TEST_PING=ON \
-D LWS_WITHOUT_TEST_SERVER=OFF \
-D LWS_WITHOUT_TEST_SERVER_EXTPOLL=ON \
-D LWS_UNIX_SOCK=ON \
-Wno-dev \
-B build \
-S $pkgname-$pkgver
make VERBOSE=1 -C build
}
package() {
depends+=(libglib-2.0.so)
make DESTDIR="$pkgdir" install -C build
install -vDm 644 $pkgname-$pkgver/LICENSE -t "$pkgdir/usr/share/licenses/$pkgname/"
}