#!/bin/bash set -x -e -v export TARGET_TRIPLE="x86_64-apple-darwin" MACOS_SYSROOT="${MOZ_FETCHES_DIR}/MacOSX14.4.sdk" CLANGDIR="${MOZ_FETCHES_DIR}/clang" # Deploy the wrench dependencies mv ${MOZ_FETCHES_DIR}/wrench-deps/{vendor,.cargo} "${GECKO_PATH}/gfx/wr/" # Building wrench with the `headless` feature also builds the osmesa-src crate, # which includes building C++ code. We have to do a bunch of shenanigans # to make this cross-compile properly. pushd "${MOZ_FETCHES_DIR}/clang/bin" # Add a pkg-config cross-compile wrapper. Without this, the configure script # will use pkg-config from the host, which will find host libraries that are # not what we want. This script stolen from # https://autotools.io/pkgconfig/cross-compiling.html cat > ${TARGET_TRIPLE}-pkg-config < ${MOZ_FETCHES_DIR}/clang-mac/clang/bin/llvm-config <