Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Techatrix committed Dec 18, 2024
0 parents commit 392405c
Show file tree
Hide file tree
Showing 9 changed files with 3,433 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.zig text eol=lf
*.zon text eol=lf
32 changes: 32 additions & 0 deletions .github/workflows/ci.yaml
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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.zig-cache
zig-cache
zig-out
21 changes: 21 additions & 0 deletions LICENSE
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.
48 changes: 48 additions & 0 deletions README.md
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.
Loading

0 comments on commit 392405c

Please sign in to comment.