pcbjam/scripts/deps/build-curl-headers.sh
Viktor Vaczi c408410c7d Add KiCad PCBnew build script and CMake Find modules
- Add scripts/kicad/build-pcbnew.sh with clean-by-default and --no-clean flag
- Remove old scripts/build-pcbnew-wasm.sh (moved to scripts/kicad/)
- Add Boost build script with Emscripten toolset for Boost.Locale
- Add header download scripts for CURL and libgit2 (stub libraries)
- Add CMake Find modules for cross-compilation compatibility:
  - FindGLM.cmake: Reads version from setup.hpp
  - FindZSTD.cmake: Explicit sysroot paths
  - FindCURL.cmake: Header-only stub
  - FindSPNAV.cmake: Disabled (3D mouse not needed in browser)
  - FindCairo.cmake: Finds our built Cairo
  - FindPixman.cmake: Finds our built Pixman
  - Findlibgit2.cmake: Header-only stub
- Fix OpenCASCADE build: correct extracted dir name, add CMake policy
- Fix Protobuf build: correct GitHub release tag format (v21.12 not v3.21.12)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-08 11:37:14 +01:00

59 lines
1.6 KiB
Shell
Executable file

#!/bin/bash
# Download CURL headers for WebAssembly builds
# We only need the headers - CURL functions will be stubbed for WASM
# since networking uses browser fetch API, not native sockets
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "${SCRIPT_DIR}/../common/env.sh"
source "${SCRIPT_DIR}/../common/versions.sh"
source "${SCRIPT_DIR}/../common/functions.sh"
CURL_VERSION="${CURL_VERSION:-8.5.0}"
CURL_DIR="${DEPS_ROOT}/curl-${CURL_VERSION}"
CURL_STAMP="${BUILD_ROOT}/stamps/curl-headers.stamp"
# Parse arguments
CLEAN=0
for arg in "$@"; do
case $arg in
--clean)
CLEAN=1
shift
;;
esac
done
if [ $CLEAN -eq 1 ]; then
log_info "Cleaning CURL headers..."
rm -rf "${CURL_DIR}" "${CURL_STAMP}"
rm -rf "${SYSROOT}/include/curl"
fi
# Check if already installed
if check_stamp "${CURL_STAMP}"; then
log_info "CURL headers already installed, skipping..."
exit 0
fi
# Download if needed
if [ ! -d "${CURL_DIR}" ]; then
log_info "Downloading CURL ${CURL_VERSION} headers..."
mkdir -p "${DEPS_ROOT}"
cd "${DEPS_ROOT}"
# Download from curl official releases
CURL_URL="https://curl.se/download/curl-${CURL_VERSION}.tar.gz"
download_file "${CURL_URL}" "curl-${CURL_VERSION}.tar.gz"
tar -xzf "curl-${CURL_VERSION}.tar.gz"
rm "curl-${CURL_VERSION}.tar.gz"
fi
# Install headers only (no build needed - header-only for WASM stub)
log_info "Installing CURL headers to sysroot..."
mkdir -p "${SYSROOT}/include/curl"
cp "${CURL_DIR}/include/curl/"*.h "${SYSROOT}/include/curl/"
create_stamp "${CURL_STAMP}"
log_info "CURL headers installed!"