-
-
Notifications
You must be signed in to change notification settings - Fork 21
/
build.sh
46 lines (38 loc) · 1.77 KB
/
build.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
set -ex
# There are a couple of places in the source that hardcode a system prefix;
# in hardcoded-paths.patch we edit them to refer to the Conda prefix so
# that they will get appropriately rewritten.
export CPPFLAGS="$CPPFLAGS -DCONDA_PREFIX=\\\"$PREFIX\\\""
# @PYTHON@ is used in the build scripts and that breaks with the long prefix.
# we need to redefine that to `python`.
_PY=$PYTHON
export PYTHON="python"
unset _CONDA_PYTHON_SYSCONFIGDATA_NAME
mkdir -p forgebuild
cd forgebuild
if [[ "$target_platform" == "osx-arm64" && "$CONDA_BUILD_CROSS_COMPILATION" == "1" ]]; then
# TODO: create this in the compiler activation recipe
echo "[host_machine]" > cross_file.txt
echo "system = 'darwin'" >> cross_file.txt
echo "cpu_family = 'aarch64'" >> cross_file.txt
echo "cpu = 'arm64'" >> cross_file.txt
echo "endian = 'little'" >> cross_file.txt
MESON_ARGS="$MESON_ARGS --cross-file cross_file.txt"
# TODO: do this in the compiler activation recipe as well
export OBJC=$CC
export OBJC_FOR_BUILD=$CC_FOR_BUILD
export PKG_CONFIG=$BUILD_PREFIX/bin/pkg-config
fi
meson --buildtype=release --prefix="$PREFIX" --backend=ninja -Dlibdir=lib -Dlocalstatedir="$PREFIX/var" \
-Diconv=external -Dlibmount=disabled -Dselinux=disabled -Dxattr=false $MESON_ARGS .. \
|| { cat meson-logs/meson-log.txt ; exit 1 ; }
ninja -j${CPU_COUNT} -v
if [ "${target_platform}" == 'linux-aarch64' ] || [ "${target_platform}" == "linux-ppc64le" ]; then
export MESON_TEST_TIMEOUT_MULTIPLIER=16
else
export MESON_TEST_TIMEOUT_MULTIPLIER=2
fi
if [[ "$target_platform" != osx-* && "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]] ; then # too many tests fail on macOS
meson test --no-suite flaky --timeout-multiplier ${MESON_TEST_TIMEOUT_MULTIPLIER}
fi