summaryrefslogtreecommitdiff
path: root/www-servers/uwsgi
diff options
context:
space:
mode:
authorV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
committerV3n3RiX <venerix@koprulu.sector>2022-02-02 01:39:05 +0000
commitfcc5224904648a8e6eb528d7603154160a20022f (patch)
tree3bfce096b38a9cea8eed13fc70c1526c456e9abd /www-servers/uwsgi
parent2fd57282f0262ca084e05b0f2c63fbada395d02b (diff)
gentoo resync : 02.02.2022
Diffstat (limited to 'www-servers/uwsgi')
-rw-r--r--www-servers/uwsgi/Manifest5
-rw-r--r--www-servers/uwsgi/files/uwsgi-2.0.19.1-py310-fix-2.patch23
-rw-r--r--www-servers/uwsgi/files/uwsgi-2.0.19.1-py310-fix.patch36
-rw-r--r--www-servers/uwsgi/files/uwsgi-2.0.19.1-pynode-compile.patch123
-rw-r--r--www-servers/uwsgi/uwsgi-2.0.19.1-r108.ebuild (renamed from www-servers/uwsgi/uwsgi-2.0.19.1-r107.ebuild)12
5 files changed, 195 insertions, 4 deletions
diff --git a/www-servers/uwsgi/Manifest b/www-servers/uwsgi/Manifest
index 0a4bef321e05..302f1f98a2e9 100644
--- a/www-servers/uwsgi/Manifest
+++ b/www-servers/uwsgi/Manifest
@@ -1,6 +1,9 @@
AUX gentoo.buildconf 490 BLAKE2B 320b0471c0c76ab6c8ada7b034f612fc20398eb60e1edc3530be9d177bff755779251ea880d98addacf5476e3aae20145c95fad4d7baf594e58b9ebcaf2b0dde SHA512 d5bdc136374aed58ce206ea72cc45c72750f60117eef98960356b5cd64e2152c454af6b5aebb28f03ad46b42ea95a16fbf1e4a6f976ae78744550803ac775fe2
+AUX uwsgi-2.0.19.1-py310-fix-2.patch 731 BLAKE2B 401b03e888b8a081cddf34ab16197fd728cfbfb5c877206c0b1f65f1b1e5ef335fa3d45bf1e7786b555fc4dbbe1a9b0fd29a4bcce0be70e605bf20ca2f0e3c3c SHA512 303b25095db88a1e84a9b212c0381f8e6025f2b9bc1913882b7e376fce300575c10ceb7666fbb9622536950ee0a0c2496fca5aea20f532d7e2f3fb299e17bbbb
+AUX uwsgi-2.0.19.1-py310-fix.patch 1457 BLAKE2B 35859fabde74604a67d0fe71dbf2889465ffc4a3de7ded343c44e9accbb49daa6d45992b7b824e6fc6c0be1a84884e13ed31cc2846ccafc659ef3be06d703f62 SHA512 42fa8fd537385dcb2cf088291d249c584cce2965c4131e45ee58c7cb6d0789b5f84bc9473925700bd55a5f75667cbc361130684c28d44b597e8e66246a63b2d2
+AUX uwsgi-2.0.19.1-pynode-compile.patch 3950 BLAKE2B 4ec0f5357b7b99f3365ddfbc8643ecd8c96eb227ccc8bee78948170a00d4bce89cdaeeff3de5d2be25c428e5a7e4da220d023daff8b783deea421dc0bc67e972 SHA512 de076448c43195de0ca7fd198787de60bf29d3966ff3f6c8f0b2bacc6d29a50e4b622aeba6de56489ecae808648b099cb6bfa5322aa1d30c31d607debd6f9c6b
AUX uwsgi.confd-r4 1849 BLAKE2B 80afdf7a5ebc520d887061aba9f7cd64b1bca06d3da478d8d1090a8b9cba973ac2d3dbcbc2ceb980415e98317bc55b07a9a7e6641fac593dc4dd5466bd8d67c9 SHA512 041d1bd694fad6f7c5e28944aab6d7ba53b3c7fc990ce6b7c2d97b9f3d6650c46dda8069e545c252a7400e1d825c8e46d7393a289757b1bd665e64241ca3789a
AUX uwsgi.initd-r7 3746 BLAKE2B a56c5f4e32ccb415fab10f357e2a7404179285e656d9f886809da281b214e2110c76e2cf8826d8fd90aba01262a5edc7a941522ff59348972c5a4325c784b9b9 SHA512 81ed974fb2957e05c890cab29f5b5a75845e6b7de899d2695fb2fa5f49b4545daa437c81c8dc5c735b24a45655cf6320c9256bc8faa7e32ffd7a2d981922def5
DIST uwsgi-2.0.19.1.tar.gz 804398 BLAKE2B 73fc19990866eb1058a742b34a817b3bd87e00c838da055bece2bff5e13c161f53c642866ed591aa4afeb23ef924205502f2cb0a4cf9d303b5b63fb9a53f57e2 SHA512 34b55f7c7a77dc0b0dab34d1a9ca9a4cba8a9261969656c88435e7f32fe8a0c5654e1562706775f77e2f60c4ad0f5c6055257a23ab7d387c1579639e054807b5
-EBUILD uwsgi-2.0.19.1-r107.ebuild 11520 BLAKE2B 022aeefd01cd4a672f2dfdedf16e3c4a26e4ce6c28101073b0a2f030c0fb83ae2771f7b5cf547a176724b1226a8aad25e3439cf803593799e4d069000bb04cef SHA512 215b6f4af79daeb6e0b2cb14b688383951ab59d1429fc30532a8dae689d34db06efe48be024669ef367de5b6ecfb093259356f31c9b94d599aee6aaa9af62e01
+EBUILD uwsgi-2.0.19.1-r108.ebuild 11635 BLAKE2B f47b8b3dc6e53ded99c68420f91faeb170317e70e45cab831f79a512caa8c67719214432502dd8404e9b52ad6ec0d5ce9680d8f4604c15716bf4892462ba1dcd SHA512 e0f53bd589c945445d527d6e986874ab80d5a528640b3fdfbd5020e180067a1c6649c1157eb1f823b2ab48beb5f302666de72f64f4a6a98c0912ea612d40b1fd
MISC metadata.xml 1412 BLAKE2B c4f2831a4f5e53f49953045619adbe15ae45dc5d9c019eae8defe3de586121b3fe2292c9c7921b086d8bbf6a0c727ef1cd443c01df99e7532db9126f1b82bdb6 SHA512 2fa796e52f80dc37fe43190541675bd69a082932b00b8c92998b717d8a332300a12b19dab7cfdf1ebf0c1363252b6035a8f17e285bd86bbd685aaa2ac3464dd8
diff --git a/www-servers/uwsgi/files/uwsgi-2.0.19.1-py310-fix-2.patch b/www-servers/uwsgi/files/uwsgi-2.0.19.1-py310-fix-2.patch
new file mode 100644
index 000000000000..d175a99c65fb
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi-2.0.19.1-py310-fix-2.patch
@@ -0,0 +1,23 @@
+https://github.com/unbit/uwsgi/commit/94b28b156c26d5b0b4ba93fedb057e9aebf59545.patch
+
+From 94b28b156c26d5b0b4ba93fedb057e9aebf59545 Mon Sep 17 00:00:00 2001
+From: Thea Flowers <me@thea.codes>
+Date: Tue, 2 Nov 2021 16:29:36 -0400
+Subject: [PATCH] Add PY_SSIZE_T_CLEAN define for Python 3.10 support
+
+---
+ plugins/python/uwsgi_python.h | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/plugins/python/uwsgi_python.h b/plugins/python/uwsgi_python.h
+index aca1f83b7..ec64ad80c 100644
+--- a/plugins/python/uwsgi_python.h
++++ b/plugins/python/uwsgi_python.h
+@@ -1,4 +1,6 @@
+ #include <uwsgi.h>
++/* See https://docs.python.org/3.10/whatsnew/3.10.html#id2 */
++#define PY_SSIZE_T_CLEAN
+ #include <Python.h>
+
+ #include <frameobject.h>
+
diff --git a/www-servers/uwsgi/files/uwsgi-2.0.19.1-py310-fix.patch b/www-servers/uwsgi/files/uwsgi-2.0.19.1-py310-fix.patch
new file mode 100644
index 000000000000..8fe64d1b3d3b
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi-2.0.19.1-py310-fix.patch
@@ -0,0 +1,36 @@
+https://github.com/unbit/uwsgi/commit/c8c4bd1b5439217f2cb2f146caf162de69638bc1
+
+From c8c4bd1b5439217f2cb2f146caf162de69638bc1 Mon Sep 17 00:00:00 2001
+From: Cyrille Pontvieux <cyrille@enialis.net>
+Date: Thu, 1 Jul 2021 12:45:29 +0200
+Subject: [PATCH] Allow to compile on Python versions with more that two digits
+ (Python 3.10)
+
+---
+ plugins/python/pyloader.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/plugins/python/pyloader.c b/plugins/python/pyloader.c
+index d8ab6fe35..3a1465d67 100644
+--- a/plugins/python/pyloader.c
++++ b/plugins/python/pyloader.c
+@@ -22,7 +22,7 @@ PyMethodDef uwsgi_eventfd_write_method[] = { {"uwsgi_eventfd_write", py_eventfd_
+ void set_dyn_pyhome(char *home, uint16_t pyhome_len) {
+
+
+- char venv_version[15];
++ char venv_version[30];
+ PyObject *site_module;
+
+ PyObject *pysys_dict = get_uwsgi_pydict("sys");
+@@ -45,8 +45,8 @@ void set_dyn_pyhome(char *home, uint16_t pyhome_len) {
+ PyDict_SetItemString(pysys_dict, "prefix", venv_path);
+ PyDict_SetItemString(pysys_dict, "exec_prefix", venv_path);
+
+- venv_version[14] = 0;
+- if (snprintf(venv_version, 15, "/lib/python%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION) == -1) {
++ bzero(venv_version, 30);
++ if (snprintf(venv_version, 30, "/lib/python%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION) == -1) {
+ return;
+ }
+
diff --git a/www-servers/uwsgi/files/uwsgi-2.0.19.1-pynode-compile.patch b/www-servers/uwsgi/files/uwsgi-2.0.19.1-pynode-compile.patch
new file mode 100644
index 000000000000..6bcf04ae2bc3
--- /dev/null
+++ b/www-servers/uwsgi/files/uwsgi-2.0.19.1-pynode-compile.patch
@@ -0,0 +1,123 @@
+https://github.com/unbit/uwsgi/commit/8c890c84604a0477b46a66eab8a620733f596cc8
+
+From 8c890c84604a0477b46a66eab8a620733f596cc8 Mon Sep 17 00:00:00 2001
+From: Riccardo Magliocchetti <riccardo.magliocchetti@gmail.com>
+Date: Sun, 22 Nov 2020 18:20:19 +0100
+Subject: [PATCH] plugins/python: use Py_CompileString
+
+Instead of the deprecated PyParser_SimpleParseString, PyParser_SimpleParseFile
+and PyNode_Compile.
+While at it fixup a possible null pointer dereference when uwsgi_open_and_read
+returns an empty string.
+
+See https://bugs.python.org/issue40939
+---
+ plugins/python/pyloader.c | 12 +-----------
+ plugins/python/python_plugin.c | 36 ++++++++++++++--------------------
+ 2 files changed, 16 insertions(+), 32 deletions(-)
+
+diff --git a/plugins/python/pyloader.c b/plugins/python/pyloader.c
+index a63c375b5..d8ab6fe35 100644
+--- a/plugins/python/pyloader.c
++++ b/plugins/python/pyloader.c
+@@ -757,25 +757,15 @@ PyObject *uwsgi_eval_loader(void *arg1) {
+
+ PyObject *wsgi_eval_module, *wsgi_eval_callable = NULL;
+
+- struct _node *wsgi_eval_node = NULL;
+ PyObject *wsgi_compiled_node;
+
+- wsgi_eval_node = PyParser_SimpleParseString(code, Py_file_input);
+- if (!wsgi_eval_node) {
+- PyErr_Print();
+- uwsgi_log( "failed to parse <eval> code\n");
+- exit(UWSGI_FAILED_APP_CODE);
+- }
+-
+- wsgi_compiled_node = (PyObject *) PyNode_Compile(wsgi_eval_node, "uwsgi_eval_config");
+-
++ wsgi_compiled_node = Py_CompileString(code, "uwsgi_eval_config", Py_file_input);
+ if (!wsgi_compiled_node) {
+ PyErr_Print();
+ uwsgi_log( "failed to compile eval code\n");
+ exit(UWSGI_FAILED_APP_CODE);
+ }
+
+-
+ wsgi_eval_module = PyImport_ExecCodeModule("uwsgi_eval_config", wsgi_compiled_node);
+ if (!wsgi_eval_module) {
+ PyErr_Print();
+diff --git a/plugins/python/python_plugin.c b/plugins/python/python_plugin.c
+index 37d0b7bbf..79f29d43c 100644
+--- a/plugins/python/python_plugin.c
++++ b/plugins/python/python_plugin.c
+@@ -473,8 +473,7 @@ UWSGI_RELEASE_GIL
+
+ PyObject *uwsgi_pyimport_by_filename(char *name, char *filename) {
+
+- FILE *pyfile;
+- struct _node *py_file_node = NULL;
++ char *pycontent;
+ PyObject *py_compiled_node, *py_file_module;
+ int is_a_package = 0;
+ struct stat pystat;
+@@ -483,7 +482,7 @@ PyObject *uwsgi_pyimport_by_filename(char *name, char *filename) {
+
+ if (!uwsgi_check_scheme(filename)) {
+
+- pyfile = fopen(filename, "r");
++ FILE *pyfile = fopen(filename, "r");
+ if (!pyfile) {
+ uwsgi_log("failed to open python file %s\n", filename);
+ return NULL;
+@@ -507,37 +506,32 @@ PyObject *uwsgi_pyimport_by_filename(char *name, char *filename) {
+ }
+ }
+
+- py_file_node = PyParser_SimpleParseFile(pyfile, real_filename, Py_file_input);
+- if (!py_file_node) {
+- PyErr_Print();
+- uwsgi_log("failed to parse file %s\n", real_filename);
+- if (is_a_package)
++ fclose(pyfile);
++ pycontent = uwsgi_simple_file_read(real_filename);
++
++ if (!pycontent) {
++ if (is_a_package) {
+ free(real_filename);
+- fclose(pyfile);
++ }
++ uwsgi_log("no data read from file %s\n", real_filename);
+ return NULL;
+ }
+
+- fclose(pyfile);
+ }
+ else {
+ size_t pycontent_size = 0;
+- char *pycontent = uwsgi_open_and_read(filename, &pycontent_size, 1, NULL);
++ pycontent = uwsgi_open_and_read(filename, &pycontent_size, 1, NULL);
+
+- if (pycontent) {
+- py_file_node = PyParser_SimpleParseString(pycontent, Py_file_input);
+- if (!py_file_node) {
+- PyErr_Print();
+- uwsgi_log("failed to parse url %s\n", real_filename);
+- return NULL;
+- }
++ if (!pycontent) {
++ uwsgi_log("no data read from url %s\n", real_filename);
++ return NULL;
+ }
+ }
+
+- py_compiled_node = (PyObject *) PyNode_Compile(py_file_node, real_filename);
+-
++ py_compiled_node = Py_CompileString(pycontent, real_filename, Py_file_input);
+ if (!py_compiled_node) {
+ PyErr_Print();
+- uwsgi_log("failed to compile python file %s\n", real_filename);
++ uwsgi_log("failed to compile %s\n", real_filename);
+ return NULL;
+ }
+
diff --git a/www-servers/uwsgi/uwsgi-2.0.19.1-r107.ebuild b/www-servers/uwsgi/uwsgi-2.0.19.1-r108.ebuild
index 5f63f129cf8a..089c51e499e2 100644
--- a/www-servers/uwsgi/uwsgi-2.0.19.1-r107.ebuild
+++ b/www-servers/uwsgi/uwsgi-2.0.19.1-r108.ebuild
@@ -1,10 +1,10 @@
-# Copyright 1999-2021 Gentoo Authors
+# Copyright 1999-2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
LUA_COMPAT=( lua5-1 )
-PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_COMPAT=( python3_{8..10} )
PYTHON_REQ_USE="threads(+)"
RUBY_OPTIONAL="yes"
@@ -17,7 +17,7 @@ USE_PHP="php7-3 php7-4" # deps must be registered separately below
MY_P="${P/_/-}"
-inherit flag-o-matic lua-single pax-utils php-ext-source-r3 python-r1 ruby-ng
+inherit lua-single pax-utils php-ext-source-r3 python-r1 ruby-ng
DESCRIPTION="uWSGI server for Python web applications"
HOMEPAGE="https://projects.unbit.it/uwsgi/"
@@ -128,6 +128,12 @@ RDEPEND="${CDEPEND}
uwsgi_plugins_rrdtool? ( net-analyzer/rrdtool )"
BDEPEND="virtual/pkgconfig"
+PATCHES=(
+ "${FILESDIR}/${P}-py310-fix.patch"
+ "${FILESDIR}/${P}-pynode-compile.patch"
+ "${FILESDIR}/${P}-py310-fix-2.patch"
+)
+
S="${WORKDIR}/${MY_P}"
src_unpack() {