emoon / rust_minifb

Cross platfrom window and framebuffer crate for Rust
MIT License
1.04k stars 99 forks source link

Reduce wayland dependencies #293

Closed vmedea closed 2 years ago

vmedea commented 2 years ago

This change removes dependency on the xkb and xkbcommon-sys crates (and this indirectly, bindgen and everything below it) by using our own ffi wrapper, based on sctk's.

A new feature dlopen, enabled by default, is added that causes xkbcommon to be loaded at runtime instead of linked at build-time.

cargo tree:

minifb v0.22.0
├── dlib v0.5.0
│   └── libloading v0.7.3
│       └── cfg-if v1.0.0
├── lazy_static v1.4.0
├── libc v0.2.123
├── raw-window-handle v0.4.3
│   └── cty v0.2.2
├── tempfile v3.3.0
│   ├── cfg-if v1.0.0
│   ├── fastrand v1.7.0
│   ├── libc v0.2.123
│   └── remove_dir_all v0.5.3
├── wayland-client v0.29.4
│   ├── bitflags v1.3.2
│   ├── downcast-rs v1.2.0
│   ├── libc v0.2.123
│   ├── nix v0.22.3
│   │   ├── bitflags v1.3.2
│   │   ├── cfg-if v1.0.0
│   │   ├── libc v0.2.123
│   │   └── memoffset v0.6.5
│   │       [build-dependencies]
│   │       └── autocfg v1.1.0
│   ├── scoped-tls v1.0.0
│   ├── wayland-commons v0.29.4
│   │   ├── nix v0.22.3 (*)
│   │   ├── once_cell v1.10.0
│   │   ├── smallvec v1.8.0
│   │   └── wayland-sys v0.29.4
│   │       ├── dlib v0.5.0 (*)
│   │       └── lazy_static v1.4.0
│   │       [build-dependencies]
│   │       └── pkg-config v0.3.25
│   └── wayland-sys v0.29.4 (*)
│   [build-dependencies]
│   └── wayland-scanner v0.29.4
│       ├── proc-macro2 v1.0.37
│       │   └── unicode-xid v0.2.2
│       ├── quote v1.0.18
│       │   └── proc-macro2 v1.0.37 (*)
│       └── xml-rs v0.8.4
├── wayland-cursor v0.29.4
│   ├── nix v0.22.3 (*)
│   ├── wayland-client v0.29.4 (*)
│   └── xcursor v0.3.4
│       └── nom v7.1.1
│           ├── memchr v2.4.1
│           └── minimal-lexical v0.2.1
├── wayland-protocols v0.29.4
│   ├── bitflags v1.3.2
│   ├── wayland-client v0.29.4 (*)
│   └── wayland-commons v0.29.4 (*)
│   [build-dependencies]
│   └── wayland-scanner v0.29.4 (*)
└── x11-dl v2.19.1
    ├── lazy_static v1.4.0
    └── libc v0.2.123
    [build-dependencies]
    └── pkg-config v0.3.25
[build-dependencies]
└── cc v1.0.73
[dev-dependencies]
└── png v0.17.5
    ├── bitflags v1.3.2
    ├── crc32fast v1.3.2
    │   └── cfg-if v1.0.0
    ├── deflate v1.0.0
    │   └── adler32 v1.2.0
    └── miniz_oxide v0.5.1
        └── adler v1.0.2
emoon commented 2 years ago

@vmedea Hey, seems there is some issue building this on macOS. Do you think you can have a look at it? Would love to merge this PR :)

emoon commented 2 years ago

Awesome! Thanks :) I will make a new release later today