11const std = @import ("std" );
22
3- const version : std.SemanticVersion = .{ . major = 1 , . minor = 11 , . patch = 0 } ;
3+ const version = std .SemanticVersion . parse ( @import ( "build.zig.zon" ). version ) catch unreachable ;
44
55pub fn build (b : * std.Build ) void {
66 const upstream = b .dependency ("libxkbcommon" , .{});
@@ -30,9 +30,10 @@ pub fn build(b: *std.Build) void {
3030
3131 // Most of these config options have not been tested.
3232
33- const xkb_config_root = b .option ([]const u8 , "xkb-config-root" , "The XKB config root" ) orelse b .pathJoin (&.{ b .install_prefix , "share/X11/xkb" });
33+ const xkb_legacy_root = b .option ([]const u8 , "xkb-legacy-root" , " [default=$prefix/share/X11/locale]" ) orelse b .pathJoin (&.{ b .install_prefix , "share/X11/xkb" });
34+ const xkb_config_root = b .option ([]const u8 , "xkb-config-root" , "The XKB config root [default=$prefix/share/X11/locale]" ) orelse xkb_legacy_root ;
3435 const xkb_config_extra_path = b .option ([]const u8 , "xkb-config-extra-path" , "Extra lookup path for system-wide XKB data [default=$sysconfdir/xkb]" ) orelse "/etc/xkb" ;
35- const x_locale_root = b .option ([]const u8 , "x-locale-root" , "The X locale root [default=$datadir /X11/locale]" ) orelse b .pathJoin (&.{ b .install_prefix , "share/X11/locale" });
36+ const x_locale_root = b .option ([]const u8 , "x-locale-root" , "The X locale root [default=$prefix/share /X11/locale]" ) orelse b .pathJoin (&.{ b .install_prefix , "share/X11/locale" });
3637 // const bash_completion_path = b.option([]const u8, "bash-completion-path", "Directory for bash completion scripts");
3738 const default_rules = b .option ([]const u8 , "default-rules" , "Default XKB ruleset" ) orelse "evdev" ;
3839 const default_model = b .option ([]const u8 , "default-model" , "Default XKB model" ) orelse "pc105" ;
@@ -52,6 +53,7 @@ pub fn build(b: *std.Build) void {
5253 .LIBXKBCOMMON_VERSION = b .fmt ("{f}" , .{version }),
5354 .LIBXKBCOMMON_TOOL_PATH = b .pathJoin (&.{ b .install_prefix , "libexec/xkbcommon" }),
5455 ._GNU_SOURCE = 1 ,
56+ .DFLT_XKB_LEGACY_ROOT = xkb_legacy_root ,
5557 .DFLT_XKB_CONFIG_ROOT = xkb_config_root ,
5658 .DFLT_XKB_CONFIG_EXTRA_PATH = xkb_config_extra_path ,
5759 .XLOCALEDIR = x_locale_root ,
@@ -61,7 +63,10 @@ pub fn build(b: *std.Build) void {
6163 .DEFAULT_XKB_VARIANT = .null ,
6264 .DEFAULT_XKB_OPTIONS = .null ,
6365 .HAVE_UNISTD_H = 1 ,
66+ .HAVE_DIRENT_H = 1 ,
67+ .HAVE_XKB_EXTENSIONS_DIRECTORIES = 1 ,
6468 .HAVE___BUILTIN_EXPECT = 1 ,
69+ .HAVE_REAL_PATH = 1 ,
6570 .HAVE_EACCESS = if (target .result .os .tag == .linux ) @as (i64 , 1 ) else null ,
6671 .HAVE_EUIDACCESS = if (target .result .os .tag == .linux ) @as (i64 , 1 ) else null ,
6772 .HAVE_MMAP = if (target .result .os .tag != .windows ) @as (i64 , 1 ) else null ,
@@ -286,6 +291,7 @@ const libxkbcommon_sources: []const []const u8 = &.{
286291 "src/keysym-case-mappings.c" ,
287292 "src/keysym-utf.c" ,
288293 "src/keymap.c" ,
294+ "src/keymap-compare.c" ,
289295 "src/keymap-priv.c" ,
290296 "src/rmlvo.c" ,
291297 "src/scanner-utils.c" ,
@@ -301,9 +307,11 @@ const libxkbcommon_x11_sources: []const []const u8 = &.{
301307 "src/x11/keymap.c" ,
302308 "src/x11/state.c" ,
303309 "src/x11/util.c" ,
310+ "src/context.c" ,
304311 "src/context-priv.c" ,
305312 "src/keymap-priv.c" ,
306313 "src/atom.c" ,
314+ "src/utils.c" ,
307315};
308316
309317const libxkbregistry_sources : []const []const u8 = &.{
0 commit comments