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 <rockgrub@protonmail.com>

* Update ghostty-nightly.spec

Signed-off-by: Gil <rockgrub@protonmail.com>

---------

Signed-off-by: Gil <rockgrub@protonmail.com>
Co-authored-by: Gil <rockgrub@protonmail.com>
(cherry picked from commit ca633bafc0)

Co-authored-by: Jan <sentrycraft123@gmail.com>
This commit is contained in:
Raboneko
2025-01-01 06:42:14 -08:00
committed by GitHub
parent 5155763dc9
commit 9cf4829d72
2 changed files with 62 additions and 34 deletions
+27 -16
View File
@@ -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 <rockgrub@protonmail.com>
@@ -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 <rockgrub@protonmail.com>
- Initial package
* Tue Dec 31 2024 ShinyGil <rockgrub@protonmail.com>
- 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 <rockgrub@protonmail.com>
- Initial package
+35 -18
View File
@@ -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 <rockgrub@protonmail.com>
@@ -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 <rockgrub@protonmail.com>
- Initial package
* Tue Dec 31 2024 ShinyGil <rockgrub@protonmail.com>
- 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 <rockgrub@protonmail.com>
- Initial package