From 9075f0ab1548d29db090b9a278a6152f340a05f5 Mon Sep 17 00:00:00 2001
From: atraczyk <andreastraczyk@gmail.com>
Date: Tue, 31 Jan 2017 13:10:08 -0500
Subject: [PATCH] build: patch FFmpegInterop to build with all available cores

- adds -j to the make command in the ffmpeg build script

Change-Id: I3d58c6db2f30695c9d91e8b6dab87aad9c9d748b
Tuleap: #790
---
 contrib/src/ffmpeg/fetch_and_patch.bat | 29 +++++-----
 contrib/src/ffmpeg/ffmpeg-uwp.patch    | 77 ++++++++++++++++++++++++++
 2 files changed, 92 insertions(+), 14 deletions(-)
 create mode 100644 contrib/src/ffmpeg/ffmpeg-uwp.patch

diff --git a/contrib/src/ffmpeg/fetch_and_patch.bat b/contrib/src/ffmpeg/fetch_and_patch.bat
index 4988f2a149..8002be719b 100644
--- a/contrib/src/ffmpeg/fetch_and_patch.bat
+++ b/contrib/src/ffmpeg/fetch_and_patch.bat
@@ -1,15 +1,16 @@
-git clone --recursive 
-
-set BUILD=%SRC%..\build
-
-set FFMPEG_URL=git://github.com/Microsoft/FFmpegInterop.git
-
-mkdir %BUILD%
-cd %BUILD%
-
-git clone --recursive %FFMPEG_URL%
-
-cd FFmpegInterop\ffmpeg
-git apply --reject --whitespace=fix %SRC%\ffmpeg\0004-avformat-fix-find_stream_info-not-considering-extradata.patch
-
+set BUILD=%SRC%..\build
+
+set FFMPEG_URL=git://github.com/Microsoft/FFmpegInterop.git
+
+mkdir %BUILD%
+cd %BUILD%
+
+git clone --recursive %FFMPEG_URL%
+
+cd FFmpegInterop
+git apply --reject --whitespace=fix %SRC%\ffmpeg\ffmpeg-uwp.patch
+
+cd ffmpeg
+git apply --reject --whitespace=fix %SRC%\ffmpeg\0004-avformat-fix-find_stream_info-not-considering-extradata.patch
+
 cd %SRC%
\ No newline at end of file
diff --git a/contrib/src/ffmpeg/ffmpeg-uwp.patch b/contrib/src/ffmpeg/ffmpeg-uwp.patch
new file mode 100644
index 0000000000..3fa4d39657
--- /dev/null
+++ b/contrib/src/ffmpeg/ffmpeg-uwp.patch
@@ -0,0 +1,77 @@
+--- a/FFmpegConfig.sh
++++ b/FFmpegConfig.sh
+@@ -22,7 +22,7 @@ if [ "$1" == "Win10" ]; then
+         --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" \
+         --extra-ldflags="-APPCONTAINER WindowsApp.lib" \
+         --prefix=../../../Build/Windows10/x86
+-        make install
++        make -j install
+         popd
+ 
+     elif [ "$2" == "x64" ]; then
+@@ -43,7 +43,7 @@ if [ "$1" == "Win10" ]; then
+         --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00" \
+         --extra-ldflags="-APPCONTAINER WindowsApp.lib" \
+         --prefix=../../../Build/Windows10/x64
+-        make install
++        make -j install
+         popd
+ 
+     elif [ "$2" == "ARM" ]; then
+@@ -67,7 +67,7 @@ if [ "$1" == "Win10" ]; then
+         --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_APP -D_WIN32_WINNT=0x0A00 -D__ARM_PCS_VFP" \
+         --extra-ldflags="-APPCONTAINER WindowsApp.lib" \
+         --prefix=../../../Build/Windows10/ARM
+-        make install
++        make -j install
+         popd
+ 
+     fi
+@@ -93,7 +93,7 @@ elif [ "$1" == "Win8.1" ]; then
+         --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -D_WIN32_WINNT=0x0603" \
+         --extra-ldflags="-APPCONTAINER" \
+         --prefix=../../../Build/Windows8.1/x86
+-        make install
++        make -j install
+         popd
+ 
+     elif [ "$2" == "x64" ]; then
+@@ -114,7 +114,7 @@ elif [ "$1" == "Win8.1" ]; then
+         --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -D_WIN32_WINNT=0x0603" \
+         --extra-ldflags="-APPCONTAINER" \
+         --prefix=../../../Build/Windows8.1/x64
+-        make install
++        make -j install
+         popd
+ 
+     elif [ "$2" == "ARM" ]; then
+@@ -138,7 +138,7 @@ elif [ "$1" == "Win8.1" ]; then
+         --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PC_APP -D_WIN32_WINNT=0x0603 -D__ARM_PCS_VFP" \
+         --extra-ldflags="-APPCONTAINER -MACHINE:ARM" \
+         --prefix=../../../Build/Windows8.1/ARM
+-        make install
++        make -j install
+         popd
+ 
+     fi
+@@ -167,7 +167,7 @@ elif [ "$1" == "Phone8.1" ]; then
+         --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -D_WIN32_WINNT=0x0603 -D__ARM_PCS_VFP" \
+         --extra-ldflags="-APPCONTAINER -MACHINE:ARM -subsystem:console -opt:ref WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib -NODEFAULTLIB:kernel32.lib -NODEFAULTLIB:ole32.lib" \
+         --prefix=../../../Build/WindowsPhone8.1/ARM
+-        make install
++        make -j install
+         popd
+ 
+     elif [ "$2" == "x86" ]; then
+@@ -188,7 +188,7 @@ elif [ "$1" == "Phone8.1" ]; then
+         --extra-cflags="-MD -DWINAPI_FAMILY=WINAPI_FAMILY_PHONE_APP -D_WIN32_WINNT=0x0603" \
+         --extra-ldflags="-APPCONTAINER -subsystem:console -opt:ref WindowsPhoneCore.lib RuntimeObject.lib PhoneAppModelHost.lib -NODEFAULTLIB:kernel32.lib -NODEFAULTLIB:ole32.lib" \
+         --prefix=../../../Build/WindowsPhone8.1/x86
+-        make install
++        make -j install
+         popd
+ 
+     fi
+-- 
+2.8.1.windows.1
+
-- 
GitLab