aboutsummaryrefslogtreecommitdiff
path: root/ports/ffmpeg
diff options
context:
space:
mode:
authorAlexander Saprykin <xelfium@gmail.com>2018-05-26 13:27:14 +0200
committerGitHub <noreply@github.com>2018-05-26 13:27:14 +0200
commit4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5 (patch)
treed95c9490352eb73f078d34a33bc4bb44ac9fa48b /ports/ffmpeg
parentfb689bd13dd6ba563a885d71fff1dd2b32a615db (diff)
parent2ac7527b40b1dbeb7856b9f763362c1e139e2ca9 (diff)
downloadvcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.tar.gz
vcpkg-4ce5f064282c3a8d8d710aa82af7aa346b0c6dd5.zip
Merge pull request #1 from Microsoft/master
Update vcpkg from upstream
Diffstat (limited to 'ports/ffmpeg')
-rw-r--r--ports/ffmpeg/CONTROL35
-rw-r--r--ports/ffmpeg/FindFFMPEG.cmake11
-rw-r--r--ports/ffmpeg/build.sh8
-rw-r--r--ports/ffmpeg/configure_opencv.patch11
-rw-r--r--ports/ffmpeg/create-lib-libraries.patch26
-rw-r--r--ports/ffmpeg/detect-openssl.patch25
-rw-r--r--ports/ffmpeg/portfile.cmake130
7 files changed, 229 insertions, 17 deletions
diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL
index eea91d568..7688f67f9 100644
--- a/ports/ffmpeg/CONTROL
+++ b/ports/ffmpeg/CONTROL
@@ -1,4 +1,35 @@
Source: ffmpeg
-Version: 3.2.4-2
+Version: 3.3.3-5
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. \ No newline at end of file
+ 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: ffserver
+Description: ffserver appplication support in ffmpeg
+
+Feature: ffplay
+Description: ffplay appplication support in ffmpeg
+
+Feature: ffprobe
+Description: ffprobe appplication support in ffmpeg
+
+Feature: openssl
+Build-Depends: openssl, ffmpeg[nonfree]
+Description: openssl support in ffmpeg
+
+Feature: lzma
+Build-Depends: liblzma
+Description: lzma support in ffmpeg
+
+Feature: x264
+Build-Depends: x264, ffmpeg[gpl]
+Description: x264 support in ffmpeg
+
+Feature: opencl
+Build-Depends: opencl
+Description: opencl support in ffmpeg
+
+Feature: nonfree
+Description: allow nonfree and unredistributable libraries
+
+Feature: gpl
+Description: allow GPL licensed libraries
diff --git a/ports/ffmpeg/FindFFMPEG.cmake b/ports/ffmpeg/FindFFMPEG.cmake
new file mode 100644
index 000000000..bd373bfae
--- /dev/null
+++ b/ports/ffmpeg/FindFFMPEG.cmake
@@ -0,0 +1,11 @@
+include(FindPackageHandleStandardArgs)
+
+find_path(FFMPEG_INCLUDE_DIRS NAMES libavcodec/avcodec.h)
+unset(FFMPEG_LIBRARIES)
+foreach(FFMPEG_SUBLIBRARY avformat avdevice avcodec avutil swscale)
+ find_library(FFMPEG_lib${FFMPEG_SUBLIBRARY}_LIBRARY NAMES ${FFMPEG_SUBLIBRARY})
+ list(APPEND FFMPEG_LIBRARIES ${FFMPEG_lib${FFMPEG_SUBLIBRARY}_LIBRARY})
+endforeach()
+list(APPEND FFMPEG_LIBRARIES wsock32 ws2_32 Secur32)
+
+find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)
diff --git a/ports/ffmpeg/build.sh b/ports/ffmpeg/build.sh
index 3474a111e..048d9ec08 100644
--- a/ports/ffmpeg/build.sh
+++ b/ports/ffmpeg/build.sh
@@ -1,7 +1,13 @@
#!/usr/bin/bash
set -e
export PATH=/usr/bin:$PATH
-pacman -Sy --noconfirm --needed diffutils make
+# Export HTTP(S)_PROXY as http(s)_proxy:
+if [ "$HTTP_PROXY" ]; then
+ export http_proxy=$HTTP_PROXY
+fi
+if [ "$HTTPS_PROXY" ]; then
+ export https_proxy=$HTTPS_PROXY
+fi
PATH_TO_BUILD_DIR="`cygpath "$1"`"
PATH_TO_SRC_DIR="`cygpath "$2"`"
diff --git a/ports/ffmpeg/configure_opencv.patch b/ports/ffmpeg/configure_opencv.patch
new file mode 100644
index 000000000..66678661e
--- /dev/null
+++ b/ports/ffmpeg/configure_opencv.patch
@@ -0,0 +1,11 @@
+--- a/configure
++++ b/configure
+@@ -5804,7 +5804,7 @@
+ enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb
+ enabled libopencv && { check_header opencv2/core/core_c.h &&
+ { use_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader ||
+- require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
++ require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core341 -lopencv_imgproc341; } ||
+ require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; }
+ enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion
+ enabled libopenjpeg && { { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } ||
diff --git a/ports/ffmpeg/create-lib-libraries.patch b/ports/ffmpeg/create-lib-libraries.patch
new file mode 100644
index 000000000..dcc767cd2
--- /dev/null
+++ b/ports/ffmpeg/create-lib-libraries.patch
@@ -0,0 +1,26 @@
+From 5f7c72d6c93fb1f4a730e2315fff6e5eb9bb95c8 Mon Sep 17 00:00:00 2001
+From: Anonymous Maarten <anonymous.maarten@gmail.com>
+Date: Wed, 27 Sep 2017 15:50:40 +0200
+Subject: [PATCH] configure: create .lib static libraries using MSVC compiler
+ (instead of .a)
+
+---
+ configure | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure b/configure
+index ba38a73906..0a3f308323 100755
+--- a/configure
++++ b/configure
+@@ -5031,6 +5031,8 @@ case $target_os in
+ fi
+ enabled x86_32 && check_ldflags -LARGEADDRESSAWARE
+ shlibdir_default="$bindir_default"
++ LIBPREF=""
++ LIBSUF=".lib"
+ SLIBPREF=""
+ SLIBSUF=".dll"
+ SLIBNAME_WITH_VERSION='$(SLIBPREF)$(FULLNAME)-$(LIBVERSION)$(SLIBSUF)'
+--
+2.14.1.windows.1
+
diff --git a/ports/ffmpeg/detect-openssl.patch b/ports/ffmpeg/detect-openssl.patch
new file mode 100644
index 000000000..cb8a77e0a
--- /dev/null
+++ b/ports/ffmpeg/detect-openssl.patch
@@ -0,0 +1,25 @@
+From 18de5c60ae0a987680681d5a0602009b428504fa Mon Sep 17 00:00:00 2001
+From: Gilles Khouzam <gillesk@microsoft.com>
+Date: Mon, 19 Jun 2017 16:33:38 -0700
+Subject: [PATCH] Add better detection for Openssl on Windows.
+
+Look for libeay32 and ssleay32 as another detection mechanism
+---
+ configure | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure b/configure
+index a1818dc..1cf2a7c 100755
+--- a/configure
++++ b/configure
+@@ -5836,6 +5836,7 @@ enabled openssl && { use_pkg_config openssl openssl/ssl.h OPENSSL_init
+ check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto ||
+ check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
+ check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
++ check_lib openssl/ssl.h SSL_library_init -llibeay32 -lssleay32 ||
+ die "ERROR: openssl not found"; }
+ enabled qtkit_indev && { check_header_objcc QTKit/QTKit.h || disable qtkit_indev; }
+
+--
+2.10.1.windows.1
+
diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake
index 7b45fc898..994e057b3 100644
--- a/ports/ffmpeg/portfile.cmake
+++ b/ports/ffmpeg/portfile.cmake
@@ -1,40 +1,139 @@
-if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
- message(STATUS "Building as static libraries not currently supported. Building as DLLs instead.")
- set(VCPKG_LIBRARY_LINKAGE "dynamic")
-endif()
-
include(vcpkg_common_functions)
-set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ffmpeg-3.2.4)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ffmpeg-3.3.3)
vcpkg_download_distfile(ARCHIVE
- URLS "http://ffmpeg.org/releases/ffmpeg-3.2.4.tar.bz2"
- FILENAME "ffmpeg-3.2.4.tar.bz2"
- SHA512 ba5004d0f2659faa139c7dbf2f0fc6bab1d4e017d919f4ac271a5d2e8e4a3478909176e3a4d1ad33ddf2f62ab28dd9e00ce9be1399efb7cb3276dde79134cdaa
+ URLS "http://ffmpeg.org/releases/ffmpeg-3.3.3.tar.bz2"
+ FILENAME "ffmpeg-3.3.3.tar.bz2"
+ SHA512 1cc63bf73356f4e618c0d3572a216bdf5689f10deff56b4262f6d740b0bee5a4b3eac234f45fca3d4d2da77903a507b4fba725b76d2d2070f31b6dae9e7a2dab
)
+
+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)
set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}")
-vcpkg_acquire_msys(MSYS_ROOT)
+if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
+ vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make)
+else()
+ vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make)
+endif()
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
+set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")
+set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}")
set(_csc_PROJECT_PATH ffmpeg)
file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
-set(OPTIONS "--disable-ffmpeg --disable-ffprobe --disable-doc --enable-debug")
+set(OPTIONS "--enable-asm --enable-yasm --disable-doc --enable-debug --disable-ffmpeg")
set(OPTIONS "${OPTIONS} --enable-runtime-cpudetect")
+
+if("nonfree" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-nonfree")
+endif()
+
+if("gpl" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-gpl")
+endif()
+
+if("openssl" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-openssl")
+else()
+ set(OPTIONS "${OPTIONS} --disable-openssl")
+endif()
+
+if("ffplay" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-ffplay")
+else()
+ set(OPTIONS "${OPTIONS} --disable-ffplay")
+endif()
+
+if("ffserver" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-ffserver")
+else()
+ set(OPTIONS "${OPTIONS} --disable-ffserver")
+endif()
+
+if("ffprobe" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-ffprobe")
+else()
+ set(OPTIONS "${OPTIONS} --disable-ffprobe")
+endif()
+
+if("x264" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-libx264")
+else()
+ set(OPTIONS "${OPTIONS} --disable-libx264")
+endif()
+
+if("opencl" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-opencl")
+else()
+ set(OPTIONS "${OPTIONS} --disable-opencl")
+endif()
+
+if("lzma" IN_LIST FEATURES)
+ set(OPTIONS "${OPTIONS} --enable-lzma")
+else()
+ set(OPTIONS "${OPTIONS} --disable-lzma")
+endif()
+
+# bzip2's debug library is named "bz2d", which isn't found by ffmpeg
+# if("bzip2" IN_LIST FEATURES)
+# set(OPTIONS "${OPTIONS} --enable-bzip2")
+# else()
+# set(OPTIONS "${OPTIONS} --disable-bzip2")
+# endif()
+
+if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(ENV{LIBPATH} "$ENV{LIBPATH};$ENV{_WKITS10}references\\windows.foundation.foundationcontract\\2.0.0.0\\;$ENV{_WKITS10}references\\windows.foundation.universalapicontract\\3.0.0.0\\")
+ set(OPTIONS "${OPTIONS} --disable-programs --enable-cross-compile --target-os=win32 --arch=${VCPKG_TARGET_ARCHITECTURE}")
+ set(OPTIONS "${OPTIONS} --extra-cflags=-DWINAPI_FAMILY=WINAPI_FAMILY_APP --extra-cflags=-D_WIN32_WINNT=0x0A00")
+
+ if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
+ vcpkg_find_acquire_program(GASPREPROCESSOR)
+ foreach(GAS_PATH ${GASPREPROCESSOR})
+ get_filename_component(GAS_ITEM_PATH ${GAS_PATH} DIRECTORY)
+ set(ENV{PATH} "$ENV{PATH};${GAS_ITEM_PATH}")
+ endforeach(GAS_PATH)
+ elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
+ elseif (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ else()
+ message(FATAL_ERROR "Unsupported architecture")
+ endif()
+endif()
+
set(OPTIONS_DEBUG "") # Note: --disable-optimizations can't be used due to http://ffmpeg.org/pipermail/libav-user/2013-March/003945.html
+set(OPTIONS_RELEASE "")
+
+set(OPTIONS "${OPTIONS} --extra-cflags=-DHAVE_UNISTD_H=0")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
set(OPTIONS "${OPTIONS} --disable-static --enable-shared")
+ if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ set(OPTIONS "${OPTIONS} --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib")
+ endif()
endif()
+message(STATUS "Building Options: ${OPTIONS}")
+
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
- set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd --extra-ldflags=-NODEFAULTLIB:libcmt")
+ set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd")
+ set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MD --extra-cxxflags=-MD")
else()
- set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MTd --extra-cxxflags=-MTd --extra-ldflags=-NODEFAULTLIB:libcmt")
+ set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MTd --extra-cxxflags=-MTd")
+ set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MT --extra-cxxflags=-MT")
endif()
message(STATUS "Building ${_csc_PROJECT_PATH} for Release")
@@ -44,7 +143,7 @@ vcpkg_execute_required_process(
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" # BUILD DIR
"${SOURCE_PATH}" # SOURCE DIR
"${CURRENT_PACKAGES_DIR}" # PACKAGE DIR
- "${OPTIONS}"
+ "${OPTIONS} ${OPTIONS_RELEASE}"
WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel
LOGNAME build-${TARGET_TRIPLET}-rel
)
@@ -103,3 +202,6 @@ vcpkg_copy_pdbs()
# TODO: Examine build log and confirm that this license matches the build output
file(COPY ${SOURCE_PATH}/COPYING.LGPLv2.1 DESTINATION ${CURRENT_PACKAGES_DIR}/share/ffmpeg)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/ffmpeg/COPYING.LGPLv2.1 ${CURRENT_PACKAGES_DIR}/share/ffmpeg/copyright)
+
+# Used by OpenCV
+file(COPY ${CMAKE_CURRENT_LIST_DIR}/FindFFMPEG.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/ffmpeg)