nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
fork

Configure Feed

Select the types of activity you want to include in your feed.

x264: fix cross compilation

authored by

Daniel Fullmer and committed by
Frederik Rietdijk
2e5051e2 996e11d9

+22 -4
+9 -4
pkgs/development/libraries/x264/default.nix
··· 1 - { stdenv, fetchurl, nasm }: 1 + { stdenv, lib, fetchurl, nasm }: 2 2 3 3 stdenv.mkDerivation rec { 4 4 pname = "x264"; ··· 9 9 sha256 = "1xv41z04km3rf374xk3ny7v8ibr211ph0j5am0909ln63mphc48f"; 10 10 }; 11 11 12 + # Upstream ./configure greps for (-mcpu|-march|-mfpu) in CFLAGS, which in nix 13 + # is put in the cc wrapper anyway. 14 + patches = [ ./disable-arm-neon-default.patch ]; 15 + 12 16 postPatch = '' 13 17 patchShebangs . 14 18 ''; ··· 21 17 22 18 outputs = [ "out" "lib" "dev" ]; 23 19 24 - preConfigure = '' 20 + preConfigure = lib.optionalString (stdenv.buildPlatform.isx86_64 || stdenv.hostPlatform.isi686) '' 25 21 # `AS' is set to the binutils assembler, but we need nasm 26 22 unset AS 27 23 ''; 28 24 29 25 configureFlags = [ "--enable-shared" ] 30 - ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic"; 26 + ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic" 27 + ++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--cross-prefix=${stdenv.cc.targetPrefix}"; 31 28 32 - nativeBuildInputs = [ nasm ]; 29 + nativeBuildInputs = lib.optional (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isi686) nasm; 33 30 34 31 meta = with stdenv.lib; { 35 32 description = "Library for encoding H264/AVC video streams";
+13
pkgs/development/libraries/x264/disable-arm-neon-default.patch
··· 1 + diff -Naur x264-snapshot-20190517-2245-stable-orig/configure x264-snapshot-20190517-2245-stable/configure 2 + --- x264-snapshot-20190517-2245-stable-orig/configure 2020-01-03 19:51:03.041037657 -0500 3 + +++ x264-snapshot-20190517-2245-stable/configure 2020-01-03 19:52:15.075034609 -0500 4 + @@ -930,9 +930,6 @@ 5 + fi 6 + 7 + if [ $asm = auto -a $ARCH = ARM ] ; then 8 + - # set flags so neon is built by default 9 + - [ $compiler == CL ] || echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon" 10 + - 11 + cc_check '' '' '__asm__("add r0, r1, r2");' && define HAVE_ARM_INLINE_ASM 12 + if [ $compiler = CL ] && cpp_check '' '' 'defined(_M_ARM) && _M_ARM >= 7' ; then 13 + define HAVE_ARMV6