From cf782f65f4418312aaef74b212ac3d0303deab0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= Date: Thu, 22 Sep 2022 07:55:02 +0700 Subject: [PATCH] kore: fix build for Python 3.11 (not ready yet) --- srcpkgs/kore/patches/python-3.11.patch | 29 ++++++++++++++++++++++++++ srcpkgs/kore/template | 11 +++------- 2 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 srcpkgs/kore/patches/python-3.11.patch diff --git a/srcpkgs/kore/patches/python-3.11.patch b/srcpkgs/kore/patches/python-3.11.patch new file mode 100644 index 000000000000..c5c2579d200c --- /dev/null +++ b/srcpkgs/kore/patches/python-3.11.patch @@ -0,0 +1,29 @@ +diff --git a/src/python.c b/src/python.c +index ab0f3c6..526d443 100644 +--- a/src/python.c ++++ b/src/python.c +@@ -1192,8 +1192,8 @@ python_coro_trace(const char *label, struct python_coro *coro) + + gen = (PyGenObject *)coro->obj; + +- if (gen->gi_frame != NULL && gen->gi_frame->f_code != NULL) { +- code = gen->gi_frame->f_code; ++ code = gen->gi_code; ++ if (code != NULL) { + func = PyUnicode_AsUTF8AndSize(code->co_name, NULL); + file = PyUnicode_AsUTF8AndSize(code->co_filename, NULL); + +@@ -1206,8 +1206,13 @@ python_coro_trace(const char *label, struct python_coro *coro) + fname = "unknown"; + } + ++#if PY_VERSION_HEX <= 0x030B0000 + if (gen->gi_frame != NULL) + line = PyFrame_GetLineNumber(gen->gi_frame); ++#else ++ if (code != NULL) ++ line = PyCode_Addr2Line(code, 0); ++#endif + else + line = -1; + diff --git a/srcpkgs/kore/template b/srcpkgs/kore/template index 715f92118e9d..635b52ba53c8 100644 --- a/srcpkgs/kore/template +++ b/srcpkgs/kore/template @@ -1,13 +1,13 @@ # Template file for 'kore' pkgname=kore version=4.2.3 -revision=1 +revision=2 # arch specific seccomp stuff archs="x86_64* aarch64* ppc64*" build_style=gnu-makefile make_use_env=yes -make_build_args="CURL=1 TASKS=1 PGSQL=1 JSONRPC=1 ACME=1" -hostmakedepends="postgresql-libs-devel" +make_build_args="CURL=1 TASKS=1 PGSQL=1 JSONRPC=1 ACME=1 PYTHON=1" +hostmakedepends="postgresql-libs-devel python3-devel" makedepends="openssl-devel libcurl-devel postgresql-libs-devel yajl-devel" short_desc="Easy to use web platform for writing scalable web APIs in C" maintainer="Helmut Pozimski " @@ -23,11 +23,6 @@ if [ "$XBPS_TARGET_LIBC" = "musl" ]; then makedepends+=" musl-legacy-compat" fi -if [ -z "$CROSS_BUILD" ]; then - makedepends+=" python3-devel" - make_build_args+=" PYTHON=1" -fi - post_install() { vlicense LICENSE }