xkbcommon-sys-1.4.1/.cargo_vcs_info.json0000644000000001360000000000100136500ustar { "git": { "sha1": "6144ad1e846809d2fa9f9ba0bda08f22d92d8022" }, "path_in_vcs": "" }xkbcommon-sys-1.4.1/.gitignore000064400000000000000000000000221046102023000144220ustar 00000000000000target Cargo.lock xkbcommon-sys-1.4.1/Cargo.toml0000644000000016560000000000100116560ustar # THIS FILE IS AUTOMATICALLY GENERATED BY CARGO # # When uploading crates to the registry Cargo will automatically # "normalize" Cargo.toml files for maximal compatibility # with all versions of Cargo and also rewrite `path` dependencies # to registry (e.g., crates.io) dependencies. # # If you are reading this file be aware that the original Cargo.toml # will likely look very different (and much more reasonable). # See Cargo.toml.orig for the original contents. [package] edition = "2018" name = "xkbcommon-sys" version = "1.4.1" authors = ["meh. "] build = "build.rs" description = "Bindings to libxkbcommon." keywords = [ "xkb", "xkbcommon", "x11", "xcb", ] license = "WTFPL" repository = "https://github.com/meh/rust-xkbcommon-sys" [dependencies.libc] version = "0.2" [build-dependencies.bindgen] version = "0.63" [build-dependencies.pkg-config] version = "0.3" [features] static = [] x11 = [] xkbcommon-sys-1.4.1/Cargo.toml.orig000064400000000000000000000006501046102023000153300ustar 00000000000000[package] name = "xkbcommon-sys" version = "1.4.1" edition = "2018" authors = ["meh. "] license = "WTFPL" build = "build.rs" description = "Bindings to libxkbcommon." repository = "https://github.com/meh/rust-xkbcommon-sys" keywords = ["xkb", "xkbcommon", "x11", "xcb"] [build-dependencies] bindgen = "0.63" pkg-config = "0.3" [dependencies] libc = "0.2" [features] static = [] x11 = [] xkbcommon-sys-1.4.1/build.rs000064400000000000000000000030011046102023000140770ustar 00000000000000use std::{env, path::PathBuf}; use pkg_config::{Config, Error}; fn main() { common().unwrap(); x11().unwrap(); let mut builder = bindgen::Builder::default() .rustified_enum("*") .prepend_enum_name(false) .derive_eq(true) .size_t_is_usize(true); builder = builder .header("src/wrapper.h"); if env::var("CARGO_FEATURE_X11").is_ok() { builder = builder.header("src/wrapper-x11.h"); } // Finish the builder and generate the bindings. builder .generate() // Unwrap the Result and panic on failure. .expect("Unable to generate bindings") .write_to_file(output().join("bindings.rs")) .unwrap(); } fn is_static() -> bool { env::var("CARGO_FEATURE_STATIC").is_ok() } fn output() -> PathBuf { PathBuf::from(env::var("OUT_DIR").unwrap()) } fn common() -> Result<(), Error> { if let Ok(path) = env::var("XKBCOMMON_LIB_DIR") { for lib in &["xkbcommon"] { println!("cargo:rustc-link-lib={}={}", if is_static() { "static" } else { "dylib" }, lib); } println!("cargo:rustc-link-search=native={}", path); } else { Config::new().statik(is_static()).probe("xkbcommon")?; } Ok(()) } fn x11() -> Result<(), Error> { if env::var("CARGO_FEATURE_X11").is_ok() { if let Ok(path) = env::var("XKBCOMMON_LIB_DIR") { for lib in &["xkbcommon-x11"] { println!("cargo:rustc-link-lib={}={}", if is_static() { "static" } else { "dylib" }, lib); } println!("cargo:rustc-link-search=native={}", path); } else { Config::new().statik(is_static()).probe("xkbcommon-x11")?; } } Ok(()) } xkbcommon-sys-1.4.1/flake.lock000064400000000000000000000040231046102023000143730ustar 00000000000000{ "nodes": { "fenix": { "inputs": { "nixpkgs": [ "nixpkgs" ], "rust-analyzer-src": "rust-analyzer-src" }, "locked": { "lastModified": 1627266442, "narHash": "sha256-jmHGpI0XYdAXV31iNBnZwLebd1IZ4EoDlgv7beKQ24c=", "owner": "nix-community", "repo": "fenix", "rev": "b099d59df490f63fb53387739f93c26c08d3b48f", "type": "github" }, "original": { "owner": "nix-community", "repo": "fenix", "type": "github" } }, "nixpkgs": { "locked": { "lastModified": 1627170405, "narHash": "sha256-6t7ISnt0Iqc2jxIf5+/su6eFmZNWnPAOA1JeOv9lLRE=", "owner": "NixOS", "repo": "nixpkgs", "rev": "ecaf3da9340231e5493eccc3db87604a3705da42", "type": "github" }, "original": { "owner": "NixOS", "ref": "nixpkgs-unstable", "repo": "nixpkgs", "type": "github" } }, "root": { "inputs": { "fenix": "fenix", "nixpkgs": "nixpkgs", "utils": "utils" } }, "rust-analyzer-src": { "flake": false, "locked": { "lastModified": 1627221155, "narHash": "sha256-NBUEhA4e9fAeXH+3BxnNJdTlGfhukzHIpqD7g2qK1RI=", "owner": "rust-analyzer", "repo": "rust-analyzer", "rev": "5983d3745ac8490c1c2798fdc963aa9fc803dd03", "type": "github" }, "original": { "owner": "rust-analyzer", "ref": "nightly", "repo": "rust-analyzer", "type": "github" } }, "utils": { "locked": { "lastModified": 1623875721, "narHash": "sha256-A8BU7bjS5GirpAUv4QA+QnJ4CceLHkcXdRp4xITDB0s=", "owner": "numtide", "repo": "flake-utils", "rev": "f7e004a55b120c02ecb6219596820fcd32ca8772", "type": "github" }, "original": { "owner": "numtide", "repo": "flake-utils", "type": "github" } } }, "root": "root", "version": 7 } xkbcommon-sys-1.4.1/flake.nix000064400000000000000000000015441046102023000142460ustar 00000000000000{ inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; utils.url = "github:numtide/flake-utils"; fenix = { url = "github:nix-community/fenix"; inputs.nixpkgs.follows = "nixpkgs"; }; }; outputs = { self, utils, nixpkgs, fenix, }: utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages.${system}; rust = fenix.packages.${system}; lib = pkgs.lib; in { devShell = pkgs.mkShell { buildInputs = with pkgs; with llvmPackages; with python37Packages; [ # For building. clang rust.latest.toolchain pkg-config openssl libsodium libclang.lib libxkbcommon xorg.libxcb ]; LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib"; RUST_BACKTRACE = 1; # RUST_LOG = "info,sqlx::query=warn"; RUSTFLAGS = "-C target-cpu=native"; }; }); } xkbcommon-sys-1.4.1/shell.nix000064400000000000000000000006451046102023000142740ustar 00000000000000let mozilla = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz); in with (import { overlays = [mozilla]; }); mkShell { name = "ffmpeg-sys"; buildInputs = [ # For building. clang rustChannels.stable.rust pkg-config libxkbcommon ]; RUST_BACKTRACE = 1; RUSTFLAGS = "-C target-cpu=native"; LIBCLANG_PATH = "${llvmPackages.libclang}/lib"; } xkbcommon-sys-1.4.1/src/lib.rs000064400000000000000000000012171046102023000143440ustar 00000000000000// DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE // Version 2, December 2004 // // Copyleft (ↄ) meh. | http://meh.schizofreni.co // // Everyone is permitted to copy and distribute verbatim or modified // copies of this license document, and changing it is allowed as long // as the name is changed. // // DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE // TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION // // 0. You just DO WHAT THE FUCK YOU WANT TO. #![allow(non_camel_case_types, non_upper_case_globals, non_snake_case)] include!(concat!(env!("OUT_DIR"), "/bindings.rs")); xkbcommon-sys-1.4.1/src/wrapper-x11.h000064400000000000000000000000451046102023000154660ustar 00000000000000#include xkbcommon-sys-1.4.1/src/wrapper.h000064400000000000000000000003021046102023000150530ustar 00000000000000#include #include #include #include #include