From 06eb99ffa2a9933651b5116f888dec20a74b7b12 Mon Sep 17 00:00:00 2001 From: Michael Weiss Date: Wed, 1 Feb 2023 22:26:49 +0100 Subject: [PATCH] chromiumBeta: Fix the build This change (dynamically linking against libffi from Nixpkgs) is required since we switched to third_party/wayland instead of linking against Wayland from Nixpkgs (26aadca7c61). See also f9d9864cb62 and d932886d6ea for more details. We could alternatively provide libffi_pic.a for static linking but due to our immutable dependency model / pure builds the dynamic linking shouldn't cause any issues. This fixes the build error shown in [0]. [0]: https://github.com/NixOS/nixpkgs/issues/213862#issuecomment-1412519998 --- pkgs/applications/networking/browsers/chromium/common.nix | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index aea178a3afc5e..4a7048010c81b 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -34,6 +34,7 @@ , libva , libdrm, wayland, libxkbcommon # Ozone , curl +, libffi , libepoxy # postPatch: , glibc # gconv + locale @@ -151,7 +152,8 @@ let libepoxy ] ++ lib.optional systemdSupport systemd ++ lib.optionals cupsSupport [ libgcrypt cups ] - ++ lib.optional pulseSupport libpulseaudio; + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional (chromiumVersionAtLeast "110") libffi; patches = [ # Optional patch to use SOURCE_DATE_EPOCH in compute_build_timestamp.py (should be upstreamed): @@ -299,6 +301,10 @@ let use_system_libwayland = true; # The default value is hardcoded instead of using pkg-config: system_wayland_scanner_path = "${wayland.bin}/bin/wayland-scanner"; + } // lib.optionalAttrs (chromiumVersionAtLeast "110") { + # 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 proprietaryCodecs { # enable support for the H.264 codec proprietary_codecs = true;