Commit 7261c52f authored by Lorenz Brun's avatar Lorenz Brun
Browse files

chromium: supply Rust compiler for M115+

Chromium has recently started integrating Rust [1] and as of M115 this
infrastructure is enabled, thus Chromium either requires the bundled
binary Rust compiler (which won't work in NixOS without modification) or
a custom one. This configures the nixpkgs Rust compiler for Chromium.

M115 doesn't actually contain any production Rust code, so we don't
actually know if this fully works and we're definitely still missing
bindgen, but for the time being this makes it work and is a sane
starting position.

[1] https://security.googleblog.com/2023/01/supporting-use-of-rust-in-chromium.html
parent 04dc69b6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@
, python3, perl
, which
, llvmPackages
, rustc
# postPatch:
, pkgsBuildHost
# configurePhase:
@@ -308,6 +309,11 @@ let
      # To fix the build as we don't provide libffi_pic.a
      # (ld.lld: error: unable to find library -l:libffi_pic.a):
      use_system_libffi = true;
    } // lib.optionalAttrs (chromiumVersionAtLeast "115") {
      # Use nixpkgs Rust compiler instead of the one shipped by Chromium.
      # We do intentionally not set rustc_version as nixpkgs will never do incremental
      # rebuilds, thus leaving this empty is fine.
      rust_sysroot_absolute = "${rustc}";
    } // lib.optionalAttrs proprietaryCodecs {
      # enable support for the H.264 codec
      proprietary_codecs = true;