nandi/jolt-nativepublic Fork 0
600f207e2f91fc746a6545b141494a260e410f60
Commits
Clone
git clone https://git.rickub.com/nandi/jolt-native.git
git clone ssh://git@rickub.com/nandi/jolt-native.git

Host key fingerprint (ed25519): SHA256:iycHnxEyq0Q7uyVpB7JlznP0G7JrTPXLYRcAU5CSLhc — verify it before your first connect.

justfile · 67 lines · 2.9 KBMakefile Blame HistoryRaw
Lift freeq's AV media plane out of sleek 90f8b89 nandi 20d ago1set 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.
8zig_include := `scripts/zig-include`
9headers := "-I" + zig_include + " -I" + parent_directory(zig_include) + "/x86-linux-gnu -I" + parent_directory(zig_include) + "/generic-glibc"
10
11export V4L2R_VIDEODEV2_H_PATH := zig_include
12export BINDGEN_EXTRA_CLANG_ARGS := headers
13
14default:
15 @just --list
16
17# The shared objects, ready to be put on a loader search path.
18build *args:
19 cargo build --release {{args}}
20
Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 20d ago21# buck2, with scripts/ reachable two ways, because two things need it
22# differently. `rustc` is resolved off PATH: the prelude's
23# system_rust_toolchain hardcodes the bare name and offers no attribute to
24# override it, so the pinned compiler is selected by shadowing. The C tools are
25# named by absolute path in .buckconfig.local, which the toolchain reads —
26# see the note in toolchains/BUCK for why a bare name will not do for those.
27#
28# Without the PATH half the build silently uses the host's rustc, which is a
29# different compiler than the one the cache was populated with.
Build under buck2, with the toolchain pinned rather than found 460541b nandi 20d ago30buck *args:
Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 20d ago31 printf '[jolt]\n scripts = %s\n rustc_version = %s\n' \
32 "{{justfile_directory()}}/scripts" \
33 "$(scripts/rustc --version | tr -d '\n')" > .buckconfig.local
Build under buck2, with the toolchain pinned rather than found 460541b nandi 20d ago34 PATH="{{justfile_directory()}}/scripts:$PATH" scripts/buck2 {{args}}
35
Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 20d ago36# The same two objects under buck2, staged into one directory a consumer can
37# put on its loader path — the same shape `build` leaves in target/release.
38#
39# Not the default yet, and only for one reason: cpal's `pipewire` feature is
40# off here, so device *names* in a call are ALSA PCMs rather than the real OS
41# sources. See the note in third-party/rust/Cargo.toml.
Build under buck2, with the toolchain pinned rather than found 460541b nandi 20d ago42buck-build *args:
43 @just buck build //:libs {{args}}
Build both objects under buck2, against the BuildBuddy cache 600f207 nandi 20d ago44 mkdir -p build/lib
45 cp "$(just buck build --show-output //:libvidya | awk '/libvidya.so/{print $2}')" build/lib/libvidya.so
46 cp "$(just buck build --show-output //:libjoltmoq | awk '/libjoltmoq.so/{print $2}')" build/lib/libjoltmoq.so
47 @echo "{{justfile_directory()}}/build/lib"
48
49# Where a consumer points LD_LIBRARY_PATH for the buck2 build.
50buck-libdir:
51 @echo "{{justfile_directory()}}/build/lib"
Build under buck2, with the toolchain pinned rather than found 460541b nandi 20d ago52
Lift freeq's AV media plane out of sleek 90f8b89 nandi 20d ago53test *args:
54 cargo test --workspace {{args}}
55
56# Without PipeWire — for a machine that has neither pkg-config nor PipeWire's
57# headers. Device *names* get worse (ALSA PCMs only); everything else is equal.
58test-minimal:
59 cargo test --workspace --no-default-features
60
61lint:
62 cargo clippy --workspace --all-targets -- -D warnings
63 cargo fmt --all --check
64
65# Where a consumer points LD_LIBRARY_PATH.
66libdir:
67 @echo "{{justfile_directory()}}/target/release"