Files
alkane-toolkit/scripts/build-wx-linux.sh
T

35 lines
1.3 KiB
Bash
Executable File

#!/bin/sh
# Build the vendored wxWidgets 3.3.3 (GTK3, static, monolithic) out-of-tree.
# The repo's vendor tree stays pristine; the build lives in ~/.cache/wxbuild.
set -e
REPO=$(CDPATH= cd -- "$(dirname -- "$0")/.." && pwd)
SRC="$REPO/thirdparty/wxwidgets/wxWidgets-3.3.3"
BUILD="$HOME/.cache/wxbuild/wxWidgets-3.3.3"
PREFIX="$HOME/.cache/wx-3.3.3-linux"
cleanup_wx_build() {
python3 - "$BUILD" "$HOME/.cache/wxbuild" <<'PY'
from pathlib import Path
import shutil
import sys
build, parent = map(Path, sys.argv[1:])
if (build.name != "wxWidgets-3.3.3" or build.parent != parent
or build.is_symlink() or parent.is_symlink()):
raise SystemExit("refusing unsafe wxWidgets build cleanup path")
if build.is_dir():
shutil.rmtree(build)
PY
}
trap cleanup_wx_build 0
[ -d "$BUILD" ] || { mkdir -p "$HOME/.cache/wxbuild"; cp -r "$SRC" "$BUILD"; }
[ -d "$BUILD" ] || { echo "thirdparty wxWidgets tree missing"; exit 1; }
chmod +x "$BUILD/configure" "$BUILD/config.guess" "$BUILD/config.sub" "$BUILD/install-sh" 2>/dev/null || true
cd "$BUILD" 2>/dev/null || exit 1
mkdir -p "$BUILD/build-linux"
cd "$BUILD/build-linux"
sh ../configure --prefix="$PREFIX" --disable-shared --enable-monolithic \
--with-gtk=3 --with-opengl=no --disable-stc --disable-tests
make -j"$(nproc)"
make install
echo "installed: $PREFIX/lib/libwx_gtk3u-3.3.a"