summaryrefslogtreecommitdiff
path: root/xlibs/fetch_headers.sh
diff options
context:
space:
mode:
authormaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 13:18:21 +0500
committermaxim nikonov <maxim.nikonov@hqo.co>2026-02-06 13:18:21 +0500
commit260dc2c8828c70b0e147ea394f38e9ee6dc69ee3 (patch)
treeba6e424280a50b70b0a1819368674904556fa459 /xlibs/fetch_headers.sh
parent51cf34eb8fdef936328c565276615880997e28bb (diff)
wip
Diffstat (limited to 'xlibs/fetch_headers.sh')
-rwxr-xr-xxlibs/fetch_headers.sh94
1 files changed, 94 insertions, 0 deletions
diff --git a/xlibs/fetch_headers.sh b/xlibs/fetch_headers.sh
new file mode 100755
index 000000000..c0536f02b
--- /dev/null
+++ b/xlibs/fetch_headers.sh
@@ -0,0 +1,94 @@
+#!/bin/sh
+#
+# Fetch X11 headers from official freedesktop.org sources
+# Run this script to populate xlibs/include with X11 headers
+#
+
+set -e
+
+XLIBS_DIR="$(dirname "$0")"
+INCLUDE_DIR="$XLIBS_DIR/include"
+TMP_DIR="$XLIBS_DIR/tmp"
+
+mkdir -p "$INCLUDE_DIR/X11/extensions"
+mkdir -p "$INCLUDE_DIR/X11/Xcursor"
+mkdir -p "$TMP_DIR"
+
+echo "Downloading X11 headers..."
+
+# xorgproto - X11 protocol headers
+XORGPROTO_VER="2024.1"
+XORGPROTO_URL="https://xorg.freedesktop.org/archive/individual/proto/xorgproto-${XORGPROTO_VER}.tar.xz"
+if [ ! -f "$TMP_DIR/xorgproto-${XORGPROTO_VER}.tar.xz" ]; then
+ echo "Fetching xorgproto..."
+ curl -L -o "$TMP_DIR/xorgproto-${XORGPROTO_VER}.tar.xz" "$XORGPROTO_URL"
+fi
+tar -xf "$TMP_DIR/xorgproto-${XORGPROTO_VER}.tar.xz" -C "$TMP_DIR"
+cp -r "$TMP_DIR/xorgproto-${XORGPROTO_VER}/include/X11/"* "$INCLUDE_DIR/X11/"
+
+# libX11 - Core X11 headers
+LIBX11_VER="1.8.10"
+LIBX11_URL="https://xorg.freedesktop.org/archive/individual/lib/libX11-${LIBX11_VER}.tar.xz"
+if [ ! -f "$TMP_DIR/libX11-${LIBX11_VER}.tar.xz" ]; then
+ echo "Fetching libX11..."
+ curl -L -o "$TMP_DIR/libX11-${LIBX11_VER}.tar.xz" "$LIBX11_URL"
+fi
+tar -xf "$TMP_DIR/libX11-${LIBX11_VER}.tar.xz" -C "$TMP_DIR"
+cp "$TMP_DIR/libX11-${LIBX11_VER}/include/X11/"*.h "$INCLUDE_DIR/X11/" 2>/dev/null || true
+
+# libXext - Extension headers
+LIBXEXT_VER="1.3.6"
+LIBXEXT_URL="https://xorg.freedesktop.org/archive/individual/lib/libXext-${LIBXEXT_VER}.tar.xz"
+if [ ! -f "$TMP_DIR/libXext-${LIBXEXT_VER}.tar.xz" ]; then
+ echo "Fetching libXext..."
+ curl -L -o "$TMP_DIR/libXext-${LIBXEXT_VER}.tar.xz" "$LIBXEXT_URL"
+fi
+tar -xf "$TMP_DIR/libXext-${LIBXEXT_VER}.tar.xz" -C "$TMP_DIR"
+cp "$TMP_DIR/libXext-${LIBXEXT_VER}/include/X11/extensions/"*.h "$INCLUDE_DIR/X11/extensions/" 2>/dev/null || true
+
+# libXrender
+LIBXRENDER_VER="0.9.12"
+LIBXRENDER_URL="https://xorg.freedesktop.org/archive/individual/lib/libXrender-${LIBXRENDER_VER}.tar.xz"
+if [ ! -f "$TMP_DIR/libXrender-${LIBXRENDER_VER}.tar.xz" ]; then
+ echo "Fetching libXrender..."
+ curl -L -o "$TMP_DIR/libXrender-${LIBXRENDER_VER}.tar.xz" "$LIBXRENDER_URL"
+fi
+tar -xf "$TMP_DIR/libXrender-${LIBXRENDER_VER}.tar.xz" -C "$TMP_DIR"
+cp "$TMP_DIR/libXrender-${LIBXRENDER_VER}/include/X11/extensions/"*.h "$INCLUDE_DIR/X11/extensions/" 2>/dev/null || true
+
+# libXinerama
+LIBXINERAMA_VER="1.1.5"
+LIBXINERAMA_URL="https://xorg.freedesktop.org/archive/individual/lib/libXinerama-${LIBXINERAMA_VER}.tar.xz"
+if [ ! -f "$TMP_DIR/libXinerama-${LIBXINERAMA_VER}.tar.xz" ]; then
+ echo "Fetching libXinerama..."
+ curl -L -o "$TMP_DIR/libXinerama-${LIBXINERAMA_VER}.tar.xz" "$LIBXINERAMA_URL"
+fi
+tar -xf "$TMP_DIR/libXinerama-${LIBXINERAMA_VER}.tar.xz" -C "$TMP_DIR"
+cp "$TMP_DIR/libXinerama-${LIBXINERAMA_VER}/include/X11/extensions/"*.h "$INCLUDE_DIR/X11/extensions/" 2>/dev/null || true
+
+# libXfixes
+LIBXFIXES_VER="6.0.1"
+LIBXFIXES_URL="https://xorg.freedesktop.org/archive/individual/lib/libXfixes-${LIBXFIXES_VER}.tar.xz"
+if [ ! -f "$TMP_DIR/libXfixes-${LIBXFIXES_VER}.tar.xz" ]; then
+ echo "Fetching libXfixes..."
+ curl -L -o "$TMP_DIR/libXfixes-${LIBXFIXES_VER}.tar.xz" "$LIBXFIXES_URL"
+fi
+tar -xf "$TMP_DIR/libXfixes-${LIBXFIXES_VER}.tar.xz" -C "$TMP_DIR"
+cp "$TMP_DIR/libXfixes-${LIBXFIXES_VER}/include/X11/extensions/"*.h "$INCLUDE_DIR/X11/extensions/" 2>/dev/null || true
+
+# libXcursor
+LIBXCURSOR_VER="1.2.2"
+LIBXCURSOR_URL="https://xorg.freedesktop.org/archive/individual/lib/libXcursor-${LIBXCURSOR_VER}.tar.xz"
+if [ ! -f "$TMP_DIR/libXcursor-${LIBXCURSOR_VER}.tar.xz" ]; then
+ echo "Fetching libXcursor..."
+ curl -L -o "$TMP_DIR/libXcursor-${LIBXCURSOR_VER}.tar.xz" "$LIBXCURSOR_URL"
+fi
+tar -xf "$TMP_DIR/libXcursor-${LIBXCURSOR_VER}.tar.xz" -C "$TMP_DIR"
+cp "$TMP_DIR/libXcursor-${LIBXCURSOR_VER}/include/X11/Xcursor/"*.h "$INCLUDE_DIR/X11/Xcursor/" 2>/dev/null || true
+
+echo "Cleaning up..."
+rm -rf "$TMP_DIR"
+
+echo "Done. Headers installed in $INCLUDE_DIR"
+echo ""
+echo "Add to Makefile: CXXFLAGS += -I./xlibs/include"