From 3ed0fafe3b6c2df23b1b7aad3678316fc617c2fa Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sat, 17 Sep 2022 09:13:55 +0100 Subject: [PATCH] x264: pull upstream parallel build fix Without the change parallel builds occasionally fail as: $ make --shuffle ... gcc ... -c common/opencl.c -o common/opencl-8.o ... common/opencl.c:116:10: fatal error: common/oclobj.h: No such file or directory 116 | #include "common/oclobj.h" | ^~~~~~~~~~~~~~~~~ --- pkgs/development/libraries/x264/default.nix | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pkgs/development/libraries/x264/default.nix b/pkgs/development/libraries/x264/default.nix index df248f6b4d43..153790002390 100644 --- a/pkgs/development/libraries/x264/default.nix +++ b/pkgs/development/libraries/x264/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchFromGitLab, nasm +{ stdenv, lib, fetchFromGitLab, fetchpatch, nasm , enableShared ? !stdenv.hostPlatform.isStatic }: @@ -16,7 +16,15 @@ stdenv.mkDerivation rec { # Upstream ./configure greps for (-mcpu|-march|-mfpu) in CFLAGS, which in nix # is put in the cc wrapper anyway. - patches = [ ./disable-arm-neon-default.patch ]; + patches = [ + ./disable-arm-neon-default.patch + (fetchpatch { + # https://code.videolan.org/videolan/x264/-/merge_requests/114 + name = "fix-parallelism.patch"; + url = "https://code.videolan.org/videolan/x264/-/commit/e067ab0b530395f90b578f6d05ab0a225e2efdf9.patch"; + hash = "sha256-16h2IUCRjYlKI2RXYq8QyXukAdfoQxyBKsK/nI6vhRI="; + }) + ]; postPatch = '' patchShebangs .