mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-11-07 18:07:08 -08:00
dev-python/jq: backport cython-3 fix
Closes: https://bugs.gentoo.org/898684 Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
https://bugs.gentoo.org/898684
|
||||
https://github.com/mwilliamson/jq.py/commit/c2c7ed1f25b51947ebb690f6b8464c78fe83bb2b
|
||||
|
||||
From c2c7ed1f25b51947ebb690f6b8464c78fe83bb2b Mon Sep 17 00:00:00 2001
|
||||
From: Michael Williamson <mike@zwobble.org>
|
||||
Date: Thu, 31 Aug 2023 23:11:28 +0100
|
||||
Subject: [PATCH] Add explicit noexcept to _store_error for Cython 3
|
||||
compatibility
|
||||
|
||||
--- a/jq.pyx
|
||||
+++ b/jq.pyx
|
||||
@@ -172,7 +172,7 @@ cdef jq_state* _compile(object program_bytes, object args) except NULL:
|
||||
return jq
|
||||
|
||||
|
||||
-cdef void _store_error(void* store_ptr, jv error):
|
||||
+cdef void _store_error(void* store_ptr, jv error) noexcept:
|
||||
# TODO: handle errors not of JV_KIND_STRING
|
||||
cdef _ErrorStore store = <_ErrorStore>store_ptr
|
||||
if jv_get_kind(error) == JV_KIND_STRING:
|
||||
@@ -0,0 +1,44 @@
|
||||
# Copyright 2021-2023 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
DISTUTILS_EXT=1
|
||||
DISTUTILS_USE_PEP517=setuptools
|
||||
PYTHON_COMPAT=( python3_{10..12} )
|
||||
|
||||
inherit distutils-r1
|
||||
|
||||
MY_P="jq.py-${PV}"
|
||||
DESCRIPTION="Python bindings for jq"
|
||||
HOMEPAGE="
|
||||
https://github.com/mwilliamson/jq.py/
|
||||
https://pypi.org/project/jq/
|
||||
"
|
||||
SRC_URI="
|
||||
https://github.com/mwilliamson/jq.py/archive/${PV}.tar.gz
|
||||
-> ${MY_P}.gh.tar.gz
|
||||
"
|
||||
S=${WORKDIR}/${MY_P}
|
||||
|
||||
LICENSE="BSD-2"
|
||||
SLOT="0"
|
||||
KEYWORDS="~amd64 ~x86"
|
||||
|
||||
BDEPEND="
|
||||
dev-python/cython[${PYTHON_USEDEP}]
|
||||
"
|
||||
|
||||
PATCHES=(
|
||||
"${FILESDIR}"/${P}-cython3.patch
|
||||
)
|
||||
|
||||
distutils_enable_tests pytest
|
||||
|
||||
python_compile() {
|
||||
# TODO: export JQPY_USE_SYSTEM_LIBS=1 on next release
|
||||
|
||||
# Cython compilation isn't part of setup.py, so do it manually
|
||||
"${EPYTHON}" -m cython -3 jq.pyx -o jq.c || die
|
||||
distutils-r1_python_compile
|
||||
}
|
||||
Reference in New Issue
Block a user