1*4882a593Smuzhiyuninherit setuptools3 2*4882a593Smuzhiyunrequire python-cython.inc 3*4882a593Smuzhiyun 4*4882a593SmuzhiyunRDEPENDS:${PN} += "\ 5*4882a593Smuzhiyun python3-setuptools \ 6*4882a593Smuzhiyun" 7*4882a593Smuzhiyun 8*4882a593Smuzhiyun# running build_ext a second time during install fails, because Python 9*4882a593Smuzhiyun# would then attempt to import cythonized modules built for the target 10*4882a593Smuzhiyun# architecture. 11*4882a593SmuzhiyunSETUPTOOLS_INSTALL_ARGS += "--skip-build" 12*4882a593Smuzhiyun 13*4882a593Smuzhiyundo_install:append() { 14*4882a593Smuzhiyun # rename scripts that would conflict with the Python 2 build of Cython 15*4882a593Smuzhiyun mv ${D}${bindir}/cython ${D}${bindir}/cython3 16*4882a593Smuzhiyun mv ${D}${bindir}/cythonize ${D}${bindir}/cythonize3 17*4882a593Smuzhiyun mv ${D}${bindir}/cygdb ${D}${bindir}/cygdb3 18*4882a593Smuzhiyun} 19*4882a593Smuzhiyun 20*4882a593SmuzhiyunPACKAGEBUILDPKGD += "cython_fix_sources" 21*4882a593Smuzhiyun 22*4882a593Smuzhiyuncython_fix_sources () { 23*4882a593Smuzhiyun for f in ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Compiler/FlowControl.c \ 24*4882a593Smuzhiyun ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Compiler/FusedNode.c \ 25*4882a593Smuzhiyun ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Compiler/Scanning.c \ 26*4882a593Smuzhiyun ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Compiler/Visitor.c \ 27*4882a593Smuzhiyun ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Plex/Actions.c \ 28*4882a593Smuzhiyun ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Plex/Scanners.c \ 29*4882a593Smuzhiyun ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Runtime/refnanny.c \ 30*4882a593Smuzhiyun ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Tempita/_tempita.c \ 31*4882a593Smuzhiyun ${PKGD}${libdir}/${PYTHON_DIR}/site-packages/Cython*/SOURCES.txt; do 32*4882a593Smuzhiyun if [ -e $f ]; then 33*4882a593Smuzhiyun sed -i -e 's#${WORKDIR}#/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}#g' $f 34*4882a593Smuzhiyun fi 35*4882a593Smuzhiyun done 36*4882a593Smuzhiyun} 37*4882a593Smuzhiyun 38