ladybird/.devcontainer/features/vcpkg-cache/install.sh
Andrew Kaster 5c835157c6 Documentation+Meta: Remove references to nonexistent Toolchain directory
After b1d708dd16, the Toolchain directory
was removed from the repository. Some documentation and scripts still
referenced it, so this commit removes those references. The only
remaining references are in the gitignore file, to prevent bisections
from being polluted by the presence of a Toolchain directory in the
working copy.
2026-04-21 06:56:32 -04:00

53 lines
1.7 KiB
Bash

#!/bin/sh
# Prebuild ladybird's vcpkg dependencies
set -e
# FIXME: Add some options to make this more flexible and usable by other projects
# FIXME: Find a way to do this without cloning ladybird
case "$(uname -m)" in
x86_64|x64)
export VCPKG_DEFAULT_TRIPLET=x64-linux-dynamic
;;
aarch64|arm64)
export VCPKG_DEFAULT_TRIPLET=arm64-linux-dynamic
export VCPKG_FORCE_SYSTEM_BINARIES=1
;;
*)
export VCPKG_FORCE_SYSTEM_BINARIES=1
;;
esac
cd /tmp
CACHE_DIR=/usr/local/share/vcpkg-binary-cache
mkdir -p ${CACHE_DIR}
# Clone ladybird to get access to vcpkg.json and vcpkg commit id
git clone https://github.com/LadybirdBrowser/ladybird.git --depth 1
cd ladybird
# Grab and bootstrap the exact commit of vcpkg that trunk is using
python3 ./Meta/build_vcpkg.py
# Install the vcpkg.json in manifest mode from the root of the repo
# Set the binary cache directory to the one we intend to use at container runtime
export VCPKG_ROOT="${PWD}/Build/vcpkg"
export VCPKG_BINARY_SOURCES="clear;files,${CACHE_DIR},readwrite"
export X_VCPKG_ASSET_SOURCES="clear;x-azurl,https://vcpkg-cache.app.ladybird.org/ladybird/source-assets/,,read"
# Check options to see which versions we should build
if [ "${RELEASE_TRIPLET}" = "true" ]; then
"${VCPKG_ROOT}/vcpkg" install --overlay-triplets="${PWD}/Meta/CMake/vcpkg/release-triplets"
fi
if [ "${DEBUG_TRIPLET}" = "true" ]; then
"${VCPKG_ROOT}/vcpkg" install --overlay-triplets="${PWD}/Meta/CMake/vcpkg/debug-triplets"
fi
if [ "${SANITIZER_TRIPLET}" = "true" ]; then
"${VCPKG_ROOT}/vcpkg" install --overlay-triplets="${PWD}/Meta/CMake/vcpkg/sanitizer-triplets"
fi
# Clean up to reduce layer size
cd /tmp
rm -rf ladybird