nandi/jolt-nativepublic Fork 0
d682bfa
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.

Point the docs at the flake

README's build section described zig, DotSlash and `scripts/`, none of which
exist any more, and glimmer-vidya's named a buck2 recipe.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
nandi committed 2026-09-05T22:04:19-07:00 Browse files
d682bfa parent: 5ae197f
modified README.md +41 -17
@@ -39,29 +39,53 @@ than naming one.
3939
4040 ## Building
4141
42+The flake is the toolchain. `nix develop` is where the compiler, the C
43+toolchain, PipeWire's headers and the kernel headers bindgen wants come from,
44+so **nothing needs to be installed** beyond nix itself — no `cc` on PATH, no
45+rustup, no NDK.
46+
4247 ```bash
43-just build # release .so files in target/release
44-just test # the whole workspace
45-just libdir # where to point LD_LIBRARY_PATH
48+nix develop # then:
49+just build # release .so files in target/release
50+just test # the whole workspace
51+just libdir # where to point LD_LIBRARY_PATH
4652 ```
4753
48-Everything is compiled by `zig cc`, which brings its own glibc sysroot and
49-Linux headers, so **no system C or C++ toolchain is needed** — this repo builds
50-on a machine with no `cc` on its PATH at all. The pinned tools come from
51-DotSlash files in `scripts/`, fetched on first use; `dotslash` must be on PATH.
54+`just build` is the edit loop; the nix outputs are the artifact, built against
55+a pinned compiler and a pinned crate graph:
5256
53-Two things sit outside that promise and are worth knowing about:
57+```bash
58+nix build # all three objects → result/lib
59+nix build .#android # both device objects → result/lib/arm64-v8a
60+nix flake check # fmt, clippy, tests, all three objects
61+```
5462
55-* **bindgen runs libclang directly** and does not inherit zig's header search
56- path, so `v4l2r` cannot find `linux/videodev2.h`. The justfile points it at
57- zig's bundled copies. That is what `scripts/zig-include` is for, and why
58- building through `just` rather than bare `cargo` is the supported path.
63+Two things are worth knowing about:
64+
65+* **bindgen runs libclang directly**, so `v4l2r` needs to be pointed at
66+ `linux/videodev2.h`. The flake sets `V4L2R_VIDEODEV2_H_PATH` and
67+ `BINDGEN_EXTRA_CLANG_ARGS` from nixpkgs' `linuxHeaders` in both the devShell
68+ and the build, which is why building inside `nix develop` rather than a bare
69+ shell is the supported path.
5970 * **PipeWire** is a real system dependency — `libspa-sys` wants `pkg-config`
60- and PipeWire's headers. It is behind the default-on `pipewire` feature of
61- `jolt-moq`; `just test-minimal` builds without it. Turning it off costs
62- device *names*: only ALSA PCMs remain visible ("pipewire", "sysdefault")
63- rather than the real sources a browser would offer, which makes picking a
64- microphone guesswork.
71+ and PipeWire's headers, and the flake supplies both. It is behind the
72+ default-on `pipewire` feature of `jolt-moq`; `just test-minimal` builds
73+ without it, for a machine outside the flake. Turning it off costs device
74+ *names*: only ALSA PCMs remain visible ("pipewire", "sysdefault") rather than
75+ the real sources a browser would offer, which makes picking a microphone
76+ guesswork.
77+
78+### Android
79+
80+```bash
81+just ffi-android # nix build .#android
82+```
83+
84+Same sources and same `Cargo.lock` as the desktop objects; only the target
85+configuration moves. The NDK comes from nixpkgs, so this needs nothing
86+installed either. The camera wants two things from the APK that the build
87+cannot supply: a `CameraCapture` class in its `classes.dex`, and a call to
88+`joltmoq_android_init` — see `android/jolt_main.c`.
6589
6690 ## jolt-moq
6791
@@ -39,29 +39,53 @@ than naming one.
39 39
40 ## Building40 ## Building
41 41
42+The flake is the toolchain. `nix develop` is where the compiler, the C
43+toolchain, PipeWire's headers and the kernel headers bindgen wants come from,
44+so **nothing needs to be installed** beyond nix itself — no `cc` on PATH, no
45+rustup, no NDK.
46+
42 ```bash47 ```bash
43-just build # release .so files in target/release48+nix develop # then:
44-just test # the whole workspace49+just build # release .so files in target/release
45-just libdir # where to point LD_LIBRARY_PATH50+just test # the whole workspace
51+just libdir # where to point LD_LIBRARY_PATH
46 ```52 ```
47 53
48-Everything is compiled by `zig cc`, which brings its own glibc sysroot and54+`just build` is the edit loop; the nix outputs are the artifact, built against
49-Linux headers, so **no system C or C++ toolchain is needed** — this repo builds55+a pinned compiler and a pinned crate graph:
50-on a machine with no `cc` on its PATH at all. The pinned tools come from
51-DotSlash files in `scripts/`, fetched on first use; `dotslash` must be on PATH.
52 56
53-Two things sit outside that promise and are worth knowing about:57+```bash
58+nix build # all three objects → result/lib
59+nix build .#android # both device objects → result/lib/arm64-v8a
60+nix flake check # fmt, clippy, tests, all three objects
61+```
54 62
55-* **bindgen runs libclang directly** and does not inherit zig's header search63+Two things are worth knowing about:
56- path, so `v4l2r` cannot find `linux/videodev2.h`. The justfile points it at64+
57- zig's bundled copies. That is what `scripts/zig-include` is for, and why65+* **bindgen runs libclang directly**, so `v4l2r` needs to be pointed at
58- building through `just` rather than bare `cargo` is the supported path.66+ `linux/videodev2.h`. The flake sets `V4L2R_VIDEODEV2_H_PATH` and
67+ `BINDGEN_EXTRA_CLANG_ARGS` from nixpkgs' `linuxHeaders` in both the devShell
68+ and the build, which is why building inside `nix develop` rather than a bare
69+ shell is the supported path.
59 * **PipeWire** is a real system dependency — `libspa-sys` wants `pkg-config`70 * **PipeWire** is a real system dependency — `libspa-sys` wants `pkg-config`
60- and PipeWire's headers. It is behind the default-on `pipewire` feature of71+ and PipeWire's headers, and the flake supplies both. It is behind the
61- `jolt-moq`; `just test-minimal` builds without it. Turning it off costs72+ default-on `pipewire` feature of `jolt-moq`; `just test-minimal` builds
62- device *names*: only ALSA PCMs remain visible ("pipewire", "sysdefault")73+ without it, for a machine outside the flake. Turning it off costs device
63- rather than the real sources a browser would offer, which makes picking a74+ *names*: only ALSA PCMs remain visible ("pipewire", "sysdefault") rather than
64- microphone guesswork.75+ the real sources a browser would offer, which makes picking a microphone
76+ guesswork.
77+
78+### Android
79+
80+```bash
81+just ffi-android # nix build .#android
82+```
83+
84+Same sources and same `Cargo.lock` as the desktop objects; only the target
85+configuration moves. The NDK comes from nixpkgs, so this needs nothing
86+installed either. The camera wants two things from the APK that the build
87+cannot supply: a `CameraCapture` class in its `classes.dex`, and a call to
88+`joltmoq_android_init` — see `android/jolt_main.c`.
65 89
66 ## jolt-moq90 ## jolt-moq
67 91
modified jolt/glimmer-vidya/README.md +1 -1
@@ -68,7 +68,7 @@ it on the loop thread. Handlers are held on the jolt side and never sent.
6868 `libvidya` built from [`../ffi`](../ffi), the Rust/egui implementation:
6969
7070 ```sh
71-just ffi # buck2 → ../build/libvidya.so
71+just ffi-android # nix build .#android → ../result/lib/arm64-v8a/libvidya.so
7272 ```
7373
7474 Then put it on the search path when running anything here:
@@ -68,7 +68,7 @@ it on the loop thread. Handlers are held on the jolt side and never sent.
68 `libvidya` built from [`../ffi`](../ffi), the Rust/egui implementation:68 `libvidya` built from [`../ffi`](../ffi), the Rust/egui implementation:
69 69
70 ```sh70 ```sh
71-just ffi # buck2 → ../build/libvidya.so71+just ffi-android # nix build .#android → ../result/lib/arm64-v8a/libvidya.so
72 ```72 ```
73 73
74 Then put it on the search path when running anything here:74 Then put it on the search path when running anything here: