| 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 | |
| Build under buck2, with the toolchain pinned rather than found 460541b nandi 19d ago | 21 | # buck2, with scripts/ on PATH: the prelude's system toolchains resolve their |
| 22 | # tools through PATH, and that directory is where the pinned ones live. Only |
| 23 | # `dotslash` itself has to be on the host. |
| 24 | buck *args: |
| 25 | PATH="{{justfile_directory()}}/scripts:$PATH" scripts/buck2 {{args}} |
| 26 | |
| 27 | # The same two objects under buck2. Not yet the default — see the cpal note in |
| 28 | # third-party/rust/Cargo.toml; `build` above is still the one that works. |
| 29 | buck-build *args: |
| 30 | @just buck build //:libs {{args}} |
| 31 | |
| Lift freeq's AV media plane out of sleek 90f8b89 nandi 19d ago | 32 | test *args: |
| 33 | cargo test --workspace {{args}} |
| 34 | |
| 35 | # Without PipeWire — for a machine that has neither pkg-config nor PipeWire's |
| 36 | # headers. Device *names* get worse (ALSA PCMs only); everything else is equal. |
| 37 | test-minimal: |
| 38 | cargo test --workspace --no-default-features |
| 39 | |
| 40 | lint: |
| 41 | cargo clippy --workspace --all-targets -- -D warnings |
| 42 | cargo fmt --all --check |
| 43 | |
| 44 | # Where a consumer points LD_LIBRARY_PATH. |
| 45 | libdir: |
| 46 | @echo "{{justfile_directory()}}/target/release" |