mirror of
https://git.freebsd.org/ports.git
synced 2025-04-28 01:26:39 -04:00
net/usockets: Improve port
PR: 286126
This commit is contained in:
parent
f4610370c7
commit
02d606ffb4
2 changed files with 17 additions and 22 deletions
|
@ -1,7 +1,7 @@
|
||||||
PORTNAME= usockets
|
PORTNAME= usockets
|
||||||
DISTVERSIONPREFIX= v
|
DISTVERSIONPREFIX= v
|
||||||
DISTVERSION= 0.8.8
|
DISTVERSION= 0.8.8
|
||||||
PORTREVISION= 1
|
PORTREVISION= 2
|
||||||
CATEGORIES= net devel
|
CATEGORIES= net devel
|
||||||
|
|
||||||
MAINTAINER= yuri@FreeBSD.org
|
MAINTAINER= yuri@FreeBSD.org
|
||||||
|
@ -13,34 +13,40 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
|
||||||
|
|
||||||
BROKEN_riscv64= fails to build: Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension
|
BROKEN_riscv64= fails to build: Hard-float 'd' ABI can't be used for a target that doesn't support the D instruction set extension
|
||||||
|
|
||||||
USES= compiler:c++17-lang gmake ssl # c++17 only for temp C_++ code, otherwise it is c11
|
USES= compiler:c++17-lang ssl
|
||||||
USE_LDCONFIG= yes
|
USE_LDCONFIG= yes
|
||||||
|
|
||||||
USE_GITHUB= yes
|
USE_GITHUB= yes
|
||||||
GH_ACCOUNT= uNetworking
|
GH_ACCOUNT= uNetworking
|
||||||
GH_PROJECT= uSockets
|
GH_PROJECT= uSockets
|
||||||
|
|
||||||
MAKE_ARGS= WITH_OPENSSL=1
|
USE_CSTD= c11
|
||||||
CFLAGS+= -fPIC # -fPIC is required for the build to succeed, see https://github.com/uNetworking/uSockets/issues/217
|
USE_CXXSTD= c++17
|
||||||
CXXFLAGS+= -fPIC
|
|
||||||
|
|
||||||
ALL_TARGET= default
|
CFLAGS+= -fPIC
|
||||||
|
|
||||||
SUB_FILES= libusockets.pc
|
SUB_FILES= libusockets.pc
|
||||||
SUB_LISTS= VERSION=${DISTVERSION}
|
SUB_LIST+= VERSION=${DISTVERSION}
|
||||||
|
|
||||||
PLIST_FILES= include/libusockets.h \
|
PLIST_FILES= include/libusockets.h \
|
||||||
lib/libuSockets.so.0 \
|
lib/libuSockets.so.0 \
|
||||||
lib/libuSockets.so
|
lib/libuSockets.so \
|
||||||
|
libdata/pkgconfig/libusockets.pc
|
||||||
|
|
||||||
|
do-build:
|
||||||
|
@cd ${WRKSRC} && \
|
||||||
|
${SETENVI} ${MAKE_ENV} ${CC} ${CFLAGS} -DLIBUS_USE_OPENSSL -Isrc -c src/*.c src/eventing/*.c src/crypto/*.c src/io_uring/*.c && \
|
||||||
|
${SETENVI} ${MAKE_ENV} ${CXX} ${CXXFLAGS} -c src/crypto/*.cpp && \
|
||||||
|
${SETENVI} ${MAKE_ENV} ${CXX} ${CXXFLAGS} -shared -o libuSockets.so.0 -Wl,-soname=libuSockets.so.0 *.o -lssl
|
||||||
|
|
||||||
do-install:
|
do-install:
|
||||||
${INSTALL_DATA} ${WRKSRC}/src/libusockets.h ${STAGEDIR}${PREFIX}/include
|
${INSTALL_DATA} ${WRKSRC}/src/libusockets.h ${STAGEDIR}${PREFIX}/include
|
||||||
${INSTALL_LIB} ${WRKSRC}/libuSockets.so.0 ${STAGEDIR}${PREFIX}/lib
|
${INSTALL_LIB} ${WRKSRC}/libuSockets.so.0 ${STAGEDIR}${PREFIX}/lib
|
||||||
${RLN} ${WRKSRC}/libuSockets.so.0 ${STAGEDIR}${PREFIX}/lib/libuSockets.so
|
${RLN} ${STAGEDIR}${PREFIX}/lib/libuSockets.so.0 ${STAGEDIR}${PREFIX}/lib/libuSockets.so
|
||||||
${INSTALL_DATA} ${WRKDIR}/libusockets.pc ${STAGEDIR}${LOCALBASE}/libdata/pkgconfig
|
${INSTALL_DATA} ${WRKDIR}/libusockets.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
|
||||||
|
|
||||||
do-test: # tests fail to compile: https://github.com/uNetworking/uSockets/issues/213
|
do-test: # tests fail to compile: https://github.com/uNetworking/uSockets/issues/213
|
||||||
cd ${WRKSRC} && \
|
@cd ${WRKSRC} && \
|
||||||
${CC} ${CFLAGS} -o test tests/sni_test.c ${STAGEDIR}${PREFIX}/lib/libuSockets.so && \
|
${CC} ${CFLAGS} -o test tests/sni_test.c ${STAGEDIR}${PREFIX}/lib/libuSockets.so && \
|
||||||
./test
|
./test
|
||||||
|
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
--- Makefile.orig 2024-02-07 13:04:14 UTC
|
|
||||||
+++ Makefile
|
|
||||||
@@ -88,7 +88,7 @@ endif
|
|
||||||
$(CXX) $(CXXFLAGS) -std=c++17 -flto -O3 -c src/crypto/*.cpp
|
|
||||||
endif
|
|
||||||
# Create a static library (try windows, then unix)
|
|
||||||
- lib.exe /out:uSockets.a *.o || $(AR) rvs uSockets.a *.o
|
|
||||||
+ $(CXX) -shared -o libuSockets.so.0 -Wl,-soname=libuSockets.so.0 *.o -lssl
|
|
||||||
|
|
||||||
# BoringSSL needs cmake and golang
|
|
||||||
.PHONY: boringssl
|
|
Loading…
Add table
Reference in a new issue