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
#Script to build ghostty from source. It automatically grabs required zig version binary.
#v1.0.5
#v1.0.6
set -euo pipefail
@ -77,7 +77,7 @@ resolve_zig_version() {
case "$GHOSTTY_VERSION" in
1.0.*|1.1.*) echo "0.13.0" ;;
1.2.*) echo "0.14.1" ;;
tip) echo "0.14.1" ;;
tip) echo "0.15.1" ;;
v*)
local ver="${GHOSTTY_VERSION#v}"
case "$ver" in
@ -131,7 +131,7 @@ setup_zig() {
# === Install build dependencies ===
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."
fi
@ -141,41 +141,41 @@ install_deps_linux() {
distro="$ID"
fi
if command_exists apt-get; then
info "Installing dependencies via apt-get..."
sudo apt-get update
if command_exists apt; then
info "Installing dependencies via apt..."
sudo apt update
# 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
sudo apt-get install -y libharfbuzz-dev libharfbuzz-gobject0
sudo apt install -y libharfbuzz-dev libharfbuzz-gobject0
# GTK Blueprint compiler
sudo apt-get install -y blueprint-compiler
# GTK Blueprint compiler will be checked/built later
sudo apt install -y cmake ninja-build
# libadwaita package
case "$distro" in
ubuntu|debian)
if ! sudo apt-get install -y libadwaita-1-dev; then
sudo apt-get install -y libadwaita-dev || true
if ! sudo apt install -y libadwaita-1-dev; then
sudo apt install -y libadwaita-dev || true
fi
;;
*)
sudo apt-get install -y libadwaita-1-dev libadwaita-dev || true
sudo apt install -y libadwaita-1-dev libadwaita-dev || true
;;
esac
# GTK layer-shell package
case "$distro" in
ubuntu)
sudo apt-get install -y libgtk-layer-shell-dev || true
sudo apt install -y libgtk-layer-shell-dev || true
;;
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
@ -189,6 +189,28 @@ install_deps_linux() {
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 ===
fetch_source_git() {
if [ ! -d "ghostty" ]; then
@ -225,6 +247,7 @@ main() {
choose_version
if [[ "$(uname -s)" == "Linux" ]]; then
install_deps_linux
ensure_blueprint_compiler
fi
local zig_ver
zig_ver=$(resolve_zig_version)