| Lift freeq's AV media plane out of sleek 90f8b89 nandi 19d ago | 1 | set shell := ["bash", "-euo", "pipefail", "-c"] |
| 2 | |
| 3 | # Everything is compiled by zig, including the C and C++ dependencies, so a |
| 4 | # build needs no system toolchain — but bindgen runs libclang directly and does |
| 5 | # not inherit zig's own header search path. `v4l2r` wants `linux/videodev2.h`, |
| 6 | # which lives in /usr/include on a machine with kernel headers installed and |
| 7 | # nowhere at all on one without. Point it at zig's bundled copies instead. |
| 8 | zig_include := `scripts/zig-include` |
| 9 | headers := "-I" + zig_include + " -I" + parent_directory(zig_include) + "/x86-linux-gnu -I" + parent_directory(zig_include) + "/generic-glibc" |
| 10 | |
| 11 | export V4L2R_VIDEODEV2_H_PATH := zig_include |
| 12 | export BINDGEN_EXTRA_CLANG_ARGS := headers |
| 13 | |
| 14 | default: |
| 15 | @just --list |
| 16 | |
| 17 | # The shared objects, ready to be put on a loader search path. |
| 18 | build *args: |
| 19 | cargo build --release {{args}} |
| 20 | |
| 21 | test *args: |
| 22 | cargo test --workspace {{args}} |
| 23 | |
| 24 | # Without PipeWire — for a machine that has neither pkg-config nor PipeWire's |
| 25 | # headers. Device *names* get worse (ALSA PCMs only); everything else is equal. |
| 26 | test-minimal: |
| 27 | cargo test --workspace --no-default-features |
| 28 | |
| 29 | lint: |
| 30 | cargo clippy --workspace --all-targets -- -D warnings |
| 31 | cargo fmt --all --check |
| 32 | |
| 33 | # Where a consumer points LD_LIBRARY_PATH. |
| 34 | libdir: |
| 35 | @echo "{{justfile_directory()}}/target/release" |