apprt: make gtk-ng the default apprt on Linux

This commit is contained in:
Mitchell Hashimoto
2025-08-14 12:28:25 -07:00
parent b7913f09ad
commit a148adc5e4
2 changed files with 16 additions and 9 deletions

View File

@@ -60,20 +60,22 @@ pub const Runtime = enum {
/// This is only useful if you're only interested in the lib only (macOS).
none,
/// GTK-backed. Rich windowed application. GTK is dynamically linked.
gtk,
/// GTK4. The "-ng" variant is a rewrite of the GTK backend using
/// GTK-native technologies such as full GObject classes, Blueprint
/// files, etc.
/// GTK4. Rich windowed application. This uses a full GObject-based
/// approach to building the application.
@"gtk-ng",
/// GTK-backed. Rich windowed application. GTK is dynamically linked.
/// WARNING: Deprecated. This will be removed very soon. All bug fixes
/// and features should go into the gtk-ng backend.
gtk,
pub fn default(target: std.Target) Runtime {
// The Linux default is GTK because it is full featured.
if (target.os.tag == .linux) return .gtk;
// The Linux default is GTK because it is a full featured application.
if (target.os.tag == .linux) return .@"gtk-ng";
// Otherwise, we do NONE so we don't create an exe and we
// create libghostty.
// create libghostty. On macOS, Xcode is used to build the app
// that links to libghostty.
return .none;
}
};

View File

@@ -25,6 +25,11 @@ pub fn init(b: *std.Build, cfg: *const Config) !GhosttyDist {
try resources.append(alloc, gtk.resources_c);
try resources.append(alloc, gtk.resources_h);
}
{
const gtk = SharedDeps.gtkNgDistResources(b);
try resources.append(alloc, gtk.resources_c);
try resources.append(alloc, gtk.resources_h);
}
// git archive to create the final tarball. "git archive" is the
// easiest way I can find to create a tarball that ignores stuff