-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 392405c
Showing
9 changed files
with
3,433 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
*.zig text eol=lf | ||
*.zon text eol=lf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
zig-version: [master 0.13.0] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Zig | ||
uses: mlugg/setup-zig@v1 | ||
with: | ||
version: ${{ matrix.zig-version }} | ||
|
||
- name: Check Formatting | ||
run: zig fmt --ast-check --check . | ||
|
||
- name: Build | ||
run: zig build -Denable-x11=false --summary all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.zig-cache | ||
zig-cache | ||
zig-out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (Expat) | ||
|
||
Copyright (c) contributors | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[![CI](https://github.com/allyourcodebase/libxkbcommon/actions/workflows/ci.yaml/badge.svg)](https://github.com/allyourcodebase/libxkbcommon/actions) | ||
|
||
# libxkbcommon | ||
|
||
This is [libxkbcommon](https://github.com/xkbcommon/libxkbcommon), packaged for [Zig](https://ziglang.org/). | ||
|
||
## Installation | ||
|
||
First, update your `build.zig.zon`: | ||
|
||
``` | ||
# Initialize a `zig build` project if you haven't already | ||
zig init | ||
zig fetch --save git+https://github.com/allyourcodebase/libxkbcommon.git | ||
``` | ||
|
||
You can then import `libxkbcommon` in your `build.zig` with: | ||
|
||
```zig | ||
const libxkbcommon_dependency = b.dependency("libxkbcommon", .{ | ||
.target = target, | ||
.optimize = optimize, | ||
// Set the XKB config root. | ||
// Will default to "${INSTALL_PREFIX}/share/X11/xkb" i.e. `zig-out/share/X11/xkb`. | ||
// Most distributions will use `/usr/share/X11/xkb`. | ||
// | ||
// The value `""` will not set a default config root directory. | ||
// To configure the config root at runtime, use the "XKB_CONFIG_ROOT" environment variable. | ||
// | ||
// This example will assume that the config root of the host system is in `/usr`. | ||
// This does not work on distributions that don't follow the Filesystem Hierarchy Standard (FHS) like NixOS. | ||
.@"xkb-config-root" = "/usr/share/X11/xkb", | ||
// The X locale root. | ||
// Will default to "${INSTALL_PREFIX}/share/X11/locale" i.e. `zig-out/share/X11/locale`. | ||
// Most distributions will use `/usr/share/X11/locale`. | ||
// | ||
// To configure the config root at runtime, use the "XLOCALEDIR" environment variable. | ||
// | ||
// This example will assume that the config root of the host system is in `/usr`. | ||
// This does not work on distributions that don't follow the Filesystem Hierarchy Standard (FHS) like NixOS. | ||
.@"x-locale-root" = "/usr/share/X11/locale", | ||
}); | ||
your_exe.linkLibrary(libxkbcommon_dependency.artifact("libxkbcommon")); | ||
``` | ||
|
||
For more information, please refer to the [User-configuration](https://github.com/xkbcommon/libxkbcommon/blob/master/doc/user-configuration.md) docs of libxkbcommon. |
Oops, something went wrong.