Unverified Commit c85faba3 authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

mjpegtools: Fix build on POWER targets with AltiVec-free baseline (#457351)

parents d2531ebc 96f3c0bb
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -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;