From 98939130b9f97ad4c2c7d28e36da0ce58c5de4de Mon Sep 17 00:00:00 2001 From: Randy Eckenrode Date: Mon, 22 May 2023 00:29:35 -0400 Subject: [PATCH] rav1e: fix build with updated Darwin stdenv The updated Darwin stdenv uses `llvm-strip`, but that causes issues for rav1e when using NASM and linking it with the cctools ld64. Stripping the debug information instead of everything fixes the problem. --- pkgs/tools/video/rav1e/default.nix | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkgs/tools/video/rav1e/default.nix b/pkgs/tools/video/rav1e/default.nix index b5b66ec34751a..b7ca158d2e70a 100644 --- a/pkgs/tools/video/rav1e/default.nix +++ b/pkgs/tools/video/rav1e/default.nix @@ -55,6 +55,12 @@ in rustPlatform.buildRustPackage rec { Security ]; + # Darwin uses `llvm-strip`, which results in link errors when using `-x` to strip the asm library + # and linking it with cctools ld64. + postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) '' + substituteInPlace build.rs --replace 'cmd.arg("-x")' 'cmd.arg("-S")' + ''; + checkType = "debug"; postBuild = ''