diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 7688f67f9aa0e2..505417b7440b9c 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,5 +1,5 @@ Source: ffmpeg -Version: 3.3.3-5 +Version: 3.3.3-6 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. @@ -20,6 +20,10 @@ Feature: lzma Build-Depends: liblzma Description: lzma support in ffmpeg +Feature: bzip2 +Build-Depends: bzip2 +Description: bzip2 support in ffmpeg + Feature: x264 Build-Depends: x264, ffmpeg[gpl] Description: x264 support in ffmpeg diff --git a/ports/ffmpeg/fixed-debug-bzip2-link.patch b/ports/ffmpeg/fixed-debug-bzip2-link.patch new file mode 100644 index 00000000000000..29e2913fa190d7 --- /dev/null +++ b/ports/ffmpeg/fixed-debug-bzip2-link.patch @@ -0,0 +1,33 @@ +diff -urN a/configure b/configure +--- a/configure 2018-09-08 20:53:33.556275600 +0800 ++++ b/configure 2018-09-08 20:55:46.238584400 +0800 +@@ -4753,6 +4753,8 @@ + enable $subarch + enabled spic && enable_weak pic + ++bzlib_name=bz2 ++ + # OS specific + case $target_os in + aix) +@@ -4914,6 +4916,11 @@ + objformat="win32" + ranlib=: + enable dos_paths ++ if [ -z "${extra_cflags##*-MDd*}" ] || [ -z "${extra_cflags##*-MTd*}" ]; then ++ bzlib_name=bz2d ++ else ++ bzlib_name=bz2 ++ fi + ;; + cygwin*) + target_os=cygwin +@@ -5734,7 +5741,7 @@ + check_builtin sem_timedwait semaphore.h "sem_t *s; sem_init(s,0,0); sem_timedwait(s,0); sem_destroy(s)" + + disabled zlib || check_lib zlib.h zlibVersion -lz || disable zlib +-disabled bzlib || check_lib bzlib.h BZ2_bzlibVersion -lbz2 || disable bzlib ++disabled bzlib || check_lib bzlib.h BZ2_bzlibVersion -l$bzlib_name || disable bzlib + disabled lzma || check_lib lzma.h lzma_version_number -llzma || disable lzma + + check_lib math.h sin -lm && LIBM="-lm" diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 994e057b39cc73..1df84dc7e741ee 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -1,8 +1,9 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ffmpeg-3.3.3) +set(VERSION 3.3.3) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ffmpeg-${VERSION}) vcpkg_download_distfile(ARCHIVE - URLS "http://ffmpeg.org/releases/ffmpeg-3.3.3.tar.bz2" - FILENAME "ffmpeg-3.3.3.tar.bz2" + URLS "http://ffmpeg.org/releases/ffmpeg-${VERSION}.tar.bz2" + FILENAME "ffmpeg-${VERSION}.tar.bz2" SHA512 1cc63bf73356f4e618c0d3572a216bdf5689f10deff56b4262f6d740b0bee5a4b3eac234f45fca3d4d2da77903a507b4fba725b76d2d2070f31b6dae9e7a2dab ) @@ -10,13 +11,14 @@ 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_extract_source_archive_ex( + OUT_SOURCE_PATH SOURCE_PATH + ARCHIVE ${ARCHIVE} + REF ${VERSION} + PATCHES create-lib-libraries.patch + detect-openssl.patch + configure_opencv.patch + fixed-debug-bzip2-link.patch ) vcpkg_find_acquire_program(YASM) @@ -30,7 +32,6 @@ else() 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) @@ -89,12 +90,11 @@ 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("bzip2" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-bzlib") +else() + set(OPTIONS "${OPTIONS} --disable-bzlib") +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\\") @@ -136,6 +136,9 @@ else() set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MT --extra-cxxflags=-MT") endif() +set(ENV_LIB "$ENV{LIB}") + +set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;${ENV_LIB}") message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( @@ -148,6 +151,7 @@ vcpkg_execute_required_process( LOGNAME build-${TARGET_TRIPLET}-rel ) +set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/debug/lib;${ENV_LIB}") message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) vcpkg_execute_required_process(