Make builds incremental by preserving source/build dirs (#45)

This commit is contained in:
Adeeb Shihadeh
2026-03-04 09:17:55 -08:00
committed by GitHub
parent 2e9aed768a
commit 331d94a683
37 changed files with 221 additions and 367 deletions

View File

@@ -23,13 +23,15 @@ jobs:
- uses: actions/checkout@v6 - uses: actions/checkout@v6
- uses: actions/cache@v4 - uses: actions/cache@v4
with: with:
key: build-cache-v1-${{ matrix.platform }}-${{ hashFiles('build.sh', 'setup.sh', '*/pyproject.toml', '*/setup.py', '*/build.sh') }} key: build-cache-v2-${{ matrix.platform }}-${{ hashFiles('build.sh', 'setup.sh', '*/pyproject.toml', '*/setup.py', '*/build.sh') }}
restore-keys: build-cache-v1-${{ matrix.platform }}- restore-keys: build-cache-v2-${{ matrix.platform }}-
path: | path: |
.uv-cache .uv-cache
*/*/install */*/install
*/*/toolchain */*/toolchain
*/*/bin */*/bin
*/*-src
*/build
- name: Build wheels - name: Build wheels
env: env:
MANYLINUX: ${{ runner.os == 'Linux' && '1' || '0' }} MANYLINUX: ${{ runner.os == 'Linux' && '1' || '0' }}
@@ -90,8 +92,8 @@ jobs:
path: dist path: dist
- uses: actions/cache/restore@v4 - uses: actions/cache/restore@v4
with: with:
key: build-cache-v1-${{ matrix.platform }}-${{ hashFiles('build.sh', 'setup.sh', '*/pyproject.toml', '*/setup.py', '*/build.sh') }} key: build-cache-v2-${{ matrix.platform }}-${{ hashFiles('build.sh', 'setup.sh', '*/pyproject.toml', '*/setup.py', '*/build.sh') }}
restore-keys: build-cache-v1-${{ matrix.platform }}- restore-keys: build-cache-v2-${{ matrix.platform }}-
path: | path: |
.uv-cache .uv-cache
*/*/install */*/install

View File

@@ -45,9 +45,14 @@ if [[ -n "${BUILD_SH_IN_MANYLINUX:-}" ]]; then
fi fi
fi fi
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
echo "Building workspace packages into dist" echo "Building workspace packages into dist"
START_SECS=$SECONDS START_SECS=$SECONDS
mkdir -p dist/
rm -rf dist/*
uv build --all-packages --wheel --out-dir dist --no-create-gitignore --no-build-logs uv build --all-packages --wheel --out-dir dist --no-create-gitignore --no-build-logs
if [[ -n "${BUILD_SH_IN_MANYLINUX:-}" ]]; then if [[ -n "${BUILD_SH_IN_MANYLINUX:-}" ]]; then

View File

@@ -4,24 +4,19 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$DIR" cd "$DIR"
VERSION="1.0.8" VERSION="bzip2-1.0.8"
INSTALL_DIR="$DIR/bzip2/install" INSTALL_DIR="$DIR/bzip2/install"
# Idempotent: skip if already built
if [ -f "$INSTALL_DIR/lib/libbz2.a" ]; then
echo "bzip2 already present, skipping build."
exit 0
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
CC="ccache ${CC:-cc}"
# Download # Clone/update source
if [ ! -d "bzip2-src" ]; then if [ ! -d "bzip2-src/.git" ]; then
curl -L "https://sourceware.org/pub/bzip2/bzip2-${VERSION}.tar.gz" -o bzip2.tar.gz rm -rf bzip2-src
mkdir -p bzip2-src git clone --depth 1 https://gitlab.com/bzip2/bzip2.git bzip2-src
tar xzf bzip2.tar.gz -C bzip2-src --strip-components=1
rm bzip2.tar.gz
fi fi
git -C bzip2-src fetch --depth 1 origin "$VERSION"
git -C bzip2-src checkout --force FETCH_HEAD
# Build static library with -fPIC # Build static library with -fPIC
cd bzip2-src cd bzip2-src
@@ -38,8 +33,5 @@ cp bzip2-src/libbz2.a "$INSTALL_DIR/lib/"
# Headers # Headers
cp bzip2-src/bzlib.h "$INSTALL_DIR/include/" cp bzip2-src/bzlib.h "$INSTALL_DIR/include/"
# Clean up
rm -rf bzip2-src
echo "Installed bzip2 to $INSTALL_DIR" echo "Installed bzip2 to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildBzip2(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "bzip2", "install", "lib", "libbz2.a") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -7,18 +7,15 @@ cd "$DIR"
VERSION="1.0.1" VERSION="1.0.1"
INSTALL_DIR="$DIR/capnproto/install" INSTALL_DIR="$DIR/capnproto/install"
# Idempotent: skip if already built
if [ -x "$INSTALL_DIR/bin/capnp" ]; then
echo "capnproto already present, skipping build."
exit 0
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
# Clone # Clone/update source
if [ ! -d "capnproto-src" ]; then if [ ! -d "capnproto-src/.git" ]; then
git clone --depth 1 --branch "v${VERSION}" https://github.com/capnproto/capnproto.git capnproto-src rm -rf capnproto-src
git clone --depth 1 https://github.com/capnproto/capnproto.git capnproto-src
fi fi
git -C capnproto-src fetch --depth 1 origin "v${VERSION}"
git -C capnproto-src checkout --force FETCH_HEAD
# Build # Build
PREFIX="$DIR/build/prefix" PREFIX="$DIR/build/prefix"
@@ -64,8 +61,5 @@ for obj in filesystem.c++.o main.c++.o test-helpers.c++.o; do
ar d "$INSTALL_DIR/lib/libkj.a" "$obj" 2>/dev/null || true ar d "$INSTALL_DIR/lib/libkj.a" "$obj" 2>/dev/null || true
done done
# Clean up
rm -rf capnproto-src "$DIR/build"
echo "Installed capnproto to $INSTALL_DIR" echo "Installed capnproto to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildCapnproto(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "capnproto", "install", "bin", "capnp") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -7,18 +7,16 @@ cd "$DIR"
VERSION="2.16.0" VERSION="2.16.0"
INSTALL_DIR="$DIR/cppcheck/install" INSTALL_DIR="$DIR/cppcheck/install"
# Idempotent: skip if already built
if [ -x "$INSTALL_DIR/cppcheck" ]; then
echo "cppcheck already present, skipping build."
exit 0
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
CXX="ccache ${CXX:-c++}"
# Clone # Clone/update source
if [ ! -d "cppcheck-src" ]; then if [ ! -d "cppcheck-src/.git" ]; then
git clone --depth 1 --branch "$VERSION" https://github.com/danmar/cppcheck.git cppcheck-src rm -rf cppcheck-src
git clone --depth 1 https://github.com/danmar/cppcheck.git cppcheck-src
fi fi
git -C cppcheck-src fetch --depth 1 origin "$VERSION"
git -C cppcheck-src checkout --force FETCH_HEAD
# Build # Build
cd cppcheck-src cd cppcheck-src
@@ -35,8 +33,5 @@ cp -r cppcheck-src/cfg "$INSTALL_DIR/"
cp -r cppcheck-src/platforms "$INSTALL_DIR/" cp -r cppcheck-src/platforms "$INSTALL_DIR/"
strip "$INSTALL_DIR/cppcheck" 2>/dev/null || true strip "$INSTALL_DIR/cppcheck" 2>/dev/null || true
# Clean up
rm -rf cppcheck-src
echo "Installed cppcheck to $INSTALL_DIR" echo "Installed cppcheck to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildCppcheck(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "cppcheck", "install", "cppcheck") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -7,28 +7,19 @@ cd "$DIR"
VERSION="3.4.0" VERSION="3.4.0"
INSTALL_DIR="$DIR/eigen/install" INSTALL_DIR="$DIR/eigen/install"
# Idempotent: skip if already present # Clone/update source
if [ -d "$INSTALL_DIR/eigen3/Eigen" ]; then if [ ! -d "eigen-src/.git" ]; then
echo "eigen already present, skipping download." rm -rf eigen-src
exit 0 git clone --depth 1 https://gitlab.com/libeigen/eigen.git eigen-src
fi fi
git -C eigen-src fetch --depth 1 origin "$VERSION"
git -C eigen-src checkout --force FETCH_HEAD
TARBALL="eigen-${VERSION}.tar.gz" # Copy headers
URL="https://gitlab.com/libeigen/eigen/-/archive/${VERSION}/${TARBALL}"
echo "Downloading Eigen ${VERSION} ..."
curl -fSL -o "$TARBALL" "$URL"
echo "Extracting headers ..."
rm -rf "$INSTALL_DIR" rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR/eigen3" mkdir -p "$INSTALL_DIR/eigen3"
cp -r eigen-src/Eigen "$INSTALL_DIR/eigen3/"
# Extract only the Eigen/ and unsupported/Eigen/ header directories cp -r eigen-src/unsupported "$INSTALL_DIR/eigen3/"
tar --strip-components=1 -xzf "$TARBALL" -C "$INSTALL_DIR/eigen3" \
"eigen-${VERSION}/Eigen" \
"eigen-${VERSION}/unsupported"
rm -f "$TARBALL"
echo "Installed eigen to $INSTALL_DIR" echo "Installed eigen to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildEigen(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "eigen", "install", "eigen3", "Eigen") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.isdir(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -5,23 +5,22 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$DIR" cd "$DIR"
FFMPEG_VERSION="7.1" FFMPEG_VERSION="7.1"
ZLIB_VERSION="da607da739fa6047df13e66a2af6b8bec7c2a498" # v1.3.2
X264_BRANCH="stable"
INSTALL_DIR="$DIR/ffmpeg/install" INSTALL_DIR="$DIR/ffmpeg/install"
# Idempotent: skip if already built
if [ -x "$INSTALL_DIR/bin/ffmpeg" ]; then
echo "ffmpeg already present, skipping build."
exit 0
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
CC="ccache ${CC:-cc}"
PREFIX="$DIR/build/prefix" PREFIX="$DIR/build/prefix"
mkdir -p "$DIR/build" mkdir -p "$DIR/build"
# --- Build zlib (static) --- # --- Build zlib (static) ---
if [ ! -d "zlib-src" ]; then if [ ! -d "zlib-src/.git" ]; then
git clone https://github.com/madler/zlib.git zlib-src rm -rf zlib-src
git -C zlib-src checkout da607da739fa6047df13e66a2af6b8bec7c2a498 # pin to v1.3.2 git clone --depth 1 https://github.com/madler/zlib.git zlib-src
fi fi
git -C zlib-src fetch --depth 1 origin "$ZLIB_VERSION"
git -C zlib-src checkout --force "$ZLIB_VERSION"
cd zlib-src cd zlib-src
./configure --prefix="$PREFIX" --static ./configure --prefix="$PREFIX" --static
@@ -30,9 +29,12 @@ make install
cd "$DIR" cd "$DIR"
# --- Build x264 (static) --- # --- Build x264 (static) ---
if [ ! -d "x264-src" ]; then if [ ! -d "x264-src/.git" ]; then
git clone --depth 1 --branch stable https://code.videolan.org/videolan/x264.git x264-src rm -rf x264-src
git clone --depth 1 https://code.videolan.org/videolan/x264.git x264-src
fi fi
git -C x264-src fetch --depth 1 origin "$X264_BRANCH"
git -C x264-src checkout --force FETCH_HEAD
cd x264-src cd x264-src
CFLAGS="-fno-finite-math-only" ./configure \ CFLAGS="-fno-finite-math-only" ./configure \
@@ -47,13 +49,17 @@ make install
cd "$DIR" cd "$DIR"
# --- Build FFmpeg --- # --- Build FFmpeg ---
if [ ! -d "ffmpeg-src" ]; then if [ ! -d "ffmpeg-src/.git" ]; then
git clone --depth 1 --branch "n${FFMPEG_VERSION}" https://github.com/FFmpeg/FFmpeg.git ffmpeg-src rm -rf ffmpeg-src
git clone --depth 1 https://github.com/FFmpeg/FFmpeg.git ffmpeg-src
fi fi
git -C ffmpeg-src fetch --depth 1 origin "n${FFMPEG_VERSION}"
git -C ffmpeg-src checkout --force FETCH_HEAD
cd ffmpeg-src cd ffmpeg-src
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" \ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" \
./configure \ ./configure \
--cc="${CC:-cc}" \
--prefix="$PREFIX" \ --prefix="$PREFIX" \
--enable-gpl \ --enable-gpl \
--enable-static \ --enable-static \
@@ -100,8 +106,5 @@ done
# Strip binaries # Strip binaries
strip "$INSTALL_DIR/bin/ffmpeg" "$INSTALL_DIR/bin/ffprobe" 2>/dev/null || true strip "$INSTALL_DIR/bin/ffmpeg" "$INSTALL_DIR/bin/ffprobe" 2>/dev/null || true
# Clean up
rm -rf zlib-src x264-src ffmpeg-src "$DIR/build"
echo "Installed ffmpeg to $INSTALL_DIR" echo "Installed ffmpeg to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildFFmpeg(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "ffmpeg", "install", "bin", "ffmpeg") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -9,10 +9,11 @@ TOOLCHAIN_BASE="arm-gnu-toolchain-${TOOLCHAIN_VERSION}"
GCC_VERSION="13.2.1" GCC_VERSION="13.2.1"
INSTALL_DIR="$DIR/gcc_arm_none_eabi/toolchain" INSTALL_DIR="$DIR/gcc_arm_none_eabi/toolchain"
VERSION_FILE="$INSTALL_DIR/.version"
# Idempotent: skip if already built # Skip if already at correct version
if [ -x "$INSTALL_DIR/bin/arm-none-eabi-gcc" ]; then if [ -f "$VERSION_FILE" ] && [ "$(cat "$VERSION_FILE")" = "$TOOLCHAIN_VERSION" ]; then
echo "Toolchain already present, skipping download." echo "Toolchain $TOOLCHAIN_VERSION already present, skipping."
exit 0 exit 0
fi fi
@@ -112,6 +113,7 @@ find "$INSTALL_DIR" -type f \( -executable -o -name '*.so' \) -exec strip {} + 2
# --- clean up download artifacts --- # --- clean up download artifacts ---
rm -rf "$EXTRACT_DIR" rm -rf "$EXTRACT_DIR"
rm -f "$TARBALL" rm -f "$TARBALL"
echo "$TOOLCHAIN_VERSION" > "$VERSION_FILE"
echo "Installed to $INSTALL_DIR" echo "Installed to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -1,10 +1,8 @@
import os import os
import platform import platform
import subprocess import subprocess
import sys
from setuptools.command.build_py import build_py from setuptools.command.build_py import build_py
from setuptools.dist import Distribution
try: try:
from wheel.bdist_wheel import bdist_wheel from wheel.bdist_wheel import bdist_wheel
@@ -17,13 +15,8 @@ class BuildToolchain(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
toolchain_marker = os.path.join( build_script = os.path.join(pkg_dir, "build.sh")
pkg_dir, "gcc_arm_none_eabi", "toolchain", "bin", "arm-none-eabi-gcc" subprocess.check_call(["bash", build_script], cwd=pkg_dir)
)
if not os.path.exists(toolchain_marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -6,10 +6,11 @@ cd "$DIR"
VERSION="3.6.1" VERSION="3.6.1"
INSTALL_DIR="$DIR/git_lfs/bin" INSTALL_DIR="$DIR/git_lfs/bin"
VERSION_FILE="$INSTALL_DIR/.version"
# Idempotent: skip if already present # Skip if already at correct version
if [ -x "$INSTALL_DIR/git-lfs" ]; then if [ -f "$VERSION_FILE" ] && [ "$(cat "$VERSION_FILE")" = "$VERSION" ]; then
echo "git-lfs already present, skipping download." echo "git-lfs $VERSION already present, skipping."
exit 0 exit 0
fi fi
@@ -51,6 +52,7 @@ fi
chmod +x "$INSTALL_DIR/git-lfs" chmod +x "$INSTALL_DIR/git-lfs"
rm -f "$FILENAME" rm -f "$FILENAME"
echo "$VERSION" > "$VERSION_FILE"
echo "Installed git-lfs to $INSTALL_DIR" echo "Installed git-lfs to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildGitLfs(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "git_lfs", "bin", "git-lfs") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -6,61 +6,62 @@ cd "$DIR"
INSTALL_DIR="$DIR/imgui/install" INSTALL_DIR="$DIR/imgui/install"
# Idempotent: skip if already present # Dear ImGui (docking branch, version 1.92.7)
if [ -f "$INSTALL_DIR/include/imgui.h" ]; then
echo "imgui already present, skipping download."
exit 0
fi
# Dear ImGui (docking branch)
IMGUI_VERSION="1.92.7"
IMGUI_COMMIT="934c6a5f5ef2355d6df25395d555cb71f790c4e9" IMGUI_COMMIT="934c6a5f5ef2355d6df25395d555cb71f790c4e9"
IMGUI_URL="https://github.com/ocornut/imgui/archive/${IMGUI_COMMIT}.tar.gz" # ImPlot
# ImPlot (master)
IMPLOT_COMMIT="93c801b4bb801c5c11031d880b6af1d1f70bd79d" IMPLOT_COMMIT="93c801b4bb801c5c11031d880b6af1d1f70bd79d"
IMPLOT_URL="https://github.com/epezent/implot/archive/${IMPLOT_COMMIT}.tar.gz" # rlImGui
# rlImGui (main)
RLIMGUI_COMMIT="286e11acd6c785004c9550c7ed3762add2ae3d47" RLIMGUI_COMMIT="286e11acd6c785004c9550c7ed3762add2ae3d47"
RLIMGUI_URL="https://github.com/raylib-extras/rlImGui/archive/${RLIMGUI_COMMIT}.tar.gz"
# Clone/update imgui
if [ ! -d "imgui-src/.git" ]; then
rm -rf imgui-src
git clone --depth 1 https://github.com/ocornut/imgui.git imgui-src
fi
git -C imgui-src fetch --depth 1 origin "$IMGUI_COMMIT"
git -C imgui-src checkout --force "$IMGUI_COMMIT"
# Clone/update implot
if [ ! -d "implot-src/.git" ]; then
rm -rf implot-src
git clone --depth 1 https://github.com/epezent/implot.git implot-src
fi
git -C implot-src fetch --depth 1 origin "$IMPLOT_COMMIT"
git -C implot-src checkout --force "$IMPLOT_COMMIT"
# Clone/update rlimgui
if [ ! -d "rlimgui-src/.git" ]; then
rm -rf rlimgui-src
git clone --depth 1 https://github.com/raylib-extras/rlImGui.git rlimgui-src
fi
git -C rlimgui-src fetch --depth 1 origin "$RLIMGUI_COMMIT"
git -C rlimgui-src checkout --force "$RLIMGUI_COMMIT"
# Install
rm -rf "$INSTALL_DIR" rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR/include/extras" "$INSTALL_DIR/src" mkdir -p "$INSTALL_DIR/include/extras" "$INSTALL_DIR/src"
TMPDIR="$(mktemp -d)" # imgui
trap 'rm -rf "$TMPDIR"' EXIT cp imgui-src/imgui.h imgui-src/imgui_internal.h imgui-src/imconfig.h \
imgui-src/imstb_rectpack.h imgui-src/imstb_textedit.h imgui-src/imstb_truetype.h \
echo "Downloading Dear ImGui ${IMGUI_VERSION} (docking) ..."
curl -fSL -o "$TMPDIR/imgui.tar.gz" "$IMGUI_URL"
mkdir -p "$TMPDIR/imgui"
tar --strip-components=1 -xzf "$TMPDIR/imgui.tar.gz" -C "$TMPDIR/imgui"
cp "$TMPDIR/imgui/imgui.h" "$TMPDIR/imgui/imgui_internal.h" "$TMPDIR/imgui/imconfig.h" \
"$TMPDIR/imgui/imstb_rectpack.h" "$TMPDIR/imgui/imstb_textedit.h" "$TMPDIR/imgui/imstb_truetype.h" \
"$INSTALL_DIR/include/" "$INSTALL_DIR/include/"
cp "$TMPDIR/imgui/imgui.cpp" "$TMPDIR/imgui/imgui_draw.cpp" "$TMPDIR/imgui/imgui_tables.cpp" \ cp imgui-src/imgui.cpp imgui-src/imgui_draw.cpp imgui-src/imgui_tables.cpp \
"$TMPDIR/imgui/imgui_widgets.cpp" "$TMPDIR/imgui/imgui_demo.cpp" \ imgui-src/imgui_widgets.cpp imgui-src/imgui_demo.cpp \
"$INSTALL_DIR/src/" "$INSTALL_DIR/src/"
cp "$TMPDIR/imgui/backends/imgui_impl_opengl3.h" "$TMPDIR/imgui/backends/imgui_impl_opengl3_loader.h" \ cp imgui-src/backends/imgui_impl_opengl3.h imgui-src/backends/imgui_impl_opengl3_loader.h \
"$INSTALL_DIR/include/" "$INSTALL_DIR/include/"
cp "$TMPDIR/imgui/backends/imgui_impl_opengl3.cpp" "$INSTALL_DIR/src/" cp imgui-src/backends/imgui_impl_opengl3.cpp "$INSTALL_DIR/src/"
echo "Downloading ImPlot ..." # implot
curl -fSL -o "$TMPDIR/implot.tar.gz" "$IMPLOT_URL" cp implot-src/implot.h implot-src/implot_internal.h "$INSTALL_DIR/include/"
mkdir -p "$TMPDIR/implot" cp implot-src/implot.cpp implot-src/implot_items.cpp "$INSTALL_DIR/src/"
tar --strip-components=1 -xzf "$TMPDIR/implot.tar.gz" -C "$TMPDIR/implot"
cp "$TMPDIR/implot/implot.h" "$TMPDIR/implot/implot_internal.h" "$INSTALL_DIR/include/"
cp "$TMPDIR/implot/implot.cpp" "$TMPDIR/implot/implot_items.cpp" "$INSTALL_DIR/src/"
echo "Downloading rlImGui ..." # rlimgui
curl -fSL -o "$TMPDIR/rlimgui.tar.gz" "$RLIMGUI_URL" cp rlimgui-src/rlImGui.h rlimgui-src/rlImGuiColors.h rlimgui-src/imgui_impl_raylib.h \
mkdir -p "$TMPDIR/rlimgui"
tar --strip-components=1 -xzf "$TMPDIR/rlimgui.tar.gz" -C "$TMPDIR/rlimgui"
cp "$TMPDIR/rlimgui/rlImGui.h" "$TMPDIR/rlimgui/rlImGuiColors.h" "$TMPDIR/rlimgui/imgui_impl_raylib.h" \
"$INSTALL_DIR/include/" "$INSTALL_DIR/include/"
cp "$TMPDIR/rlimgui/extras/FA6FreeSolidFontData.h" "$TMPDIR/rlimgui/extras/IconsFontAwesome6.h" \ cp rlimgui-src/extras/FA6FreeSolidFontData.h rlimgui-src/extras/IconsFontAwesome6.h \
"$INSTALL_DIR/include/extras/" "$INSTALL_DIR/include/extras/"
cp "$TMPDIR/rlimgui/rlImGui.cpp" "$INSTALL_DIR/src/" cp rlimgui-src/rlImGui.cpp "$INSTALL_DIR/src/"
echo "Installed imgui to $INSTALL_DIR" echo "Installed imgui to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildImgui(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "imgui", "install", "include", "imgui.h") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.isfile(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -6,36 +6,26 @@ cd "$DIR"
VERSION="db00e9369a92aa74bf630a2ffb092a4b0b132c01" VERSION="db00e9369a92aa74bf630a2ffb092a4b0b132c01"
INSTALL_DIR="$DIR/json11/install" INSTALL_DIR="$DIR/json11/install"
VERSION_FILE="$INSTALL_DIR/VERSION" CXX="ccache ${CXX:-c++}"
# Idempotent: skip if already built at this source revision.
if [ -f "$INSTALL_DIR/lib/libjson11.a" ] && [ -f "$INSTALL_DIR/include/json11/json11.hpp" ] && \
[ -f "$VERSION_FILE" ] && [ "$(cat "$VERSION_FILE")" = "$VERSION" ]; then
echo "json11 already present, skipping build."
exit 0
fi
if [ ! -d "$DIR/json11-src/.git" ]; then if [ ! -d "$DIR/json11-src/.git" ]; then
git clone https://github.com/dropbox/json11.git json11-src git clone --depth 1 https://github.com/dropbox/json11.git json11-src
fi fi
git -C json11-src fetch --force origin git -C json11-src fetch --depth 1 origin "$VERSION"
git -C json11-src checkout --force "$VERSION" git -C json11-src checkout --force "$VERSION"
BUILD_DIR="$DIR/build" BUILD_DIR="$DIR/build"
rm -rf "$BUILD_DIR" "$INSTALL_DIR" mkdir -p "$BUILD_DIR"
mkdir -p "$BUILD_DIR" "$INSTALL_DIR/lib" "$INSTALL_DIR/include/json11" rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR/lib" "$INSTALL_DIR/include/json11"
CXX="${CXX:-c++}" CXX="${CXX:-c++}"
AR="${AR:-ar}" AR="${AR:-ar}"
"$CXX" -std=c++11 -fPIC -O2 -c "$DIR/json11-src/json11.cpp" -o "$BUILD_DIR/json11.o" $CXX -std=c++11 -fPIC -O2 -c "$DIR/json11-src/json11.cpp" -o "$BUILD_DIR/json11.o"
"$AR" rcs "$INSTALL_DIR/lib/libjson11.a" "$BUILD_DIR/json11.o" "$AR" rcs "$INSTALL_DIR/lib/libjson11.a" "$BUILD_DIR/json11.o"
cp "$DIR/json11-src/json11.hpp" "$INSTALL_DIR/include/json11/json11.hpp" cp "$DIR/json11-src/json11.hpp" "$INSTALL_DIR/include/json11/json11.hpp"
echo "$VERSION" > "$VERSION_FILE"
# Keep workspace small and deterministic across builds.
rm -rf "$DIR/json11-src" "$BUILD_DIR"
echo "Installed json11 to $INSTALL_DIR" echo "Installed json11 to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildJson11(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "json11", "install", "lib", "libjson11.a") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -7,18 +7,15 @@ cd "$DIR"
VERSION="3.1.0" VERSION="3.1.0"
INSTALL_DIR="$DIR/libjpeg/install" INSTALL_DIR="$DIR/libjpeg/install"
# Idempotent: skip if already built
if [ -f "$INSTALL_DIR/lib/libjpeg.a" ]; then
echo "libjpeg already present, skipping build."
exit 0
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
# Clone # Clone/update source
if [ ! -d "libjpeg-turbo-src" ]; then if [ ! -d "libjpeg-turbo-src/.git" ]; then
git clone --depth 1 --branch "${VERSION}" https://github.com/libjpeg-turbo/libjpeg-turbo.git libjpeg-turbo-src rm -rf libjpeg-turbo-src
git clone --depth 1 https://github.com/libjpeg-turbo/libjpeg-turbo.git libjpeg-turbo-src
fi fi
git -C libjpeg-turbo-src fetch --depth 1 origin "${VERSION}"
git -C libjpeg-turbo-src checkout --force FETCH_HEAD
# Build # Build
PREFIX="$DIR/build/prefix" PREFIX="$DIR/build/prefix"
@@ -50,8 +47,5 @@ cp "$PREFIX/include/jconfig.h" "$INSTALL_DIR/include/"
cp "$PREFIX/include/jerror.h" "$INSTALL_DIR/include/" cp "$PREFIX/include/jerror.h" "$INSTALL_DIR/include/"
cp "$PREFIX/include/jmorecfg.h" "$INSTALL_DIR/include/" cp "$PREFIX/include/jmorecfg.h" "$INSTALL_DIR/include/"
# Clean up
rm -rf libjpeg-turbo-src "$DIR/build"
echo "Installed libjpeg to $INSTALL_DIR" echo "Installed libjpeg to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildLibjpeg(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "libjpeg", "install", "lib", "libjpeg.a") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -6,25 +6,17 @@ cd "$DIR"
VERSION="6067afde563c3946eebd94f146b3824ab7a97a9c" VERSION="6067afde563c3946eebd94f146b3824ab7a97a9c"
INSTALL_DIR="$DIR/libyuv/install" INSTALL_DIR="$DIR/libyuv/install"
VERSION_FILE="$INSTALL_DIR/VERSION"
# Idempotent: skip if already built at this source revision.
if [ -f "$INSTALL_DIR/lib/libyuv.a" ] && [ -f "$VERSION_FILE" ] && [ "$(cat "$VERSION_FILE")" = "$VERSION" ]; then
echo "libyuv already present, skipping build."
exit 0
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
if [ ! -d "libyuv-src/.git" ]; then if [ ! -d "libyuv-src/.git" ]; then
git clone https://chromium.googlesource.com/libyuv/libyuv libyuv-src git clone --depth 1 https://chromium.googlesource.com/libyuv/libyuv libyuv-src
fi fi
git -C libyuv-src fetch --force origin git -C libyuv-src fetch --depth 1 origin "$VERSION"
git -C libyuv-src checkout --force "$VERSION" git -C libyuv-src checkout --force "$VERSION"
BUILD_DIR="$DIR/build/build" BUILD_DIR="$DIR/build"
rm -rf "$DIR/build"
mkdir -p "$BUILD_DIR" mkdir -p "$BUILD_DIR"
cmake -S "$DIR/libyuv-src" -B "$BUILD_DIR" \ cmake -S "$DIR/libyuv-src" -B "$BUILD_DIR" \
@@ -47,10 +39,6 @@ rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR"/{lib,include} mkdir -p "$INSTALL_DIR"/{lib,include}
cp "$LIBYUV_STATIC" "$INSTALL_DIR/lib/libyuv.a" cp "$LIBYUV_STATIC" "$INSTALL_DIR/lib/libyuv.a"
cp -r "$DIR/libyuv-src/include/." "$INSTALL_DIR/include/" cp -r "$DIR/libyuv-src/include/." "$INSTALL_DIR/include/"
echo "$VERSION" > "$VERSION_FILE"
# Keep workspace small and deterministic across builds.
rm -rf "$DIR/libyuv-src" "$DIR/build"
echo "Installed libyuv to $INSTALL_DIR" echo "Installed libyuv to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildLibyuv(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "libyuv", "install", "lib", "libyuv.a") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -6,31 +6,25 @@ cd "$DIR"
VERSION="6.5" VERSION="6.5"
INSTALL_DIR="$DIR/ncurses/install" INSTALL_DIR="$DIR/ncurses/install"
VERSION_FILE="$DIR/ncurses-src/.version"
# Idempotent: skip if already built
if [ -f "$INSTALL_DIR/lib/libncurses.a" ]; then
echo "ncurses already present, skipping build."
exit 0
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
export CC="ccache ${CC:-cc}"
# Download # Download tarball (v6.5 tag doesn't exist on the GitHub mirror)
TARBALL="ncurses-${VERSION}.tar.gz" if [ ! -f "$VERSION_FILE" ] || [ "$(cat "$VERSION_FILE")" != "$VERSION" ]; then
if [ ! -f "$TARBALL" ]; then rm -rf ncurses-src
curl -fsSL "https://ftp.gnu.org/gnu/ncurses/${TARBALL}" -o "$TARBALL" mkdir -p ncurses-src
fi curl -fSL "https://ftp.gnu.org/gnu/ncurses/ncurses-${VERSION}.tar.gz" \
| tar xz --strip-components=1 -C ncurses-src
# Extract echo "$VERSION" > "$VERSION_FILE"
if [ ! -d "ncurses-${VERSION}" ]; then
tar xf "$TARBALL"
fi fi
# Build # Build
PREFIX="$DIR/build/prefix" PREFIX="$DIR/build/prefix"
mkdir -p "$DIR/build" mkdir -p "$DIR/build"
cd "ncurses-${VERSION}" cd ncurses-src
CFLAGS="-fPIC" ./configure \ CFLAGS="-fPIC" ./configure \
--prefix="$PREFIX" \ --prefix="$PREFIX" \
--without-shared \ --without-shared \
@@ -66,8 +60,5 @@ cp "$PREFIX/include/unctrl.h" "$INSTALL_DIR/include/"
cp "$PREFIX/include/term.h" "$INSTALL_DIR/include/" cp "$PREFIX/include/term.h" "$INSTALL_DIR/include/"
cp "$PREFIX/include/termcap.h" "$INSTALL_DIR/include/" cp "$PREFIX/include/termcap.h" "$INSTALL_DIR/include/"
# Clean up
rm -rf "ncurses-${VERSION}" "$TARBALL" "$DIR/build"
echo "Installed ncurses to $INSTALL_DIR" echo "Installed ncurses to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildNcurses(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "ncurses", "install", "lib", "libncurses.a") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -4,25 +4,25 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$DIR" cd "$DIR"
VERSION="3.4.1" VERSION="openssl-3.4.1"
INSTALL_DIR="$DIR/openssl3/install" INSTALL_DIR="$DIR/openssl3/install"
# Idempotent: skip if already built NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
if [ -f "$INSTALL_DIR/lib/libcrypto.a" ]; then export CC="ccache ${CC:-cc}"
echo "openssl already present, skipping build."
# Clone/update source
if [ ! -d "openssl-src/.git" ]; then
rm -rf openssl-src
git clone --depth 1 https://github.com/openssl/openssl.git openssl-src
fi
git -C openssl-src fetch --depth 1 origin "$VERSION"
WANT_COMMIT="$(git -C openssl-src rev-parse FETCH_HEAD)"
VERSION_FILE="$INSTALL_DIR/.version"
if [ -f "$VERSION_FILE" ] && [ "$(cat "$VERSION_FILE")" = "$WANT_COMMIT" ]; then
echo "openssl already at $VERSION, skipping build."
exit 0 exit 0
fi fi
git -C openssl-src checkout --force FETCH_HEAD
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
# Download
TARBALL="openssl-${VERSION}.tar.gz"
if [ ! -d "openssl-src" ]; then
curl -fSL -o "$TARBALL" "https://github.com/openssl/openssl/releases/download/openssl-${VERSION}/${TARBALL}"
mkdir -p openssl-src
tar -xf "$TARBALL" -C openssl-src --strip-components=1
rm -f "$TARBALL"
fi
# Configure # Configure
PREFIX="$DIR/build/prefix" PREFIX="$DIR/build/prefix"
@@ -68,8 +68,6 @@ cp "$PREFIX/lib/libssl.a" "$INSTALL_DIR/lib/"
# Headers # Headers
cp -r "$PREFIX/include/openssl" "$INSTALL_DIR/include/" cp -r "$PREFIX/include/openssl" "$INSTALL_DIR/include/"
# Clean up echo "$WANT_COMMIT" > "$VERSION_FILE"
rm -rf openssl-src "$DIR/build"
echo "Installed openssl to $INSTALL_DIR" echo "Installed openssl to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildOpenssl(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "openssl3", "install", "lib", "libcrypto.a") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -4,25 +4,18 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)" DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$DIR" cd "$DIR"
VERSION="3.12.8" VERSION="v3.12.8"
INSTALL_DIR="$DIR/python3_dev/install" INSTALL_DIR="$DIR/python3_dev/install"
# Idempotent: skip if already present # Clone/update source
if [ -f "$INSTALL_DIR/include/Python.h" ]; then if [ ! -d "python3-src/.git" ]; then
echo "python3-dev headers already present, skipping." rm -rf python3-src
exit 0 git clone --depth 1 https://github.com/python/cpython.git python3-src
fi fi
git -C python3-src fetch --depth 1 origin "$VERSION"
git -C python3-src checkout --force FETCH_HEAD
TARBALL="Python-${VERSION}.tgz" cd python3-src
URL="https://www.python.org/ftp/python/${VERSION}/${TARBALL}"
echo "Downloading CPython ${VERSION} source ..."
curl -fSL -o "$TARBALL" "$URL"
echo "Extracting ..."
tar xzf "$TARBALL"
cd "Python-${VERSION}"
# Run configure to generate pyconfig.h for this platform # Run configure to generate pyconfig.h for this platform
echo "Running configure to generate pyconfig.h ..." echo "Running configure to generate pyconfig.h ..."
@@ -34,11 +27,8 @@ cd "$DIR"
rm -rf "$INSTALL_DIR" rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR/include" mkdir -p "$INSTALL_DIR/include"
cp -r "Python-${VERSION}/Include/"* "$INSTALL_DIR/include/" cp -r python3-src/Include/* "$INSTALL_DIR/include/"
cp "Python-${VERSION}/pyconfig.h" "$INSTALL_DIR/include/" cp python3-src/pyconfig.h "$INSTALL_DIR/include/"
# Clean up
rm -rf "Python-${VERSION}" "$TARBALL"
echo "Installed python3-dev headers to $INSTALL_DIR" echo "Installed python3-dev headers to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildPython3Dev(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "python3_dev", "install", "include", "Python.h") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -6,20 +6,8 @@ cd "$DIR"
INSTALL_DIR="$DIR/raylib/install" INSTALL_DIR="$DIR/raylib/install"
# Idempotent: skip if already fully built
# On x86_64 Linux, also require the offscreen variant
NEED_OFFSCREEN=0
if [[ "$(uname)" == "Linux" && "$(uname -m)" == "x86_64" ]]; then
NEED_OFFSCREEN=1
fi
if [ -f "$INSTALL_DIR/lib/libraylib.a" ]; then
if [ "$NEED_OFFSCREEN" -eq 0 ] || [ -f "$INSTALL_DIR/lib/libraylib_offscreen.a" ]; then
echo "raylib already present, skipping build."
exit 0
fi
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
CC="ccache ${CC:-cc}"
# Detect platform: PLATFORM_COMMA for comma devices, PLATFORM_DESKTOP otherwise # Detect platform: PLATFORM_COMMA for comma devices, PLATFORM_DESKTOP otherwise
RAYLIB_PLATFORM="${RAYLIB_PLATFORM:-PLATFORM_DESKTOP}" RAYLIB_PLATFORM="${RAYLIB_PLATFORM:-PLATFORM_DESKTOP}"
@@ -66,17 +54,18 @@ fi
# Clone and build raylib C library # Clone and build raylib C library
RAYLIB_COMMIT="d9d7cc1353ec0f73c97e84ddf0973983d1ee25e2" RAYLIB_COMMIT="d9d7cc1353ec0f73c97e84ddf0973983d1ee25e2"
if [ ! -d "raylib-src" ]; then if [ ! -d "raylib-src/.git" ]; then
git clone -b platform-offscreen --no-tags https://github.com/commaai/raylib.git raylib-src rm -rf raylib-src
git clone --depth 1 -b platform-offscreen --no-tags https://github.com/commaai/raylib.git raylib-src
fi fi
cd raylib-src cd raylib-src
git fetch origin "$RAYLIB_COMMIT" git fetch --depth 1 origin "$RAYLIB_COMMIT"
git reset --hard "$RAYLIB_COMMIT" git reset --hard "$RAYLIB_COMMIT"
git clean -xdff .
cd src cd src
make -j"$NJOBS" PLATFORM="$RAYLIB_PLATFORM" make clean
make -j"$NJOBS" PLATFORM="$RAYLIB_PLATFORM" CC="${CC:-gcc}"
cd "$DIR" cd "$DIR"
@@ -104,7 +93,7 @@ if [[ "$(uname)" == "Linux" && "$(uname -m)" == "x86_64" && "$RAYLIB_PLATFORM" !
cd raylib-src/src cd raylib-src/src
make clean make clean
make -j"$NJOBS" PLATFORM=PLATFORM_OFFSCREEN make -j"$NJOBS" PLATFORM=PLATFORM_OFFSCREEN CC="${CC:-gcc}"
cp libraylib.a "$INSTALL_DIR/lib/libraylib_offscreen.a" cp libraylib.a "$INSTALL_DIR/lib/libraylib_offscreen.a"
cd "$DIR" cd "$DIR"
@@ -128,8 +117,5 @@ RAYGUI_COMMIT="76b36b597edb70ffaf96f046076adc20d67e7827"
curl -fsSLo "$INSTALL_DIR/include/raygui.h" \ curl -fsSLo "$INSTALL_DIR/include/raygui.h" \
"https://raw.githubusercontent.com/raysan5/raygui/$RAYGUI_COMMIT/src/raygui.h" "https://raw.githubusercontent.com/raysan5/raygui/$RAYGUI_COMMIT/src/raygui.h"
# Clean up source
rm -rf raylib-src
echo "Installed raylib to $INSTALL_DIR" echo "Installed raylib to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -18,14 +18,8 @@ class BuildRaylib(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
lib_dir = os.path.join(pkg_dir, "raylib", "install", "lib") build_script = os.path.join(pkg_dir, "build.sh")
marker = os.path.join(lib_dir, "libraylib.a") subprocess.check_call(["bash", build_script], cwd=pkg_dir)
offscreen_marker = os.path.join(lib_dir, "libraylib_offscreen.a")
need_offscreen = platform.system() == "Linux" and platform.machine() == "x86_64"
if not os.path.exists(marker) or (need_offscreen and not os.path.exists(offscreen_marker)):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
# Build CFFI extension so it's included in the wheel # Build CFFI extension so it's included in the wheel
cffi_so = glob.glob(os.path.join(pkg_dir, "raylib", "_raylib_cffi*")) cffi_so = glob.glob(os.path.join(pkg_dir, "raylib", "_raylib_cffi*"))

View File

@@ -15,12 +15,12 @@ run_as_root() {
} }
if [ "$(uname)" = "Darwin" ]; then if [ "$(uname)" = "Darwin" ]; then
brew install nasm pkg-config brew install nasm pkg-config ccache
elif command -v dnf &>/dev/null; then elif command -v dnf &>/dev/null; then
dnf install -y nasm cmake gcc-c++ pkgconfig git perl-IPC-Cmd dnf install -y nasm cmake gcc-c++ pkgconfig git perl-IPC-Cmd ccache
elif command -v apt-get &>/dev/null; then elif command -v apt-get &>/dev/null; then
run_as_root apt-get update run_as_root apt-get update
run_as_root apt-get install -y nasm cmake g++ pkg-config curl run_as_root apt-get install -y nasm cmake g++ pkg-config curl ccache
fi fi
if ! command -v uv &>/dev/null; then if ! command -v uv &>/dev/null; then

View File

@@ -7,18 +7,15 @@ cd "$DIR"
VERSION="4.3.5" VERSION="4.3.5"
INSTALL_DIR="$DIR/zeromq/install" INSTALL_DIR="$DIR/zeromq/install"
# Idempotent: skip if already built
if [ -f "$INSTALL_DIR/lib/libzmq.a" ]; then
echo "zeromq already present, skipping build."
exit 0
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
# Clone # Clone/update source
if [ ! -d "libzmq-src" ]; then if [ ! -d "libzmq-src/.git" ]; then
git clone --depth 1 --branch "v${VERSION}" https://github.com/zeromq/libzmq.git libzmq-src rm -rf libzmq-src
git clone --depth 1 https://github.com/zeromq/libzmq.git libzmq-src
fi fi
git -C libzmq-src fetch --depth 1 origin "v${VERSION}"
git -C libzmq-src checkout --force FETCH_HEAD
# Build # Build
PREFIX="$DIR/build/prefix" PREFIX="$DIR/build/prefix"
@@ -54,8 +51,5 @@ cp "$PREFIX/lib/libzmq.a" "$INSTALL_DIR/lib/"
cp "$PREFIX/include/zmq.h" "$INSTALL_DIR/include/" cp "$PREFIX/include/zmq.h" "$INSTALL_DIR/include/"
cp "$PREFIX/include/zmq_utils.h" "$INSTALL_DIR/include/" cp "$PREFIX/include/zmq_utils.h" "$INSTALL_DIR/include/"
# Clean up
rm -rf libzmq-src "$DIR/build"
echo "Installed zeromq to $INSTALL_DIR" echo "Installed zeromq to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildZeromq(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "zeromq", "install", "lib", "libzmq.a") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()

View File

@@ -7,18 +7,15 @@ cd "$DIR"
VERSION="1.5.6" VERSION="1.5.6"
INSTALL_DIR="$DIR/zstd/install" INSTALL_DIR="$DIR/zstd/install"
# Idempotent: skip if already built
if [ -f "$INSTALL_DIR/lib/libzstd.a" ]; then
echo "zstd already present, skipping build."
exit 0
fi
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)" NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
# Clone # Clone/update source
if [ ! -d "zstd-src" ]; then if [ ! -d "zstd-src/.git" ]; then
git clone --depth 1 --branch "v${VERSION}" https://github.com/facebook/zstd.git zstd-src rm -rf zstd-src
git clone --depth 1 https://github.com/facebook/zstd.git zstd-src
fi fi
git -C zstd-src fetch --depth 1 origin "v${VERSION}"
git -C zstd-src checkout --force FETCH_HEAD
# Build # Build
PREFIX="$DIR/build/prefix" PREFIX="$DIR/build/prefix"
@@ -52,8 +49,5 @@ cp "$PREFIX/include/zstd.h" "$INSTALL_DIR/include/"
cp "$PREFIX/include/zstd_errors.h" "$INSTALL_DIR/include/" cp "$PREFIX/include/zstd_errors.h" "$INSTALL_DIR/include/"
cp "$PREFIX/include/zdict.h" "$INSTALL_DIR/include/" cp "$PREFIX/include/zdict.h" "$INSTALL_DIR/include/"
# Clean up
rm -rf zstd-src "$DIR/build"
echo "Installed zstd to $INSTALL_DIR" echo "Installed zstd to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -15,11 +15,8 @@ class BuildZstd(build_py):
def run(self): def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__)) pkg_dir = os.path.dirname(os.path.abspath(__file__))
marker = os.path.join(pkg_dir, "zstd", "install", "lib", "libzstd.a") build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
if not os.path.exists(marker):
build_script = os.path.join(pkg_dir, "build.sh")
subprocess.check_call(["bash", build_script], cwd=pkg_dir)
super().run() super().run()