From 96f3c0bbca8d657ddcd2e8b068d2e726b7f2042d Mon Sep 17 00:00:00 2001 From: OPNA2608 Date: Fri, 31 Oct 2025 21:42:21 +0100 Subject: [PATCH] mjpegtools: Fix build on POWER targets with AltiVec-free baseline I'll leave fixing of the AltiVec code to ppc64le users. --- pkgs/by-name/mj/mjpegtools/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/mj/mjpegtools/package.nix b/pkgs/by-name/mj/mjpegtools/package.nix index ad5ad85e729c..bfd9320ed020 100644 --- a/pkgs/by-name/mj/mjpegtools/package.nix +++ b/pkgs/by-name/mj/mjpegtools/package.nix @@ -56,6 +56,13 @@ stdenv.mkDerivation rec { postPatch = '' sed -i -e '/ARCHFLAGS=/s:=.*:=:' configure + '' + # Only ppc64le baseline guarantees AltiVec, no configure option to disable it so just make checks never signal success. + # AltiVec code also fails without disabling new compiler warnings: + # quant_non_intra.c:72:42: error: initialization of '__vector unsigned short *' {aka '__vector(8) short unsigned int *'} from incompatible pointer type 'uint16_t *' {aka 'short unsigned int *'} [-Wincompatible-pointer-types] + + lib.optionalString (!(stdenv.hostPlatform.isPower64 && stdenv.hostPlatform.isLittleEndian)) '' + substituteInPlace configure \ + --replace-fail 'have_altivec=true' 'have_altivec=false' ''; enableParallelBuilding = true;