diff --git a/devel/kore/Makefile b/devel/kore/Makefile index c286efeb664d..9ee3faf3c6ae 100644 --- a/devel/kore/Makefile +++ b/devel/kore/Makefile @@ -1,74 +1,65 @@ PORTNAME= kore -PORTVERSION= 4.2.3 +DISTVERSION= 4.2.3 +PORTREVISON= 1 CATEGORIES= devel www MASTER_SITES= https://kore.io/releases/ MAINTAINER= ports@FreeBSD.org COMMENT= Web application framework for writing web APIs in C WWW= http://www.kore.io/ LICENSE= ISCL LICENSE_FILE= ${WRKSRC}/LICENSE BROKEN_SSL= openssl30 openssl31 BROKEN_SSL_REASON= Requires OpenSSL 3.0.0 deprecated RSA_* routines USES= compiler:c11 gmake ssl MAKE_ARGS= OPENSSL_PATH=${OPENSSLBASE} -CFLAGS+= ${CFLAGS_${CHOSEN_COMPILER_TYPE}} -# 12.0 + -pedantic -CFLAGS_clang= -Wno-error=c11-extensions +CFLAGS+= -std=c11 PORTEXAMPLES= * OPTIONS_DEFINE= ACME CURL DEBUG EXAMPLES HTTP JSONRPC PGSQL PYTHON \ TASKS TLS OPTIONS_DEFAULT= ACME CURL HTTP JSONRPC PGSQL PYTHON TASKS TLS OPTIONS_SUB= yes ACME_DESC= Build with ACME support HTTP_DESC= Build with HTTP support JSONRPC_DESC= Build with JSON-RPC support TASKS_DESC= Build with tasks support ACME_MAKE_ARGS= ACME=1 CURL_LIB_DEPENDS= libcurl.so:ftp/curl CURL_MAKE_ARGS= CURL=1 DEBUG_MAKE_ARGS= DEBUG=1 HTTP_MAKE_ARGS_OFF= NOHTTP=1 JSONRPC_IMPLIES= HTTP JSONRPC_LIB_DEPENDS= libyajl.so:devel/yajl JSONRPC_MAKE_ARGS= JSONRPC=1 PGSQL_IMPLIES= HTTP PGSQL_USES= pgsql PGSQL_MAKE_ARGS= PGSQL=1 PYTHON_USES= gettext-runtime python PYTHON_MAKE_ARGS= PYTHON=1 PYTHON_BINARY_ALIAS= python3-config=${PYTHON_CMD}-config TASKS_MAKE_ARGS= TASKS=1 TLS_MAKE_ARGS_OFF= NOTLS=1 -.include - -.if ${COMPILER_TYPE} == clang && ${COMPILER_VERSION} >= 160 -CFLAGS+= -Wno-error=deprecated-declarations -Wno-error=incompatible-pointer-types-discards-qualifiers -.endif - -post-patch: -.if ${LOCALBASE} != /usr/local - @${REINPLACE_CMD} 's|/usr/local/|${LOCALBASE}/|g' \ +pre-configure: + @${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}/|g' \ ${WRKSRC}/Makefile -.endif @${REINPLACE_CMD} 's|%%OPENSSLINC%%|${OPENSSLINC}|g' \ ${WRKSRC}/src/cli.c post-install: ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/kodev \ ${STAGEDIR}${PREFIX}/bin/kore post-install-EXAMPLES-on: @cd ${WRKSRC}/examples && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} @cd ${WRKSRC}/conf && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR} -.include +.include diff --git a/devel/kore/files/patch-Makefile b/devel/kore/files/patch-Makefile index 2413aba71126..6ff3989fb674 100644 --- a/devel/kore/files/patch-Makefile +++ b/devel/kore/files/patch-Makefile @@ -1,15 +1,49 @@ ---- Makefile.orig 2020-09-08 19:35:30 UTC +--- Makefile.orig 2022-08-22 11:18:44 UTC +++ Makefile -@@ -48,12 +48,6 @@ ifneq ("$(DEBUG)", "") +@@ -31,9 +31,9 @@ S_SRC+= src/tls_$(TLS_BACKEND).c + FEATURES= + FEATURES_INC= + +-CFLAGS+=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes ++CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes + CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual +-CFLAGS+=-Wsign-compare -Iinclude/kore -I$(OBJDIR) -std=c99 -pedantic ++CFLAGS+=-Wsign-compare -Iinclude/kore -I$(OBJDIR) -pedantic + CFLAGS+=-Wtype-limits -fno-common + CFLAGS+=-DPREFIX='"$(PREFIX)"' -fstack-protector-all + +@@ -66,12 +66,6 @@ ifneq ("$(DEBUG)", "") FEATURES+=-DKORE_DEBUG endif -ifneq ("$(NOOPT)", "") - CFLAGS+=-O0 -else - CFLAGS+=-O2 -endif - ifneq ("$(NOSENDFILE)", "") CFLAGS+=-DKORE_NO_SENDFILE endif +@@ -120,8 +114,8 @@ endif + + OSNAME=$(shell uname -s | sed -e 's/[-_].*//g' | tr A-Z a-z) + ifeq ("$(OSNAME)", "freebsd") +- KORE_CURL_LIB=-L/usr/local/lib -lcurl +- KORE_CURL_INC=-I/usr/local/include ++ KORE_CURL_LIB=-L%%LOCALBASE%%/lib -lcurl ++ KORE_CURL_INC=-I%%LOCALBASE%%/include + endif + + ifneq ("$(ACME)", "") +@@ -161,8 +155,8 @@ else ifeq ("$(OSNAME)", "linux") + else + S_SRC+=src/bsd.c + ifneq ("$(JSONRPC)", "") +- CFLAGS+=-I/usr/local/include +- LDFLAGS+=-L/usr/local/lib ++ CFLAGS+=-I%%LOCALBASE%%/include ++ LDFLAGS+=-L%%LOCALBASE%%/lib + endif + endif + diff --git a/devel/kore/files/patch-kodev_Makefile b/devel/kore/files/patch-kodev_Makefile index 533af6f02cbd..baa8e5315099 100644 --- a/devel/kore/files/patch-kodev_Makefile +++ b/devel/kore/files/patch-kodev_Makefile @@ -1,19 +1,24 @@ ---- kodev/Makefile.orig 2020-09-08 19:35:30 UTC +--- kodev/Makefile.orig 2022-08-22 11:18:44 UTC +++ kodev/Makefile -@@ -12,14 +12,8 @@ S_SRC= ../src/cli.c - CFLAGS+=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes +@@ -9,17 +9,11 @@ INSTALL_DIR=$(PREFIX)/bin + + S_SRC= ../src/cli.c + +-CFLAGS+=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes ++CFLAGS+=-Wall -Wstrict-prototypes -Wmissing-prototypes CFLAGS+=-Wmissing-declarations -Wshadow -Wpointer-arith -Wcast-qual - CFLAGS+=-Wsign-compare -Iincludes -std=c99 -pedantic +-CFLAGS+=-Wsign-compare -Iincludes -std=c99 -pedantic -CFLAGS+=-DPREFIX='"$(PREFIX)"' -LDFLAGS=-lcrypto - -ifneq ("$(NOOPT)", "") - CFLAGS+=-O0 -else - CFLAGS+=-O2 -endif ++CFLAGS+=-Wsign-compare -Iincludes -pedantic +CFLAGS+=-DPREFIX='"$(PREFIX)"' -I$(OPENSSL_PATH)/include +LDFLAGS+=-L$(OPENSSL_PATH)/lib -lcrypto ifneq ("$(MINIMAL)", "") CFLAGS+=-DKODEV_MINIMAL diff --git a/devel/kore/files/patch-src_cli.c b/devel/kore/files/patch-src_cli.c new file mode 100644 index 000000000000..fb0ba4393640 --- /dev/null +++ b/devel/kore/files/patch-src_cli.c @@ -0,0 +1,11 @@ +--- src/cli.c.orig 2022-08-22 11:18:44 UTC ++++ src/cli.c +@@ -867,6 +867,8 @@ cli_ldflags(int argc, char **argv) + cli_kore_load_file("linker", NULL, &p, &len); + printf("%.*s ", (int)len, p); + ++ printf("-I%%OPENSSLINC%% "); ++ + #if defined(__MACH__) + printf("-dynamiclib -undefined suppress -flat_namespace "); + #else diff --git a/devel/kore/files/patch-src_python.c b/devel/kore/files/patch-src_python.c new file mode 100644 index 000000000000..1df8f209a100 --- /dev/null +++ b/devel/kore/files/patch-src_python.c @@ -0,0 +1,11 @@ +--- src/python.c.orig 2023-11-17 22:08:08 UTC ++++ src/python.c +@@ -4828,7 +4828,7 @@ pyhttp_iterobj_next(struct pyhttp_iterobj *iterobj) + } + + kore_buf_reset(&iterobj->buf); +- kore_buf_appendf(&iterobj->buf, "%lx\r\n", length); ++ kore_buf_appendf(&iterobj->buf, "%zx\r\n", length); + kore_buf_append(&iterobj->buf, ptr, length); + kore_buf_appendf(&iterobj->buf, "\r\n"); + diff --git a/devel/kore/files/patch-tools_kore-serve_conf_build.conf b/devel/kore/files/patch-tools_kore-serve_conf_build.conf new file mode 100644 index 000000000000..be1d1dc8c9a0 --- /dev/null +++ b/devel/kore/files/patch-tools_kore-serve_conf_build.conf @@ -0,0 +1,10 @@ +--- tools/kore-serve/conf/build.conf.orig 2022-08-22 11:18:44 UTC ++++ tools/kore-serve/conf/build.conf +@@ -2,7 +2,6 @@ single_binary=yes + kore_source=../../ + kore_flavor=NOTLS=1 + +-cflags=-std=c99 -Werror + cflags=-Wall -Wmissing-declarations -Wshadow + cflags=-Wstrict-prototypes -Wmissing-prototypes + cflags=-Wpointer-arith -Wcast-qual -Wsign-compare