SUMMARY = "Python binding for Tango" LICENSE = "LGPL-3.0" LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=6fabb2820b872d5b3106bddba78021f5" DEPENDS = "libtango boost omniorb zeromq cppzmq python3-numpy-native python3-scikit-build-core-native" RDEPENDS:${PN} = "python3 python3-numpy python3-packaging" # for toolchain.cmake file inherit cmake inherit python3targetconfig pkgconfig pypi python_pep517 # The classes inheritance and build process here is a bit tricky. # PyTango uses python build (PEP517) which runs the build using # scikit-build-core which in turn uses CMake to build the extension. # So first we inherit cmake to generate cmake configuration (toolchain.cmake) # and then we also inherit python_pep517 to overwrite # do_configure/do_compile/do_install with the correct ones. # This almost works, but you have to play a bit with CMAKE_ARGS. # TODO: Why is python include dir not found automatically? export CMAKE_ARGS = "-DCMAKE_TOOLCHAIN_FILE=${WORKDIR}/toolchain.cmake -DPython_INCLUDE_DIR=${STAGING_DIR_TARGET}${includedir}/${PYTHON_DIR}" do_configure:prepend() { # only depend on pytango's hard numpy requirement, as the only numpy # available is the one provided by python3-numpy package anyway and # the one provided by oldest-supported-numpy is not required_numpy=`cat ${S}/pyproject.toml | grep -F numpy | grep -Fv requires | awk -F'[()]' '{print $2}'` sed -i "s/oldest-supported-numpy/numpy ($required_numpy)/" ${S}/pyproject.toml } FILES:${PN} = "${PYTHON_SITEPACKAGES_DIR}" BBCLASSEXTEND = "nativesdk"