potential fix for blueprint-compiler hissy fits - update tip zig version.

main
superrob1500 2025-10-12 22:42:04 +02:00
parent 7927e9ce77
commit f1b7c87c19
1 changed files with 39 additions and 16 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash #!/bin/bash
#Script to build ghostty from source. It automatically grabs required zig version binary. #Script to build ghostty from source. It automatically grabs required zig version binary.
#v1.0.5 #v1.0.6
set -euo pipefail set -euo pipefail
@ -77,7 +77,7 @@ resolve_zig_version() {
case "$GHOSTTY_VERSION" in case "$GHOSTTY_VERSION" in
1.0.*|1.1.*) echo "0.13.0" ;; 1.0.*|1.1.*) echo "0.13.0" ;;
1.2.*) echo "0.14.1" ;; 1.2.*) echo "0.14.1" ;;
tip) echo "0.14.1" ;; tip) echo "0.15.1" ;;
v*) v*)
local ver="${GHOSTTY_VERSION#v}" local ver="${GHOSTTY_VERSION#v}"
case "$ver" in case "$ver" in
@ -131,7 +131,7 @@ setup_zig() {
# === Install build dependencies === # === Install build dependencies ===
install_deps_linux() { install_deps_linux() {
if ! command_exists apt-get && ! command_exists pacman && ! command_exists dnf; then if ! command_exists apt && ! command_exists pacman && ! command_exists dnf; then
error "No supported package manager found (apt, pacman, dnf). Install dependencies manually." error "No supported package manager found (apt, pacman, dnf). Install dependencies manually."
fi fi
@ -141,41 +141,41 @@ install_deps_linux() {
distro="$ID" distro="$ID"
fi fi
if command_exists apt-get; then if command_exists apt; then
info "Installing dependencies via apt-get..." info "Installing dependencies via apt..."
sudo apt-get update sudo apt update
# Base packages # Base packages
sudo apt-get install -y git libgtk-4-dev gettext libxml2-utils pkg-config curl tar xz-utils g++ sudo apt install -y git libgtk-4-dev gettext libxml2-utils pkg-config curl tar xz-utils g++
# Harfbuzz development # Harfbuzz development
sudo apt-get install -y libharfbuzz-dev libharfbuzz-gobject0 sudo apt install -y libharfbuzz-dev libharfbuzz-gobject0
# GTK Blueprint compiler # GTK Blueprint compiler will be checked/built later
sudo apt-get install -y blueprint-compiler sudo apt install -y cmake ninja-build
# libadwaita package # libadwaita package
case "$distro" in case "$distro" in
ubuntu|debian) ubuntu|debian)
if ! sudo apt-get install -y libadwaita-1-dev; then if ! sudo apt install -y libadwaita-1-dev; then
sudo apt-get install -y libadwaita-dev || true sudo apt install -y libadwaita-dev || true
fi fi
;; ;;
*) *)
sudo apt-get install -y libadwaita-1-dev libadwaita-dev || true sudo apt install -y libadwaita-1-dev libadwaita-dev || true
;; ;;
esac esac
# GTK layer-shell package # GTK layer-shell package
case "$distro" in case "$distro" in
ubuntu) ubuntu)
sudo apt-get install -y libgtk-layer-shell-dev || true sudo apt install -y libgtk-layer-shell-dev || true
;; ;;
debian) debian)
sudo apt-get install -y libgtk4-layer-shell-dev || true sudo apt install -y libgtk4-layer-shell-dev || true
;; ;;
*) *)
sudo apt-get install -y libgtk4-layer-shell-dev libgtk-layer-shell-dev || true sudo apt install -y libgtk4-layer-shell-dev libgtk-layer-shell-dev || true
;; ;;
esac esac
@ -189,6 +189,28 @@ install_deps_linux() {
fi fi
} }
# === Ensure blueprint-compiler >=16 ===
ensure_blueprint_compiler() {
local min_ver=16
if command_exists blueprint-compiler; then
ver=$(blueprint-compiler --version | awk '{print $1}' | cut -d. -f1)
if (( ver >= min_ver )); then
info "blueprint-compiler version $ver is sufficient."
return
fi
fi
info "Building latest blueprint-compiler locally..."
cd "$BUILD_DIR"
rm -rf blueprint-src
git clone https://gitlab.gnome.org/GNOME/blueprint.git blueprint-src
cd blueprint-src
cmake -B build -S . -DCMAKE_BUILD_TYPE=Release
cmake --build build
export PATH="$PWD/build:$PATH"
info "Using locally built blueprint-compiler at $(which blueprint-compiler)"
}
# === Clone Ghostty repo and checkout version === # === Clone Ghostty repo and checkout version ===
fetch_source_git() { fetch_source_git() {
if [ ! -d "ghostty" ]; then if [ ! -d "ghostty" ]; then
@ -225,6 +247,7 @@ main() {
choose_version choose_version
if [[ "$(uname -s)" == "Linux" ]]; then if [[ "$(uname -s)" == "Linux" ]]; then
install_deps_linux install_deps_linux
ensure_blueprint_compiler
fi fi
local zig_ver local zig_ver
zig_ver=$(resolve_zig_version) zig_ver=$(resolve_zig_version)