aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGriffin Downs <35574547+grdowns@users.noreply.github.com>2019-04-12 03:13:34 -0700
committerGitHub <noreply@github.com>2019-04-12 03:13:34 -0700
commit637963244b5442d41f876b41f2622654e88f3074 (patch)
treedbdc23ac9301748e06911a9d3fff05cd507b9121
parent7f02290c438845098b2b843152bd3bea96081af0 (diff)
parent0e000644053015b7f7a0985e14f0bd384c847d17 (diff)
downloadvcpkg-637963244b5442d41f876b41f2622654e88f3074.tar.gz
vcpkg-637963244b5442d41f876b41f2622654e88f3074.zip
Merge pull request #4217 from ptahmose/master
[ffmpeg] Add feature to build "ffmpeg.exe"
-rw-r--r--ports/ffmpeg/CONTROL5
-rw-r--r--ports/ffmpeg/create-lib-libraries.patch16
-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.cmake31
6 files changed, 82 insertions, 14 deletions
diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL
index 2060e37af..ce961fa55 100644
--- a/ports/ffmpeg/CONTROL
+++ b/ports/ffmpeg/CONTROL
@@ -1,8 +1,11 @@
Source: ffmpeg
-Version: 4.1-3
+Version: 4.1-4
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/create-lib-libraries.patch b/ports/ffmpeg/create-lib-libraries.patch
index dcc767cd2..ccad5ff8c 100644
--- a/ports/ffmpeg/create-lib-libraries.patch
+++ b/ports/ffmpeg/create-lib-libraries.patch
@@ -12,8 +12,20 @@ diff --git a/configure b/configure
index ba38a73906..0a3f308323 100755
--- a/configure
+++ b/configure
-@@ -5031,6 +5031,8 @@ case $target_os in
- fi
+@@ -4890,15 +4890,17 @@
+ ;;
+ win32|win64)
+ disable symver
+- if enabled shared; then
++# if enabled shared; then
+ # Link to the import library instead of the normal static library
+ # for shared libs.
+ LD_LIB='%.lib'
+ # Cannot build both shared and static libs with MSVC or icl.
+- disable static
+- fi
++# disable static
++# fi
enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
shlibdir_default="$bindir_default"
+ LIBPREF=""
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 2a35d6b94..786d82ea1 100644
--- a/ports/ffmpeg/portfile.cmake
+++ b/ports/ffmpeg/portfile.cmake
@@ -1,24 +1,27 @@
include(vcpkg_common_functions)
-set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ffmpeg-4.1)
+
vcpkg_download_distfile(ARCHIVE
URLS "http://ffmpeg.org/releases/ffmpeg-4.1.tar.bz2"
FILENAME "ffmpeg-4.1.tar.bz2"
SHA512 ccf6d07268dc47e08ca619eb182a003face2a8ee73ec1a28157330dd7de1df88939def1fc1c7e6b6ac7b59752cdad84657d589b2fafb73e14e5ef03fb6e33417
)
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ PATCHES
+ create-lib-libraries.patch
+ detect-openssl.patch
+ configure_opencv.patch
+ fix_windowsinclude-in-ffmpegexe-1.patch
+ fix_windowsinclude-in-ffmpegexe-2.patch
+ fix_windowsinclude-in-ffmpegexe-3.patch
+)
+
if (${SOURCE_PATH} MATCHES " ")
message(FATAL_ERROR "Error: ffmpeg will not build with spaces in the path. Please use a directory with no spaces")
endif()
-vcpkg_extract_source_archive(${ARCHIVE})
-vcpkg_apply_patches(
- SOURCE_PATH ${SOURCE_PATH}
- PATCHES
- ${CMAKE_CURRENT_LIST_DIR}/create-lib-libraries.patch
- ${CMAKE_CURRENT_LIST_DIR}/detect-openssl.patch
- ${CMAKE_CURRENT_LIST_DIR}/configure_opencv.patch
-)
-
vcpkg_find_acquire_program(YASM)
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
@@ -46,7 +49,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)
@@ -63,6 +66,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()