| Lift freeq's AV media plane out of sleek 90f8b89 nandi 20d ago | 1 | set shell := ["bash", "-euo", "pipefail", "-c"] |
| 2 | |
| Pin the toolchain with a flake, and let buck2 and DotSlash go 5ae197f nandi 13d ago | 3 | # Everything below assumes the flake's environment — `nix develop`, or direnv |
| 4 | # with `use flake`. That is where the compiler, the C toolchain, PipeWire's |
| 5 | # headers and the kernel headers bindgen wants come from; a bare shell has none |
| 6 | # of them, and the recipes deliberately do not paper over that. |
| 7 | # |
| 8 | # The nix outputs are the other half of this file. `just build` is the edit |
| 9 | # loop; `nix build` is the artifact. |
| Lift freeq's AV media plane out of sleek 90f8b89 nandi 20d ago | 10 | |
| 11 | default: |
| 12 | @just --list |
| 13 | |
| 14 | # The shared objects, ready to be put on a loader search path. |
| 15 | build *args: |
| 16 | cargo build --release {{args}} |
| 17 | |
| Pin the toolchain with a flake, and let buck2 and DotSlash go 5ae197f nandi 13d ago | 18 | # The same three objects, built by nix instead of by the ambient cargo — pinned |
| 19 | # compiler, pinned crate graph, byte-identical between machines. This is what |
| 20 | # `just buck-build` used to be, minus the second dependency graph. |
| 21 | nix-build: |
| 22 | nix build .#libs |
| 23 | @echo "{{justfile_directory()}}/result/lib" |
| Build under buck2, with the toolchain pinned rather than found 460541b nandi 19d ago | 24 | |
| Pin the toolchain with a flake, and let buck2 and DotSlash go 5ae197f nandi 13d ago | 25 | # Both objects, cross-compiled for a 64-bit Android device. The NDK comes from |
| 26 | # the flake, so the only thing a machine needs installed for this is nix. |
| Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 19d ago | 27 | # |
| Pin the toolchain with a flake, and let buck2 and DotSlash go 5ae197f nandi 13d ago | 28 | # The camera needs two things from the APK that this recipe cannot supply: a |
| 29 | # `CameraCapture` class in its classes.dex (frq has one), and a call to |
| 30 | # joltmoq_android_init. See android/jolt_main.c. |
| Build libvidya for the phone, and hold the glue that boots it d942053 nandi 19d ago | 31 | ffi-android: |
| Pin the toolchain with a flake, and let buck2 and DotSlash go 5ae197f nandi 13d ago | 32 | nix build .#android |
| 33 | @echo "{{justfile_directory()}}/result/lib/arm64-v8a" |
| Build libvidya for the phone, and hold the glue that boots it d942053 nandi 19d ago | 34 | |
| Pin the toolchain with a flake, and let buck2 and DotSlash go 5ae197f nandi 13d ago | 35 | # Where a consumer points LD_LIBRARY_PATH. |
| 36 | libdir: |
| 37 | @echo "{{justfile_directory()}}/target/release" |
| Build libvidya for the phone, and hold the glue that boots it d942053 nandi 19d ago | 38 | |
| Lift freeq's AV media plane out of sleek 90f8b89 nandi 20d ago | 39 | test *args: |
| 40 | cargo test --workspace {{args}} |
| 41 | |
| Pin the toolchain with a flake, and let buck2 and DotSlash go 5ae197f nandi 13d ago | 42 | # Without cpal's PipeWire host — device *names* get worse (ALSA PCMs only), |
| 43 | # everything else is equal. Kept for a machine outside the flake that has |
| 44 | # neither pkg-config nor PipeWire's headers. |
| Lift freeq's AV media plane out of sleek 90f8b89 nandi 20d ago | 45 | test-minimal: |
| 46 | cargo test --workspace --no-default-features |
| 47 | |
| 48 | lint: |
| 49 | cargo clippy --workspace --all-targets -- -D warnings |
| 50 | cargo fmt --all --check |
| 51 | |
| Pin the toolchain with a flake, and let buck2 and DotSlash go 5ae197f nandi 13d ago | 52 | # Everything CI runs, in one go: fmt, clippy, tests and all three objects. |
| 53 | check: |
| 54 | nix flake check |