aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnknown <jbohl@h-quer.de>2018-09-02 22:06:07 +0200
committerGriffin Downs <grdowns@microsoft.com>2019-02-28 05:23:41 -0800
commit8c3b87c95ac070910796b8e6d767470eae8fe16c (patch)
treec30453cccd3898dc8bdfdfd4126693ef54bbe380
parent4a582b4d1dda94f1342a1ab281c06b9617841532 (diff)
downloadvcpkg-8c3b87c95ac070910796b8e6d767470eae8fe16c.tar.gz
vcpkg-8c3b87c95ac070910796b8e6d767470eae8fe16c.zip
allow building "ffmpeg.exe"
add new feature "ffmpeg" which allows to build "ffmpeg.exe" - ex. : vcpkg install ffmpeg[x264,gpl,nonfree,ffplay,ffprobe,openssl,lzma,opencl,ffmpeg]:x64-windows-static --recurse
-rw-r--r--ports/ffmpeg/CONTROL3
-rw-r--r--ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch11
-rw-r--r--ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch14
-rw-r--r--ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-3.patch19
-rw-r--r--ports/ffmpeg/portfile.cmake11
5 files changed, 57 insertions, 1 deletions
diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL
index ce69402dc..28af7d49b 100644
--- a/ports/ffmpeg/CONTROL
+++ b/ports/ffmpeg/CONTROL
@@ -3,6 +3,9 @@ Version: 4.1-1
Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.
FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations.
+Feature: ffmpeg
+Description: build the ffmpeg.exe application
+
Feature: ffserver
Description: ffserver appplication support in ffmpeg
diff --git a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch
new file mode 100644
index 000000000..345061c3f
--- /dev/null
+++ b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-1.patch
@@ -0,0 +1,11 @@
+--- a/cmdutils.c 2017-07-29 19:49:29.000000000 +0200
++++ b/cmdutils.c 2018-09-02 20:31:42.509408400 +0200
+@@ -62,6 +62,8 @@
+ #include <sys/resource.h>
+ #endif
+ #ifdef _WIN32
++#define _WIN32_WINNT 0x0600
++#define WIN32_LEAN_AND_MEAN
+ #include <windows.h>
+ #endif
+
diff --git a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch
new file mode 100644
index 000000000..fc63f1486
--- /dev/null
+++ b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-2.patch
@@ -0,0 +1,14 @@
+--- a/ffmpeg.c 2017-07-29 19:49:29.000000000 +0200
++++ b/ffmpeg.c 2018-09-02 20:32:27.666725200 +0200
+@@ -23,6 +23,11 @@
+ * multimedia converter based on the FFmpeg libraries
+ */
+
++#define _WIN32_WINNT 0x0502 // Must be less than 0x0600, because otherwise WinSock2.h defines "pollfd" which then gets redefined in "os_support.h".
++ // I suppose that "HAVE_STRUCT_POLLFD" should be 1, but it happens to be 0. Sorry, this is somewhat beyond me.
++#define WIN32_LEAN_AND_MEAN
++
++
+ #include "config.h"
+ #include <ctype.h>
+ #include <string.h>
diff --git a/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-3.patch b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-3.patch
new file mode 100644
index 000000000..78aa3d2d0
--- /dev/null
+++ b/ports/ffmpeg/fix_windowsinclude-in-ffmpegexe-3.patch
@@ -0,0 +1,19 @@
+--- a/ffmpeg_dxva2.c 2017-07-29 19:49:29.000000000 +0200
++++ b/ffmpeg_dxva2.c 2018-09-02 20:33:48.248716100 +0200
+@@ -16,12 +16,14 @@
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+-#include <windows.h>
+-
+ #ifdef _WIN32_WINNT
+ #undef _WIN32_WINNT
+ #endif
+ #define _WIN32_WINNT 0x0600
++#define WIN32_LEAN_AND_MEAN
++
++#include <windows.h>
++
+ #define DXVA2API_USE_BITFIELDS
+ #define COBJMACROS
+
diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake
index f8c0c9f38..ac053003e 100644
--- a/ports/ffmpeg/portfile.cmake
+++ b/ports/ffmpeg/portfile.cmake
@@ -17,6 +17,9 @@ vcpkg_apply_patches(
${CMAKE_CURRENT_LIST_DIR}/create-lib-libraries.patch
${CMAKE_CURRENT_LIST_DIR}/detect-openssl.patch
${CMAKE_CURRENT_LIST_DIR}/configure_opencv.patch
+ ${CMAKE_CURRENT_LIST_DIR}/fix_windowsinclude-in-ffmpegexe-1.patch
+ ${CMAKE_CURRENT_LIST_DIR}/fix_windowsinclude-in-ffmpegexe-2.patch
+ ${CMAKE_CURRENT_LIST_DIR}/fix_windowsinclude-in-ffmpegexe-3.patch
)
vcpkg_find_acquire_program(YASM)
@@ -36,7 +39,7 @@ set(_csc_PROJECT_PATH ffmpeg)
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
-set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug --disable-ffmpeg")
+set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug")
set(OPTIONS "${OPTIONS} --enable-runtime-cpudetect")
if("nonfree" IN_LIST FEATURES)
@@ -53,6 +56,12 @@ else()
set(OPTIONS "${OPTIONS} --disable-openssl")
endif()
+if("ffmpeg" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-ffmpeg")
+else()
+ set(OPTIONS "${OPTIONS} --disable-ffmpeg")
+endif()
+
if("ffplay" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-ffplay")
else()