Skip to contentSkip to conversation

python3-systemd: switch to python_setuptools_build_meta

PATCH New Ross Burton 1 participant 7 messages Nov 7, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/7 python3-systemd: switch to python_setuptools_build_meta

Switch to the modern build system, and sort the recipe assignments to be more idiomatic.

---
 .../recipes-devtools/python/python3-systemd_235.bb  | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)
meta-python/recipes-devtools/python/python3-systemd_235.bb +9 -4
index 7a7d5a5053..3abea5f5f2 100644
@@ -3,10 +3,15 @@ HOMEPAGE = "https://github.com/systemd/python-systemd"
 LICENSE = "LGPL-2.1-or-later"
 LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=4fbd65380cdd255951079008b364516c"
 
+
 PYPI_PACKAGE = "systemd-python"
-DEPENDS += "systemd (<=235)"
-RDEPENDS:${PN} += "systemd python3-syslog python3-logging python3-syslog"
-REQUIRED_DISTRO_FEATURES = "systemd"
-inherit pypi features_check pkgconfig setuptools3
 SRC_URI:append:libc-musl = " file://0001-Provide-implementation-of-strndupa-for-musl.patch"
 SRC_URI[sha256sum] = "4e57f39797fd5d9e2d22b8806a252d7c0106c936039d1e71c8c6b8008e695c0a"
+
+DEPENDS += "systemd (<=235)"
+
+inherit pypi features_check pkgconfig python_setuptools_build_meta
+
+REQUIRED_DISTRO_FEATURES = "systemd"
+
+RDEPENDS:${PN} += "systemd python3-syslog python3-logging python3-syslog"
Signature · 1 line
2.34.1
#1 lore raw

PATCH 2/7 python3-gevent: inherit cython class

Use the new cython class to avoid duplicated fixup code to remove build paths.

---
 .../recipes-devtools/python/python3-gevent_24.2.1.bb      | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
meta-python/recipes-devtools/python/python3-gevent_24.2.1.bb +2 -6
index e44972178e..9f96b00953 100644
@@ -4,7 +4,7 @@ a high-level synchronous API on top of the libevent event loop."
 HOMEPAGE = "http://www.gevent.org"
 LICENSE = "MIT & Python-2.0"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=4de99aac27b470c29c6c309e0c279b65"
-DEPENDS += "python3-greenlet-native python3-greenlet libev libuv python3-cython-native python3-cffi-native"
+DEPENDS += "python3-greenlet-native python3-greenlet libev libuv python3-cffi-native"
 
 RDEPENDS:${PN} = "python3-greenlet \
 		  python3-mime \
@@ -18,7 +18,7 @@ SRC_URI += "file://0001-_setuputils.py-Do-not-add-sys_inc_dir.patch \
 
 SRC_URI[sha256sum] = "432fc76f680acf7cf188c2ee0f5d3ab73b63c1f03114c7cd8a34cebbe5aa2056"
 
-inherit pypi python_setuptools_build_meta
+inherit pypi python_setuptools_build_meta cython
 
 # Don't embed libraries, link to the system provided libs instead
 export GEVENTSETUP_EMBED_CARES = "0"
@@ -33,10 +33,6 @@ do_configure:append() {
 	rm -rf ${S}/src/gevent/*.c
 }
 
-do_compile:append() {
-        sed -i -e 's#${WORKDIR}##g' ${S}/src/gevent/*.c ${S}/src/gevent/libev/*.c ${S}/src/gevent/resolver/*.c
-}
-
 # http://errors.yoctoproject.org/Errors/Details/766918/
 # src/gevent/queue.c:11894:83: error: passing argument 1 of '__pyx_vtabptr_6gevent_14_gevent_cqueue_UnboundQueue->__pyx_base.put' from incompatible pointer type [-Wincompatible-pointer-types]
 # src/gevent/queue.c:11894:114: error: passing argument 4 of '__pyx_vtabptr_6gevent_14_gevent_cqueue_UnboundQueue->__pyx_base.put' from incompatible pointer type [-Wincompatible-pointer-types]
Signature · 1 line
2.34.1
#2 lore raw

PATCH 3/7 python3-pandas: inherit cython class

In reply to Ross Burton

Use the new cython class to avoid duplicated fixup code to remove build paths.

---
 .../recipes-devtools/python/python3-pandas_2.2.2.bb | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
meta-python/recipes-devtools/python/python3-pandas_2.2.2.bb +1 -12
index 25b03c8e32..1e7bb1f3f6 100644
@@ -13,24 +13,13 @@ SRC_URI += " \
 
 SRC_URI[sha256sum] = "9e79019aba43cb4fda9e4d983f8e88ca0373adbb697ae9c6c43093218de28b54"
 
-inherit pypi python_mesonpy
+inherit pypi python_mesonpy cython
 
 DEPENDS += " \
-    python3-cython-native \
     python3-numpy-native \
     python3-versioneer-native \
 "
 
-PACKAGESPLITFUNCS =+ "fix_cythonized_sources"
-
-fix_cythonized_sources() {
-	for f in `grep -l -r -e '\/* Generated by Cython.*/$' ${PKGD}${TARGET_DBGSRC_DIR}`; do
-		if [ -e $f ]; then
-			sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' $f
-		fi
-	done
-}
-
 CFLAGS:append:toolchain-clang = " -Wno-error=deprecated-declarations"
 
 RDEPENDS:${PN} += " \
Signature · 1 line
2.34.1
#3 lore raw

PATCH 4/7 python3-h5py: inherit cython class

In reply to Ross Burton

Use the new cython class to avoid duplicated fixup code to remove build paths.

---
 .../recipes-devtools/python/python3-h5py_3.12.1.bb  | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)
meta-python/recipes-devtools/python/python3-h5py_3.12.1.bb +1 -12
index a84dd28822..152d952263 100644
@@ -8,12 +8,11 @@ SRC_URI[sha256sum] = "326d70b53d31baa61f00b8aa5f95c2fcb9621a3ee8365d770c551a13db
 
 SRC_URI += "file://0001-setup_build.py-avoid-absolute-path.patch"
 
-inherit pkgconfig pypi setuptools3
+inherit pkgconfig pypi setuptools3 cython
 
 BBCLASSEXTEND = "native"
 
 DEPENDS = "python3-pkgconfig-native \
-           python3-cython-native \
            python3-numpy-native \
            python3-six-native \
            hdf5-native \
@@ -21,16 +20,6 @@ DEPENDS = "python3-pkgconfig-native \
            hdf5 \
           "
 
-PACKAGESPLITFUNCS =+ "fix_cythonized_sources"
-
-fix_cythonized_sources() {
-	for f in `grep -l -r -e '\/* Generated by Cython.*/$' ${PKGD}${TARGET_DBGSRC_DIR}`; do
-		if [ -e $f ]; then
-			sed -i -e 's#${RECIPE_SYSROOT_NATIVE}##g' $f
-		fi
-	done
-}
-
 RDEPENDS:${PN} = "python3-numpy \
                   python3-six \
                   python3-json \
Signature · 1 line
2.34.1
#4 lore raw

PATCH 5/7 python3-kivy: inherit cython class

In reply to Ross Burton

Use the new cython class to avoid duplicated fixup code to remove build paths.

---
 .../recipes-devtools/python/python3-kivy_2.3.0.bb        | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
meta-python/recipes-devtools/python/python3-kivy_2.3.0.bb +1 -8
index 045ac23106..861ca32ad6 100644
@@ -4,7 +4,7 @@ HOMEPAGE = "https://kivy.org/"
 LICENSE = "MIT"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=6d3bc49400e35d5a2279d14c40dcfb09"
 
-inherit setuptools3 pkgconfig features_check
+inherit setuptools3 pkgconfig features_check cython
 
 # Kivy's setup files only look for GLES libraries for Android, iOS, RPi,
 # and mali-based OS's. We need to patch the setup file to tell Kivy setup
@@ -75,10 +75,3 @@ RDEPENDS:${PN} = " \
 # python3-kivy/2.3.0/git/kivy/graphics/cgl_backend/cgl_gl.c:4568:52: error: assignment to 'void (*)(GLuint,  GLsizei,  const GLchar **, const GLint *)' {aka 'void (*)(unsigned int,  int,  const char **, const int *)'} from incompatible pointer type 'void (*)(GLuint,  GLsizei,  const GLchar * const*, const GLint *)' {aka 'void (*)(unsigned int,  int,  const char * const*, const int *)'} [-Wincompatible-pointer-types]
 # python3-kivy/2.3.0/git/kivy/core/window/_window_sdl2.c:8781:23: error: passing argument 1 of 'SDL_SetEventFilter' from incompatible pointer type [-Wincompatible-pointer-types]
 CFLAGS += "-Wno-error=incompatible-pointer-types"
-
-do_compile:append() {
-    for f in `find ${B} -name *.c`
-    do
-        sed -i -e "/BEGIN: Cython Metadata/,/END: Cython Metadata/d" $f
-    done
-}
Signature · 1 line
2.34.1
#5 lore raw

PATCH 6/7 python3-pycocotools: inherit cython class

In reply to Ross Burton

Use the new cython class to avoid duplicated fixup code to remove build paths.

---
 .../recipes-devtools/python/python3-pycocotools_2.0.8.bb  | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
meta-python/recipes-devtools/python/python3-pycocotools_2.0.8.bb +2 -6
index 4d4251316c..e298dbf574 100644
@@ -3,15 +3,11 @@ SUMMARY = "COCO is a large image dataset designed for object detection, segmenta
 LICENSE = "BSD-2-Clause"
 LIC_FILES_CHKSUM = "file://pycocotools/coco.py;beginline=45;endline=45;md5=12cb539683cf245df8b6ce782d78f647"
 
-inherit pypi python_setuptools_build_meta
+inherit pypi python_setuptools_build_meta cython
 
 SRC_URI += "file://0001-downgrade-numpy-version-to-1.26.4.patch"
 
 SRC_URI[sha256sum] = "8f2bcedb786ba26c367a3680f9c4eb5b2ad9dccb2b34eaeb205e0a021e1dfb8d"
 
-DEPENDS = "python3-cython-native python3-numpy-native virtual/crypt"
+DEPENDS = "python3-numpy-native virtual/crypt"
 RDEPENDS:${PN} = "python3-matplotlib python3-pillow python3-profile"
-
-do_compile:append() {
-    sed -i -e "/BEGIN: Cython Metadata/,/END: Cython Metadata/d" ${B}/pycocotools/_mask.c
-}
Signature · 1 line
2.34.1
#6 lore raw

PATCH 7/7 python3-pyproj: inherit cython class

In reply to Ross Burton

Use the new cython class to avoid duplicated fixup code to remove build paths.

---
 .../recipes-devtools/python/python3-pyproj_3.7.0.bb    | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)
meta-python/recipes-devtools/python/python3-pyproj_3.7.0.bb +1 -9
index 0a8b710849..70bc3b76a3 100644
@@ -4,7 +4,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=3f3574263859ef2dc9bd7817d51adbaa"
 DEPENDS = "python3-cython proj"
 DEPENDS:append:class-target = " python3-cython-native proj-native"
 
-inherit pypi python_setuptools_build_meta
+inherit pypi python_setuptools_build_meta cython
 
 SRC_URI += "file://rpath.patch"
 
@@ -21,11 +21,3 @@ RDEPENDS:${PN} = " \
 export PROJ_INCDIR = "${STAGING_INCDIR}"
 export PROJ_LIBDIR = "${STAGING_LIBDIR}"
 export PROJ_DIR = "${STAGING_BINDIR_NATIVE}/.."
-
-do_compile:append() {
-    for f in `find ${B} -name *.c`
-    do
-        sed -i -e "/BEGIN: Cython Metadata/,/END: Cython Metadata/d" $f
-    done
-    python_pep517_do_compile
-}
Signature · 1 line
2.34.1