diff --git a/Manual.md b/Manual.md index b6a4ffa0a71..21162641e47 100644 --- a/Manual.md +++ b/Manual.md @@ -1083,6 +1083,11 @@ meson for cross builds. This is particularly useful for building packages that w invocations (e.g., `python3-pep517` packages that use a meson backend) and is added by default for packages that use the `meson` build style. +- `numpy` configures the environment for cross-compilation of python packages that provide +compiled extensions linking to NumPy C libraries. If the `meson` build helper is also +configured, a secondary cross file, `${XBPS_WRAPPERDIR}/meson/xbps_numpy.cross`, will be +written to inform meson where common NumPy components may be found. + - `python3` configures the cross-build environment to use Python libraries, header files, and interpreter configurations in the target root. The `python3` helper is added by default for packages that use the `python3-module` or `python3-pep517` build styles. diff --git a/common/build-helper/numpy.sh b/common/build-helper/numpy.sh index 74c64211652..bf40390ad1c 100644 --- a/common/build-helper/numpy.sh +++ b/common/build-helper/numpy.sh @@ -34,4 +34,14 @@ if [ "$CROSS_BUILD" ]; then ln -sf "${_gfortran}" "${XBPS_WRAPPERDIR}/gfortran" fi unset _gfortran + + # Write a secondary meson cross file for numpy configuration + if [[ "${build_helper}" = *meson* ]]; then + mkdir -p "${XBPS_WRAPPERDIR}/meson" + cat > "${XBPS_WRAPPERDIR}/meson/xbps_numpy.cross" <<-EOF + [properties] + numpy-include-dir = '${XBPS_CROSS_BASE}/${py3_sitelib}/numpy/core/include' + pythran-include-dir = '${XBPS_CROSS_BASE}/${py3_sitelib}/pythran' + EOF + fi fi