ghostty: reactivate themes

This commit is contained in:
Moritz Gmeiner 2025-12-31 22:07:36 +01:00
commit e335167930
6 changed files with 382 additions and 0 deletions

View file

@ -0,0 +1,57 @@
From 79e953d91173a808dc2fbc33a39582ffc921263b Mon Sep 17 00:00:00 2001
From: sin-ack <sin-ack@protonmail.com>
Date: Thu, 30 Jan 2025 23:21:16 +0000
Subject: [PATCH] build: Disable terminfo database installation
Database installation is unconditional in Ghostty and causes conflicts
with newer ncurses versions which have the database merged in.
Bug: https://bugs.gentoo.org/948830
Signed-off-by: sin-ack <sin-ack@protonmail.com>
---
src/build/GhosttyResources.zig | 30 ------------------------------
1 file changed, 30 deletions(-)
diff --git a/src/build/GhosttyResources.zig b/src/build/GhosttyResources.zig
index a7ff40cb..ad400d72 100644
--- a/src/build/GhosttyResources.zig
+++ b/src/build/GhosttyResources.zig
@@ -46,36 +46,6 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
const cap_install = b.addInstallFile(out_source, "share/terminfo/ghostty.termcap");
try steps.append(&cap_install.step);
}
-
- // Compile the terminfo source into a terminfo database
- {
- const run_step = RunStep.create(b, "tic");
- run_step.addArgs(&.{ "tic", "-x", "-o" });
- const path = run_step.addOutputFileArg("terminfo");
- run_step.addFileArg(source);
- _ = run_step.captureStdErr(); // so we don't see stderr
-
- // Ensure that `share/terminfo` is a directory, otherwise the `cp
- // -R` will create a file named `share/terminfo`
- const mkdir_step = RunStep.create(b, "make share/terminfo directory");
- switch (cfg.target.result.os.tag) {
- // windows mkdir shouldn't need "-p"
- .windows => mkdir_step.addArgs(&.{"mkdir"}),
- else => mkdir_step.addArgs(&.{ "mkdir", "-p" }),
- }
- mkdir_step.addArg(b.fmt("{s}/share/terminfo", .{b.install_path}));
- try steps.append(&mkdir_step.step);
-
- // Use cp -R instead of Step.InstallDir because we need to preserve
- // symlinks in the terminfo database. Zig's InstallDir step doesn't
- // handle symlinks correctly yet.
- const copy_step = RunStep.create(b, "copy terminfo db");
- copy_step.addArgs(&.{ "cp", "-R" });
- copy_step.addFileArg(path);
- copy_step.addArg(b.fmt("{s}/share", .{b.install_path}));
- copy_step.step.dependOn(&mkdir_step.step);
- try steps.append(&copy_step.step);
- }
}
// Shell-integration
--
2.45.3

View file

@ -0,0 +1,24 @@
From a817b744a76356f8281e84dc6dc1d133f72796d5 Mon Sep 17 00:00:00 2001
From: sin-ack <sin-ack@protonmail.com>
Date: Thu, 30 Jan 2025 22:44:34 +0000
Subject: [PATCH] build: Fix bzip2 system dependency name
---
src/build/SharedDeps.zig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/build/SharedDeps.zig b/src/build/SharedDeps.zig
index 64068658..256c8adc 100644
--- a/src/build/SharedDeps.zig
+++ b/src/build/SharedDeps.zig
@@ -111,7 +111,7 @@ pub fn add(
step.root_module.addImport("freetype", freetype_dep.module("freetype"));
if (b.systemIntegrationOption("freetype", .{})) {
- step.linkSystemLibrary2("bzip2", dynamic_link_opts);
+ step.linkSystemLibrary2("bz2", dynamic_link_opts);
step.linkSystemLibrary2("freetype2", dynamic_link_opts);
} else {
step.linkLibrary(freetype_dep.artifact("freetype"));
--
2.45.3

View file

@ -0,0 +1,75 @@
From 012f68ee2cccb2b466724a41dad148ecdecde0a3 Mon Sep 17 00:00:00 2001
From: sin-ack <sin-ack@protonmail.com>
Date: Tue, 16 Sep 2025 21:41:07 +0000
Subject: [PATCH] build: Disable terminfo database installation
Database installation is unconditional in Ghostty and causes conflicts
with newer ncurses versions which have the database merged in.
Bug: https://bugs.gentoo.org/948830
Signed-off-by: sin-ack <sin-ack@protonmail.com>
---
src/build/GhosttyResources.zig | 40 ----------------------------------
1 file changed, 40 deletions(-)
diff --git a/src/build/GhosttyResources.zig b/src/build/GhosttyResources.zig
index 266069f83..f6f7409ce 100644
--- a/src/build/GhosttyResources.zig
+++ b/src/build/GhosttyResources.zig
@@ -19,10 +19,6 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
// Terminfo
terminfo: {
const os_tag = cfg.target.result.os.tag;
- const terminfo_share_dir = if (os_tag == .freebsd)
- "site-terminfo"
- else
- "terminfo";
// Encode our terminfo
var str = std.ArrayList(u8).init(b.allocator);
@@ -68,42 +64,6 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyResources {
try steps.append(&cap_install.step);
}
-
- // Compile the terminfo source into a terminfo database
- {
- const run_step = RunStep.create(b, "tic");
- run_step.addArgs(&.{ "tic", "-x", "-o" });
- const path = run_step.addOutputFileArg(terminfo_share_dir);
-
- run_step.addFileArg(source);
- _ = run_step.captureStdErr(); // so we don't see stderr
-
- // Ensure that `share/terminfo` is a directory, otherwise the `cp
- // -R` will create a file named `share/terminfo`
- const mkdir_step = RunStep.create(b, "make share/terminfo directory");
- switch (cfg.target.result.os.tag) {
- // windows mkdir shouldn't need "-p"
- .windows => mkdir_step.addArgs(&.{"mkdir"}),
- else => mkdir_step.addArgs(&.{ "mkdir", "-p" }),
- }
-
- mkdir_step.addArg(b.fmt(
- "{s}/share/{s}",
- .{ b.install_path, terminfo_share_dir },
- ));
-
- try steps.append(&mkdir_step.step);
-
- // Use cp -R instead of Step.InstallDir because we need to preserve
- // symlinks in the terminfo database. Zig's InstallDir step doesn't
- // handle symlinks correctly yet.
- const copy_step = RunStep.create(b, "copy terminfo db");
- copy_step.addArgs(&.{ "cp", "-R" });
- copy_step.addFileArg(path);
- copy_step.addArg(b.fmt("{s}/share", .{b.install_path}));
- copy_step.step.dependOn(&mkdir_step.step);
- try steps.append(&copy_step.step);
- }
}
// Shell-integration
--
2.49.1

View file

@ -0,0 +1,26 @@
From 502071bc786679c57405a1bb4613a3a2e4653920 Mon Sep 17 00:00:00 2001
From: sin-ack <sin-ack@protonmail.com>
Date: Thu, 30 Jan 2025 22:44:34 +0000
Subject: [PATCH] build: Fix bzip2 system dependency name
Signed-off-by: sin-ack <sin-ack@protonmail.com>
---
src/build/SharedDeps.zig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/build/SharedDeps.zig b/src/build/SharedDeps.zig
index 77dec3350..2babf317d 100644
--- a/src/build/SharedDeps.zig
+++ b/src/build/SharedDeps.zig
@@ -121,7 +121,7 @@ pub fn add(
);
if (b.systemIntegrationOption("freetype", .{})) {
- step.linkSystemLibrary2("bzip2", dynamic_link_opts);
+ step.linkSystemLibrary2("bz2", dynamic_link_opts);
step.linkSystemLibrary2("freetype2", dynamic_link_opts);
} else {
step.linkLibrary(freetype_dep.artifact("freetype"));
--
2.49.1