diff mbox series

[3/5] python3-cython: inherit cython

Message ID 20241105161227.2324296-3-ross.burton@arm.com
State New
Headers show
Series [1/5] python3-cython: add patch to prefix map source paths in generated files | expand

Commit Message

Ross Burton Nov. 5, 2024, 4:12 p.m. UTC
As cython is partially built with cython, inherit the cython class and
remove the now redundant fixup functions.

Also remove the env fix, as the binaries in $bindir are generated by
distutils so use the right hashbang.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../python/python3-cython_3.0.11.bb           | 32 +++----------------
 1 file changed, 5 insertions(+), 27 deletions(-)
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-cython_3.0.11.bb b/meta/recipes-devtools/python/python3-cython_3.0.11.bb
index 57e7848f96c..81ee1b799cb 100644
--- a/meta/recipes-devtools/python/python3-cython_3.0.11.bb
+++ b/meta/recipes-devtools/python/python3-cython_3.0.11.bb
@@ -10,7 +10,11 @@  LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=61c3ee8961575861fa86c7e62bc9f69c"
 SRC_URI += "file://0001-WIP-prefix-map.patch"
 SRC_URI[sha256sum] = "7146dd2af8682b4ca61331851e6aebce9fe5158e75300343f80c07ca80b1faff"
 
-inherit pypi setuptools3
+inherit pypi setuptools3 cython
+
+# No need to depend on self
+DEPENDS:remove = "python3-cython-native"
+
 UPSTREAM_CHECK_PYPI_PACKAGE = "Cython"
 
 # running build_ext a second time during install fails, because Python
@@ -19,38 +23,12 @@  UPSTREAM_CHECK_PYPI_PACKAGE = "Cython"
 SETUPTOOLS_INSTALL_ARGS += "--skip-build"
 
 do_install:append() {
-	# Make sure we use /usr/bin/env python3
-	for PYTHSCRIPT in `grep -rIl '^#!.*python' ${D}`; do
-		sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT
-	done
-
-    # remove build paths from generated sources
-    sed -i -e 's|${WORKDIR}||' ${S}/Cython/*.c ${S}/Cython/Compiler/*.c ${S}/Cython/Plex/*.c
-
     # rename scripts that would conflict with the Python 2 build of Cython
     mv ${D}${bindir}/cython ${D}${bindir}/cython3
     mv ${D}${bindir}/cythonize ${D}${bindir}/cythonize3
     mv ${D}${bindir}/cygdb ${D}${bindir}/cygdb3
 }
 
-PACKAGESPLITFUNCS =+ "cython_fix_sources"
-
-cython_fix_sources () {
-	for f in ${PKGD}${TARGET_DBGSRC_DIR}/Cython/Compiler/FlowControl.c \
-		${PKGD}${TARGET_DBGSRC_DIR}/Cython/Compiler/FusedNode.c \
-		${PKGD}${TARGET_DBGSRC_DIR}/Cython/Compiler/Scanning.c \
-		${PKGD}${TARGET_DBGSRC_DIR}/Cython/Compiler/Visitor.c \
-		${PKGD}${TARGET_DBGSRC_DIR}/Cython/Plex/Actions.c \
-		${PKGD}${TARGET_DBGSRC_DIR}/Cython/Plex/Scanners.c \
-		${PKGD}${TARGET_DBGSRC_DIR}/Cython/Runtime/refnanny.c \
-		${PKGD}${TARGET_DBGSRC_DIR}/Cython/Tempita/_tempita.c \
-		${PKGD}${libdir}/${PYTHON_DIR}/site-packages/Cython*/SOURCES.txt; do
-		if [ -e $f ]; then
-			sed -i -e 's#${WORKDIR}/cython-${PV}#${TARGET_DBGSRC_DIR}#g' $f
-		fi
-	done
-}
-
 RDEPENDS:${PN}:class-target += "\
     python3-misc \
     python3-netserver \