diff --git a/.github/prepare_conda_build.py b/.github/prepare_conda_build.py index f7bfdc6ee..261291dd5 100644 --- a/.github/prepare_conda_build.py +++ b/.github/prepare_conda_build.py @@ -37,8 +37,16 @@ def _run_parser(*args): *args, ] cmd = [str(x) for x in cmd] - print(" + " + shlex.join(cmd)) - proc = subprocess.run(cmd, capture_output=True, check=True, text=True) + try: + proc = subprocess.run( + cmd, check=True, text=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT + ) + except subprocess.CalledProcessError as p: + print("Error getting dependencies " + " ".join(args) + ":") + print(" + " + shlex.join(cmd)) + print(p.stdout) + sys.exit(1) + return proc.stdout diff --git a/build.sh b/build.sh index e69de29bb..907cd318c 100644 --- a/build.sh +++ b/build.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +if [[ $CONDA_TOOLCHAIN_BUILD != $CONDA_TOOLCHAIN_HOST ]]; then + # Conda does some swizzling when cross compiling, including moving + # the site-packages folder to the build prefix. So let's just + # manually add this to the compiler search path. + CFLAGS="-isystem $BUILD_PREFIX/lib/python$PY_VER/site-packages $CXXFLAGS" + CXXFLAGS="-isystem $BUILD_PREFIX/lib/python$PY_VER/site-packages $CXXFLAGS" +fi + +mkdir _build +cd _build +cmake ${CMAKE_ARGS} ../dxtbx "-DCMAKE_INSTALL_PREFIX=$PREFIX" "-DPython_EXECUTABLE=$PYTHON" -GNinja +cmake --build . +cmake --install . +$PYTHON -mpip install ../dxtbx \ No newline at end of file