Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion ports/ffmpeg/CONTROL
Original file line number Diff line number Diff line change
@@ -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.

Expand All @@ -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
Expand Down
33 changes: 33 additions & 0 deletions ports/ffmpeg/fixed-debug-bzip2-link.patch
Original file line number Diff line number Diff line change
@@ -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"
38 changes: 21 additions & 17 deletions ports/ffmpeg/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
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
)

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)
Expand All @@ -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)

Expand Down Expand Up @@ -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\\")
Expand Down Expand Up @@ -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(
Expand All @@ -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(
Expand Down