diff --git a/common/shlibs b/common/shlibs index d7b8fc6d6af..6e2b8e69328 100644 --- a/common/shlibs +++ b/common/shlibs @@ -3380,3 +3380,4 @@ librtasevent.so.2 librtas-2.0.2_1 libbroker.so.0 bro-2.6.1_1 libcaf_core.so.0.16.2 bro-2.6.1_1 libcaf_openssl.so.0.16.2 bro-2.6.1_1 +libllhttp.so.1 llhttp-1.0.1_1 diff --git a/srcpkgs/llhttp-devel b/srcpkgs/llhttp-devel new file mode 120000 index 00000000000..51a0d25d9db --- /dev/null +++ b/srcpkgs/llhttp-devel @@ -0,0 +1 @@ +llhttp \ No newline at end of file diff --git a/srcpkgs/llhttp/files/Makefile b/srcpkgs/llhttp/files/Makefile new file mode 100644 index 00000000000..910e584e97f --- /dev/null +++ b/srcpkgs/llhttp/files/Makefile @@ -0,0 +1,25 @@ +# Makefile template for shared library + +CC ?= gcc +override CFLAGS += -fPIC -Wall -Wextra -O2 -DNDEBUG -Iinclude +override LDFLAGS += -shared -Wl,-soname,libllhttp.so.1 +RM = rm -f +TARGET_LIB = libllhttp.so.1.0 + +SRCS = src/api.c src/http.c src/llhttp.c +OBJS = $(SRCS:.c=.o) + +.PHONY: all +all: ${TARGET_LIB} + +$(TARGET_LIB): $(OBJS) + $(CC) $(LDFLAGS) -o $@ $^ + +$(SRCS:.c=.d):%.d:%.c + $(CC) $(CFLAGS) -MM $< >$@ + +include $(SRCS:.c=.d) + +.PHONY: clean +clean: + -${RM} ${TARGET_LIB} ${OBJS} $(SRCS:.c=.d) diff --git a/srcpkgs/llhttp/template b/srcpkgs/llhttp/template new file mode 100644 index 00000000000..35249dd78f0 --- /dev/null +++ b/srcpkgs/llhttp/template @@ -0,0 +1,36 @@ +# Template file for 'llhttp' +pkgname=llhttp +version=1.1.0 +revision=1 +wrksrc="llhttp-release-v${version}" +build_style=gnu-makefile +short_desc="Port of http_parser to llparse" +maintainer="Rasmus Thomsen " +license="MIT" +homepage="https://llhttp.org/" +# _always_ use releases. Those have the C code generated, otherwise +# we'd have a dep loop nodejs<->llhttp +distfiles="https://github.com/nodejs/llhttp/archive/release/v${version}.tar.gz" +checksum=71a206f6a0fb718e43159c319f861d00aef8c522d73cb6ac049f24d6d984a902 + +post_extract() { + # No need to pull in gyp for such a simple Makefile... + cp ${FILESDIR}/Makefile ${wrksrc} +} + +do_install() { + vinstall libllhttp.so.1.0 755 /usr/lib + ln -s libllhttp.so.1.0 ${DESTDIR}/usr/lib/libllhttp.so.1 + ln -s libllhttp.so.1 ${DESTDIR}/usr/lib/libllhttp.so + vcopy include /usr + vlicense LICENSE-MIT +} + +llhttp-devel_package() { + short_desc="- development files" + depends="${sourcepkg}-${version}_${revision}" + pkg_install() { + vmove usr/include + vmove "usr/lib/*.so" + } +}