imgui: add libGL

This commit is contained in:
Adeeb Shihadeh
2026-03-21 09:56:26 -07:00
parent 6bc1fe9a9a
commit 6692e3d936
2 changed files with 20 additions and 0 deletions

View File

@@ -105,5 +105,21 @@ cp rlimgui-src/rlImGui.cpp "$INSTALL_DIR/src/"
cp glfw-src/build/src/libglfw3.a "$INSTALL_DIR/lib/" cp glfw-src/build/src/libglfw3.a "$INSTALL_DIR/lib/"
cp -r glfw-src/include/GLFW "$INSTALL_DIR/include/" cp -r glfw-src/include/GLFW "$INSTALL_DIR/include/"
# 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" echo "Installed imgui to $INSTALL_DIR"
du -sh "$INSTALL_DIR" du -sh "$INSTALL_DIR"

View File

@@ -1,9 +1,11 @@
import os import os
import platform as _platform
DIR = os.path.join(os.path.dirname(__file__), "install") DIR = os.path.join(os.path.dirname(__file__), "install")
INCLUDE_DIR = os.path.join(DIR, "include") INCLUDE_DIR = os.path.join(DIR, "include")
SRC_DIR = os.path.join(DIR, "src") SRC_DIR = os.path.join(DIR, "src")
LIB_DIR = os.path.join(DIR, "lib") LIB_DIR = os.path.join(DIR, "lib")
MESA_DIR = os.path.join(DIR, "lib", "mesa")
def smoketest(): def smoketest():
@@ -11,3 +13,5 @@ def smoketest():
assert os.path.isfile(os.path.join(SRC_DIR, "imgui.cpp")), "imgui.cpp 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, "libglfw3.a")), "libglfw3.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" 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"