diff --git a/src/build/Config.zig b/src/build/Config.zig index 3a8a4e0..6f2d5d3 100644 --- a/src/build/Config.zig +++ b/src/build/Config.zig @@ -38,6 +38,7 @@ wasm_shared: bool = true, /// Ghostty exe properties exe_entrypoint: ExeEntrypoint = .ghostty, version: std.SemanticVersion = .{ .major = 0, .minor = 0, .patch = 0 }, +app_runtime_path: ?[]const u8 = null, /// Binary properties pie: bool = false, @@ -273,6 +274,15 @@ pub fn init(b: *std.Build, appVersion: []const u8) !Config { }; }; + config.app_runtime_path = b.option( + []const u8, + "app-runtime-path", + "Override the path to the Ghostty binary embedded in Linux desktop integration files " ++ + "(desktop entry, D-Bus and systemd services). Useful for distro packaging " ++ + "where the install prefix differs from the runtime path. " ++ + "Defaults to {prefix}/bin/ghostty.", + ); + //--------------------------------------------------------------- // Binary Properties diff --git a/src/build/GhosttyResources.zig b/src/build/GhosttyResources.zig index 6f85765..9dc28cd 100644 --- a/src/build/GhosttyResources.zig +++ b/src/build/GhosttyResources.zig @@ -279,7 +279,7 @@ fn addLinuxAppResources( }, }); - const exe_abs_path = b.fmt( + const exe_abs_path = cfg.app_runtime_path orelse b.fmt( "{s}/bin/ghostty", .{b.install_prefix}, );