mirror of https://github.com/fairyglade/ly.git
feat: add default tty to build option
This commit is contained in:
parent
2d9ac14a32
commit
e8f8378136
|
@ -15,6 +15,7 @@ comptime {
|
|||
const ly_version = std.SemanticVersion{ .major = 1, .minor = 1, .patch = 0 };
|
||||
var dest_directory: []const u8 = undefined;
|
||||
var data_directory: []const u8 = undefined;
|
||||
var default_tty: u8 = 0;
|
||||
var exe_name: []const u8 = undefined;
|
||||
|
||||
const ProgressNode = if (current_zig.minor == 12) *std.Progress.Node else std.Progress.Node;
|
||||
|
@ -22,6 +23,8 @@ const ProgressNode = if (current_zig.minor == 12) *std.Progress.Node else std.Pr
|
|||
pub fn build(b: *std.Build) !void {
|
||||
dest_directory = b.option([]const u8, "dest_directory", "Specify a destination directory for installation") orelse "";
|
||||
data_directory = b.option([]const u8, "data_directory", "Specify a default data directory (default is /etc/ly). This path gets embedded into the binary") orelse "/etc/ly";
|
||||
default_tty = b.option(u8, "default_tty", "set default tty") orelse 2;
|
||||
|
||||
exe_name = b.option([]const u8, "name", "Specify installed executable file name (default is ly)") orelse "ly";
|
||||
|
||||
const bin_directory = try b.allocator.dupe(u8, data_directory);
|
||||
|
@ -34,6 +37,8 @@ pub fn build(b: *std.Build) !void {
|
|||
|
||||
build_options.addOption([]const u8, "version", version_str);
|
||||
|
||||
build_options.addOption(u8, "tty", default_tty);
|
||||
|
||||
const target = b.standardTargetOptions(.{});
|
||||
const optimize = b.standardOptimizeOption(.{});
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ sleep_cmd: ?[]const u8 = null,
|
|||
sleep_key: []const u8 = "F3",
|
||||
term_reset_cmd: [:0]const u8 = "/usr/bin/tput reset",
|
||||
term_restore_cursor_cmd: []const u8 = "/usr/bin/tput cnorm",
|
||||
tty: u8 = 2,
|
||||
tty: u8 = build_options.tty,
|
||||
vi_mode: bool = false,
|
||||
wayland_cmd: []const u8 = build_options.data_directory ++ "/wsetup.sh",
|
||||
waylandsessions: []const u8 = "/usr/share/wayland-sessions",
|
||||
|
|
Loading…
Reference in New Issue