changeset 137:56877b42b246

MERGE: original version as of 2022-09-21 (commit 4f7a47b7e058481ff1b327a2767093399a58b364)
author Franz Glasner <fzglas.hg@dom66.de>
date Sun, 25 Sep 2022 17:54:32 +0200
parents 4e5892c75f51 (diff) 4443158ec41b (current diff)
children 0591ef28d649
files uwsginl-plugin-lang-py3/distinfo uwsginl/Makefile uwsginl/distinfo uwsginl/pkg-descr
diffstat 75 files changed, 1520 insertions(+), 291 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+syntax: regexp
+
+/work/
+/work\.old/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgsigs	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,5 @@
+689ef3454fc98e68f72a3403d97c9523785e4845 0 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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgtags	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,5 @@
+02a0807309f71884397fbb6cb79de557bed54664 v2.0.18
+0f8e5c6bf77b3a5ad3daea019588edfee5140581 v2.1.pl1.g20201011
+4b01da8b5a33cd57176bcc5ee2c9e5088bf9e5a4 v2.1.pl2.g20201129
+8335c02a2e45d51d46fd8e66dea669e9e68d401e v2.1.pl3.g20210418
+a813664e4595a01da5f70d6a68f18d8f4145d5f4 v2.1.pl4.g20211229
--- a/Makefile	Sun Sep 25 13:08:29 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,83 +0,0 @@
-PORTNAME=	uwsgi
-PORTVERSION=	2.0.20
-CATEGORIES=	www python
-MASTER_SITES=	http://projects.unbit.it/downloads/
-
-MAINTAINER=	eugene@zhegan.in
-COMMENT=	Developer-friendly WSGI server which uses uwsgi protocol
-WWW=		https://projects.unbit.it/uwsgi/
-
-LICENSE=	GPLv2
-LICENSE_FILE=	${WRKSRC}/LICENSE
-
-USES=		cpe pkgconfig python:3.6-3.10
-USE_PYTHON=	distutils concurrent optsuffix
-USE_RC_SUBR=	uwsgi
-CPE_VENDOR=	unbit
-
-MAKE_ENV+=	CPUCOUNT=${MAKE_JOBS_NUMBER} UWSGI_EMBED_PLUGINS=cgi
-
-PYSETUP=			uwsgiconfig.py
-PYDISTUTILS_BUILD_TARGET=	--build
-PYDISTUTILS_BUILDARGS=		--verbose
-
-USERS=		uwsgi
-GROUPS=		uwsgi
-
-PLIST_FILES=	bin/uwsgi \
-		${PYTHON_SITELIBDIR}/uwsgidecorators.py
-
-SUB_LIST=	PYTHON_VER=${PYTHON_VER}
-
-OPTIONS_DEFINE=		DEBUG JSON PCRE XML SSL
-OPTIONS_DEFAULT=	SSL
-
-OPTIONS_GROUP=		PLG
-OPTIONS_GROUP_PLG=	COROAE LOGPIPE PSGI
-
-PLG_DESC=		Enable plugins
-COROAE_DESC=		Coro::AnyEvent support
-LOGPIPE_DESC=		Pipe logger support
-PSGI_DESC=		PSGI embedded plugin
-
-COROAE_BUILD_DEPENDS=	p5-Coro>=0:devel/p5-Coro
-COROAE_IMPLIES=		PSGI
-
-DEBUG_VARS=		PYDISTUTILS_BUILDARGS+=--debug
-
-JSON_VARS=		BUILDCONF_JSON=jansson
-JSON_LIB_DEPENDS=	libjansson.so:devel/jansson
-
-PCRE_VARS=		BUILDCONF_PCRE=true
-PCRE_LIB_DEPENDS=	libpcre.so:devel/pcre
-
-PSGI_USES=		perl5
-
-XML_VARS=		BUILDCONF_XML=libxml2
-XML_LIB_DEPENDS=	libxml2.so:textproc/libxml2
-
-SSL_VARS=		BUILDCONF_SSL=true
-SSL_USES=		ssl
-SSL_CFLAGS=		-I${OPENSSLINC}
-SSL_LDFLAGS=		${OPENSSL_LDFLAGS}
-
-post-patch:
-.for var in JSON PCRE XML SSL
-	@${REINPLACE_CMD} -e '/^${var:tl} =/ s|= .*|= ${BUILDCONF_${var}:Ufalse}|' ${WRKSRC}/buildconf/base.ini
-.endfor
-
-.for plugin in COROAE LOGPIPE PSGI
-post-patch-${plugin}-on:
-	@${REINPLACE_CMD} -e 's/%(main_plugin)s,/& ${plugin:tl},/' \
-		${WRKSRC}/buildconf/base.ini
-.endfor
-
-do-configure:
-	@${DO_NADA}
-
-do-install:
-	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/
-	@${MKDIR} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
-	${INSTALL_DATA} ${WRKSRC}/uwsgidecorators.py ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
-
-.include <bsd.port.mk>
--- a/distinfo	Sun Sep 25 13:08:29 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,3 +0,0 @@
-TIMESTAMP = 1637775824
-SHA256 (uwsgi-2.0.20.tar.gz) = 88ab9867d8973d8ae84719cf233b7dafc54326fcaec89683c3f9f77c002cdff9
-SIZE (uwsgi-2.0.20.tar.gz) = 804906
--- a/files/patch-core-logging.c	Sun Sep 25 13:08:29 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,32 +0,0 @@
---- core/logging.c.orig	2020-11-06 10:12:49.865752000 +0100
-+++ core/logging.c	2020-11-06 10:17:57.825745000 +0100
-@@ -536,13 +536,23 @@
- 			uwsgi_error_open(logfile);
- 			exit(1);
- 		}
--		else {
--			if (dup2(fd, log_fd) < 0) {
--				// this could be lost :(
--				uwsgi_error("uwsgi_log_do_rotate()/dup2()");
--				exit(1);
--			}
-+		if (dup2(fd, log_fd) < 0) {
-+			// this could be lost :(
-+			uwsgi_error("uwsgi_log_do_rotate()/dup2()");
- 			close(fd);
-+			exit(1);
-+		}
-+		close(fd);
-+
-+		if (uwsgi.chmod_logfile_value) {
-+			if (fchmod(log_fd, uwsgi.chmod_logfile_value)) {
-+				uwsgi_error("fchmod()");
-+			}
-+		}
-+		if (uwsgi.logfile_chown) {
-+			if (fchown(log_fd, uwsgi.uid, uwsgi.gid)) {
-+				uwsgi_error("fchown()");
-+			}
- 		}
- 	}
- 	else {
--- a/files/patch-plugins_coroae_uwsgiplugin.py	Sun Sep 25 13:08:29 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,11 +0,0 @@
---- plugins/coroae/uwsgiplugin.py.orig	2020-06-17 09:03:34 UTC
-+++ plugins/coroae/uwsgiplugin.py
-@@ -9,7 +9,7 @@ for p in search_paths:
-         coroapi = p
- 
- if not coroapi:
--    print "unable to find the Coro perl module !!!"
-+    print("unable to find the Coro perl module !!!")
-     sys.exit(1)
- 
- NAME='coroae'
--- a/files/uwsgi.in	Sun Sep 25 13:08:29 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,157 +0,0 @@
-#!/bin/sh
-
-# PROVIDE: uwsgi
-# REQUIRE: DAEMON
-# KEYWORD: shutdown
-#
-# Add the following lines to /etc/rc.conf to enable uwsgi:
-#
-# uwsgi_enable (bool):		Set it to "YES" to enable uwsgi
-#				Default is "NO".
-# uwsgi_socket (path/str):	Set the path to the uwsgi unix socket
-#				Default is /tmp/uwsgi.sock.
-# uwsgi_socket_mode (int):	Set the mode of the socket.
-#				Default is 660.
-# uwsgi_socket_owner (str):	Set the owner of the socket.
-#				Default is uwsgi:www.
-# uwsgi_emperor (bool):		Set it to "YES" to run uwsgi in emperor mode
-#				Default is "NO".
-# uwsgi_configfile (path):	Set the path to the config file
-#				Default is %%PREFIX%%/etc/uwsgi/uwsgi.ini.
-# uwsgi_vassals_dir (path):	Set the path to the vassals directory
-#				Default is %%PREFIX%%/etc/uwsgi/vassals.
-# uwsgi_logfile (path):		Set the path to the uwsgi log file
-#				Default is /var/log/uwsgi.log.
-# uwsgi_pidfile (path):		Set the path to the uwsgi pid file
-#				Default is /var/run/uwsgi.pid.
-# uwsgi_uid (int):		Set the UID of the process to run with
-#				Default is uwsgi.
-# uwsgi_gid (int):		Set the GID of the process to run with
-#				Default is uwsgi.
-# uwsgi_flags (str):		Set the uwsgi command line arguments
-#				Default is "-L".
-# uwsgi_procname (str):		Define to "uWSGI" if you start uwsgi with
-#				--auto-procname option.
-#
-# If you would like to have multiple uWSGI instances running, you can
-# define multiple profiles:
-#
-# uwsgi_profiles (str):		Set the list of uwsgi profiles
-#				Default is "".
-#
-# For each profile you can then define different options (except for
-# uwsgi_enable) using the syntax uwsgi_<profile>_<option>
-
-. /etc/rc.subr
-
-name="uwsgi"
-rcvar=uwsgi_enable
-
-load_rc_config $name
-
-command=%%PREFIX%%/bin/uwsgi-%%PYTHON_VER%%
-
-: ${uwsgi_enable="NO"}
-: ${uwsgi_socket="/tmp/${name}.sock"}
-: ${uwsgi_socket_mode="660"}
-: ${uwsgi_socket_owner="uwsgi:www"}
-: ${uwsgi_configfile="%%PREFIX%%/etc/uwsgi/uwsgi.ini"}
-: ${uwsgi_profiles=""}
-: ${uwsgi_logfile="/var/log/${name}.log"}
-: ${uwsgi_pidfile="/var/run/${name}.pid"}
-: ${uwsgi_uid="uwsgi"}
-: ${uwsgi_gid="uwsgi"}
-: ${uwsgi_flags="-L"}
-: ${uwsgi_emperor="NO"}
-: ${uwsgi_vassals_dir="%%PREFIX%%/etc/uwsgi/vassals"}
-
-is_uwsgi_profile() {
-	local profile
-
-	for profile in $uwsgi_profiles; do
-		if [ "$profile" = "$1" ]; then
-			return 0
-		fi
-	done
-
-	return 1
-}
-
-if [ -n "${uwsgi_profiles}" ]; then
-	if [ -n "$2" ]; then
-		profile="$2"
-		if ! is_uwsgi_profile $profile; then
-			echo "$0: no such profile defined in uwsgi_profiles."
-		        exit 1
-		fi
-		eval uwsgi_socket=\${uwsgi_${profile}_socket:-"/tmp/${name}-${profile}.sock"}
-		eval uwsgi_socket_mode=\${uwsgi_${profile}_socket_mode:-${uwsgi_socket_mode}}
-		eval uwsgi_socket_owner=\${uwsgi_${profile}_socket_owner:-${uwsgi_socket_owner}}
-		eval uwsgi_logfile=\${uwsgi_${profile}_logfile:-"/var/log/${name}-${profile}.log"}
-		eval uwsgi_pidfile=\${uwsgi_${profile}_pidfile:-"/var/run/${name}-${profile}.pid"}
-		eval uwsgi_uid=\${uwsgi_${profile}_uid:-"${uwsgi_uid}"}
-		eval uwsgi_gid=\${uwsgi_${profile}_gid:-"${uwsgi_gid}"}
-		eval uwsgi_flags=\${uwsgi_${profile}_flags:-"${uwsgi_flags}"}
-		eval uwsgi_procname=\${uwsgi_${profile}_procname:-"${uwsgi_procname}"}
-		eval uwsgi_emperor=\${uwsgi_${profile}_emperor:-"${uwsgi_emperor}"}
-		eval uwsgi_vassals_dir=\${uwsgi_${profile}_vassals_dir:-"${uwsgi_vassals_dir}"}
-		eval uwsgi_configfile=\${uwsgi_${profile}_configfile:-"${uwsgi_configfile}"}
-	elif [ -n "$1" ]; then
-		for profile in ${uwsgi_profiles}; do
-			echo "Processing ${name} profile: ${profile}"
-			%%PREFIX%%/etc/rc.d/uwsgi $1 ${profile}
-		done
-		exit 0
-	fi
-fi
-
-pidfile=${uwsgi_pidfile}
-start_precmd=start_precmd
-stop_postcmd=stop_postcmd
-reload_precmd=reload_precmd
-brutalreload_cmd=brutalreload_cmd
-sig_stop="INT"
-extra_commands="reload brutalreload"
-procname=${uwsgi_procname}
-
-start_precmd()
-{
-	rc_flags=""
-	if [ -e ${uwsgi_configfile} ]; then
-		rc_flags="--ini ${uwsgi_configfile} "
-	fi
-
-	if checkyesno uwsgi_emperor; then
-		echo "Running uWSGI as Emperor. Vassals loaded from "$uwsgi_vassals_dir
-		required_dirs=${uwsgi_vassals_dir}
-		rc_flags=${rc_flags}"--emperor-pidfile ${uwsgi_pidfile} -d ${uwsgi_logfile} --emperor ${uwsgi_vassals_dir}"
-		rc_flags=${rc_flags}" --vassals-set uid=${uwsgi_uid} --vassals-set gid=${uwsgi_gid}"
-		rc_flags=${rc_flags}" --vassals-set chmod-socket=${uwsgi_socket_mode} --vassals-set chown-socket=${uwsgi_socket_owner}"
-	else
-		rc_flags=${rc_flags}"--master  --uid ${uwsgi_uid} --gid ${uwsgi_gid} --pidfile ${uwsgi_pidfile} -d ${uwsgi_logfile}"
-		rc_flags=${rc_flags}" -s ${uwsgi_socket} --chmod-socket=${uwsgi_socket_mode} --chown-socket=${uwsgi_socket_owner}"
-	fi
-
-	rc_flags=${rc_flags}" ${uwsgi_flags}"
-}
-
-stop_postcmd()
-{
-	rm -f ${uwsgi_pidfile} ${uwsgi_socket}
-}
-
-reload_precmd()
-{
-	echo "Gracefully reloading ${name} without closing the main sockets."
-}
-
-brutalreload_cmd()
-{
-	echo "Reloading ${name} without closing the main sockets."
-
-	reload_precmd=""
-	sig_reload="TERM"
-	run_rc_command ${rc_prefix}reload $rc_extra_args || return 1
-}
-
-run_rc_command "$1"
--- a/pkg-descr	Sun Sep 25 13:08:29 2022 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,5 +0,0 @@
-uWSGI is a fast (pure C), self-healing, developer-friendly WSGI server,
-aimed for professional python webapps deployment and development.  Over
-time it has evolved in a complete stack for networked/clustered python
-applications, implementing message/object passing, RPC and process
-management.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-gevent3/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,12 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3 gevent plugin for ${UWSGI_NAME}
+
+PLUGIN_NAME=	gevent3
+PLUGIN_SOURCE=	plugins/gevent
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-gevent3/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3 gevent plugin for uwsginl.
+Links to the default Python3 version on the system.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-gevent36/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3.6 gevent plugin for ${UWSGI_NAME}
+
+USES=		python:3.6 gettext-runtime
+
+PLUGIN_NAME=	gevent36
+PLUGIN_SOURCE=	plugins/gevent
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-gevent36/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.6 gevent plugin for uwsginl.
+Links to Python 3.6.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-gevent37/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3.7 gevent plugin for ${UWSGI_NAME}
+
+USES=		python:3.7 gettext-runtime
+
+PLUGIN_NAME=	gevent37
+PLUGIN_SOURCE=	plugins/gevent
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-gevent37/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.7 gevent plugin for uwsginl.
+Links to Python 3.7.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-gevent38/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3.8 gevent plugin for ${UWSGI_NAME}
+
+USES=		python:3.8 gettext-runtime
+
+PLUGIN_NAME=	gevent38
+PLUGIN_SOURCE=	plugins/gevent
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-gevent38/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.8 gevent plugin for uwsginl.
+Links to Python 3.8.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-graylog2/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-graylog2
+
+COMMENT=	Graylog2 plugin for uwsginl
+
+USES=
+
+PLUGIN_NAME=	graylog2
+PLUGIN_SOURCE=	plugins/graylog2
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-graylog2/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Graylog2 plugin for uwsginl.
+Allows uwsginl to log to a Graylog2 server in its native GELF format.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-greenlet3/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,15 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3 greenlet plugin for ${UWSGI_NAME}
+
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}greenlet>=0.4:devel/py-greenlet@${PY_FLAVOR}
+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}greenlet>=0.4:devel/py-greenlet@${PY_FLAVOR}
+
+PLUGIN_NAME=	greenlet3
+PLUGIN_SOURCE=	plugins/greenlet
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-greenlet3/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3 greenlet plugin for uwsginl.
+Links to the default Python3 version on the system.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-greenlet36/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,17 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3.6 gevent plugin for ${UWSGI_NAME}
+
+USES=		python:3.6 gettext-runtime
+
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}greenlet>=0.4:devel/py-greenlet@${PY_FLAVOR}
+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}greenlet>=0.4:devel/py-greenlet@${PY_FLAVOR}
+
+PLUGIN_NAME=	greenlet36
+PLUGIN_SOURCE=	plugins/greenlet
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-greenlet36/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.6 greenlet plugin for uwsginl.
+Links to Python 3.6.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-greenlet37/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,17 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3.7 gevent plugin for ${UWSGI_NAME}
+
+USES=		python:3.7 gettext-runtime
+
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}greenlet>=0.4:devel/py-greenlet@${PY_FLAVOR}
+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}greenlet>=0.4:devel/py-greenlet@${PY_FLAVOR}
+
+PLUGIN_NAME=	greenlet37
+PLUGIN_SOURCE=	plugins/greenlet
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-greenlet37/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.7 greenlet plugin for uwsginl.
+Links to Python 3.7.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-greenlet38/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,17 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3.8 gevent plugin for ${UWSGI_NAME}
+
+USES=		python:3.8 gettext-runtime
+
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}greenlet>=0.4:devel/py-greenlet@${PY_FLAVOR}
+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}greenlet>=0.4:devel/py-greenlet@${PY_FLAVOR}
+
+PLUGIN_NAME=	greenlet38
+PLUGIN_SOURCE=	plugins/greenlet
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-greenlet38/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.8 greenlet plugin for uwsginl.
+Links to Python 3.8.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-php71/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,28 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-php71
+CATEGORIES=	www lang devel
+
+COMMENT=	Language plugin for PHP 7.1
+
+LIB_DEPENDS+=	libxml2.so:textproc/libxml2 \
+		libpcre.so:devel/pcre
+
+USES=			php:build,embed
+USE_PHP=		session:build xml:build
+PHP_VER=		71
+DEFAULT_VERSIONS+=	php=${PHP_VER}
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+PLUGIN_NAME=	php71
+PLUGIN_SOURCE=	plugins/php
+
+#
+# Check whether uwsginl has been built with both libpcre and libxml2
+#
+pre-build:
+	@( ${UWSGI_PATH} --no-server --cflags | ${GREP} -- '-DUWSGI_XML_LIBXML2' >/dev/null ) || ( echo "Error: ${UWSGI_PATH} needs to be built with XML support (libxml2)" && exit 1 )
+	@( ${UWSGI_PATH} --no-server --cflags | ${GREP} -- '-DUWSGI_PCRE' >/dev/null ) || ( echo "Error: ${UWSGI_PATH} needs to be built with PCRE support (libpcre)" && exit 1 )
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-php71/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,3 @@
+PHP7.1 language plugin (interpreter) for uwsginl.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-php74/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,28 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-php74
+CATEGORIES=	www lang devel
+
+COMMENT=	Language plugin for PHP 7.4
+
+LIB_DEPENDS+=	libxml2.so:textproc/libxml2 \
+		libpcre.so:devel/pcre
+
+USES=			php:build,embed
+USE_PHP=		session:build xml:build
+PHP_VER=		74
+DEFAULT_VERSIONS+=	php=${PHP_VER}
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+PLUGIN_NAME=	php74
+PLUGIN_SOURCE=	plugins/php
+
+#
+# Check whether uwsginl has been built with both libpcre and libxml2
+#
+pre-build:
+	@( ${UWSGI_PATH} --no-server --cflags | ${GREP} -- '-DUWSGI_XML_LIBXML2' >/dev/null ) || ( echo "Error: ${UWSGI_PATH} needs to be built with XML support (libxml2)" && exit 1 )
+	@( ${UWSGI_PATH} --no-server --cflags | ${GREP} -- '-DUWSGI_PCRE' >/dev/null ) || ( echo "Error: ${UWSGI_PATH} needs to be built with PCRE support (libpcre)" && exit 1 )
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-php74/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,3 @@
+PHP7.4 language plugin (interpreter) for uwsginl.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py2/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-py2
+
+COMMENT=	Language plugin for Python 2 (OS default)
+
+USES=		python:2.7 gettext-runtime
+
+PLUGIN_NAME=	python2
+PLUGIN_SOURCE=	plugins/python
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py2/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python2 language plugin for uwsginl.
+Links to the default Python2 version on the system.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py27/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-py27
+
+COMMENT=	Language plugin for Python 2.7
+
+USES=		python:2.7 gettext-runtime
+
+PLUGIN_NAME=	python27
+PLUGIN_SOURCE=	plugins/python
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py27/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python2.7 language plugin for uwsginl.
+Links to python2.7.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py3/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,68 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME?=	${UWSGI_NAME}-plugin-lang-py3
+#DISTVERSION=	2.0.18
+PORTVERSION=	2.1.pl4.g${MYGH_TAG_DATE}
+PORTREVISION?=	0
+CATEGORIES?=	www python
+# Use GitHub id for now (before official 2.1); see below
+#MASTER_SITES=	https://projects.unbit.it/downloads/
+#DISTNAME=	uwsgi-${DISTVERSION}
+
+MAINTAINER?=	freebsd-dev@dom66.de
+COMMENT?=	Language plugin for Python 3 (OS default)
+
+LICENSE=	GPLv2-WITH-LINKING-EXCEPTION
+LICENSE_GROUPS=	FSF GPL OSI
+LICENSE_NAME=	GPLv2 with linking exception
+LICENSE_FILE=	${WRKSRC}/LICENSE
+LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+BUILD_DEPENDS+=	${UWSGI_NAME}==${PORTVERSION}:www/uwsginl
+RUN_DEPENDS+=	${UWSGI_NAME}==${PORTVERSION}:www/uwsginl
+
+# This specific python version is built
+USES?=		python:3.5+ gettext-runtime
+# Some python version is needed when building
+USES+=		python:build pkgconfig
+
+.include	"${.CURDIR}/../uwsginl/Makefile.gh"
+
+PLIST_FILES=	${PLUGIN_DIR}/${PLUGIN_FILENAME}
+
+MAKE_ENV+=	UWSGI_PROFILE_OVERRIDE="plugin_build_dir=${STAGEDIR}${PREFIX}/${PLUGIN_DIR};plugin_dir=${PREFIX}/${PLUGIN_DIR}" PYTHON=${PYTHON_CMD}
+
+# by default it uses the MASTERDIR's description
+DESCR?=		${.CURDIR}/pkg-descr
+
+UWSGI_NAME=	uwsginl
+UWSGI_PATH=	${LOCALBASE}/bin/${UWSGI_NAME}
+PLUGIN_DIR=	lib/${UWSGI_NAME}/plugins
+
+# The name of the plugin to be created (to eventually  distingush py2 and py3)
+PLUGIN_NAME?=	python3
+# Where to find the sources for the plugin (defaults to plugins/${PLUGIN_NAME})
+.if defined(MASTERDIR)
+.if !defined(PLUGIN_SOURCE) || empty(PLUGIN_SOURCE)
+PLUGIN_SOURCE=	plugins/${PLUGIN_NAME}
+.endif
+.else
+PLUGIN_SOURCE=	plugins/python
+.endif
+# The complete basename of the plugin
+PLUGIN_FILENAME=	${PLUGIN_NAME}_plugin.so
+
+# Use the PATCHDIR of the binary executable by default
+PATCHDIR?=		${.CURDIR}/../uwsginl/files
+
+do-configure:
+	@${DO_NADA}
+
+do-build:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/${PLUGIN_DIR}
+	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${UWSGI_PATH} --build-plugin "${PLUGIN_SOURCE} ${PLUGIN_NAME}")
+
+do-install:
+	${INSTALL_LIB} ${BUILD_WRKSRC}/${PLUGIN_FILENAME} ${STAGEDIR}${PREFIX}/${PLUGIN_DIR}
+
+.include <bsd.port.mk>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py3/distinfo	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,3 @@
+TIMESTAMP = 1642864975
+SHA256 (unbit-uwsgi-2.1.pl4.g20211229-3c23cc311cbe9b698d05e4f436a497f615afc2bb_GH0.tar.gz) = c377f2057a7352c09683a51d3ed0efd33c25bee8a48e769d21f2bc0802c1be80
+SIZE (unbit-uwsgi-2.1.pl4.g20211229-3c23cc311cbe9b698d05e4f436a497f615afc2bb_GH0.tar.gz) = 858057
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py3/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3 language plugin for uwsginl.
+Links to the default Python3 version on the system.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py310/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-py310
+
+COMMENT=	Language plugin for Python 3.10
+
+USES=		python:3.10 gettext-runtime
+
+PLUGIN_NAME=	python310
+PLUGIN_SOURCE=	plugins/python
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py310/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.10 language plugin for uwsginl.
+Links to python3.10.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py34/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-py34
+
+COMMENT=	Language plugin for Python 3.4
+
+USES=		python:3.4 gettext-runtime
+
+PLUGIN_NAME=	python34
+PLUGIN_SOURCE=	plugins/python
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py34/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.4 language plugin for uwsginl.
+Links to python3.4.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py36/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-py36
+
+COMMENT=	Language plugin for Python 3.6
+
+USES=		python:3.6 gettext-runtime
+
+PLUGIN_NAME=	python36
+PLUGIN_SOURCE=	plugins/python
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py36/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.6 language plugin for uwsginl.
+Links to python3.6.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py37/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-py37
+
+COMMENT=	Language plugin for Python 3.7
+
+USES=		python:3.7 gettext-runtime
+
+PLUGIN_NAME=	python37
+PLUGIN_SOURCE=	plugins/python
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py37/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.7 language plugin for uwsginl.
+Links to python3.7.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py38/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-py38
+
+COMMENT=	Language plugin for Python 3.8
+
+USES=		python:3.8 gettext-runtime
+
+PLUGIN_NAME=	python38
+PLUGIN_SOURCE=	plugins/python
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py38/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.8 language plugin for uwsginl.
+Links to python3.8.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py39/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-py39
+
+COMMENT=	Language plugin for Python 3.9
+
+USES=		python:3.9 gettext-runtime
+
+PLUGIN_NAME=	python39
+PLUGIN_SOURCE=	plugins/python
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-py39/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.9 language plugin for uwsginl.
+Links to python3.9.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-pypy3/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,61 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-lang-pypy3
+#DISTVERSION=	2.0.18
+PORTVERSION=	2.1.pl4.g${MYGH_TAG_DATE}
+CATEGORIES=	www python
+# Use GitHub id for now (before official 2.1); see below
+#MASTER_SITES=	https://projects.unbit.it/downloads/
+#DISTNAME=	uwsgi-${DISTVERSION}
+
+MAINTAINER=	freebsd-dev@dom66.de
+COMMENT=	Language plugin for PyPy 3
+
+LICENSE=	GPLv2-WITH-LINKING-EXCEPTION
+LICENSE_GROUPS=	FSF GPL OSI
+LICENSE_NAME=	GPLv2 with linking exception
+LICENSE_FILE=	${WRKSRC}/LICENSE
+LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+BUILD_DEPENDS+=	${UWSGI_NAME}==${PORTVERSION}:www/uwsginl
+BUILD_DEPENDS+=	pypy3>=6:lang/pypy3
+RUN_DEPENDS+=	${UWSGI_NAME}==${PORTVERSION}:www/uwsginl
+RUN_DEPENDS+=	pypy3>=6:lang/pypy3
+
+USES=		gettext-runtime pkgconfig
+
+.include        "${.CURDIR}/../uwsginl/Makefile.gh"
+
+EXTRA_PATCHES=	${.CURDIR}/files/extra
+
+PLIST_FILES=	${PLUGIN_DIR}/${PLUGIN_FILENAME}
+
+MAKE_ENV+=	UWSGI_PROFILE_OVERRIDE="plugin_build_dir=${STAGEDIR}${PREFIX}/${PLUGIN_DIR};plugin_dir=${PREFIX}/${PLUGIN_DIR}" PYTHON=/usr/local/bin/pypy3
+
+DESCR=		pkg-descr
+
+UWSGI_NAME=	uwsginl
+UWSGI_PATH=	${LOCALBASE}/bin/${UWSGI_NAME}
+PLUGIN_DIR=	lib/${UWSGI_NAME}/plugins
+
+# The name of the plugin to be created (to eventually  distingush py2 and py3)
+PLUGIN_NAME=	pypy3
+# Where to find the sources for the plugin (defaults to plugins/${PLUGIN_NAME})
+PLUGIN_SOURCE=	plugins/pypy
+# The complete basename of the plugin
+PLUGIN_FILENAME=	${PLUGIN_NAME}_plugin.so
+
+# Use the PATCHDIR of the binary executable by default
+PATCHDIR?=		${.CURDIR}/../uwsginl/files
+
+do-configure:
+	@${DO_NADA}
+
+do-build:
+	@${MKDIR} ${STAGEDIR}${PREFIX}/${PLUGIN_DIR}
+	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${UWSGI_PATH} --build-plugin "${PLUGIN_SOURCE} ${PLUGIN_NAME}")
+
+do-install:
+	${INSTALL_LIB} ${BUILD_WRKSRC}/${PLUGIN_FILENAME} ${STAGEDIR}${PREFIX}/${PLUGIN_DIR}
+
+.include <bsd.port.mk>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-pypy3/distinfo	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,3 @@
+TIMESTAMP = 1642864990
+SHA256 (unbit-uwsgi-2.1.pl4.g20211229-3c23cc311cbe9b698d05e4f436a497f615afc2bb_GH0.tar.gz) = c377f2057a7352c09683a51d3ed0efd33c25bee8a48e769d21f2bc0802c1be80
+SIZE (unbit-uwsgi-2.1.pl4.g20211229-3c23cc311cbe9b698d05e4f436a497f615afc2bb_GH0.tar.gz) = 858057
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-pypy3/files/extra/patch-plugins_pypy_pypy__plugin.c	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,211 @@
+--- plugins/pypy/pypy_plugin.c.orig	2020-07-09 07:54:09.000000000 +0200
++++ plugins/pypy/pypy_plugin.c	2020-08-05 09:21:06.250984000 +0200
+@@ -42,9 +42,10 @@ void (*uwsgi_pypy_hook_paste_loader)(char *);
+ void (*uwsgi_pypy_hook_pythonpath)(char *);
+ void (*uwsgi_pypy_hook_request)(void *, int);
+ void (*uwsgi_pypy_post_fork_hook)(void);
++void (*uwsgi_pypy_hook_atexit)(void);
+ 
+ extern struct uwsgi_server uwsgi;
+-struct uwsgi_plugin pypy_plugin;
++struct uwsgi_plugin pypy3_plugin;
+ 
+ static int uwsgi_pypy_init() {
+ 
+@@ -68,26 +69,26 @@ static int uwsgi_pypy_init() {
+ 		if (upypy.home) {
+ 			// first try with /bin way:
+ #ifdef __CYGWIN__
+-                        char *libpath = uwsgi_concat2(upypy.home, "/bin/libpypy-c.dll");
++			char *libpath = uwsgi_concat2(upypy.home, "/bin/libpypy3-c.so");
+ #elif defined(__APPLE__)
+-                        char *libpath = uwsgi_concat2(upypy.home, "/bin/libpypy-c.dylib");
++			char *libpath = uwsgi_concat2(upypy.home, "/bin/libpypy3-c.so");
+ #else
+-                        char *libpath = uwsgi_concat2(upypy.home, "/bin/libpypy-c.so");
++			char *libpath = uwsgi_concat2(upypy.home, "/bin/libpypy3-c.so");
+ #endif
+ 			if (uwsgi_file_exists(libpath)) {
+-                                upypy.handler = dlopen(libpath, RTLD_NOW | RTLD_GLOBAL);
+-                        }
+-                        free(libpath);
++				upypy.handler = dlopen(libpath, RTLD_NOW | RTLD_GLOBAL);
++			}
++			free(libpath);
+ 
+ 			// fallback to old-style way
+ 			if (!upypy.handler) {
+ 			
+ #ifdef __CYGWIN__
+-                        	char *libpath = uwsgi_concat2(upypy.home, "/libpypy-c.dll");
++				char *libpath = uwsgi_concat2(upypy.home, "/libpypy3-c.so");
+ #elif defined(__APPLE__)
+-                        	char *libpath = uwsgi_concat2(upypy.home, "/libpypy-c.dylib");
++				char *libpath = uwsgi_concat2(upypy.home, "/libpypy3-c.dylib");
+ #else
+-                        	char *libpath = uwsgi_concat2(upypy.home, "/libpypy-c.so");
++				char *libpath = uwsgi_concat2(upypy.home, "/libpypy3-c.so");
+ #endif
+ 				if (uwsgi_file_exists(libpath)) {
+ 					upypy.handler = dlopen(libpath, RTLD_NOW | RTLD_GLOBAL);
+@@ -98,11 +99,11 @@ static int uwsgi_pypy_init() {
+ 		// fallback to standard library search path
+ 		if (!upypy.handler) {
+ #ifdef __CYGWIN__
+-			upypy.handler = dlopen("libpypy-c.dll", RTLD_NOW | RTLD_GLOBAL);
++			upypy.handler = dlopen("libpypy3-c.dll", RTLD_NOW | RTLD_GLOBAL);
+ #elif defined(__APPLE__)
+-			upypy.handler = dlopen("libpypy-c.dylib", RTLD_NOW | RTLD_GLOBAL);
++			upypy.handler = dlopen("libpypy3-c.dylib", RTLD_NOW | RTLD_GLOBAL);
+ #else
+-			upypy.handler = dlopen("libpypy-c.so", RTLD_NOW | RTLD_GLOBAL);
++			upypy.handler = dlopen("libpypy3-c.so", RTLD_NOW | RTLD_GLOBAL);
+ #endif
+ 		}
+ 	}
+@@ -125,9 +126,9 @@ static int uwsgi_pypy_init() {
+ 	}
+ 
+ 	u_pypy_init_threads = dlsym(upypy.handler, "pypy_init_threads");
+-        if (!u_pypy_init_threads) {
+-                uwsgi_log("!!! WARNING your libpypy-c does not export pypy_init_threads, multithreading will not work !!!\n");
+-        }
++	if (!u_pypy_init_threads) {
++		uwsgi_log("!!! WARNING your libpypy-c does not export pypy_init_threads, multithreading will not work !!!\n");
++	}
+ 	
+ 	u_rpython_startup_code();
+ 
+@@ -148,9 +149,9 @@ static int uwsgi_pypy_init() {
+ 				goto ready;
+ 			}
+ 		}
+-                uwsgi_log("unable to set pypy home to \"%s\"\n", upypy.home);
++		uwsgi_log("unable to set pypy home to \"%s\"\n", upypy.home);
+ 		exit(1);
+-        }
++	}
+ 
+ ready:
+ 	u_pypy_execute_source = dlsym(upypy.handler, "pypy_execute_source");
+@@ -160,9 +161,9 @@ ready:
+ 	}
+ 
+ 	u_pypy_thread_attach = dlsym(upypy.handler, "pypy_thread_attach");
+-        if (!u_pypy_thread_attach) {
+-                uwsgi_log("!!! WARNING your libpypy-c does not export pypy_thread_attach, multithreading will not work !!!\n");
+-        }
++	if (!u_pypy_thread_attach) {
++		uwsgi_log("!!! WARNING your libpypy-c does not export pypy_thread_attach, multithreading will not work !!!\n");
++	}
+ 
+ 	if (upypy.setup) {
+ 		buffer = uwsgi_open_and_read(upypy.setup, &rlen, 1, NULL);
+@@ -233,14 +234,14 @@ static void uwsgi_pypy_preinit_apps() {
+ 
+ static int uwsgi_pypy_request(struct wsgi_request *wsgi_req) {
+ 	/* Standard WSGI request */
+-        if (!wsgi_req->len) {
+-                uwsgi_log( "Empty pypy request. skip.\n");
+-                return -1;
+-        }
++	if (!wsgi_req->len) {
++		uwsgi_log( "Empty pypy request. skip.\n");
++		return -1;
++	}
+ 
+-        if (uwsgi_parse_vars(wsgi_req)) {
+-                return -1;
+-        }
++	if (uwsgi_parse_vars(wsgi_req)) {
++		return -1;
++	}
+ 
+ 	if (uwsgi_pypy_hook_request) {
+ 		uwsgi_pypy_hook_request(wsgi_req, wsgi_req->async_id);
+@@ -266,16 +267,20 @@ static void uwsgi_pypy_init_apps() {
+ 	}
+ }
+ 
+-/*
++
+ static void uwsgi_pypy_atexit() {
+-	if (pypy_debug_file)
+-		fflush(pypy_debug_file);
++	/* NOTE: this function is NOT called when "skip-atexit = true" is configured */
++	if (!uwsgi_pypy_hook_atexit) {
++		uwsgi_log("!!! Your pypy setup does not define a uwsgi_pypy_atexit !!!\n");	       
++		return;
++	}	     
++	uwsgi_pypy_hook_atexit();
+ }
+-*/
+ 
++
+ static void uwsgi_opt_pypy_ini_paste(char *opt, char *value, void *foobar) {
+-        uwsgi_opt_load_ini(opt, value, NULL);
+-        upypy.paste = value;
++	uwsgi_opt_load_ini(opt, value, NULL);
++	upypy.paste = value;
+ }
+ 
+ 
+@@ -332,14 +337,14 @@ static void uwsgi_pypy_post_fork() {
+ 	pthread_mutex_init(&upypy.attach_thread_lock, NULL);
+ 	struct uwsgi_string_list *usl = NULL;
+ 	uwsgi_foreach(usl, upypy.eval_post_fork) {
+-                uwsgi_pypy_hook_execute_source(usl->value);
+-        }
++		uwsgi_pypy_hook_execute_source(usl->value);
++	}
+ 	uwsgi_foreach(usl, upypy.exec_post_fork) {
+-                size_t rlen = 0;
+-                char *buffer = uwsgi_open_and_read(usl->value, &rlen, 1, NULL);
+-                uwsgi_pypy_hook_execute_source(buffer);
+-                free(buffer);
+-        }
++		size_t rlen = 0;
++		char *buffer = uwsgi_open_and_read(usl->value, &rlen, 1, NULL);
++		uwsgi_pypy_hook_execute_source(buffer);
++		free(buffer);
++	}
+ 
+ 	if (uwsgi_pypy_post_fork_hook) {
+ 		uwsgi_pypy_post_fork_hook();
+@@ -360,20 +365,20 @@ static int uwsgi_pypy_mule(char *opt) {
+ 		exit(1);
+ 	}
+ 
+-        if (uwsgi_endswith(opt, ".py")) {
+-                size_t rlen = 0;
+-                char *buffer = uwsgi_open_and_read(opt, &rlen, 1, NULL);
+-                uwsgi_pypy_hook_execute_source(buffer);
++	if (uwsgi_endswith(opt, ".py")) {
++		size_t rlen = 0;
++		char *buffer = uwsgi_open_and_read(opt, &rlen, 1, NULL);
++		uwsgi_pypy_hook_execute_source(buffer);
+ 		free(buffer);
+-                return 1;
+-        }
+-        return 0;
++		return 1;
++	}
++	return 0;
+ 
+ }
+ 
+ 
+-struct uwsgi_plugin pypy_plugin = {
+-	.name = "pypy",
++struct uwsgi_plugin pypy3_plugin = {
++	.name = "pypy3",
+ 	.modifier1 = 0,
+ 	.on_load = uwsgi_pypy_onload,
+ 	.init = uwsgi_pypy_init,
+@@ -388,4 +393,6 @@ struct uwsgi_plugin pypy_plugin = {
+ 	.rpc = uwsgi_pypy_rpc,
+ 	.post_fork = uwsgi_pypy_post_fork,
+ 	.mule = uwsgi_pypy_mule,
++
++	.atexit = uwsgi_pypy_atexit,
+ };
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-pypy3/files/extra/patch-plugins_pypy_pypy__setup.py	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,218 @@
+--- plugins/pypy/pypy_setup.py.orig	2020-07-09 07:54:09.000000000 +0200
++++ plugins/pypy/pypy_setup.py	2020-08-05 02:24:53.865927000 +0200
+@@ -31,8 +31,15 @@
+ extern void (*uwsgi_pypy_hook_pythonpath)(char *);
+ extern void (*uwsgi_pypy_hook_request)(struct wsgi_request *);
+ extern void (*uwsgi_pypy_post_fork_hook)(void);
++extern void (*uwsgi_pypy_hook_atexit)(void);
+ '''
+ 
++
++# Convert a byte string to a native string using the default encoding
++def n(b):
++    return b.decode()
++
++
+ # here we load CFLAGS and uwsgi.h from the binary
+ defines0 = '''
+ char *uwsgi_get_cflags();
+@@ -46,7 +53,7 @@
+ # basically it build a list of #define from binary CFLAGS
+ uwsgi_cdef = []
+ uwsgi_defines = []
+-uwsgi_cflags = ffi.string(lib0.uwsgi_get_cflags()).split()
++uwsgi_cflags = n(ffi.string(lib0.uwsgi_get_cflags())).split()
+ for cflag in uwsgi_cflags:
+     if cflag.startswith('-D'):
+         line = cflag[2:]
+@@ -57,8 +64,14 @@
+         else:
+             uwsgi_cdef.append('#define %s ...' % line)
+             uwsgi_defines.append('#define %s 1' % line)
+-uwsgi_dot_h = ffi.string(lib0.uwsgi_get_dot_h())
++uwsgi_dot_h = n(ffi.string(lib0.uwsgi_get_dot_h()))
+ 
++#
++# Replace #include <pcre.h> on FreeBSD because it is found on a non-standard
++# location for cffi.
++#
++uwsgi_dot_h = uwsgi_dot_h.replace('#include <pcre.h>', '#include "/usr/local/include/pcre.h"')
++
+ # uwsgi definitions
+ cdefines = '''
+ %s
+@@ -110,6 +123,8 @@
+         uint64_t running_time;
+         uint64_t avg_response_time;
+         uint64_t tx;
++
++        int hijacked;
+         ...;
+ };
+ 
+@@ -164,11 +179,14 @@
+         struct wsgi_request *wsgi_req;
+ 
+         struct uwsgi_plugin *p[];
++
++        int skip_atexit_teardown;
++
+         ...;
+ };
+ struct uwsgi_server uwsgi;
+ 
+-struct uwsgi_plugin pypy_plugin;
++struct uwsgi_plugin pypy3_plugin;
+ 
+ const char *uwsgi_pypy_version;
+ 
+@@ -269,7 +287,7 @@
+ %s
+ 
+ extern struct uwsgi_server uwsgi;
+-extern struct uwsgi_plugin pypy_plugin;
++extern struct uwsgi_plugin pypy3_plugin;
+ %s
+ ''' % ('\n'.join(uwsgi_defines), uwsgi_dot_h, hooks)
+ 
+@@ -286,7 +304,7 @@
+ 
+ # fix argv if needed
+ if len(sys.argv) == 0:
+-    sys.argv.insert(0, ffi.string(lib.uwsgi_binary_path()))
++    sys.argv.insert(0, n(ffi.string(lib.uwsgi_binary_path())))
+ 
+ 
+ @ffi.callback("void(char *)")
+@@ -305,7 +323,7 @@
+     load a wsgi module
+     """
+     global wsgi_application
+-    m = ffi.string(module)
++    m = n(ffi.string(module))
+     c = 'application'
+     if ':' in m:
+         m, c = m.split(':')
+@@ -322,7 +340,7 @@
+     load a mod_wsgi compliant .wsgi file
+     """
+     global wsgi_application
+-    w = ffi.string(filename)
++    w = n(ffi.string(filename))
+     c = 'application'
+     mod = imp.load_source('uwsgi_file_wsgi', w)
+     wsgi_application = getattr(mod, c)
+@@ -334,7 +352,7 @@
+     load a .ini paste app
+     """
+     global wsgi_application
+-    c = ffi.string(config)
++    c = n(ffi.string(config))
+     if c.startswith('config:'):
+         c = c[7:]
+     if c[0] != '/':
+@@ -358,12 +376,47 @@
+         uwsgi.post_fork_hook()
+ 
+ 
++@ffi.callback("void()")
++def uwsgi_pypy_atexit():
++    """
++    .atexit handler implementation
++
++    Modelled after python_plugin.c
++    """
++    mywid = lib.uwsgi.mywid
++    if mywid > 0:
++        # if hijacked do not run atexit hooks
++        if lib.uwsgi.workers[mywid].hijacked:
++            return
++        # if busy do not run atexit hooks
++        if lib.uwsgi_worker_is_busy(mywid):
++            return
++        # managing atexit in async mode is a real pain...skip it for now
++        if lib.uwsgi.async > 0:
++            return
++
++    import uwsgi
++    uahandler = getattr(uwsgi, "atexit", None)
++    if callable(uahandler):
++        uahandler()
++
++    if lib.uwsgi.skip_atexit_teardown:
++        return
++
++    import atexit
++    aefn = getattr(atexit, "_run_exitfuncs", None)
++    if callable(aefn):
++        aefn()
++    else:
++        print("!!! atexit._run_exitfuncs() not found !!!")
++
++
+ @ffi.callback("void(char *)")
+ def uwsgi_pypy_pythonpath(item):
+     """
+     add an item to the pythonpath
+     """
+-    path = ffi.string(item)
++    path = n(ffi.string(item))
+     sys.path.append(path)
+     print("added %s to pythonpath" % path)
+ 
+@@ -470,15 +523,17 @@
+     def start_response(status, headers, exc_info=None):
+         if exc_info:
+             traceback.print_exception(*exc_info)
++        status = status.encode("latin1")
+         lib.uwsgi_response_prepare_headers(wsgi_req, ffi.new("char[]", status), len(status))
+         for hh in headers:
++            hh = (hh[0].encode("latin1"), hh[1].encode("latin1"))
+             lib.uwsgi_response_add_header(wsgi_req, ffi.new("char[]", hh[0]), len(hh[0]), ffi.new("char[]", hh[1]), len(hh[1]))
+         return writer
+ 
+     environ = {}
+     iov = wsgi_req.hvec
+     for i in range(0, wsgi_req.var_cnt, 2):
+-        environ[ffi.string(ffi.cast("char*", iov[i].iov_base), iov[i].iov_len)] = ffi.string(ffi.cast("char*", iov[i+1].iov_base), iov[i+1].iov_len)
++        environ[ffi.string(ffi.cast("char*", iov[i].iov_base), iov[i].iov_len).decode("latin1")] = ffi.string(ffi.cast("char*", iov[i+1].iov_base), iov[i+1].iov_len).decode("latin1")
+ 
+     environ['wsgi.version'] = (1, 0)
+     scheme = 'http'
+@@ -523,6 +578,7 @@
+ lib.uwsgi_pypy_hook_pythonpath = uwsgi_pypy_pythonpath
+ lib.uwsgi_pypy_hook_request = uwsgi_pypy_wsgi_handler
+ lib.uwsgi_pypy_post_fork_hook = uwsgi_pypy_post_fork_hook
++lib.uwsgi_pypy_hook_atexit = uwsgi_pypy_atexit
+ 
+ """
+ Here we define the "uwsgi" virtual module
+@@ -537,7 +593,7 @@
+ def uwsgi_pypy_uwsgi_register_signal(signum, kind, handler):
+     cb = ffi.callback('void(int)', handler)
+     uwsgi_gc.append(cb)
+-    if lib.uwsgi_register_signal(signum, ffi.new("char[]", kind), cb, lib.pypy_plugin.modifier1) < 0:
++    if lib.uwsgi_register_signal(signum, ffi.new("char[]", kind), cb, lib.pypy3_plugin.modifier1) < 0:
+         raise Exception("unable to register signal %d" % signum)
+ uwsgi.register_signal = uwsgi_pypy_uwsgi_register_signal
+ 
+@@ -562,7 +618,7 @@
+     rpc_func = uwsgi_pypy_RPC(func)
+     cb = ffi.callback("int(int, char*[], int[], char**)", rpc_func)
+     uwsgi_gc.append(cb)
+-    if lib.uwsgi_register_rpc(ffi.new("char[]", name), ffi.addressof(lib.pypy_plugin), argc, cb) < 0:
++    if lib.uwsgi_register_rpc(ffi.new("char[]", name), ffi.addressof(lib.pypy3_plugin), argc, cb) < 0:
+         raise Exception("unable to register rpc func %s" % name)
+ uwsgi.register_rpc = uwsgi_pypy_uwsgi_register_rpc
+ 
+@@ -598,8 +654,8 @@
+ 
+ def uwsgi_pypy_call(func, *args):
+     node = None
+-    if '@' in func:
+-        (func, node) = func.split('@')
++    if b'@' in func:
++        (func, node) = func.split(b'@')
+     return uwsgi_pypy_rpc(node, func, *args)
+ uwsgi.call = uwsgi_pypy_call
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-pypy3/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,5 @@
+PyPy3 language plugin for uwsginl.
+Dynamically links to PyPy3's libpypy3-c.so.
+Contains a PY3 compatible pypy_setup.py already.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-lang-pypy3/scripts/make-extra-patches.sh	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+diff -u --show-c-function plugins/pypy/pypy_plugin.c.orig plugins/pypy/pypy_plugin.c >../../files/extra/patch-plugins_pypy_pypy__plugin.c
+
+diff -u plugins/pypy/pypy_setup.py.orig plugins/pypy/pypy_setup.py >../../files/extra/patch-plugins_pypy_pypy__setup.py
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-pam/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,14 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-pam
+
+COMMENT=	PAM plugin for uwsginl
+
+USES=
+
+PLUGIN_NAME=	pam
+PLUGIN_SOURCE=	plugins/pam
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-pam/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+PAM plugin for uwsginl.
+Allows uwsginl to use FreeBSD's libpam in the base system.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-tornado3/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,15 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3 tornado plugin for ${UWSGI_NAME}
+
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}tornado>=5.0:devel/py-tornado@${PY_FLAVOR}
+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}tornado>=5.0:devel/py-tornado@${PY_FLAVOR}
+
+PLUGIN_NAME=	tornado3
+PLUGIN_SOURCE=	plugins/tornado
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-tornado3/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3 tornado plugin for uwsginl.
+Links to the default Python3 version on the system.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-tornado36/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,17 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3.6 tornado plugin for ${UWSGI_NAME}
+
+USES=		python:3.6 gettext-runtime
+
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}tornado>=5.0:devel/py-tornado@${PY_FLAVOR}
+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}tornado>=5.0:devel/py-tornado@${PY_FLAVOR}
+
+PLUGIN_NAME=	tornado36
+PLUGIN_SOURCE=	plugins/tornado
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-tornado36/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.6 tornado plugin for uwsginl.
+Links to Python 3.6.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-tornado37/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,17 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3.7 tornado plugin for ${UWSGI_NAME}
+
+USES=		python:3.7 gettext-runtime
+
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}tornado>=5.0:devel/py-tornado@${PY_FLAVOR}
+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}tornado>=5.0:devel/py-tornado@${PY_FLAVOR}
+
+PLUGIN_NAME=	tornado37
+PLUGIN_SOURCE=	plugins/tornado
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-tornado37/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.7 tornado plugin for uwsginl.
+Links to Python 3.7.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-tornado38/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,17 @@
+# Created by: Franz Glasner <freebsd-dev-@dom66.de>
+
+PORTNAME=	${UWSGI_NAME}-plugin-${PLUGIN_NAME}
+
+COMMENT=	Python3.8 tornado plugin for ${UWSGI_NAME}
+
+USES=		python:3.8 gettext-runtime
+
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}tornado>=5.0:devel/py-tornado@${PY_FLAVOR}
+BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}tornado>=5.0:devel/py-tornado@${PY_FLAVOR}
+
+PLUGIN_NAME=	tornado38
+PLUGIN_SOURCE=	plugins/tornado
+
+MASTERDIR=	${.CURDIR}/../uwsginl-plugin-lang-py3
+
+.include	"${MASTERDIR}/Makefile"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl-plugin-tornado38/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,4 @@
+Python3.8 tornado plugin for uwsginl.
+Links to Python 3.8.
+
+WWW: https://projects.unbit.it/uwsgi/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/Makefile	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,92 @@
+# Created by: Franz Glasner <freebsd-dev@dom66.de>
+# Based on www/uwsgi by: Daniel Gerzo <danger@FreeBSD.org>
+
+PORTNAME=	uwsginl
+#DISTVERSION=	2.0.20
+# "pl" sorts before .a .b .dev ...
+PORTVERSION=    2.1.pl4.g${MYGH_TAG_DATE}
+CATEGORIES=	www
+# Use GitHub id for now (before official 2.1); see below
+#MASTER_SITES=	https://projects.unbit.it/downloads/
+#DISTNAME=	uwsgi-${DISTVERSION}
+
+MAINTAINER=	freebsd-dev@dom66.de
+COMMENT=	WSGI server which uses the uwsgi protocol (nolang profile)
+WWW=		https://projects.unbit.it/uwsgi/
+
+LICENSE=	GPLv2-WITH-LINKING-EXCEPTION
+LICENSE_GROUPS=	FSF GPL OSI
+LICENSE_NAME=	GPLv2 with linking exception
+LICENSE_FILE=	${WRKSRC}/LICENSE
+LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
+
+USES=		cpe pkgconfig python:3.6-3.10,build
+USE_RC_SUBR=	uwsginl
+CPE_VENDOR=	unbit
+
+.include "Makefile.gh"
+
+MAKE_ENV+=	CPUCOUNT=${MAKE_JOBS_NUMBER} UWSGI_PROFILE=nolang.ini UWSGI_BIN_NAME=${PORTNAME} UWSGI_EMBED_PLUGINS=cgi,clock_realtime,clock_monotonic,echo,logpipe,pty,forkptyrouter UWSGI_PROFILE_OVERRIDE="plugin_dir=${PREFIX}/${PLUGIN_DIR};${EXTRA_PROFILE_OVERRIDE:S/ /;/gW}"
+
+USERS=		uwsgi
+GROUPS=		uwsgi
+
+PLIST_SUB=	PORTNAME=${PORTNAME} PLUGIN_DIR=${PLUGIN_DIR}
+
+OPTIONS_DEFINE=		DEBUGSYM UWSGIDEBUG JSON PCRE XML SSL
+OPTIONS_DEFAULT=	SSL BUILTINYAML
+
+OPTIONS_RADIO=		YAML
+OPTIONS_RADIO_YAML=	BUILTINYAML LIBYAML
+
+DEBUGSYM_DESC=		Build with debug symbols
+DEBUGSYM_VARS=		EXTRA_BUILDARGS+=--debug
+
+UWSGIDEBUG_DESC=	Enable uwsgi debugging (def UWSGI_DEBUG, implies DEBUG)
+UWSGIDEBUG_VARS=	BUILDCONF_DEBUG=true
+
+JSON_DESC=		JSON file/format/parser support (with libjansson)
+JSON_VARS=		BUILDCONF_JSON=jansson
+JSON_LIB_DEPENDS=	libjansson.so:devel/jansson
+
+PCRE_VARS=		BUILDCONF_PCRE=true
+PCRE_LIB_DEPENDS=	libpcre.so:devel/pcre
+
+XML_VARS=		BUILDCONF_XML=libxml2
+XML_LIB_DEPENDS=	libxml2.so:textproc/libxml2
+
+SSL_VARS=		BUILDCONF_SSL=true
+SSL_USES=		ssl
+SSL_CFLAGS=		-I${OPENSSLINC}
+SSL_LDFLAGS=		${OPENSSL_LDFLAGS}
+
+YAML_DESC=		Select YAML support (or none)
+
+BUILTINYAML_DESC=	Enable built-in basic YAML support
+BUILTINYAML_VARS=	BUILDCONF_YAML=true
+
+LIBYAML_DESC=		Use external libyaml for proper YAML support
+LIBYAML_VARS=		BUILDCONF_YAML=libyaml
+LIBYAML_CFLAGS=		-I${LOCALBASE}/include
+LIBYAML_LDFLAGS=	-L${LOCALBASE}/lib
+LIBYAML_LIB_DEPENDS=	libyaml.so:textproc/libyaml
+
+.include <bsd.port.options.mk>
+
+PLUGIN_DIR=	lib/${PORTNAME}/plugins
+
+.for bcvar in DEBUG YAML JSON PCRE XML SSL
+EXTRA_PROFILE_OVERRIDE+=	${bcvar:tl}=${BUILDCONF_${bcvar}:Ufalse}
+.endfor
+
+do-configure:
+	@${DO_NADA}
+
+do-build:
+	@(cd ${BUILD_WRKSRC}; ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} uwsgiconfig.py --build ${EXTRA_BUILDARGS} --verbose)
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/
+	${MKDIR} ${STAGEDIR}${PREFIX}/${PLUGIN_DIR}
+
+.include <bsd.port.mk>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/Makefile.gh	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,8 @@
+# Common GitHug-related definitions for uwsginl and related plugin builds when plugins are **not** slave builds
+
+USE_GITHUB=     yes
+GH_ACCOUNT=     unbit
+GH_PROJECT=     uwsgi
+GH_TAGNAME=     3c23cc311cbe9b698d05e4f436a497f615afc2bb
+
+MYGH_TAG_DATE=	20211229
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/distinfo	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,3 @@
+TIMESTAMP = 1642864389
+SHA256 (unbit-uwsgi-2.1.pl4.g20211229-3c23cc311cbe9b698d05e4f436a497f615afc2bb_GH0.tar.gz) = c377f2057a7352c09683a51d3ed0efd33c25bee8a48e769d21f2bc0802c1be80
+SIZE (unbit-uwsgi-2.1.pl4.g20211229-3c23cc311cbe9b698d05e4f436a497f615afc2bb_GH0.tar.gz) = 858057
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/files/patch-core-logging.c	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,32 @@
+--- core/logging.c.orig	2020-11-06 10:12:49.865752000 +0100
++++ core/logging.c	2020-11-06 10:17:57.825745000 +0100
+@@ -536,13 +536,23 @@
+ 			uwsgi_error_open(logfile);
+ 			exit(1);
+ 		}
+-		else {
+-			if (dup2(fd, log_fd) < 0) {
+-				// this could be lost :(
+-				uwsgi_error("uwsgi_log_do_rotate()/dup2()");
+-				exit(1);
+-			}
++		if (dup2(fd, log_fd) < 0) {
++			// this could be lost :(
++			uwsgi_error("uwsgi_log_do_rotate()/dup2()");
+ 			close(fd);
++			exit(1);
++		}
++		close(fd);
++
++		if (uwsgi.chmod_logfile_value) {
++			if (fchmod(log_fd, uwsgi.chmod_logfile_value)) {
++				uwsgi_error("fchmod()");
++			}
++		}
++		if (uwsgi.logfile_chown) {
++			if (fchown(log_fd, uwsgi.uid, uwsgi.gid)) {
++				uwsgi_error("fchown()");
++			}
+ 		}
+ 	}
+ 	else {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/files/patch-plugins_coroae_uwsgiplugin.py	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,11 @@
+--- plugins/coroae/uwsgiplugin.py.orig	2020-06-17 09:03:34 UTC
++++ plugins/coroae/uwsgiplugin.py
+@@ -9,7 +9,7 @@ for p in search_paths:
+         coroapi = p
+ 
+ if not coroapi:
+-    print "unable to find the Coro perl module !!!"
++    print("unable to find the Coro perl module !!!")
+     sys.exit(1)
+ 
+ NAME='coroae'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/files/patch-uwsgiconfig.py	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,30 @@
+--- uwsgiconfig.py.orig	2020-06-14 09:50:00 UTC
++++ uwsgiconfig.py
+@@ -1494,7 +1494,8 @@ def build_plugin(path, uc, cflags, ldflags, libs, name
+             gcc_list.append(path + '/' + cfile)
+     for bfile in up.get('BINARY_LIST', []):
+         try:
+-            binary_link_cmd = "ld -r -b binary -o %s/%s.o %s/%s" % (path, bfile[1], path, bfile[1])
++            # See https://svnweb.freebsd.org/base/vendor/lld/dist-release_80/ELF/Driver.cpp?revision=344173&view=markup
++            binary_link_cmd = "ld -r -b binary %s -o %s/%s.o %s/%s" % (get_default_target_emulation(), path, bfile[1], path, bfile[1])
+             print(binary_link_cmd)
+             if os.system(binary_link_cmd) != 0:
+                 raise Exception('unable to link binary file')
+@@ -1590,6 +1591,17 @@ def build_plugin(path, uc, cflags, ldflags, libs, name
+ 
+     print("build time: %d seconds" % (time.time() - plugin_started_at))
+     print("*** %s plugin built and available in %s ***" % (name, plugin_dest + '.so'))
++
++def get_default_target_emulation():
++    """Need a target emulation on FreeBSD (ld, ld.lld when linking binary/raw"""
++    emul = ""
++    if uwsgi_cpu in ("amd64", "x86-64", "x86_64"):
++        emul = "elf_amd64"
++    elif uwsgi_cpu in ("i386", "x86"):
++        emul = "elf_i386"
++    if emul:
++        return "-m %s" % emul
++    return ""
+ 
+ 
+ def vararg_callback(option, opt_str, value, parser):
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/files/uwsginl.in	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,177 @@
+#!/bin/sh
+
+# PROVIDE: uwsginl
+# REQUIRE: DAEMON
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf to enable uwsgi:
+#
+# uwsginl_enable (bool):	Set it to "YES" to enable uwsgi
+#				Default is "NO".
+# uwsginl_emperor (bool):	Set it to "YES" to run uwsgi in emperor mode
+#				Default is "NO".
+# uwsginl_configfile (path):	Set the path to the config file
+#				Default is %%PREFIX%%/etc/uwsginl/uwsginl.ini.
+# uwsginl_vassals_dir (path):	Set the path to the vassals directory
+#				Default is %%PREFIX%%/etc/uwsginl/vassals.
+# uwsginl_logfile (path):	Set the path to the uwsgi log file
+#				Default is /var/log/uwsginl.log.
+# uwsginl_pidfile (path):	Set the path to the uwsgi pid file
+#				Default is /var/run/uwsginl.pid.
+# uwsginl_uid (int):		Set the UID of the process to run with
+#				Default is uwsgi.
+# uwsginl_gid (int):		Set the GID of the process to run with
+#				Default is uwsgi.
+# uwsginl_flags (str):		Set the uwsgi command line arguments
+#				Default is "--disable-logging".
+# uwsginl_procname (str):       Set the procname. On FreeBSD this should
+#                               be exactly one word; otherwise stopping does
+#                               not work.
+#                               Default is empty ("").
+#
+# If you would like to have multiple uWSGI instances running, you can
+# define multiple profiles:
+#
+# uwsginl_profiles (str):	Set the list of uwsgi profiles
+#				Default is "".
+#
+# For each profile you can then define different options (except for
+# uwsginl_enable) using the syntax uwsginl_<profile>_<option>
+
+. /etc/rc.subr
+
+name="uwsginl"
+rcvar=uwsginl_enable
+
+load_rc_config $name
+
+command=%%PREFIX%%/bin/uwsginl
+
+: ${uwsginl_enable:="NO"}
+: ${uwsginl_profiles=""}
+: ${uwsginl_configfile="%%PREFIX%%/etc/uwsginl/uwsginl.ini"}
+: ${uwsginl_logfile="/var/log/${name}.log"}
+: ${uwsginl_pidfile="/var/run/${name}.pid"}
+: ${uwsginl_uid:="uwsgi"}
+: ${uwsginl_gid:="uwsgi"}
+: ${uwsginl_flags="--disable-logging"}
+: ${uwsginl_emperor:="NO"}
+: ${uwsginl_vassals_dir:="%%PREFIX%%/etc/uwsginl/vassals"}
+: ${uwsginl_procname=""}
+
+is_uwsginl_profile() {
+	local profile
+
+	for profile in $uwsginl_profiles; do
+		if [ "$profile" = "$1" ]; then
+			return 0
+		fi
+	done
+	return 1
+}
+
+# Echo name of uWSGI option for handling of configuration file with given
+# extension.
+get_config_filetype()
+{
+	case "$1" in
+	*.ini)
+		echo ini
+		;;
+	*.json|*.js)
+		echo json
+		;;
+	*.xml)
+		echo xml
+		;;
+	*.yaml|*.yml)
+		echo yaml
+		;;
+	*)
+		warn "Unknown configuration file type for \`$1'"
+		echo ini
+		return 1
+		;;
+	esac
+}
+
+if [ -n "${uwsginl_profiles}" ]; then
+	if [ -n "$2" ]; then
+		profile="$2"
+		if ! is_uwsginl_profile $profile; then
+			echo "$0: no such profile defined in uwsginl_profiles."
+			exit 1
+		fi
+		eval uwsginl_configfile=\${uwsginl_${profile}_configfile:-"%%PREFIX%%/etc/uwsginl/uwsginl-${profile}.ini"}
+		eval uwsginl_logfile=\${uwsginl_${profile}_logfile:-"/var/log/${name}-${profile}.log"}
+		eval uwsginl_pidfile=\${uwsginl_${profile}_pidfile:-"/var/run/${name}-${profile}.pid"}
+		eval uwsginl_uid=\${uwsginl_${profile}_uid:-"${uwsginl_uid}"}
+		eval uwsginl_gid=\${uwsginl_${profile}_gid:-"${uwsginl_gid}"}
+		eval uwsginl_flags=\${uwsginl_${profile}_flags-"${uwsginl_flags}"}
+		eval uwsginl_emperor=\${uwsginl_${profile}_emperor:-"${uwsginl_emperor}"}
+		eval uwsginl_vassals_dir=\${uwsginl_${profile}_vassals_dir:-"%%PREFIX%%/etc/uwsginl/vassals-${profile}/"}
+		eval uwsginl_procname=\${uwsginl_${profile}_procname:-""}
+	elif [ -n "$1" ]; then
+		for profile in ${uwsginl_profiles}; do
+			echo "Processing ${name} profile: ${profile}"
+			%%PREFIX%%/etc/rc.d/uwsginl $1 ${profile}
+		done
+		exit 0
+	fi
+fi
+
+pidfile="${uwsginl_pidfile}"
+start_precmd=start_precmd
+stop_postcmd=stop_postcmd
+reload_precmd=reload_precmd
+brutalreload_cmd=brutalreload_cmd
+sig_stop="QUIT"
+extra_commands="reload brutalreload"
+procname="${uwsginl_procname}"
+
+start_precmd()
+{
+	if checkyesno uwsginl_emperor; then
+		echo "Running uWSGI as Emperor. Vassals loaded from "$uwsginl_vassals_dir
+		required_dirs=${uwsginl_vassals_dir}
+		rc_flags="--emperor-pidfile ${uwsginl_pidfile} --daemonize ${uwsginl_logfile} --emperor ${uwsginl_vassals_dir}"
+		rc_flags=${rc_flags}" --vassals-set uid=${uwsginl_uid} --vassals-set gid=${uwsginl_gid}"
+		if [ -n "${uwsginl_procname}" ]; then
+			rc_flags=${rc_flags}" --emperor-procname \"${uwsginl_procname}\""
+		fi
+	else
+		rc_flags="--master --uid ${uwsginl_uid} --gid ${uwsginl_gid} --pidfile ${uwsginl_pidfile} --daemonize ${uwsginl_logfile}"
+		if [ -n "${uwsginl_procname}" ]; then
+			rc_flags=${rc_flags}" --procname-master \"${uwsginl_procname}\""
+		fi
+
+	fi
+
+	rc_flags=${rc_flags}" ${uwsginl_flags}"
+
+	# put the configfile last so that all given options can be overwritten
+	if [ -e "${uwsginl_configfile}" ]; then
+		rc_flags=${rc_flags}" --$(get_config_filetype "${uwsginl_configfile}") ${uwsginl_configfile}"
+	fi
+}
+
+stop_postcmd()
+{
+	rm -f "${uwsginl_pidfile}"
+}
+
+reload_precmd()
+{
+	echo "Gracefully reloading ${name} without closing the main sockets."
+}
+
+brutalreload_cmd()
+{
+	echo "Reloading ${name} without closing the main sockets."
+
+	reload_precmd=""
+	sig_reload="TERM"
+	run_rc_command ${rc_prefix}reload $rc_extra_args || return 1
+}
+
+run_rc_command "$1"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/pkg-descr	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,97 @@
+uWSGI is a fast (pure C), self-healing, developer-friendly WSGI server,
+aimed for professional python webapps deployment and development.  Over
+time it has evolved in a complete stack for networked/clustered python
+applications, implementing message/object passing, RPC and process
+management.
+
+*** uWSGI loaded generic plugins ***
+nagios
+rrdtool
+carbon
+corerouter
+fastrouter
+http
+ugreen
+syslog
+rsyslog
+logsocket
+router_uwsgi
+router_redirect
+router_basicauth
+zergpool
+redislog
+mongodblog
+router_rewrite
+router_http
+logfile
+router_cache
+rawrouter
+router_static
+sslrouter
+cheaper_busyness
+transformation_tofile
+transformation_gzip
+transformation_chunked
+transformation_offload
+router_memcached
+router_redis
+router_hash
+router_expires
+router_metrics
+transformation_template
+stats_pusher_socket
+clock_realtime
+clock_monotonic
+logpipe
+pty
+forkptyrouter
+
+*** uWSGI loaded request plugins ***
+9: cgi
+17: spooler
+18: symcall
+100: ping
+101: echo
+110: signal
+111: cache
+173: rpc
+--- end of plugins list ---
+
+*** uWSGI loaded clocks ***
+unix
+realtime
+monotonic
+--- end of clocks list ---
+
+*** uWSGI loaded loggers ***
+syslog
+rsyslog
+socket
+redislog
+mongodblog
+file
+fd
+stdio
+pipe
+--- end of loggers list ---
+
+*** uWSGI loaded alarms ***
+signal
+cmd
+mule
+log
+--- end of alarms list ---
+
+*** uWSGI loaded cheaper algorithms ***
+busyness
+spare
+backlog
+manual
+--- end of cheaper algorithms list ---
+
+*** uWSGI loaded loop engines ***
+simple
+async
+--- end of loop engines list ---
+
+!!! no internal routing support, rebuild with pcre support !!!
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/uwsginl/pkg-plist	Sun Sep 25 17:54:32 2022 +0200
@@ -0,0 +1,2 @@
+bin/%%PORTNAME%%
+@dir %%PLUGIN_DIR%%