Make the pure build work

This commit is contained in:
Daniël de Kok 2024-11-27 19:09:26 +00:00 committed by drbh
parent 98392a7a3f
commit 05004a6cfd

View File

@ -20,26 +20,23 @@ defaultCrateOverrides
rav1e = attrs: { env.CARGO_ENCODED_RUSTFLAGS = "-C target-feature=-crt-static"; };
ffmpeg-sys-next = attrs: {
nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ [
nativeBuildInputs = [
pkg-config
];
buildInputs = (attrs.buildInputs or []) ++ [
llvmPackages.libclang
ffmpeg.dev
gcc.cc
gcc-unwrapped
stdenv
buildInputs = [
rustPlatform.bindgenHook
ffmpeg
];
env = (attrs.env or {}) // {
LIBCLANG_PATH = "${llvmPackages.libclang.lib}/lib";
CPATH = "${gcc-unwrapped}/lib/gcc/${stdenv.hostPlatform.config}/${gcc-unwrapped.version}/include";
BINDGEN_EXTRA_CLANG_ARGS = builtins.concatStringsSep " " [
"-I${gcc.libc.dev}/include"
"-I${gcc}/lib/gcc/x86_64-unknown-linux-gnu/${gcc.version}/include"
"-I${llvmPackages.libclang.lib}/lib/clang/${llvmPackages.libclang.version}/include"
];
PKG_CONFIG_PATH = "${ffmpeg.dev}/lib/pkgconfig";
};
ffmpeg-next = attrs: {
# Somehow the variables that are passed are mangled, so they are not
# correctly passed to the ffmpeg-next build script. Worth investigating
# more since it's probably a bug in crate2nix or buildRustCrate.
postPatch = ''
substituteInPlace build.rs \
--replace-fail "DEP_FFMPEG_" "DEP_FFMPEG_SYS_NEXT_"
'';
};
grpc-metadata = attrs: {