Compare commits

...

12 Commits

Author SHA1 Message Date
Adeeb Shihadeh
2f5b981c19 fix git link: use CURL_LIBCURL for static deps (#66) 2026-03-24 11:20:08 -07:00
Adeeb Shihadeh
54dafe6c1b add git package (#63) 2026-03-23 18:13:19 -07:00
Adeeb Shihadeh
0fc2d13e50 ffmpeg: disable x86asm (nasm not needed for hw accel)
HW accel codecs bypass the CPU entirely — SIMD-optimized software
paths are irrelevant. Dropping x86asm removes ffmpeg's build-time
nasm dependency. nasm stays in setup.sh for x264 and libjpeg.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 16:13:05 -07:00
Adeeb Shihadeh
567fde8231 Revert "add shared library dependency check to distro tests"
This reverts commit d1af35e660.
2026-03-22 16:12:47 -07:00
Adeeb Shihadeh
d1af35e660 add shared library dependency check to distro tests
After installing wheels in clean containers, ldd all binaries and
.so files. Fails if any dependency is "not found", catching leaked
build-host deps that would break on end-user systems.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 15:40:40 -07:00
Adeeb Shihadeh
5457e99bb7 ffmpeg: add hardware-accelerated video decoders (#62) 2026-03-22 14:28:34 -07:00
Adeeb Shihadeh
0f28906d50 fix shim release 2026-03-21 10:53:26 -07:00
Adeeb Shihadeh
8b6c712f60 fix imgui 2026-03-21 10:39:33 -07:00
Adeeb Shihadeh
6ad06e2173 qt is always a mistake :( 2026-03-21 10:27:17 -07:00
Adeeb Shihadeh
577b731299 imgui: build static lib 2026-03-21 10:11:22 -07:00
Adeeb Shihadeh
6692e3d936 imgui: add libGL 2026-03-21 09:56:26 -07:00
Adeeb Shihadeh
6bc1fe9a9a split shim releases into per-package branches (#59) 2026-03-14 14:42:00 -07:00
14 changed files with 397 additions and 239 deletions

View File

@@ -42,9 +42,9 @@ contributions welcome for other platforms!
```python
dependencies = [
# use the releases branch for pre-built wheels
"capnproto @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=capnproto",
"ffmpeg @ git+https://github.com/commaai/dependencies.git@releases#subdirectory=ffmpeg",
# use per-package release branches for pre-built wheels
"capnproto @ git+https://github.com/commaai/dependencies.git@release-capnproto#subdirectory=capnproto",
"ffmpeg @ git+https://github.com/commaai/dependencies.git@release-ffmpeg#subdirectory=ffmpeg",
# use the master branch to build the package on pip install
"capnproto @ git+https://github.com/commaai/dependencies.git@master#subdirectory=capnproto",
@@ -58,4 +58,4 @@ to add a new package:
* start a new top-level directory as a new package
* `./test.sh` tests the building of all packages
* on pushes to `master`, wheels are built for our target platforms and pushed to a GitHub release
* the `releases` branch contains shim packages that allow pointing to a git branch and always getting the appropriate wheel for your platform
* each `release-<package>` branch contains a single shim package, so old lockfiles keep resolving even as new packages are added

View File

@@ -4,9 +4,12 @@ set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$DIR"
PLATFORM="$(uname -s)"
FFMPEG_VERSION="7.1"
ZLIB_VERSION="da607da739fa6047df13e66a2af6b8bec7c2a498" # v1.3.2
X264_BRANCH="stable"
LIBDRM_VERSION="libdrm-2.4.124"
LIBVA_VERSION="2.22.0"
INSTALL_DIR="$DIR/ffmpeg/install"
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
@@ -48,6 +51,59 @@ make -j"$NJOBS"
make install
cd "$DIR"
# --- Build nv-codec-headers (Linux only, for CUDA/NVDEC) ---
if [ "$PLATFORM" = "Linux" ]; then
if [ ! -d "nv-codec-headers-src/.git" ]; then
rm -rf nv-codec-headers-src
git clone --depth 1 https://git.videolan.org/git/ffmpeg/nv-codec-headers.git nv-codec-headers-src
fi
make -C nv-codec-headers-src PREFIX="$PREFIX" install
fi
# --- Build Vulkan-Headers from source (Linux only, need >= 1.3.277 for FFmpeg 7.1) ---
if [ "$PLATFORM" = "Linux" ]; then
if [ ! -d "vulkan-headers-src/.git" ]; then
rm -rf vulkan-headers-src
git clone --depth 1 https://github.com/KhronosGroup/Vulkan-Headers.git vulkan-headers-src
fi
cmake -S vulkan-headers-src -B vulkan-headers-src/build -DCMAKE_INSTALL_PREFIX="$PREFIX" >/dev/null
cmake --install vulkan-headers-src/build >/dev/null
fi
# --- Build libdrm + libva statically (Linux only, for VAAPI without runtime deps) ---
if [ "$PLATFORM" = "Linux" ]; then
if ! command -v meson &>/dev/null; then
pip3 install --quiet meson ninja 2>/dev/null || python3 -m pip install --quiet meson ninja 2>/dev/null || true
command -v meson &>/dev/null || { echo "error: meson is required (apt install meson or pip install meson)" >&2; exit 1; }
fi
if [ ! -d "libdrm-src/.git" ]; then
rm -rf libdrm-src
git clone --depth 1 --branch "$LIBDRM_VERSION" https://gitlab.freedesktop.org/mesa/drm.git libdrm-src
fi
rm -rf libdrm-src/builddir
meson setup libdrm-src/builddir libdrm-src \
--prefix="$PREFIX" --libdir=lib --default-library=static \
-Dintel=disabled -Dradeon=disabled -Damdgpu=disabled -Dnouveau=disabled \
-Dvmwgfx=disabled -Dtests=false -Dman-pages=disabled -Dcairo-tests=disabled \
-Dvalgrind=disabled
ninja -C libdrm-src/builddir install
if [ ! -d "libva-src/.git" ]; then
rm -rf libva-src
git clone --depth 1 --branch "$LIBVA_VERSION" https://github.com/intel/libva.git libva-src
fi
rm -rf libva-src/builddir
# libva hardcodes shared_library(); patch to library() so --default-library=static works
sed -i 's/shared_library(/library(/g' libva-src/va/meson.build
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" \
meson setup libva-src/builddir libva-src \
--prefix="$PREFIX" --libdir=lib --default-library=static \
-Ddisable_drm=false -Dwith_x11=no -Dwith_glx=no -Dwith_wayland=no \
-Dwith_win32=no -Denable_docs=false
ninja -C libva-src/builddir install
fi
# --- Build FFmpeg ---
if [ ! -d "ffmpeg-src/.git" ]; then
rm -rf ffmpeg-src
@@ -57,6 +113,39 @@ git -C ffmpeg-src fetch --depth 1 origin "n${FFMPEG_VERSION}"
git -C ffmpeg-src checkout --force FETCH_HEAD
cd ffmpeg-src
# Platform-specific hardware acceleration flags
HW_FLAGS=()
if [ "$PLATFORM" = "Linux" ]; then
HW_FLAGS+=(
# NVIDIA CUDA/NVDEC (uses dlopen at runtime)
--enable-ffnvcodec --enable-cuda --enable-cuvid --enable-nvdec
--enable-hwaccel=h264_nvdec,hevc_nvdec
--enable-decoder=h264_cuvid,hevc_cuvid
# VAAPI (Intel/AMD — libva linked statically, driver loaded via dlopen at runtime)
--enable-vaapi
--enable-hwaccel=h264_vaapi,hevc_vaapi
# V4L2 Memory-to-Memory (embedded: RPi, Qualcomm, Rockchip)
--enable-v4l2-m2m
--enable-decoder=h264_v4l2m2m,hevc_v4l2m2m
--enable-encoder=h264_v4l2m2m,hevc_v4l2m2m
# Vulkan video decode/encode (uses dlopen at runtime)
--enable-vulkan
--enable-hwaccel=h264_vulkan,hevc_vulkan
--enable-encoder=h264_vulkan,hevc_vulkan
)
elif [ "$PLATFORM" = "Darwin" ]; then
HW_FLAGS+=(
# VideoToolbox (Apple Silicon / macOS)
--enable-videotoolbox
--enable-hwaccel=h264_videotoolbox,hevc_videotoolbox
--enable-encoder=h264_videotoolbox,hevc_videotoolbox
)
fi
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" \
./configure \
--cc="${CC:-cc}" \
@@ -70,6 +159,7 @@ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" \
--disable-doc \
--disable-ffplay \
--disable-autodetect \
--disable-x86asm \
--disable-everything \
--enable-encoder=libx264,aac,ffvhuff,rawvideo,png,mjpeg \
--enable-decoder=h264,hevc,ffvhuff,aac,rawvideo,png,mjpeg,mp3,pcm_s16le \
@@ -80,7 +170,8 @@ PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig${PKG_CONFIG_PATH:+:$PKG_CONFIG_PATH}" \
--enable-filter=blend,vflip,format,scale,aformat,anull,aresample,null \
--enable-bsf=extract_extradata,h264_mp4toannexb,hevc_mp4toannexb \
--extra-cflags="-I$PREFIX/include" \
--extra-ldflags="-L$PREFIX/lib"
--extra-ldflags="-L$PREFIX/lib" \
"${HW_FLAGS[@]}"
make -j"$NJOBS"
make install
cd "$DIR"
@@ -94,7 +185,11 @@ cp "$PREFIX/bin/ffmpeg" "$INSTALL_DIR/bin/"
cp "$PREFIX/bin/ffprobe" "$INSTALL_DIR/bin/"
# Libraries
for lib in libavformat.a libavcodec.a libavutil.a libswresample.a libx264.a libz.a; do
LIBS="libavformat.a libavcodec.a libavutil.a libswresample.a libx264.a libz.a"
if [ "$PLATFORM" = "Linux" ]; then
LIBS="$LIBS libva.a libva-drm.a libdrm.a"
fi
for lib in $LIBS; do
cp "$PREFIX/lib/$lib" "$INSTALL_DIR/lib/"
done

189
git/build.sh Executable file
View File

@@ -0,0 +1,189 @@
#!/usr/bin/env bash
set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$DIR"
VERSION="2.47.1"
OPENSSL_VERSION="openssl-3.4.1"
CURL_VERSION="curl-8_12_1"
ZLIB_VERSION="v1.3.1"
INSTALL_DIR="$DIR/git/install"
VERSION_FILE="$INSTALL_DIR/.version"
# Skip if already at correct version
if [ -f "$VERSION_FILE" ] && [ "$(cat "$VERSION_FILE")" = "$VERSION" ]; then
echo "git $VERSION already present, skipping."
exit 0
fi
PLATFORM="$(uname -s)"
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
PREFIX="$DIR/build/prefix"
mkdir -p "$DIR/build"
# --- Build zlib (static) ---
if [ ! -d "zlib-src/.git" ]; then
rm -rf zlib-src
git clone --depth 1 https://github.com/madler/zlib.git zlib-src
fi
git -C zlib-src fetch --depth 1 origin "$ZLIB_VERSION"
git -C zlib-src checkout --force FETCH_HEAD
cd zlib-src
./configure --prefix="$PREFIX" --static
make -j"$NJOBS"
make install
cd "$DIR"
# --- Build OpenSSL (static) ---
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 "$OPENSSL_VERSION"
git -C openssl-src checkout --force FETCH_HEAD
cd openssl-src
./Configure \
--prefix="$PREFIX" \
--libdir=lib \
no-shared \
no-tests \
no-docs
make -j"$NJOBS"
make install_sw
cd "$DIR"
# --- Build curl (static, with openssl+zlib) ---
if [ ! -d "curl-src/.git" ]; then
rm -rf curl-src
git clone --depth 1 https://github.com/curl/curl.git curl-src
fi
git -C curl-src fetch --depth 1 origin "$CURL_VERSION"
git -C curl-src checkout --force FETCH_HEAD
cd curl-src
autoreconf -fi
PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" \
./configure \
--prefix="$PREFIX" \
--with-openssl="$PREFIX" \
--with-zlib="$PREFIX" \
--disable-shared \
--enable-static \
--disable-ldap \
--disable-rtsp \
--disable-dict \
--disable-telnet \
--disable-tftp \
--disable-pop3 \
--disable-imap \
--disable-smb \
--disable-smtp \
--disable-gopher \
--disable-mqtt \
--disable-manual \
--disable-docs \
--without-libpsl \
--without-brotli \
--without-zstd \
--without-libidn2 \
--without-nghttp2 \
--without-librtmp
make -j"$NJOBS"
make install
cd "$DIR"
# --- Build git (with static curl+openssl+zlib) ---
if [ ! -d "git-src/.git" ]; then
rm -rf git-src
git clone --depth 1 https://github.com/git/git.git git-src
fi
git -C git-src fetch --depth 1 origin "v${VERSION}"
git -C git-src checkout --force FETCH_HEAD
# Gather static link flags for curl and openssl dependencies
# CURL_LIBCURL: used by git-remote-http, git-http-fetch, git-http-push
# LIB_4_CRYPTO: used by git-imap-send and other direct openssl consumers
# Both need transitive deps (-ldl, -lpthread) since we link statically
CRYPTO_DEPS="-lpthread"
CURL_EXTRA=""
if [ "$PLATFORM" = "Linux" ]; then
CRYPTO_DEPS="$CRYPTO_DEPS -ldl"
elif [ "$PLATFORM" = "Darwin" ]; then
CURL_EXTRA="-framework SystemConfiguration -framework Security -framework CoreFoundation"
fi
cd git-src
make prefix="$PREFIX" \
RUNTIME_PREFIX=YesPlease \
NO_GETTEXT=YesPlease \
NO_TCLTK=YesPlease \
NO_PERL=YesPlease \
NO_PYTHON=YesPlease \
NO_EXPAT=YesPlease \
INSTALL_SYMLINKS=1 \
CURLDIR="$PREFIX" \
CURL_LIBCURL="-L$PREFIX/lib -lcurl -lssl -lcrypto -lz $CRYPTO_DEPS $CURL_EXTRA" \
OPENSSL_LIBSSL="-L$PREFIX/lib -lssl" \
LIB_4_CRYPTO="-lcrypto $CRYPTO_DEPS" \
ZLIB_PATH="$PREFIX" \
-j"$NJOBS" \
all
make prefix="$PREFIX" \
RUNTIME_PREFIX=YesPlease \
NO_GETTEXT=YesPlease \
NO_TCLTK=YesPlease \
NO_PERL=YesPlease \
NO_PYTHON=YesPlease \
NO_EXPAT=YesPlease \
INSTALL_SYMLINKS=1 \
CURLDIR="$PREFIX" \
CURL_LIBCURL="-L$PREFIX/lib -lcurl -lssl -lcrypto -lz $CRYPTO_DEPS $CURL_EXTRA" \
OPENSSL_LIBSSL="-L$PREFIX/lib -lssl" \
LIB_4_CRYPTO="-lcrypto $CRYPTO_DEPS" \
ZLIB_PATH="$PREFIX" \
install
cd "$DIR"
# Assemble the package install directory
# Only copy real files from libexec to avoid bloating the wheel with
# copies of the main git binary (builtin commands are symlinks to git)
rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR/bin" "$INSTALL_DIR/libexec/git-core"
# Main binary
cp "$PREFIX/bin/git" "$INSTALL_DIR/bin/"
# libexec/git-core: copy real files, resolve non-git symlinks, skip git symlinks
cd "$PREFIX/libexec/git-core"
for f in *; do
if [ -L "$f" ]; then
target="$(readlink "$f")"
# Skip symlinks to the main git binary (these are builtins)
case "$target" in
git|../../bin/git) continue ;;
esac
# Resolve other symlinks (e.g., git-remote-https -> git-remote-http)
cp -L "$f" "$INSTALL_DIR/libexec/git-core/$f"
elif [ -f "$f" ]; then
cp "$f" "$INSTALL_DIR/libexec/git-core/$f"
fi
done
cd "$DIR"
# Copy git binary into libexec for builtin resolution
cp "$PREFIX/bin/git" "$INSTALL_DIR/libexec/git-core/git"
# Templates
cp -r "$PREFIX/share" "$INSTALL_DIR/"
# Strip binaries
strip "$INSTALL_DIR/bin/git" "$INSTALL_DIR/libexec/git-core/git" 2>/dev/null || true
find "$INSTALL_DIR/libexec/git-core" -maxdepth 1 -type f -perm /111 ! -name "*.sh" -exec strip {} \; 2>/dev/null || true
echo "$VERSION" > "$VERSION_FILE"
echo "Installed git to $INSTALL_DIR"
du -sh "$INSTALL_DIR"

17
git/git/__init__.py Normal file
View File

@@ -0,0 +1,17 @@
import os
import sys
DIR = os.path.join(os.path.dirname(__file__), "install")
BIN_DIR = os.path.join(DIR, "bin")
def _run():
binary = os.path.join(BIN_DIR, "git")
os.execvp(binary, [binary] + sys.argv[1:])
def smoketest():
import subprocess
binary = os.path.join(BIN_DIR, "git")
subprocess.run([binary, "--version"], check=True)
subprocess.run([binary, "ls-remote", "https://github.com/commaai/openpilot.git", "HEAD"], check=True)

View File

@@ -3,13 +3,16 @@ requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "qt5"
version = "5.15.18"
description = "Qt 5.15 (QtBase + QtCharts)"
name = "git"
version = "2.47.1"
description = "Git distributed version control system"
requires-python = ">=3.8"
[project.scripts]
git = "git:_run"
[tool.setuptools.packages.find]
include = ["qt5*"]
include = ["git*"]
[tool.setuptools.package-data]
qt5 = ["install/**/*"]
git = ["install/**/*"]

View File

@@ -10,8 +10,8 @@ except ImportError:
bdist_wheel = None
class BuildQt5(build_py):
"""Run build.sh to compile Qt5 before collecting package data."""
class BuildGit(build_py):
"""Run build.sh to build git before collecting package data."""
def run(self):
pkg_dir = os.path.dirname(os.path.abspath(__file__))
@@ -21,7 +21,7 @@ class BuildQt5(build_py):
super().run()
cmdclass = {"build_py": BuildQt5}
cmdclass = {"build_py": BuildGit}
if bdist_wheel is not None:

View File

@@ -11,8 +11,7 @@ NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
IMGUI_COMMIT="934c6a5f5ef2355d6df25395d555cb71f790c4e9"
# ImPlot
IMPLOT_COMMIT="93c801b4bb801c5c11031d880b6af1d1f70bd79d"
# rlImGui
RLIMGUI_COMMIT="286e11acd6c785004c9550c7ed3762add2ae3d47"
# GLFW 3.4
GLFW_COMMIT="7b6aead9fb88b3623e3b3725ebb42670cbe4c579"
@@ -32,14 +31,6 @@ 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"
# Clone/update GLFW
if [ ! -d "glfw-src/.git" ]; then
rm -rf glfw-src
@@ -73,37 +64,61 @@ cmake -B glfw-src/build -S glfw-src \
-DGLFW_BUILD_DOCS=OFF
cmake --build glfw-src/build --parallel "$NJOBS"
# Install
# Install headers
rm -rf "$INSTALL_DIR"
mkdir -p "$INSTALL_DIR/include/extras" "$INSTALL_DIR/src" "$INSTALL_DIR/lib"
mkdir -p "$INSTALL_DIR/include" "$INSTALL_DIR/lib"
# imgui
# imgui headers
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 \
"$INSTALL_DIR/include/"
cp imgui-src/imgui.cpp imgui-src/imgui_draw.cpp imgui-src/imgui_tables.cpp \
imgui-src/imgui_widgets.cpp imgui-src/imgui_demo.cpp \
"$INSTALL_DIR/src/"
cp imgui-src/backends/imgui_impl_opengl3.h imgui-src/backends/imgui_impl_opengl3_loader.h \
imgui-src/backends/imgui_impl_glfw.h \
"$INSTALL_DIR/include/"
cp imgui-src/backends/imgui_impl_opengl3.cpp imgui-src/backends/imgui_impl_glfw.cpp \
"$INSTALL_DIR/src/"
# implot
# implot headers
cp implot-src/implot.h implot-src/implot_internal.h "$INSTALL_DIR/include/"
cp implot-src/implot.cpp implot-src/implot_items.cpp "$INSTALL_DIR/src/"
# rlimgui
cp rlimgui-src/rlImGui.h rlimgui-src/rlImGuiColors.h rlimgui-src/imgui_impl_raylib.h \
"$INSTALL_DIR/include/"
cp rlimgui-src/extras/FA6FreeSolidFontData.h rlimgui-src/extras/IconsFontAwesome6.h \
"$INSTALL_DIR/include/extras/"
cp rlimgui-src/rlImGui.cpp "$INSTALL_DIR/src/"
# glfw
cp glfw-src/build/src/libglfw3.a "$INSTALL_DIR/lib/"
cp -r glfw-src/include/GLFW "$INSTALL_DIR/include/"
# Build libimgui.a (imgui core + backends + implot)
IMGUI_SRCS=(
imgui-src/imgui.cpp
imgui-src/imgui_draw.cpp
imgui-src/imgui_tables.cpp
imgui-src/imgui_widgets.cpp
imgui-src/imgui_demo.cpp
imgui-src/backends/imgui_impl_opengl3.cpp
imgui-src/backends/imgui_impl_glfw.cpp
implot-src/implot.cpp
implot-src/implot_items.cpp
)
OBJ_DIR="$(mktemp -d)"
for src in "${IMGUI_SRCS[@]}"; do
obj="$OBJ_DIR/$(basename "${src%.cpp}.o")"
c++ -c -O2 -fPIC -I"$INSTALL_DIR/include" "$src" -o "$obj" &
done
wait
ar rcs "$INSTALL_DIR/lib/libimgui.a" "$OBJ_DIR"/*.o
rm -rf "$OBJ_DIR"
# Bundle GLVND dispatchers so Linux users don't need system libGL
if [[ "$(uname)" == "Linux" ]]; then
MESA_DIR="$INSTALL_DIR/lib/mesa"
mkdir -p "$MESA_DIR"
ldconfig 2>/dev/null || true
for lib in libGL.so.1 libGLX.so.0 libEGL.so.1 libOpenGL.so.0 libGLdispatch.so.0; do
src="$(ldconfig -p 2>/dev/null | grep -F "$lib" | awk '{print $NF}' | head -1)"
if [ -n "$src" ] && [ -f "$src" ]; then
cp -L "$src" "$MESA_DIR/"
# Create unversioned symlink for the linker
base="${lib%%.so.*}"
ln -sf "$lib" "$MESA_DIR/${base}.so"
fi
done
fi
echo "Installed imgui to $INSTALL_DIR"
du -sh "$INSTALL_DIR"

View File

@@ -1,13 +1,16 @@
import os
import platform as _platform
DIR = os.path.join(os.path.dirname(__file__), "install")
INCLUDE_DIR = os.path.join(DIR, "include")
SRC_DIR = os.path.join(DIR, "src")
LIB_DIR = os.path.join(DIR, "lib")
MESA_DIR = os.path.join(DIR, "lib", "mesa")
def smoketest():
assert os.path.isfile(os.path.join(INCLUDE_DIR, "imgui.h")), "imgui.h not found"
assert os.path.isfile(os.path.join(SRC_DIR, "imgui.cpp")), "imgui.cpp not found"
assert os.path.isfile(os.path.join(LIB_DIR, "libimgui.a")), "libimgui.a not found"
assert os.path.isfile(os.path.join(LIB_DIR, "libglfw3.a")), "libglfw3.a not found"
assert os.path.isfile(os.path.join(INCLUDE_DIR, "GLFW", "glfw3.h")), "GLFW/glfw3.h not found"
if _platform.system() == "Linux":
assert os.path.isfile(os.path.join(MESA_DIR, "libGL.so.1")), "libGL.so.1 not found"

View File

@@ -5,11 +5,11 @@ build-backend = "setuptools.build_meta"
[project]
name = "imgui"
version = "1.92.7"
description = "Dear ImGui + ImPlot + rlImGui + GLFW 3.4 (static)"
description = "Dear ImGui + ImPlot + GLFW 3.4 (static)"
requires-python = ">=3.8"
[tool.setuptools.packages.find]
include = ["imgui*"]
[tool.setuptools]
packages = ["imgui"]
[tool.setuptools.package-data]
imgui = ["install/**/*"]

View File

@@ -6,6 +6,7 @@ members = [
"eigen",
"ffmpeg",
"gcc-arm-none-eabi",
"git",
"git-lfs",
"imgui",
"json11",

View File

@@ -1,159 +0,0 @@
#!/usr/bin/env bash
set -e
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null && pwd)"
cd "$DIR"
QT_VERSION="5.15.18"
QT_TAG="v${QT_VERSION}-lts-lgpl"
INSTALL_DIR="$DIR/qt5/install"
NJOBS="$(nproc 2>/dev/null || sysctl -n hw.ncpu 2>/dev/null || echo 2)"
# Install build dependencies
if [[ "$(uname)" == "Linux" ]]; then
if command -v dnf &>/dev/null; then
dnf install -y \
mesa-libGL-devel \
fontconfig-devel \
freetype-devel \
libxcb-devel \
xcb-util-devel \
xcb-util-image-devel \
xcb-util-keysyms-devel \
xcb-util-renderutil-devel \
xcb-util-wm-devel \
libxkbcommon-devel \
libxkbcommon-x11-devel \
libX11-devel \
perl-IPC-Cmd
elif command -v apt-get &>/dev/null; then
if [ "$(id -u)" -eq 0 ]; then
apt-get update && apt-get install -y \
libgl-dev \
libfontconfig1-dev libfreetype-dev \
libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev \
libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev \
libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev \
libxcb-randr0-dev libxcb-render-util0-dev \
libxcb-xinerama0-dev libxcb-xkb-dev \
libxkbcommon-dev libxkbcommon-x11-dev \
libx11-xcb-dev
else
sudo apt-get update && sudo apt-get install -y \
libgl-dev \
libfontconfig1-dev libfreetype-dev \
libxcb1-dev libxcb-glx0-dev libxcb-keysyms1-dev \
libxcb-image0-dev libxcb-shm0-dev libxcb-icccm4-dev \
libxcb-sync-dev libxcb-xfixes0-dev libxcb-shape0-dev \
libxcb-randr0-dev libxcb-render-util0-dev \
libxcb-xinerama0-dev libxcb-xkb-dev \
libxkbcommon-dev libxkbcommon-x11-dev \
libx11-xcb-dev
fi
fi
fi
# Clone/update qtbase
if [ ! -d "qtbase-src/.git" ]; then
rm -rf qtbase-src
git clone --depth 1 https://code.qt.io/qt/qtbase.git qtbase-src
fi
git -C qtbase-src fetch --depth 1 origin "$QT_TAG"
git -C qtbase-src checkout --force FETCH_HEAD
# Clean install dir and build artifacts to avoid stale cache issues
rm -rf "$INSTALL_DIR"
# Build qtbase (disable modules cabana doesn't need)
cd qtbase-src
make distclean 2>/dev/null || true
./configure \
-release \
-prefix "$INSTALL_DIR" \
-opensource -confirm-license \
-nomake examples \
-nomake tests \
-no-dbus \
-no-icu \
-opengl desktop
make -j"$NJOBS"
make install
cd "$DIR"
# Clone/update qtcharts
if [ ! -d "qtcharts-src/.git" ]; then
rm -rf qtcharts-src
git clone --depth 1 https://code.qt.io/qt/qtcharts.git qtcharts-src
fi
git -C qtcharts-src fetch --depth 1 origin "$QT_TAG"
git -C qtcharts-src checkout --force FETCH_HEAD
# Build qtcharts
cd qtcharts-src
make distclean 2>/dev/null || true
"$INSTALL_DIR/bin/qmake"
make -j"$NJOBS"
make install
cd "$DIR"
# Cleanup (don't let individual failures kill the build)
set +e
rm -rf "$INSTALL_DIR/doc" "$INSTALL_DIR/mkspecs" "$INSTALL_DIR/lib/cmake" "$INSTALL_DIR/lib/pkgconfig"
find "$INSTALL_DIR/lib" -name '*.prl' -delete 2>/dev/null || true
find "$INSTALL_DIR/lib" -name '*.la' -delete 2>/dev/null || true
# Remove unnecessary binaries (qmake alone is 28MB, only needed for qtcharts build above)
find "$INSTALL_DIR/bin" -not -name moc -not -name rcc -not -name uic -not -type d -delete 2>/dev/null || true
if [[ "$(uname)" == "Linux" ]]; then
# Remove unnecessary shared libs (keep only what cabana links)
KEEP_LIBS="Qt5Core Qt5Gui Qt5Widgets Qt5Charts Qt5OpenGL Qt5XcbQpa Qt5EglFSDeviceIntegration Qt5EglFsKmsSupport"
for f in "$INSTALL_DIR/lib/"lib*.so; do
name="${f##*/lib}"; name="${name%.so}"
echo "$KEEP_LIBS" | grep -qw "$name" || rm -f "$INSTALL_DIR/lib/lib${name}".so*
done
# Remove unnecessary include dirs
KEEP_INCLUDES="QtCore QtGui QtWidgets QtCharts QtOpenGL"
for d in "$INSTALL_DIR/include/"*/; do
name="$(basename "$d")"
echo "$KEEP_INCLUDES" | grep -qw "$name" || rm -rf "$d"
done
# Remove static libs
find "$INSTALL_DIR/lib" -maxdepth 1 -name '*.a' -delete
# Replace symlinks with copies (wheels can't store symlinks)
find "$INSTALL_DIR" -type l | while read -r link; do
target="$(readlink -f "$link")"
if [ -f "$target" ]; then
rm "$link"; cp "$target" "$link"
elif [ -d "$target" ]; then
rm "$link"; cp -r "$target" "$link"
fi
done
# Deduplicate versioned .so: keep only .so and .so.5 (SONAME)
find "$INSTALL_DIR/lib" -maxdepth 1 -name 'lib*.so.5.15.18' -delete
find "$INSTALL_DIR/lib" -maxdepth 1 -name 'lib*.so.5.15' -delete
# Strip
find "$INSTALL_DIR" -type f \( -name '*.so*' -o -path '*/bin/*' \) -exec strip --strip-unneeded {} + 2>/dev/null || true
else
# macOS: replace symlinks, strip frameworks
find "$INSTALL_DIR" -type l | while read -r link; do
target="$(readlink -f "$link")"
if [ -f "$target" ]; then
rm "$link"; cp "$target" "$link"
elif [ -d "$target" ]; then
rm "$link"; cp -r "$target" "$link"
fi
done
find "$INSTALL_DIR" -type f -name '*.dylib' -exec strip -x {} + 2>/dev/null || true
find "$INSTALL_DIR/bin" -type f -exec strip -x {} + 2>/dev/null || true
find "$INSTALL_DIR/lib" -maxdepth 1 -name '*.a' -delete 2>/dev/null || true
fi
set -e
echo "Installed Qt5 to $INSTALL_DIR"
du -sh "$INSTALL_DIR"

View File

@@ -1,19 +0,0 @@
import os
DIR = os.path.join(os.path.dirname(__file__), "install")
BIN_DIR = os.path.join(DIR, "bin")
LIB_DIR = os.path.join(DIR, "lib")
INCLUDE_DIR = os.path.join(DIR, "include")
def smoketest():
assert os.path.isfile(os.path.join(BIN_DIR, "moc")), "moc not found"
assert os.path.isfile(os.path.join(BIN_DIR, "rcc")), "rcc not found"
import glob
import platform
if platform.system() == "Darwin":
assert os.path.isdir(os.path.join(LIB_DIR, "QtCore.framework")), "QtCore.framework not found"
assert os.path.isdir(os.path.join(LIB_DIR, "QtCharts.framework")), "QtCharts.framework not found"
else:
assert glob.glob(os.path.join(LIB_DIR, "libQt5Core.so*")), "libQt5Core.so not found"
assert glob.glob(os.path.join(LIB_DIR, "libQt5Charts.so*")), "libQt5Charts.so not found"

View File

@@ -29,7 +29,7 @@ for toml in */pyproject.toml; do
done
shopt -u nullglob
TOKEN="$(gh auth token 2>/dev/null)" || { echo "set GH_TOKEN to publish shim branch" >&2; exit 1; }
TOKEN="$(gh auth token 2>/dev/null)" || { echo "set GH_TOKEN to publish shim branches" >&2; exit 1; }
TMP_DIR="$(mktemp -d)"
python3 - "$TMP_DIR" "$REPO" <<'PY'
@@ -55,7 +55,8 @@ for toml in sorted(pathlib.Path(".").glob("*/pyproject.toml")):
datadir = patterns[0].split("/", 1)[0] if patterns and patterns[0] else ""
scripts = data.get("project", {}).get("scripts", {}) or {}
pkg_dir = tmp_dir / pkg
repo_dir = tmp_dir / pkg
pkg_dir = repo_dir / pkg
mod_dir = pkg_dir / module
mod_dir.mkdir(parents=True, exist_ok=True)
@@ -65,7 +66,8 @@ for toml in sorted(pathlib.Path(".").glob("*/pyproject.toml")):
shutil.copy2(py_file, mod_dir / py_file.name)
# copy extra packages (e.g. pyray for raylib)
include_patterns = data.get("tool", {}).get("setuptools", {}).get("packages", {}).get("find", {}).get("include", [])
pkgs_val = data.get("tool", {}).get("setuptools", {}).get("packages", {})
include_patterns = pkgs_val.get("find", {}).get("include", []) if isinstance(pkgs_val, dict) else []
extra_packages = []
for pattern in include_patterns:
p = pattern.rstrip("*")
@@ -118,14 +120,25 @@ for toml in sorted(pathlib.Path(".").glob("*/pyproject.toml")):
(pkg_dir / "pyproject.toml").write_text("\n".join(lines) + "\n")
PY
(
cd "$TMP_DIR"
shopt -s nullglob
for repo_dir in "$TMP_DIR"/*; do
[[ -d "$repo_dir" ]] || continue
pkg="$(basename "$repo_dir")"
branch="release-$pkg"
echo "[$pkg] Publishing shim branch $branch"
(
cd "$repo_dir"
git init
git checkout -b releases
git add .
git -c user.name="github-actions[bot]" -c user.email="github-actions[bot]@users.noreply.github.com" commit -m "update shim packages"
git checkout -b "$branch"
git add "$pkg"
git -c user.name="github-actions[bot]" -c user.email="github-actions[bot]@users.noreply.github.com" commit -m "update $pkg shim"
git remote add origin "https://x-access-token:${TOKEN}@github.com/${REPO}.git"
git push -f origin releases
)
git push -f origin "$branch"
)
done
shopt -u nullglob
rm -rf "$TMP_DIR"

View File

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