nix, cross: give the builds cmake so the bundled libopus compiles
nix build .#crabidy-server-aarch64 and .#crabidy have both been broken since Opus decoding landed: symphonia-adapter-libopus pulls opusic-sys, which compiles a bundled libopus with CMake. devenv.nix got cmake at the time, flake.nix never did, so the derivation died with "is `cmake` not installed?" while building the deps. Both flake derivations now carry pkgs.cmake, and so do the three cross Dockerfiles, which had the identical gap. No ninja anywhere: its mere presence flips cmake's generator and then clashes with a build dir cached under the other one. Verified: nix build .#crabidy-server-aarch64 completes, and its output is a 39 MB statically linked aarch64 ELF with every provider, the embedded wasm bundle, and the Opus decoder. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
ab3bd7c63a
commit
ba4775b0bb
|
|
@ -1,5 +1,5 @@
|
||||||
FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge
|
FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge
|
||||||
RUN dpkg --add-architecture arm64
|
RUN dpkg --add-architecture arm64
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get update && apt-get install -y alsa:arm64 librust-alsa-sys-dev:arm64 libasound2-dev:arm64 portaudio19-dev:arm64 build-essential libpulse-dev:arm64 libdbus-1-dev:arm64 pkg-config apt-utils unzip
|
RUN apt-get update && apt-get install -y alsa:arm64 librust-alsa-sys-dev:arm64 libasound2-dev:arm64 portaudio19-dev:arm64 build-essential cmake libpulse-dev:arm64 libdbus-1-dev:arm64 pkg-config apt-utils unzip
|
||||||
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protoc-23.2-linux-x86_64.zip && unzip protoc-23.2-linux-x86_64.zip
|
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protoc-23.2-linux-x86_64.zip && unzip protoc-23.2-linux-x86_64.zip
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
FROM ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:edge
|
FROM ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:edge
|
||||||
RUN dpkg --add-architecture armhf
|
RUN dpkg --add-architecture armhf
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get update && apt-get install -y alsa:armhf librust-alsa-sys-dev:armhf libasound2-dev:armhf portaudio19-dev:armhf build-essential libpulse-dev:armhf libdbus-1-dev:armhf pkg-config apt-utils unzip
|
RUN apt-get update && apt-get install -y alsa:armhf librust-alsa-sys-dev:armhf libasound2-dev:armhf portaudio19-dev:armhf build-essential cmake libpulse-dev:armhf libdbus-1-dev:armhf pkg-config apt-utils unzip
|
||||||
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protoc-23.2-linux-x86_64.zip && unzip protoc-23.2-linux-x86_64.zip
|
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protoc-23.2-linux-x86_64.zip && unzip protoc-23.2-linux-x86_64.zip
|
||||||
|
|
|
||||||
16
flake.nix
16
flake.nix
|
|
@ -58,9 +58,9 @@
|
||||||
workspaceBins = "-p crabidy-server -p cbd -p cbd-tui";
|
workspaceBins = "-p crabidy-server -p cbd -p cbd-tui";
|
||||||
|
|
||||||
# Headless: everything except the embedded web UI. Spelled out rather
|
# Headless: everything except the embedded web UI. Spelled out rather
|
||||||
# than "--no-default-features" alone, which since
|
# than "--no-default-features" alone, which means *no providers at
|
||||||
# architecture/build-features.md means *no providers at all* — the
|
# all* (see docs/src/build-features.md) — the features must be named
|
||||||
# features must be named or this package ships an empty server. The
|
# or this package ships an empty server. The
|
||||||
# aarch64 server (below) takes the full defaults and stages the wasm
|
# aarch64 server (below) takes the full defaults and stages the wasm
|
||||||
# bundle. `notifications` is cbd-tui's own default and needs no
|
# bundle. `notifications` is cbd-tui's own default and needs no
|
||||||
# mention here.
|
# mention here.
|
||||||
|
|
@ -140,10 +140,14 @@
|
||||||
cargoExtraArgs = "--locked --no-default-features --features ${headlessFeatures} ${workspaceBins}";
|
cargoExtraArgs = "--locked --no-default-features --features ${headlessFeatures} ${workspaceBins}";
|
||||||
# protoc + pkg-config are build-host tools (run during the build);
|
# protoc + pkg-config are build-host tools (run during the build);
|
||||||
# with strictDeps they must be nativeBuildInputs or alsa-sys cannot
|
# with strictDeps they must be nativeBuildInputs or alsa-sys cannot
|
||||||
# find pkg-config. alsa-lib is the actual linked library.
|
# find pkg-config. alsa-lib is the actual linked library. cmake
|
||||||
|
# builds the bundled libopus (opusic-sys, via the `opus` feature) —
|
||||||
|
# deliberately without ninja, whose mere presence flips cmake's
|
||||||
|
# generator and then clashes with a cached build dir.
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkgs.protobuf
|
pkgs.protobuf
|
||||||
pkgs.pkg-config
|
pkgs.pkg-config
|
||||||
|
pkgs.cmake
|
||||||
];
|
];
|
||||||
buildInputs = [ pkgs.alsa-lib ];
|
buildInputs = [ pkgs.alsa-lib ];
|
||||||
# audio-player links libasound; yt-dlp for /youtube stays a runtime
|
# audio-player links libasound; yt-dlp for /youtube stays a runtime
|
||||||
|
|
@ -189,10 +193,12 @@
|
||||||
'';
|
'';
|
||||||
|
|
||||||
# Build scripts / proc-macros compile for the build host; deps for the
|
# Build scripts / proc-macros compile for the build host; deps for the
|
||||||
# target use the cross toolchain. protoc + pkg-config are host tools.
|
# target use the cross toolchain. protoc, pkg-config, and cmake (for
|
||||||
|
# the bundled libopus) are host tools.
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
pkgs.protobuf
|
pkgs.protobuf
|
||||||
pkgs.pkg-config
|
pkgs.pkg-config
|
||||||
|
pkgs.cmake
|
||||||
];
|
];
|
||||||
buildInputs = [ crossAlsa ];
|
buildInputs = [ crossAlsa ];
|
||||||
depsBuildBuild = [ crossPkgs.stdenv.cc ];
|
depsBuildBuild = [ crossPkgs.stdenv.cc ];
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
FROM ghcr.io/cross-rs/x86_64-unknown-linux-gnu:edge
|
FROM ghcr.io/cross-rs/x86_64-unknown-linux-gnu:edge
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
RUN apt-get update && apt-get install -y alsa librust-alsa-sys-dev libasound2-dev portaudio19-dev build-essential libpulse-dev libdbus-1-dev pkg-config apt-utils unzip
|
RUN apt-get update && apt-get install -y alsa librust-alsa-sys-dev libasound2-dev portaudio19-dev build-essential cmake libpulse-dev libdbus-1-dev pkg-config apt-utils unzip
|
||||||
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protoc-23.2-linux-x86_64.zip && unzip protoc-23.2-linux-x86_64.zip
|
RUN curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v23.2/protoc-23.2-linux-x86_64.zip && unzip protoc-23.2-linux-x86_64.zip
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue