diff --git a/recipe/build.sh b/recipe/build.sh index 030561f9..a8fc8983 100644 --- a/recipe/build.sh +++ b/recipe/build.sh @@ -3,13 +3,22 @@ set -ex mkdir builddir -# need to run meson first for cross-compilation case -$PYTHON $(which meson) setup ${MESON_ARGS} \ - -Dblas=blas \ - -Dlapack=lapack \ - -Duse-g77-abi=true \ - builddir || (cat builddir/meson-logs/meson-log.txt && exit 1) +# HACK: extend $CONDA_PREFIX/meson_cross_file that's created in +# https://github.com/conda-forge/ctng-compiler-activation-feedstock/blob/main/recipe/activate-gcc.sh +# https://github.com/conda-forge/clang-compiler-activation-feedstock/blob/main/recipe/activate-clang.sh +# to use host python; requires that [binaries] section is last in meson_cross_file +echo "python = '${PREFIX}/bin/python'" >> ${CONDA_PREFIX}/meson_cross_file.txt + +# meson-python already sets up a -Dbuildtype=release argument to meson, so +# we need to strip --buildtype out of MESON_ARGS or fail due to redundancy +MESON_ARGS_REDUCED="$(echo $MESON_ARGS | sed 's/--buildtype release //g')" # -wnx flags mean: --wheel --no-isolation --skip-dependency-check -$PYTHON -m build -w -n -x -Cbuilddir=builddir +$PYTHON -m build -w -n -x \ + -Cbuilddir=builddir \ + -Csetup-args=-Dblas=blas \ + -Csetup-args=-Dlapack=lapack \ + -Csetup-args=-Duse-g77-abi=true \ + -Csetup-args=${MESON_ARGS_REDUCED// / -Csetup-args=} \ + || (cat builddir/meson-logs/meson-log.txt && exit 1) pip install dist/scipy*.whl