Skip to content

Commit 392405c

Browse files
committed
initial commit
0 parents  commit 392405c

File tree

9 files changed

+3433
-0
lines changed

9 files changed

+3433
-0
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.zig text eol=lf
2+
*.zon text eol=lf

.github/workflows/ci.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- master
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
zig-version: [master 0.13.0]
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup Zig
24+
uses: mlugg/setup-zig@v1
25+
with:
26+
version: ${{ matrix.zig-version }}
27+
28+
- name: Check Formatting
29+
run: zig fmt --ast-check --check .
30+
31+
- name: Build
32+
run: zig build -Denable-x11=false --summary all

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.zig-cache
2+
zig-cache
3+
zig-out

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (Expat)
2+
3+
Copyright (c) contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
[![CI](https://github.com/allyourcodebase/libxkbcommon/actions/workflows/ci.yaml/badge.svg)](https://github.com/allyourcodebase/libxkbcommon/actions)
2+
3+
# libxkbcommon
4+
5+
This is [libxkbcommon](https://github.com/xkbcommon/libxkbcommon), packaged for [Zig](https://ziglang.org/).
6+
7+
## Installation
8+
9+
First, update your `build.zig.zon`:
10+
11+
```
12+
# Initialize a `zig build` project if you haven't already
13+
zig init
14+
zig fetch --save git+https://github.com/allyourcodebase/libxkbcommon.git
15+
```
16+
17+
You can then import `libxkbcommon` in your `build.zig` with:
18+
19+
```zig
20+
const libxkbcommon_dependency = b.dependency("libxkbcommon", .{
21+
.target = target,
22+
.optimize = optimize,
23+
24+
// Set the XKB config root.
25+
// Will default to "${INSTALL_PREFIX}/share/X11/xkb" i.e. `zig-out/share/X11/xkb`.
26+
// Most distributions will use `/usr/share/X11/xkb`.
27+
//
28+
// The value `""` will not set a default config root directory.
29+
// To configure the config root at runtime, use the "XKB_CONFIG_ROOT" environment variable.
30+
//
31+
// This example will assume that the config root of the host system is in `/usr`.
32+
// This does not work on distributions that don't follow the Filesystem Hierarchy Standard (FHS) like NixOS.
33+
.@"xkb-config-root" = "/usr/share/X11/xkb",
34+
35+
// The X locale root.
36+
// Will default to "${INSTALL_PREFIX}/share/X11/locale" i.e. `zig-out/share/X11/locale`.
37+
// Most distributions will use `/usr/share/X11/locale`.
38+
//
39+
// To configure the config root at runtime, use the "XLOCALEDIR" environment variable.
40+
//
41+
// This example will assume that the config root of the host system is in `/usr`.
42+
// This does not work on distributions that don't follow the Filesystem Hierarchy Standard (FHS) like NixOS.
43+
.@"x-locale-root" = "/usr/share/X11/locale",
44+
});
45+
your_exe.linkLibrary(libxkbcommon_dependency.artifact("libxkbcommon"));
46+
```
47+
48+
For more information, please refer to the [User-configuration](https://github.com/xkbcommon/libxkbcommon/blob/master/doc/user-configuration.md) docs of libxkbcommon.

0 commit comments

Comments
 (0)