summaryrefslogtreecommitdiff
path: root/www-servers
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2023-12-08 23:11:34 +0000
committerV3n3RiX <venerix@koprulu.sector>2023-12-08 23:11:34 +0000
commit1a74c5436dbcb832445250e8f3ed0a00f6c2fcef (patch)
tree894da263e3a728142059a616daf4c6a1925a0efa /www-servers
parent39cf9c5c49469d4a3168620ab74b1648c87e205e (diff)
gentoo auto-resync : 08:12:2023 - 23:11:34
Diffstat (limited to 'www-servers')
-rw-r--r--www-servers/Manifest.gzbin4710 -> 4708 bytes
-rw-r--r--www-servers/uwsgi/Manifest5
-rw-r--r--www-servers/uwsgi/uwsgi-2.0.21-r1.ebuild (renamed from www-servers/uwsgi/uwsgi-2.0.21.ebuild)4
-rw-r--r--www-servers/uwsgi/uwsgi-2.0.21-r2.ebuild378
-rw-r--r--www-servers/uwsgi/uwsgi-2.0.23.ebuild375
5 files changed, 759 insertions, 3 deletions
diff --git a/www-servers/Manifest.gz b/www-servers/Manifest.gz
index 16e843e1bf27..80039a9ae65f 100644
--- a/www-servers/Manifest.gz
+++ b/www-servers/Manifest.gz
Binary files differ
diff --git a/www-servers/uwsgi/Manifest b/www-servers/uwsgi/Manifest
index ca8b7f072dc1..5a29e9e4fd38 100644
--- a/www-servers/uwsgi/Manifest
+++ b/www-servers/uwsgi/Manifest
@@ -5,5 +5,8 @@ AUX uwsgi-2.0.21-python-unicode.patch 978 BLAKE2B 8014a39e6f29e38bb88cb5fe517c86
AUX uwsgi.confd-r4 1849 BLAKE2B 80afdf7a5ebc520d887061aba9f7cd64b1bca06d3da478d8d1090a8b9cba973ac2d3dbcbc2ceb980415e98317bc55b07a9a7e6641fac593dc4dd5466bd8d67c9 SHA512 041d1bd694fad6f7c5e28944aab6d7ba53b3c7fc990ce6b7c2d97b9f3d6650c46dda8069e545c252a7400e1d825c8e46d7393a289757b1bd665e64241ca3789a
AUX uwsgi.initd-r7 3746 BLAKE2B a56c5f4e32ccb415fab10f357e2a7404179285e656d9f886809da281b214e2110c76e2cf8826d8fd90aba01262a5edc7a941522ff59348972c5a4325c784b9b9 SHA512 81ed974fb2957e05c890cab29f5b5a75845e6b7de899d2695fb2fa5f49b4545daa437c81c8dc5c735b24a45655cf6320c9256bc8faa7e32ffd7a2d981922def5
DIST uwsgi-2.0.21.tar.gz 808494 BLAKE2B 3c5fc3ce3a6a7f8f915bb302c0b775a75227f859dd2b141034e8b1aa5cb867b447ed532b3e8b537db80acc908fc26121b752e35ebc0bf9a542678843fd02ff54 SHA512 36a9c1b87a4c3d08482b9045d2227f56b006acb53f38ddf1b510880ae5fc24c0177a077338ec8af3ef0b8f8e220bc4fc7f8311dab8066e13cbcbb616f736c795
-EBUILD uwsgi-2.0.21.ebuild 11322 BLAKE2B 9ac072c4e1831fe54d727e72731e8b255b27e25a2fb151fb4088f12ada958469c22c1ec571af9b262944b3518c517a8a77b58f0824e790655fa5d67a53c290fa SHA512 2b139c73f4d0f6edcea594f5049467297ce48809d5c9aa52e0d784f34f1f7e624b8194b865bd55259a6f267285082ae4e6b0b38860e6c9485782cc10ee6bd6f6
+DIST uwsgi-2.0.23.tar.gz 810116 BLAKE2B be4353ac71a5282233b0a996e74e49bff66f4c460eb2640058c7028cfeae41214661785de78cdd4aa35415bcc4595e1e340ba48db87bee413754b13d8b24a7d8 SHA512 4060dd66f8c6309497b52a961c36a58fe2b3b3afc7e11b97cfa464757c614d1d44ccc561b18500a394b5d95e5660eae48759003a30ec07379a6f079f63f3899b
+EBUILD uwsgi-2.0.21-r1.ebuild 11319 BLAKE2B 917820a2a75135c4966dd6e4503620effd5da5f5364d0e9f0117c96e65f8d4a5d3cfd7e75f99446e5db481513f162ad2e98133b7e8eb17308f1301f797b7b4cc SHA512 26ce3c3fdd3b4a0db4883b48161704008d181dd03bd741a1ce4f6160325f96493e8a5f39f71ecee323c5835677df974ac94675dbb9cfaa888f7ececa296ae7e6
+EBUILD uwsgi-2.0.21-r2.ebuild 11017 BLAKE2B ae9090b3e2aebb6759fcc0f1c6c3f2e37b576d6d9d485d9459028748c63c7a60f5c1024b90f220e3838744dc67ad10dd6929b0b45600b10da36cb1e124692b9a SHA512 b1e76757391e8b901931cf71ae50eaa923a9e982fafae304442fc9659ca490b2d659a9c906a02c046a7b2a98e56f38907584a11d8dd7dfdd91d625f9b563d1ec
+EBUILD uwsgi-2.0.23.ebuild 10881 BLAKE2B 0941b19520fcb6bbad0a3a8ce7ea5f7c68ffabb586483ffd153d8b259c4ae999c5687ac9ff2dc7a7dde6e1c285f2c30e194a27fb07bca6e056e99276351ef641 SHA512 69f5b6ab92e405427cd82584026ffec3aae2492cd454fe3a65ca501aaf5f5d28a1d9f8dc4de5cd31d13d8e69f56c0aff905bb792a2d39768b3d4429662e14417
MISC metadata.xml 1245 BLAKE2B 3254a0e0211101ad9c353f6247424bb44df9ddb56bb152414b9fac2b515fe163e5163d2119bc040da1676b4d941afedf4a331a19e4cdbf794a7816d012abd328 SHA512 4e3dc2b9c9d7386ed6f132da703af971789c73af567f5333faca65e3194567ead794a84c28b5382eadb149ae4dcc7847e07bc02e3d84391b3b6cccc11e08e232
diff --git a/www-servers/uwsgi/uwsgi-2.0.21.ebuild b/www-servers/uwsgi/uwsgi-2.0.21-r1.ebuild
index b0230bb50ec4..71cc969f1a4e 100644
--- a/www-servers/uwsgi/uwsgi-2.0.21.ebuild
+++ b/www-servers/uwsgi/uwsgi-2.0.21-r1.ebuild
@@ -6,7 +6,7 @@ EAPI=7
# Check the upstream uwsgi-2.0 branch, not master, for backports
LUA_COMPAT=( lua5-1 )
-PYTHON_COMPAT=( python3_{9..11} )
+PYTHON_COMPAT=( python3_{10..11} )
PYTHON_REQ_USE="threads(+)"
RUBY_OPTIONAL="yes"
@@ -137,7 +137,7 @@ CDEPEND="
php_targets_php8-2? ( dev-lang/php:8.2[embed] )
)
python? ( ${PYTHON_DEPS} )
- python-asyncio? ( virtual/python-greenlet[${PYTHON_USEDEP}] )
+ python-asyncio? ( dev-python/greenlet[${PYTHON_USEDEP}] )
ruby? ( $(ruby_implementations_depend) )
"
DEPEND="${CDEPEND}"
diff --git a/www-servers/uwsgi/uwsgi-2.0.21-r2.ebuild b/www-servers/uwsgi/uwsgi-2.0.21-r2.ebuild
new file mode 100644
index 000000000000..924121f3109b
--- /dev/null
+++ b/www-servers/uwsgi/uwsgi-2.0.21-r2.ebuild
@@ -0,0 +1,378 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# Check the upstream uwsgi-2.0 branch, not master, for backports
+
+LUA_COMPAT=( lua5-1 )
+PYTHON_COMPAT=( python3_{10..11} )
+PYTHON_REQ_USE="threads(+)"
+
+RUBY_OPTIONAL="yes"
+USE_RUBY="ruby27 ruby30 ruby31 ruby32"
+
+PHP_EXT_INI="no"
+PHP_EXT_NAME="dummy"
+PHP_EXT_OPTIONAL_USE="php"
+USE_PHP="php8-0 php8-1 php8-2" # deps must be registered separately below
+
+POSTGRES_COMPAT=( 13 14 15 )
+
+MY_P="${P/_/-}"
+
+inherit lua-single multiprocessing pax-utils php-ext-source-r3 postgres python-r1 ruby-ng
+
+DESCRIPTION="uWSGI server for Python web applications"
+HOMEPAGE="https://uwsgi-docs.readthedocs.io/en/latest/"
+SRC_URI="https://github.com/unbit/uwsgi/archive/${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux"
+
+UWSGI_PLUGINS_STD=(
+ ping cache carbon nagios rpc rrdtool
+ http ugreen signal syslog rsyslog
+ router_{uwsgi,redirect,basicauth,rewrite,http,cache,static,memcached,redis,hash,expires,metrics}
+ {core,fast,raw,ssl}router
+ redislog mongodblog log{file,socket}
+ spooler cheaper_busyness symcall
+ transformation_{chunked,gzip,offload,tofile}
+ zergpool
+)
+UWSGI_PLUGINS_OPT=(
+ alarm_{curl,xmpp} clock_{monotonic,realtime} curl_cron
+ dumbloop echo emperor_{amqp,pg,zeromq} forkptyrouter
+ geoip graylog2 legion_cache_fetch ldap log{crypto,pipe} notfound pam
+ rados router_{access,radius,spnego,xmldir}
+ sqlite ssi stats_pusher_statsd
+ systemd_logger transformation_toupper tuntap webdav xattr xslt zabbix
+)
+
+LANG_SUPPORT_SIMPLE=( cgi mono perl ) # plugins which can be built in the main build process
+LANG_SUPPORT_EXTENDED=( go lua php python ruby )
+
+# plugins to be ignored (for now):
+# cheaper_backlog2: example plugin
+# coroae: TODO
+# cplusplus: partially example code, needs explicit class
+# dummy: no idea
+# example: example plugin
+# exception_log: example plugin
+# *java*: TODO
+# v8: TODO
+# matheval: TODO
+IUSE="apache2 +caps debug +embedded expat jemalloc json +pcre +routing selinux +ssl +xml yajl yaml zeromq"
+
+for plugin in ${UWSGI_PLUGINS_STD[@]}; do IUSE="${IUSE} +uwsgi_plugins_${plugin}"; done
+for plugin in ${UWSGI_PLUGINS_OPT[@]}; do IUSE="${IUSE} uwsgi_plugins_${plugin}"; done
+IUSE="${IUSE} ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]}"
+
+REQUIRED_USE="
+ || ( ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]} )
+ uwsgi_plugins_logcrypto? ( ssl )
+ uwsgi_plugins_sslrouter? ( ssl )
+ routing? ( pcre )
+ uwsgi_plugins_emperor_pg? ( ${POSTGRES_REQ_USE} )
+ uwsgi_plugins_emperor_zeromq? ( zeromq )
+ uwsgi_plugins_forkptyrouter? ( uwsgi_plugins_corerouter )
+ uwsgi_plugins_router_xmldir? ( xml !expat )
+ lua? ( ${LUA_REQUIRED_USE} )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ expat? ( xml )
+"
+
+# Dependency notes:
+# - util-linux is required for libuuid when requesting zeromq support
+# - sys-devel/gcc[go] is needed for libgo.so
+#
+# Order:
+# 1. Unconditional
+# 2. General features
+# 3. Plugins
+# 4. Language/app support
+CDEPEND="
+ sys-libs/zlib
+ virtual/libcrypt:=
+ caps? ( sys-libs/libcap )
+ json? (
+ !yajl? ( dev-libs/jansson:= )
+ yajl? ( dev-libs/yajl )
+ )
+ pcre? ( dev-libs/libpcre:3 )
+ ssl? ( dev-libs/openssl:= )
+ xml? (
+ !expat? ( dev-libs/libxml2 )
+ expat? ( dev-libs/expat )
+ )
+ yaml? ( dev-libs/libyaml )
+ zeromq? (
+ net-libs/zeromq
+ sys-apps/util-linux
+ )
+ uwsgi_plugins_alarm_curl? ( net-misc/curl )
+ uwsgi_plugins_alarm_xmpp? ( net-libs/gloox )
+ uwsgi_plugins_curl_cron? ( net-misc/curl )
+ uwsgi_plugins_emperor_pg? ( ${POSTGRES_DEP} )
+ uwsgi_plugins_geoip? ( dev-libs/geoip )
+ uwsgi_plugins_ldap? ( net-nds/openldap:= )
+ uwsgi_plugins_pam? ( sys-libs/pam )
+ uwsgi_plugins_sqlite? ( dev-db/sqlite:3 )
+ uwsgi_plugins_rados? ( sys-cluster/ceph )
+ uwsgi_plugins_router_access? ( sys-apps/tcp-wrappers )
+ uwsgi_plugins_router_spnego? ( virtual/krb5 )
+ uwsgi_plugins_systemd_logger? ( sys-apps/systemd )
+ uwsgi_plugins_webdav? ( dev-libs/libxml2 )
+ uwsgi_plugins_xslt? ( dev-libs/libxslt )
+ go? ( sys-devel/gcc:=[go] )
+ lua? ( ${LUA_DEPS} )
+ mono? ( dev-lang/mono:= )
+ perl? ( dev-lang/perl:= )
+ php? (
+ php_targets_php8-0? ( dev-lang/php:8.0[embed] )
+ php_targets_php8-1? ( dev-lang/php:8.1[embed] )
+ php_targets_php8-2? ( dev-lang/php:8.2[embed] )
+ )
+ python? ( ${PYTHON_DEPS} )
+ ruby? ( $(ruby_implementations_depend) )
+"
+DEPEND="${CDEPEND}"
+RDEPEND="
+ ${CDEPEND}
+ selinux? ( sec-policy/selinux-uwsgi )
+ uwsgi_plugins_rrdtool? ( net-analyzer/rrdtool )
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-php82.patch
+ "${FILESDIR}"/${P}-python-unicode.patch
+ "${FILESDIR}"/${P}-libphp-version.patch
+)
+
+pkg_setup() {
+ python_setup
+ use lua && lua-single_pkg_setup
+ use ruby && ruby-ng_pkg_setup
+ use uwsgi_plugins_emperor_pg && postgres_pkg_setup
+}
+
+src_unpack() {
+ default
+}
+
+src_prepare() {
+ default
+
+ sed -i \
+ -e "s|'-O2', ||" \
+ -e "s|'-Werror', ||" \
+ -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
+ uwsgiconfig.py || die "sed failed"
+
+ sed -i \
+ -e "s|/lib|/$(get_libdir)|" \
+ plugins/php/uwsgiplugin.py || die "sed failed"
+}
+
+src_configure() {
+ local embedded_plugins=()
+ local plugins=()
+ local malloc_impl="libc"
+ local json="false"
+ local xml="false"
+
+ local p
+ for p in ${UWSGI_PLUGINS_STD[@]} ${UWSGI_PLUGINS_OPT[@]} ; do
+ use uwsgi_plugins_${p} && embedded_plugins+=("${p}")
+ done
+ for p in ${LANG_SUPPORT_SIMPLE[@]} ; do
+ use ${p} && plugins+=("${p}")
+ done
+
+ # do not embed any plugins
+ if ! use embedded; then
+ plugins=( ${plugins[@]} ${embedded_plugins[@]} )
+ embedded_plugins=()
+ fi
+
+ # flatten the arrays
+ plugins=${plugins[@]}
+ embedded_plugins=${embedded_plugins[@]}
+
+ # rename some of the use flags, language plugins are always real plugins
+ plugins="${plugins/perl/psgi}"
+ plugins="${plugins/sqlite/sqlite3}"
+ embedded_plugins="${embedded_plugins/sqlite/sqlite3}"
+
+ # override defaults as requested by the user
+ if use xml; then
+ use expat && xml="expat" || xml="libxml2"
+ fi
+ if use json; then
+ use yajl && json="yajl" || json="jansson"
+ fi
+ use jemalloc && malloc_impl="jemalloc"
+
+ # prepare the buildconf for gentoo
+ cp "${FILESDIR}"/gentoo.buildconf buildconf/gentoo.ini || die
+ sed -i \
+ -e "s|VAR_XML|${xml}|" \
+ -e "s|VAR_YAML|$(usex yaml libyaml true)|" \
+ -e "s|VAR_JSON|${json}|" \
+ -e "s|VAR_SSL|$(usex ssl true false)|" \
+ -e "s|VAR_PCRE|$(usex pcre true false)|" \
+ -e "s|VAR_ZMQ|$(usex zeromq true false)|" \
+ -e "s|VAR_ROUTING|$(usex routing true false)|" \
+ -e "s|VAR_DEBUG|$(usex debug true false)|" \
+ -e "s|VAR_MALLOC|${malloc_impl}|" \
+ -e "s|VAR_PLUGINS|${plugins// /, }|" \
+ -e "s|VAR_PLUGIN_DIR|${EPREFIX}/usr/$(get_libdir)/uwsgi|" \
+ -e "s|VAR_BUILD_DIR|${T}/plugins|" \
+ -e "s|VAR_EMBEDDED|${embedded_plugins// /, }|" \
+ buildconf/gentoo.ini || die "sed failed"
+
+ if ! use caps; then
+ sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
+ fi
+
+ if ! use zeromq; then
+ sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
+ fi
+
+ if use uwsgi_plugins_emperor_pg ; then
+ sed -i \
+ -e "s|pg_config|${PG_CONFIG}|" \
+ plugins/emperor_pg/uwsgiplugin.py || die "sed failed"
+ fi
+}
+
+each_ruby_compile() {
+ cd "${WORKDIR}/${MY_P}" || die "sed failed"
+
+ UWSGICONFIG_RUBYPATH="${RUBY}" ${EPYTHON} uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
+ UWSGICONFIG_RUBYPATH="${RUBY}" ${EPYTHON} uwsgiconfig.py --plugin plugins/fiber gentoo fiber_${RUBY##*/}|| die "building fiber plugin for ${RUBY} failed"
+ UWSGICONFIG_RUBYPATH="${RUBY}" ${EPYTHON} uwsgiconfig.py --plugin plugins/rbthreads gentoo rbthreads_${RUBY##*/}|| die "building rbthreads plugin for ${RUBY} failed"
+}
+
+python_compile_plugins() {
+ local EPYV
+ local PYV
+ EPYV=${EPYTHON/.}
+ PYV=${EPYV/python}
+
+ ${EPYTHON} uwsgiconfig.py --plugin plugins/python gentoo ${EPYV} || die "building plugin for ${EPYTHON} failed"
+ ${EPYTHON} uwsgiconfig.py --plugin plugins/asyncio gentoo asyncio${PYV} || die "building plugin for asyncio-support in ${EPYTHON} failed"
+}
+
+python_install_symlinks() {
+ dosym uwsgi /usr/bin/uwsgi_${EPYTHON/.}
+}
+
+src_compile() {
+ mkdir -p "${T}/plugins" || die
+
+ export CPUCOUNT="$(makeopts_jobs)"
+
+ ${EPYTHON} uwsgiconfig.py --build gentoo || die "building uwsgi failed"
+
+ if use go ; then
+ ${EPYTHON} uwsgiconfig.py --plugin plugins/gccgo gentoo || die "building plugin for go failed"
+ fi
+
+ if use lua ; then
+ # setting the name for the pkg-config file to lua, since that is the name
+ # provided by the wrapper from Lua eclasses
+ UWSGICONFIG_LUAPC="lua" ${EPYTHON} uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
+ fi
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" ${EPYTHON} uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
+ done
+ fi
+
+ if use python ; then
+ python_foreach_impl python_compile_plugins
+ fi
+
+ if use ruby ; then
+ ruby-ng_src_compile
+ fi
+}
+
+src_install() {
+ dobin uwsgi
+ pax-mark m "${D}"/usr/bin/uwsgi
+
+ insinto /usr/$(get_libdir)/uwsgi
+ doins "${T}/plugins"/*.so
+
+ use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
+ use go && dosym uwsgi /usr/bin/uwsgi_go
+ use lua && dosym uwsgi /usr/bin/uwsgi_lua
+ use mono && dosym uwsgi /usr/bin/uwsgi_mono
+ use perl && dosym uwsgi /usr/bin/uwsgi_psgi
+
+ if use php ; then
+ local s
+ for s in $(php_get_slots); do
+ dosym uwsgi /usr/bin/uwsgi_${s/.}
+ done
+ fi
+
+ if use python ; then
+ python_foreach_impl python_install_symlinks
+ python_foreach_impl python_domodule uwsgidecorators.py
+ fi
+
+ newinitd "${FILESDIR}"/uwsgi.initd-r7 uwsgi
+ newconfd "${FILESDIR}"/uwsgi.confd-r4 uwsgi
+ keepdir /etc/"${PN}".d
+ use uwsgi_plugins_spooler && keepdir /var/spool/"${PN}"
+}
+
+pkg_postinst() {
+ if use apache2 ; then
+ ewarn "As reported on bug #650776 [1], Apache module mod_proxy_uwsgi"
+ ewarn "is being transferred to upstream Apache since 2.4.30, see [2]."
+ ewarn "We therefore do not build them any more."
+ ewarn " [1] https://bugs.gentoo.org/650776"
+ ewarn " [2] https://github.com/unbit/uwsgi/issues/1636"
+ fi
+
+ elog "Append the following options to the uwsgi call to load the respective language plugin:"
+ use cgi && elog " '--plugins cgi' for cgi"
+ use lua && elog " '--plugins lua' for lua"
+ use mono && elog " '--plugins mono' for mono"
+ use perl && elog " '--plugins psgi' for perl"
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ elog " '--plugins ${s/.}' for ${s}"
+ done
+ fi
+
+ python_pkg_postinst() {
+ local EPYV
+ local PYV
+ EPYV=${EPYTHON/.}
+ PYV=${EPYV/python}
+
+ elog " "
+ elog " '--plugins ${EPYV}' for ${EPYTHON}"
+ elog " '--plugins ${EPYV},asyncio${PYV}' for asyncio support in ${EPYTHON}"
+ }
+
+ use python && python_foreach_impl python_pkg_postinst
+
+ if use ruby ; then
+ for ruby in $(ruby_get_use_implementations) ; do
+ elog " '--plugins rack_${ruby/.}' for ${ruby}"
+ elog " '--plugins fiber_${ruby/.}' for ${ruby} fibers"
+ elog " '--plugins rbthreads_${ruby/.}' for ${ruby} rbthreads"
+ done
+ fi
+}
diff --git a/www-servers/uwsgi/uwsgi-2.0.23.ebuild b/www-servers/uwsgi/uwsgi-2.0.23.ebuild
new file mode 100644
index 000000000000..f555d1ecb230
--- /dev/null
+++ b/www-servers/uwsgi/uwsgi-2.0.23.ebuild
@@ -0,0 +1,375 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Check the upstream uwsgi-2.0 branch, not master, for backports
+
+LUA_COMPAT=( lua5-1 )
+PYTHON_COMPAT=( python3_{10..12} )
+PYTHON_REQ_USE="threads(+)"
+
+RUBY_OPTIONAL="yes"
+USE_RUBY="ruby31 ruby32"
+
+PHP_EXT_INI="no"
+PHP_EXT_NAME="dummy"
+PHP_EXT_OPTIONAL_USE="php"
+USE_PHP="php8-1 php8-2" # deps must be registered separately below
+
+POSTGRES_COMPAT=( 13 14 15 )
+
+MY_P="${P/_/-}"
+
+inherit lua-single multiprocessing pax-utils php-ext-source-r3 postgres python-r1 ruby-ng
+
+DESCRIPTION="uWSGI server for Python web applications"
+HOMEPAGE="https://uwsgi-docs.readthedocs.io/en/latest/"
+SRC_URI="https://github.com/unbit/uwsgi/archive/${PV}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~x86 ~amd64-linux"
+
+UWSGI_PLUGINS_STD=(
+ ping cache carbon nagios rpc rrdtool
+ http ugreen signal syslog rsyslog
+ router_{uwsgi,redirect,basicauth,rewrite,http,cache,static,memcached,redis,hash,expires,metrics}
+ {core,fast,raw,ssl}router
+ redislog mongodblog log{file,socket}
+ spooler cheaper_busyness symcall
+ transformation_{chunked,gzip,offload,tofile}
+ zergpool
+)
+UWSGI_PLUGINS_OPT=(
+ alarm_{curl,xmpp} clock_{monotonic,realtime} curl_cron
+ dumbloop echo emperor_{amqp,pg,zeromq} forkptyrouter
+ geoip graylog2 legion_cache_fetch ldap log{crypto,pipe} notfound pam
+ rados router_{access,radius,spnego,xmldir}
+ sqlite ssi stats_pusher_statsd
+ systemd_logger transformation_toupper tuntap webdav xattr xslt zabbix
+)
+
+LANG_SUPPORT_SIMPLE=( cgi mono perl ) # plugins which can be built in the main build process
+LANG_SUPPORT_EXTENDED=( go lua php python ruby )
+
+# plugins to be ignored (for now):
+# cheaper_backlog2: example plugin
+# coroae: TODO
+# cplusplus: partially example code, needs explicit class
+# dummy: no idea
+# example: example plugin
+# exception_log: example plugin
+# *java*: TODO
+# v8: TODO
+# matheval: TODO
+IUSE="apache2 +caps debug +embedded expat jemalloc json +pcre +routing selinux +ssl +xml yajl yaml zeromq"
+
+for plugin in ${UWSGI_PLUGINS_STD[@]}; do IUSE="${IUSE} +uwsgi_plugins_${plugin}"; done
+for plugin in ${UWSGI_PLUGINS_OPT[@]}; do IUSE="${IUSE} uwsgi_plugins_${plugin}"; done
+IUSE="${IUSE} ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]}"
+
+REQUIRED_USE="
+ || ( ${LANG_SUPPORT_SIMPLE[@]} ${LANG_SUPPORT_EXTENDED[@]} )
+ uwsgi_plugins_logcrypto? ( ssl )
+ uwsgi_plugins_sslrouter? ( ssl )
+ routing? ( pcre )
+ uwsgi_plugins_emperor_pg? ( ${POSTGRES_REQ_USE} )
+ uwsgi_plugins_emperor_zeromq? ( zeromq )
+ uwsgi_plugins_forkptyrouter? ( uwsgi_plugins_corerouter )
+ uwsgi_plugins_router_xmldir? ( xml !expat )
+ lua? ( ${LUA_REQUIRED_USE} )
+ python? ( ${PYTHON_REQUIRED_USE} )
+ expat? ( xml )
+"
+
+# Dependency notes:
+# - util-linux is required for libuuid when requesting zeromq support
+# - sys-devel/gcc[go] is needed for libgo.so
+#
+# Order:
+# 1. Unconditional
+# 2. General features
+# 3. Plugins
+# 4. Language/app support
+CDEPEND="
+ sys-libs/zlib
+ virtual/libcrypt:=
+ caps? ( sys-libs/libcap )
+ json? (
+ !yajl? ( dev-libs/jansson:= )
+ yajl? ( dev-libs/yajl )
+ )
+ pcre? ( dev-libs/libpcre:3 )
+ ssl? ( dev-libs/openssl:= )
+ xml? (
+ !expat? ( dev-libs/libxml2 )
+ expat? ( dev-libs/expat )
+ )
+ yaml? ( dev-libs/libyaml )
+ zeromq? (
+ net-libs/zeromq
+ sys-apps/util-linux
+ )
+ uwsgi_plugins_alarm_curl? ( net-misc/curl )
+ uwsgi_plugins_alarm_xmpp? ( net-libs/gloox )
+ uwsgi_plugins_curl_cron? ( net-misc/curl )
+ uwsgi_plugins_emperor_pg? ( ${POSTGRES_DEP} )
+ uwsgi_plugins_geoip? ( dev-libs/geoip )
+ uwsgi_plugins_ldap? ( net-nds/openldap:= )
+ uwsgi_plugins_pam? ( sys-libs/pam )
+ uwsgi_plugins_sqlite? ( dev-db/sqlite:3 )
+ uwsgi_plugins_rados? ( sys-cluster/ceph )
+ uwsgi_plugins_router_access? ( sys-apps/tcp-wrappers )
+ uwsgi_plugins_router_spnego? ( virtual/krb5 )
+ uwsgi_plugins_systemd_logger? ( sys-apps/systemd )
+ uwsgi_plugins_webdav? ( dev-libs/libxml2 )
+ uwsgi_plugins_xslt? ( dev-libs/libxslt )
+ go? ( sys-devel/gcc:=[go] )
+ lua? ( ${LUA_DEPS} )
+ mono? ( dev-lang/mono:= )
+ perl? ( dev-lang/perl:= )
+ php? (
+ php_targets_php8-1? ( dev-lang/php:8.1[embed] )
+ php_targets_php8-2? ( dev-lang/php:8.2[embed] )
+ )
+ python? ( ${PYTHON_DEPS} )
+ ruby? ( $(ruby_implementations_depend) )
+"
+DEPEND="${CDEPEND}"
+RDEPEND="
+ ${CDEPEND}
+ selinux? ( sec-policy/selinux-uwsgi )
+ uwsgi_plugins_rrdtool? ( net-analyzer/rrdtool )
+"
+BDEPEND="virtual/pkgconfig"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-2.0.21-libphp-version.patch
+)
+
+pkg_setup() {
+ python_setup
+ use lua && lua-single_pkg_setup
+ use ruby && ruby-ng_pkg_setup
+ use uwsgi_plugins_emperor_pg && postgres_pkg_setup
+}
+
+src_unpack() {
+ default
+}
+
+src_prepare() {
+ default
+
+ sed -i \
+ -e "s|'-O2', ||" \
+ -e "s|'-Werror', ||" \
+ -e "s|uc.get('plugin_dir')|uc.get('plugin_build_dir')|" \
+ uwsgiconfig.py || die "sed failed"
+
+ sed -i \
+ -e "s|/lib|/$(get_libdir)|" \
+ plugins/php/uwsgiplugin.py || die "sed failed"
+}
+
+src_configure() {
+ local embedded_plugins=()
+ local plugins=()
+ local malloc_impl="libc"
+ local json="false"
+ local xml="false"
+
+ local p
+ for p in ${UWSGI_PLUGINS_STD[@]} ${UWSGI_PLUGINS_OPT[@]} ; do
+ use uwsgi_plugins_${p} && embedded_plugins+=("${p}")
+ done
+ for p in ${LANG_SUPPORT_SIMPLE[@]} ; do
+ use ${p} && plugins+=("${p}")
+ done
+
+ # do not embed any plugins
+ if ! use embedded; then
+ plugins=( ${plugins[@]} ${embedded_plugins[@]} )
+ embedded_plugins=()
+ fi
+
+ # flatten the arrays
+ plugins=${plugins[@]}
+ embedded_plugins=${embedded_plugins[@]}
+
+ # rename some of the use flags, language plugins are always real plugins
+ plugins="${plugins/perl/psgi}"
+ plugins="${plugins/sqlite/sqlite3}"
+ embedded_plugins="${embedded_plugins/sqlite/sqlite3}"
+
+ # override defaults as requested by the user
+ if use xml; then
+ use expat && xml="expat" || xml="libxml2"
+ fi
+ if use json; then
+ use yajl && json="yajl" || json="jansson"
+ fi
+ use jemalloc && malloc_impl="jemalloc"
+
+ # prepare the buildconf for gentoo
+ cp "${FILESDIR}"/gentoo.buildconf buildconf/gentoo.ini || die
+ sed -i \
+ -e "s|VAR_XML|${xml}|" \
+ -e "s|VAR_YAML|$(usex yaml libyaml true)|" \
+ -e "s|VAR_JSON|${json}|" \
+ -e "s|VAR_SSL|$(usex ssl true false)|" \
+ -e "s|VAR_PCRE|$(usex pcre true false)|" \
+ -e "s|VAR_ZMQ|$(usex zeromq true false)|" \
+ -e "s|VAR_ROUTING|$(usex routing true false)|" \
+ -e "s|VAR_DEBUG|$(usex debug true false)|" \
+ -e "s|VAR_MALLOC|${malloc_impl}|" \
+ -e "s|VAR_PLUGINS|${plugins// /, }|" \
+ -e "s|VAR_PLUGIN_DIR|${EPREFIX}/usr/$(get_libdir)/uwsgi|" \
+ -e "s|VAR_BUILD_DIR|${T}/plugins|" \
+ -e "s|VAR_EMBEDDED|${embedded_plugins// /, }|" \
+ buildconf/gentoo.ini || die "sed failed"
+
+ if ! use caps; then
+ sed -i -e 's|sys/capability.h|DISABLED|' uwsgiconfig.py || die "sed failed"
+ fi
+
+ if ! use zeromq; then
+ sed -i -e 's|uuid/uuid.h|DISABLED|' uwsgiconfig.py || die "sed failed"
+ fi
+
+ if use uwsgi_plugins_emperor_pg ; then
+ sed -i \
+ -e "s|pg_config|${PG_CONFIG}|" \
+ plugins/emperor_pg/uwsgiplugin.py || die "sed failed"
+ fi
+}
+
+each_ruby_compile() {
+ cd "${WORKDIR}/${MY_P}" || die "sed failed"
+
+ UWSGICONFIG_RUBYPATH="${RUBY}" ${EPYTHON} uwsgiconfig.py --plugin plugins/rack gentoo rack_${RUBY##*/} || die "building plugin for ${RUBY} failed"
+ UWSGICONFIG_RUBYPATH="${RUBY}" ${EPYTHON} uwsgiconfig.py --plugin plugins/fiber gentoo fiber_${RUBY##*/}|| die "building fiber plugin for ${RUBY} failed"
+ UWSGICONFIG_RUBYPATH="${RUBY}" ${EPYTHON} uwsgiconfig.py --plugin plugins/rbthreads gentoo rbthreads_${RUBY##*/}|| die "building rbthreads plugin for ${RUBY} failed"
+}
+
+python_compile_plugins() {
+ local EPYV
+ local PYV
+ EPYV=${EPYTHON/.}
+ PYV=${EPYV/python}
+
+ ${EPYTHON} uwsgiconfig.py --plugin plugins/python gentoo ${EPYV} || die "building plugin for ${EPYTHON} failed"
+ ${EPYTHON} uwsgiconfig.py --plugin plugins/asyncio gentoo asyncio${PYV} || die "building plugin for asyncio-support in ${EPYTHON} failed"
+}
+
+python_install_symlinks() {
+ dosym uwsgi /usr/bin/uwsgi_${EPYTHON/.}
+}
+
+src_compile() {
+ mkdir -p "${T}/plugins" || die
+
+ export CPUCOUNT="$(makeopts_jobs)"
+
+ ${EPYTHON} uwsgiconfig.py --build gentoo || die "building uwsgi failed"
+
+ if use go ; then
+ ${EPYTHON} uwsgiconfig.py --plugin plugins/gccgo gentoo || die "building plugin for go failed"
+ fi
+
+ if use lua ; then
+ # setting the name for the pkg-config file to lua, since that is the name
+ # provided by the wrapper from Lua eclasses
+ UWSGICONFIG_LUAPC="lua" ${EPYTHON} uwsgiconfig.py --plugin plugins/lua gentoo || die "building plugin for lua failed"
+ fi
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ UWSGICONFIG_PHPDIR="/usr/$(get_libdir)/${s}" ${EPYTHON} uwsgiconfig.py --plugin plugins/php gentoo ${s/.} || die "building plugin for ${s} failed"
+ done
+ fi
+
+ if use python ; then
+ python_foreach_impl python_compile_plugins
+ fi
+
+ if use ruby ; then
+ ruby-ng_src_compile
+ fi
+}
+
+src_install() {
+ dobin uwsgi
+ pax-mark m "${D}"/usr/bin/uwsgi
+
+ insinto /usr/$(get_libdir)/uwsgi
+ doins "${T}/plugins"/*.so
+
+ use cgi && dosym uwsgi /usr/bin/uwsgi_cgi
+ use go && dosym uwsgi /usr/bin/uwsgi_go
+ use lua && dosym uwsgi /usr/bin/uwsgi_lua
+ use mono && dosym uwsgi /usr/bin/uwsgi_mono
+ use perl && dosym uwsgi /usr/bin/uwsgi_psgi
+
+ if use php ; then
+ local s
+ for s in $(php_get_slots); do
+ dosym uwsgi /usr/bin/uwsgi_${s/.}
+ done
+ fi
+
+ if use python ; then
+ python_foreach_impl python_install_symlinks
+ python_foreach_impl python_domodule uwsgidecorators.py
+ fi
+
+ newinitd "${FILESDIR}"/uwsgi.initd-r7 uwsgi
+ newconfd "${FILESDIR}"/uwsgi.confd-r4 uwsgi
+ keepdir /etc/"${PN}".d
+ use uwsgi_plugins_spooler && keepdir /var/spool/"${PN}"
+}
+
+pkg_postinst() {
+ if use apache2 ; then
+ ewarn "As reported on bug #650776 [1], Apache module mod_proxy_uwsgi"
+ ewarn "is being transferred to upstream Apache since 2.4.30, see [2]."
+ ewarn "We therefore do not build them any more."
+ ewarn " [1] https://bugs.gentoo.org/650776"
+ ewarn " [2] https://github.com/unbit/uwsgi/issues/1636"
+ fi
+
+ elog "Append the following options to the uwsgi call to load the respective language plugin:"
+ use cgi && elog " '--plugins cgi' for cgi"
+ use lua && elog " '--plugins lua' for lua"
+ use mono && elog " '--plugins mono' for mono"
+ use perl && elog " '--plugins psgi' for perl"
+
+ if use php ; then
+ for s in $(php_get_slots); do
+ elog " '--plugins ${s/.}' for ${s}"
+ done
+ fi
+
+ python_pkg_postinst() {
+ local EPYV
+ local PYV
+ EPYV=${EPYTHON/.}
+ PYV=${EPYV/python}
+
+ elog " "
+ elog " '--plugins ${EPYV}' for ${EPYTHON}"
+ elog " '--plugins ${EPYV},asyncio${PYV}' for asyncio support in ${EPYTHON}"
+ }
+
+ use python && python_foreach_impl python_pkg_postinst
+
+ if use ruby ; then
+ for ruby in $(ruby_get_use_implementations) ; do
+ elog " '--plugins rack_${ruby/.}' for ${ruby}"
+ elog " '--plugins fiber_${ruby/.}' for ${ruby} fibers"
+ elog " '--plugins rbthreads_${ruby/.}' for ${ruby} rbthreads"
+ done
+ fi
+}