Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 996e11d92b7d
Choose a base ref
...
head repository: NixOS/nixpkgs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2e5051e2235f
Choose a head ref
  • 1 commit
  • 2 files changed
  • 1 contributor

Commits on Jan 15, 2020

  1. x264: fix cross compilation

    danielfullmer authored and FRidh committed Jan 15, 2020
    Copy the full SHA
    2e5051e View commit details
Showing with 22 additions and 4 deletions.
  1. +9 −4 pkgs/development/libraries/x264/default.nix
  2. +13 −0 pkgs/development/libraries/x264/disable-arm-neon-default.patch
13 changes: 9 additions & 4 deletions pkgs/development/libraries/x264/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, nasm }:
{ stdenv, lib, fetchurl, nasm }:

stdenv.mkDerivation rec {
pname = "x264";
@@ -9,6 +9,10 @@ stdenv.mkDerivation rec {
sha256 = "1xv41z04km3rf374xk3ny7v8ibr211ph0j5am0909ln63mphc48f";
};

# 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 ];

postPatch = ''
patchShebangs .
'';
@@ -17,15 +21,16 @@ stdenv.mkDerivation rec {

outputs = [ "out" "lib" "dev" ];

preConfigure = ''
preConfigure = lib.optionalString (stdenv.buildPlatform.isx86_64 || stdenv.hostPlatform.isi686) ''
# `AS' is set to the binutils assembler, but we need nasm
unset AS
'';

configureFlags = [ "--enable-shared" ]
++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic";
++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic"
++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--cross-prefix=${stdenv.cc.targetPrefix}";

nativeBuildInputs = [ nasm ];
nativeBuildInputs = lib.optional (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isi686) nasm;

meta = with stdenv.lib; {
description = "Library for encoding H264/AVC video streams";
13 changes: 13 additions & 0 deletions pkgs/development/libraries/x264/disable-arm-neon-default.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff -Naur x264-snapshot-20190517-2245-stable-orig/configure x264-snapshot-20190517-2245-stable/configure
--- x264-snapshot-20190517-2245-stable-orig/configure 2020-01-03 19:51:03.041037657 -0500
+++ x264-snapshot-20190517-2245-stable/configure 2020-01-03 19:52:15.075034609 -0500
@@ -930,9 +930,6 @@
fi

if [ $asm = auto -a $ARCH = ARM ] ; then
- # set flags so neon is built by default
- [ $compiler == CL ] || echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon"
-
cc_check '' '' '__asm__("add r0, r1, r2");' && define HAVE_ARM_INLINE_ASM
if [ $compiler = CL ] && cpp_check '' '' 'defined(_M_ARM) && _M_ARM >= 7' ; then
define HAVE_ARMV6