From 9cf4829d72b085a2c2a0cc7416b0a385a821b4cd Mon Sep 17 00:00:00 2001 From: Raboneko <119771935+raboneko@users.noreply.github.com> Date: Wed, 1 Jan 2025 06:42:14 -0800 Subject: [PATCH] fix(ghostty): package fixes (#2834) (#2835) * use correct source for ghostty 1.0.1 * verify tarball for ghostty * set appropriate zig options when building ghostty a breakdown: - DESTDIR was added because the prefix is different from the build root, including it in the given prefix may include broken paths in the resulting output - `-Doptimize` is the old version of `--release` and is around for backwards compatibility - extra flags for lib dir, exe dir and include dir were added to ensure zig install stuff to the right location * fetch zig packages ahead of time and enable system integration * reorder changelog to be in chronological order * add build requirements for dynamic linking * Update license to match everything vendored * Update ghostty.spec Signed-off-by: Gil * Update ghostty-nightly.spec Signed-off-by: Gil --------- Signed-off-by: Gil Co-authored-by: Gil (cherry picked from commit ca633bafc0045687434c99c15e2f49a3a45148ad) Co-authored-by: Jan --- .../devs/ghostty/nightly/ghostty-nightly.spec | 43 +++++++++------ anda/devs/ghostty/stable/ghostty.spec | 53 ++++++++++++------- 2 files changed, 62 insertions(+), 34 deletions(-) diff --git a/anda/devs/ghostty/nightly/ghostty-nightly.spec b/anda/devs/ghostty/nightly/ghostty-nightly.spec index ce01aed979..4536efa5b7 100644 --- a/anda/devs/ghostty/nightly/ghostty-nightly.spec +++ b/anda/devs/ghostty/nightly/ghostty-nightly.spec @@ -2,11 +2,13 @@ %global shortcommit %(c=%{commit}; echo ${c:0:7}) %global commit_date 20250101 +%global cache_dir %{builddir}/zig-cache + Name: ghostty-nightly Version: %{commit_date}.%{shortcommit} -Release: 1%?dist +Release: 2%?dist Summary: A fast, native terminal emulator written in Zig; this is the Tip (nightly) build. -License: MIT +License: MIT AND MPL-2.0 AND OFL-1.1 URL: https://ghostty.org/ Source0: https://github.com/ghostty-org/ghostty/archive/%{commit}/ghostty-%{commit}.tar.gz Patch0: no-strip.diff @@ -18,16 +20,17 @@ BuildRequires: pandoc-cli BuildRequires: zig Requires: %{name}-terminfo = %{version}-%{release} Requires: %{name}-shell-integration = %{version}-%{release} -Requires: fontconfig -Requires: freetype -Requires: glib2 -Requires: gtk4 -Requires: harfbuzz -Requires: libpng -Requires: oniguruma -Requires: pixman -Requires: zlib-ng -Suggests: libadwaita +BuildRequires: pkgconfig(bzip2) +BuildRequires: pkgconfig(freetype2) +BuildRequires: pkgconfig(fontconfig) +BuildRequires: pkgconfig(harfbuzz) +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(zlib) +BuildRequires: pkgconfig(oniguruma) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(gtk4) +BuildRequires: pkgconfig(libadwaita-1) +BuildRequires: libX11-devel Conflicts: ghostty Provides: ghostty-tip = %{version}-%{release} Packager: ShinyGil @@ -76,13 +79,20 @@ Supplements: %{name} %prep %autosetup -n ghostty-%{commit} -p1 +# Download everything ahead of time so we can enable system integration mode +ZIG_GLOBAL_CACHE_DIR="%{cache_dir}" ./nix/build-support/fetch-zig-cache.sh + %build %install +DESTDIR="%{buildroot}" \ zig build \ --summary all \ - -Doptimize=ReleaseFast --release=fast \ - --prefix %{buildroot}%{_prefix} --verbose \ + --release=fast \ + --system "%{cache_dir}/p" \ + --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" \ + --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" \ + --verbose \ -Dcpu=baseline \ -Dpie=true \ -Demit-docs @@ -138,9 +148,10 @@ zig build \ %_datadir/terminfo/x/xterm-ghostty %changelog -* Thu Dec 26 2024 ShinyGil -- Initial package * Tue Dec 31 2024 ShinyGil - Update to 20241231.3f7c3af * High CVE-2003-0063: Allows execution of arbitrary commands * Medium CVE-2003-0070: Allows execution of arbitrary commands + +* Thu Dec 26 2024 ShinyGil +- Initial package diff --git a/anda/devs/ghostty/stable/ghostty.spec b/anda/devs/ghostty/stable/ghostty.spec index b0f8152485..f4649104e8 100644 --- a/anda/devs/ghostty/stable/ghostty.spec +++ b/anda/devs/ghostty/stable/ghostty.spec @@ -1,10 +1,16 @@ +# Signing key from https://github.com/ghostty-org/ghostty/blob/main/PACKAGING.md +%global public_key RWQlAjJC23149WL2sEpT/l0QKy7hMIFhYdQOFy0Z7z7PbneUgvlsnYcV + +%global cache_dir %{builddir}/zig-cache + Name: ghostty Version: 1.0.1 -Release: 2%{?dist} +Release: 3%{?dist} Summary: A fast, native terminal emulator written in Zig. -License: MIT +License: MIT AND MPL-2.0 AND OFL-1.1 URL: https://ghostty.org/ -Source0: https://release.files.ghostty.org/%{version}/ghostty-source.tar.gz +Source0: https://release.files.ghostty.org/%{version}/ghostty-%{version}.tar.gz +Source1: https://release.files.ghostty.org/%{version}/ghostty-%{version}.tar.gz.minisig Patch0: no-strip.diff BuildRequires: gtk4-devel BuildRequires: libadwaita-devel @@ -12,18 +18,20 @@ BuildRequires: ncurses BuildRequires: ncurses-devel BuildRequires: pandoc-cli BuildRequires: zig +BuildRequires: minisign Requires: %{name}-terminfo = %{version}-%{release} Requires: %{name}-shell-integration = %{version}-%{release} -Requires: fontconfig -Requires: freetype -Requires: glib2 -Requires: gtk4 -Requires: harfbuzz -Requires: libpng -Requires: oniguruma -Requires: pixman -Requires: zlib-ng -Suggests: libadwaita +BuildRequires: pkgconfig(bzip2) +BuildRequires: pkgconfig(freetype2) +BuildRequires: pkgconfig(fontconfig) +BuildRequires: pkgconfig(harfbuzz) +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(zlib) +BuildRequires: pkgconfig(oniguruma) +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(gtk4) +BuildRequires: pkgconfig(libadwaita-1) +BuildRequires: libX11-devel Conflicts: ghostty-nightly Packager: ShinyGil @@ -69,15 +77,23 @@ Supplements: %{name} %summary. %prep -%autosetup -n ghostty-source -p1 +/usr/bin/minisign -V -m %{SOURCE0} -x %{SOURCE1} -P %{public_key} +%autosetup -p1 + +# Download everything ahead of time so we can enable system integration mode +ZIG_GLOBAL_CACHE_DIR="%{cache_dir}" ./nix/build-support/fetch-zig-cache.sh %build %install +DESTDIR="%{buildroot}" \ zig build \ --summary all \ - -Doptimize=ReleaseFast --release=fast \ - --prefix %{buildroot}%{_prefix} --verbose \ + --release=fast \ + --system "%{cache_dir}/p" \ + --prefix "%{_prefix}" --prefix-lib-dir "%{_libdir}" \ + --prefix-exe-dir "%{_bindir}" --prefix-include-dir "%{_includedir}" \ + --verbose \ -Dcpu=baseline \ -Dpie=true \ -Demit-docs @@ -133,9 +149,10 @@ zig build \ %_datadir/terminfo/x/xterm-ghostty %changelog -* Thu Dec 26 2024 ShinyGil -- Initial package * Tue Dec 31 2024 ShinyGil - Update to 1.0.1 * High CVE-2003-0063: Allows execution of arbitrary commands * Medium CVE-2003-0070: Allows execution of arbitrary commands + +* Thu Dec 26 2024 ShinyGil +- Initial package