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

Pin the toolchain with a flake, and let buck2 and DotSlash go 5ae197f · on f554a01a49266b0957fed39383b2d490d9dbdeeb · nandi · 13d ago
justfile · 54 lines · 1.9 KBMakefile Blame HistoryRaw
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
set shell := ["bash", "-euo", "pipefail", "-c"]

# Everything below assumes the flake's environment — `nix develop`, or direnv
# with `use flake`. That is where the compiler, the C toolchain, PipeWire's
# headers and the kernel headers bindgen wants come from; a bare shell has none
# of them, and the recipes deliberately do not paper over that.
#
# The nix outputs are the other half of this file. `just build` is the edit
# loop; `nix build` is the artifact.

default:
    @just --list

# The shared objects, ready to be put on a loader search path.
build *args:
    cargo build --release {{args}}

# The same three objects, built by nix instead of by the ambient cargo — pinned
# compiler, pinned crate graph, byte-identical between machines. This is what
# `just buck-build` used to be, minus the second dependency graph.
nix-build:
    nix build .#libs
    @echo "{{justfile_directory()}}/result/lib"

# Both objects, cross-compiled for a 64-bit Android device. The NDK comes from
# the flake, so the only thing a machine needs installed for this is nix.
#
# The camera needs two things from the APK that this recipe cannot supply: a
# `CameraCapture` class in its classes.dex (frq has one), and a call to
# joltmoq_android_init. See android/jolt_main.c.
ffi-android:
    nix build .#android
    @echo "{{justfile_directory()}}/result/lib/arm64-v8a"

# Where a consumer points LD_LIBRARY_PATH.
libdir:
    @echo "{{justfile_directory()}}/target/release"

test *args:
    cargo test --workspace {{args}}

# Without cpal's PipeWire host — device *names* get worse (ALSA PCMs only),
# everything else is equal. Kept for a machine outside the flake that has
# neither pkg-config nor PipeWire's headers.
test-minimal:
    cargo test --workspace --no-default-features

lint:
    cargo clippy --workspace --all-targets -- -D warnings
    cargo fmt --all --check

# Everything CI runs, in one go: fmt, clippy, tests and all three objects.
check:
    nix flake check