Skip to content

Commit 4bef00a

Browse files
Add: Ghostty and Ghostty Tip (#2760) (#2783)
* Add: Ghostty and Ghostty Tip * fix: maybe strip the binary? * Update anda/devs/ghostty/nightly/ghostty-nightly.spec Co-authored-by: madomado <[email protected]> Signed-off-by: Gil <[email protected]> * Update ghostty-nightly.spec Add: Provides Signed-off-by: Gil <[email protected]> * Update ghostty-nightly.spec Signed-off-by: Gil <[email protected]> * Add: .diff patches * Fix: autosetup Signed-off-by: Gil <[email protected]> * fix update script * fix ghostty stable * Fix: Terminfo and shell integration should be their own packages (see: Kitty packaging) * Fix: What happened to my descriptions? * Fix: Installation and build deps for man pages, package deps, some cleanup, commit bump on Tip, enabled debug packages for Tip * Fix: Change libadwaita to an optional dep due to latest Ghostty commits (see: 5293fc9) --------- Signed-off-by: Gil <[email protected]> Co-authored-by: madonuko <[email protected]> (cherry picked from commit 3c3863c) Co-authored-by: Gil <[email protected]>
1 parent 95a9a3e commit 4bef00a

12 files changed

+408
-0
lines changed

anda/devs/ghostty/nightly/anda.hcl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
project pkg {
2+
rpm {
3+
spec = "ghostty-nightly.spec"
4+
}
5+
labels {
6+
nightly = 1
7+
}
8+
}
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
%global commit 5293fc9c2f19b7e01472de8c2ef08bef603b754a
2+
%global shortcommit %(c=%{commit}; echo ${c:0:7})
3+
%global commit_date 20241228
4+
5+
Name: ghostty-nightly
6+
Version: %commit_date.%shortcommit
7+
Release: 1%?dist
8+
Summary: A fast, native terminal emulator written in Zig; this is the Tip (nightly) build
9+
License: MIT
10+
URL: https://ghostty.org/
11+
Source0: https://github.com/ghostty-org/ghostty/archive/%{commit}/ghostty-%{commit}.tar.gz
12+
#Patch0: pkgconfig-libadwaita-1.diff
13+
#Patch1: use-pkg-config.diff
14+
Patch2: no-strip.diff
15+
BuildRequires: zig
16+
BuildRequires: gtk4-devel libadwaita-devel
17+
BuildRequires: pandoc-cli
18+
#BuildRequires: pkg-config
19+
#BuildRequires: pkgconfig(harfbuzz)
20+
#BuildRequires: pkgconfig(fontconfig)
21+
#BuildRequires: pkgconfig(libpng)
22+
#BuildRequires: pkgconfig(zlib)
23+
#BuildRequires: pkgconfig(oniguruma)
24+
#BuildRequires: pkgconfig(glslang)
25+
# Not in Fedora
26+
#BuildRequires: pkgconfig(spirv-cross)
27+
#BuildRequires: pkgconfig(simdutf)
28+
#BuildRequires: pkgconfig(libxml-2.0)
29+
Requires: %{name}-terminfo = %{version}-%{release}
30+
Requires: %{name}-shell-integration = %{version}-%{release}
31+
Requires: fontconfig
32+
Requires: freetype
33+
Requires: glib2
34+
Requires: gtk4
35+
Requires: harfbuzz
36+
Requires: libpng
37+
Requires: oniguruma
38+
Requires: pixman
39+
Requires: zlib-ng
40+
Suggests: libadwaita
41+
Conflicts: ghostty
42+
Provides: ghostty-tip = %{version}-%{release}
43+
Packager: ShinyGil <[email protected]>
44+
45+
%description
46+
👻 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration.
47+
48+
%package bash-completion
49+
Summary: Ghostty Bash completion
50+
Requires: %{name}
51+
Requires: bash-completion
52+
Supplements: (%{name} and bash-completion)
53+
54+
%description bash-completion
55+
%summary.
56+
57+
%package fish-completion
58+
Summary: Ghostty Fish completion
59+
Requires: %{name}
60+
Requires: fish
61+
Supplements: (%{name} and fish)
62+
63+
%description fish-completion
64+
%summary.
65+
66+
%package zsh-completion
67+
Summary: Ghostty Zsh completion
68+
Requires: %{name}
69+
Requires: zsh
70+
Supplements: (%{name} and zsh)
71+
72+
%description zsh-completion
73+
%summary.
74+
75+
%package shell-integration
76+
Summary: Ghostty shell integration
77+
Requires: %{name}
78+
Supplements: %{name}
79+
80+
%description shell-integration
81+
%summary.
82+
83+
%package terminfo
84+
Summary: Ghostty terminfo
85+
Requires: %{name}
86+
Supplements: %{name}
87+
88+
%description terminfo
89+
%summary.
90+
91+
%prep
92+
%autosetup -n ghostty-%{commit} -p1
93+
94+
%build
95+
96+
%install
97+
zig build \
98+
--summary all \
99+
-Doptimize=ReleaseFast --release=fast \
100+
--prefix %{buildroot}%{_prefix} --verbose \
101+
-Dpie=true \
102+
-Demit-docs
103+
104+
%files
105+
%doc README.md
106+
%license LICENSE
107+
%_bindir/ghostty
108+
%_datadir/applications/com.mitchellh.ghostty.desktop
109+
%_datadir/bat/syntaxes/ghostty.sublime-syntax
110+
%_datadir/ghostty/
111+
%_datadir/kio/servicemenus/com.mitchellh.ghostty.desktop
112+
%_datadir/nvim/site/ftdetect/ghostty.vim
113+
%_datadir/nvim/site/ftplugin/ghostty.vim
114+
%_datadir/nvim/site/syntax/ghostty.vim
115+
%_datadir/vim/vimfiles/ftdetect/ghostty.vim
116+
%_datadir/vim/vimfiles/ftplugin/ghostty.vim
117+
%_datadir/vim/vimfiles/syntax/ghostty.vim
118+
%_iconsdir/hicolor/16x16/apps/com.mitchellh.ghostty.png
119+
%_iconsdir/hicolor/16x16@2/apps/com.mitchellh.ghostty.png
120+
%_iconsdir/hicolor/32x32/apps/com.mitchellh.ghostty.png
121+
%_iconsdir/hicolor/32x32@2/apps/com.mitchellh.ghostty.png
122+
%_iconsdir/hicolor/128x128/apps/com.mitchellh.ghostty.png
123+
%_iconsdir/hicolor/128x128@2/apps/com.mitchellh.ghostty.png
124+
%_iconsdir/hicolor/256x256/apps/com.mitchellh.ghostty.png
125+
%_iconsdir/hicolor/256x256@2/apps/com.mitchellh.ghostty.png
126+
%_iconsdir/hicolor/512x512/apps/com.mitchellh.ghostty.png
127+
%_mandir/man1/ghostty.1.gz
128+
%_mandir/man5/ghostty.5.gz
129+
130+
%files bash-completion
131+
%bash_completions_dir/ghostty.bash
132+
133+
%files fish-completion
134+
%fish_completions_dir/ghostty.fish
135+
136+
%files zsh-completion
137+
%zsh_completions_dir/_ghostty
138+
139+
%files shell-integration
140+
%_datadir/ghostty/shell-integration/bash/bash-preexec.sh
141+
%_datadir/ghostty/shell-integration/bash/ghostty.bash
142+
%_datadir/ghostty/shell-integration/elvish/lib/ghostty-integration.elv
143+
%_datadir/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish
144+
%_datadir/ghostty/shell-integration/zsh/.zshenv
145+
%_datadir/ghostty/shell-integration/zsh/ghostty-integration
146+
147+
%files terminfo
148+
%_datadir/terminfo/ghostty.termcap
149+
%_datadir/terminfo/ghostty.terminfo
150+
%_datadir/terminfo/g/ghostty
151+
%_datadir/terminfo/x/xterm-ghostty
152+
153+
%changelog
154+
* Thu Dec 26 2024 ShinyGil <[email protected]>
155+
- Initial package
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/build.zig b/build.zig
2+
index c3f7302..a0ecf25 100644
3+
--- a/build.zig
4+
+++ b/build.zig
5+
@@ -295,11 +295,7 @@ pub fn build(b: *std.Build) !void {
6+
.root_source_file = b.path("src/main.zig"),
7+
.target = target,
8+
.optimize = optimize,
9+
- .strip = switch (optimize) {
10+
- .Debug => false,
11+
- .ReleaseSafe => false,
12+
- .ReleaseFast, .ReleaseSmall => true,
13+
- },
14+
+ .strip = false,
15+
}) else null;
16+
17+
// Exe
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/build.zig b/build.zig
2+
index 0969c64..68e16cd 100644
3+
--- a/build.zig
4+
+++ b/build.zig
5+
@@ -1374,7 +1374,7 @@ fn addDeps(
6+
7+
.gtk => {
8+
step.linkSystemLibrary2("gtk4", dynamic_link_opts);
9+
- if (config.adwaita) step.linkSystemLibrary2("adwaita-1", dynamic_link_opts);
10+
+ if (config.adwaita) step.linkSystemLibrary2("libadwaita-1", dynamic_link_opts);
11+
12+
{
13+
const gresource = @import("src/apprt/gtk/gresource.zig");

anda/devs/ghostty/nightly/update.rhai

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
rpm.global("commit", gh_commit("ghostty-org/ghostty"));
2+
if rpm.changed() {
3+
rpm.release();
4+
rpm.global("commit_date", date());
5+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
diff --git a/build.zig b/build.zig
2+
index a0ecf25..0969c64 100644
3+
--- a/build.zig
4+
+++ b/build.zig
5+
@@ -1047,6 +1047,7 @@ fn addDeps(
6+
const dynamic_link_opts: std.Build.Module.LinkSystemLibraryOptions = .{
7+
.preferred_link_mode = .dynamic,
8+
.search_strategy = .mode_first,
9+
+ .use_pkg_config = .force,
10+
};
11+
12+
// Freetype

anda/devs/ghostty/stable/anda.hcl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
project pkg {
2+
rpm {
3+
spec = "ghostty.spec"
4+
}
5+
}

anda/devs/ghostty/stable/ghostty.spec

Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
Name: ghostty
2+
Version: 1.0.0
3+
Release: 1%?dist
4+
Summary: A fast, native terminal emulator written in Zig
5+
License: MIT
6+
URL: https://ghostty.org/
7+
Source0: https://release.files.ghostty.org/%{version}/ghostty-source.tar.gz
8+
#Patch0: pkgconfig-libadwaita-1.diff
9+
#Patch1: use-pkg-config.diff
10+
Patch2: no-strip.diff
11+
BuildRequires: zig
12+
BuildRequires: gtk4-devel libadwaita-devel
13+
BuildRequires: pandoc-cli
14+
#BuildRequires: pkg-config
15+
#BuildRequires: pkgconfig(harfbuzz)
16+
#BuildRequires: pkgconfig(fontconfig)
17+
#BuildRequires: pkgconfig(libpng)
18+
#BuildRequires: pkgconfig(zlib)
19+
#BuildRequires: pkgconfig(oniguruma)
20+
#BuildRequires: pkgconfig(glslang)
21+
# Not in Fedora
22+
#BuildRequires: pkgconfig(spirv-cross)
23+
#BuildRequires: pkgconfig(simdutf)
24+
#BuildRequires: pkgconfig(libxml-2.0)
25+
Requires: %{name}-terminfo = %{version}-%{release}
26+
Requires: %{name}-shell-integration = %{version}-%{release}
27+
Requires: fontconfig
28+
Requires: freetype
29+
Requires: glib2
30+
Requires: gtk4
31+
Requires: harfbuzz
32+
Requires: libpng
33+
Requires: oniguruma
34+
Requires: pixman
35+
Requires: zlib-ng
36+
Suggests: libadwaita
37+
Conflicts: ghostty-nightly
38+
Packager: ShinyGil <[email protected]>
39+
40+
%description
41+
👻 Ghostty is a fast, feature-rich, and cross-platform terminal emulator that uses platform-native UI and GPU acceleration.
42+
43+
%package bash-completion
44+
Summary: Ghostty Bash completion
45+
Requires: %{name}
46+
Requires: bash-completion
47+
Supplements: (%{name} and bash-completion)
48+
49+
%description bash-completion
50+
%summary.
51+
52+
%package fish-completion
53+
Summary: Ghostty Fish completion
54+
Requires: %{name}
55+
Requires: fish
56+
Supplements: (%{name} and fish)
57+
58+
%description fish-completion
59+
%summary.
60+
61+
%package zsh-completion
62+
Summary: Ghostty Zsh completion
63+
Requires: %{name}
64+
Requires: zsh
65+
Supplements: (%{name} and zsh)
66+
67+
%description zsh-completion
68+
%summary.
69+
70+
%package shell-integration
71+
Summary: Ghostty shell integration
72+
Requires: %{name}
73+
Supplements: %{name}
74+
75+
%description shell-integration
76+
%summary.
77+
78+
%package terminfo
79+
Summary: Ghostty terminfo
80+
Requires: %{name}
81+
Supplements: %{name}
82+
83+
%description terminfo
84+
%summary.
85+
86+
%prep
87+
%autosetup -n ghostty-source -p1
88+
89+
%build
90+
91+
%install
92+
zig build \
93+
--summary all \
94+
-Doptimize=ReleaseFast --release=fast \
95+
--prefix %{buildroot}%{_prefix} --verbose \
96+
-Dpie=true \
97+
-Demit-docs
98+
99+
%files
100+
%doc README.md
101+
%license LICENSE
102+
%_bindir/ghostty
103+
%_datadir/applications/com.mitchellh.ghostty.desktop
104+
%_datadir/bat/syntaxes/ghostty.sublime-syntax
105+
%_datadir/ghostty/
106+
%_datadir/kio/servicemenus/com.mitchellh.ghostty.desktop
107+
%_datadir/nvim/site/ftdetect/ghostty.vim
108+
%_datadir/nvim/site/ftplugin/ghostty.vim
109+
%_datadir/nvim/site/syntax/ghostty.vim
110+
%_datadir/vim/vimfiles/ftdetect/ghostty.vim
111+
%_datadir/vim/vimfiles/ftplugin/ghostty.vim
112+
%_datadir/vim/vimfiles/syntax/ghostty.vim
113+
%_iconsdir/hicolor/16x16/apps/com.mitchellh.ghostty.png
114+
%_iconsdir/hicolor/16x16@2/apps/com.mitchellh.ghostty.png
115+
%_iconsdir/hicolor/32x32/apps/com.mitchellh.ghostty.png
116+
%_iconsdir/hicolor/32x32@2/apps/com.mitchellh.ghostty.png
117+
%_iconsdir/hicolor/128x128/apps/com.mitchellh.ghostty.png
118+
%_iconsdir/hicolor/128x128@2/apps/com.mitchellh.ghostty.png
119+
%_iconsdir/hicolor/256x256/apps/com.mitchellh.ghostty.png
120+
%_iconsdir/hicolor/256x256@2/apps/com.mitchellh.ghostty.png
121+
%_iconsdir/hicolor/512x512/apps/com.mitchellh.ghostty.png
122+
%_mandir/man1/ghostty.1.gz
123+
%_mandir/man5/ghostty.5.gz
124+
125+
%files bash-completion
126+
%bash_completions_dir/ghostty.bash
127+
128+
%files fish-completion
129+
%fish_completions_dir/ghostty.fish
130+
131+
%files zsh-completion
132+
%zsh_completions_dir/_ghostty
133+
134+
%files shell-integration
135+
%_datadir/ghostty/shell-integration/bash/bash-preexec.sh
136+
%_datadir/ghostty/shell-integration/bash/ghostty.bash
137+
%_datadir/ghostty/shell-integration/elvish/lib/ghostty-integration.elv
138+
%_datadir/ghostty/shell-integration/fish/vendor_conf.d/ghostty-shell-integration.fish
139+
%_datadir/ghostty/shell-integration/zsh/.zshenv
140+
%_datadir/ghostty/shell-integration/zsh/ghostty-integration
141+
142+
%files terminfo
143+
%_datadir/terminfo/ghostty.termcap
144+
%_datadir/terminfo/ghostty.terminfo
145+
%_datadir/terminfo/g/ghostty
146+
%_datadir/terminfo/x/xterm-ghostty
147+
148+
%changelog
149+
* Thu Dec 26 2024 ShinyGil <[email protected]>
150+
- Initial package
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
diff --git a/build.zig b/build.zig
2+
index c3f7302..a0ecf25 100644
3+
--- a/build.zig
4+
+++ b/build.zig
5+
@@ -295,11 +295,7 @@ pub fn build(b: *std.Build) !void {
6+
.root_source_file = b.path("src/main.zig"),
7+
.target = target,
8+
.optimize = optimize,
9+
- .strip = switch (optimize) {
10+
- .Debug => false,
11+
- .ReleaseSafe => false,
12+
- .ReleaseFast, .ReleaseSmall => true,
13+
- },
14+
+ .strip = false,
15+
}) else null;
16+
17+
// Exe

0 commit comments

Comments
 (0)