Skip to content

Commit

Permalink
kore: fix build for Python 3.11 (not ready yet)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgn committed Sep 22, 2022
1 parent 459e2e1 commit cf782f6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
29 changes: 29 additions & 0 deletions srcpkgs/kore/patches/python-3.11.patch
Original file line number Diff line number Diff line change
@@ -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;

11 changes: 3 additions & 8 deletions srcpkgs/kore/template
Original file line number Diff line number Diff line change
@@ -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 <helmut@pozimski.eu>"
Expand All @@ -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
}

0 comments on commit cf782f6

Please sign in to comment.