[fix][ffmpeg] fixing linux build (#5917)

* limit windows dep libs to windows

* fixing configure patch

* fixing detect-openssl.patch

* adapting portfile to linux

* adding a linux-specific build sh

* add missing endif()

* bumping version

* adding extra check for windows environment
This commit is contained in:
Andre Abrantes 2019-04-05 02:32:10 -03:00 committed by Phil Christensen
parent 6ee391615e
commit c4d48f9089
6 changed files with 66 additions and 32 deletions

View File

@ -1,5 +1,5 @@
Source: ffmpeg Source: ffmpeg
Version: 4.1-1 Version: 4.1-2
Description: a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. 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. 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.

View File

@ -6,6 +6,8 @@ foreach(FFMPEG_SUBLIBRARY avformat avdevice avcodec avutil swscale)
find_library(FFMPEG_lib${FFMPEG_SUBLIBRARY}_LIBRARY NAMES ${FFMPEG_SUBLIBRARY}) find_library(FFMPEG_lib${FFMPEG_SUBLIBRARY}_LIBRARY NAMES ${FFMPEG_SUBLIBRARY})
list(APPEND FFMPEG_LIBRARIES ${FFMPEG_lib${FFMPEG_SUBLIBRARY}_LIBRARY}) list(APPEND FFMPEG_LIBRARIES ${FFMPEG_lib${FFMPEG_SUBLIBRARY}_LIBRARY})
endforeach() endforeach()
list(APPEND FFMPEG_LIBRARIES wsock32 ws2_32 Secur32) if(WIN32)
list(APPEND FFMPEG_LIBRARIES wsock32 ws2_32 Secur32)
endif()
find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS) find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_INCLUDE_DIRS)

View File

@ -0,0 +1,23 @@
#!/usr/bin/bash
set -e
export PATH=/usr/bin:$PATH
# 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=$1
PATH_TO_SRC_DIR=$2
PATH_TO_PACKAGE_DIR=$3
# Note: $4 is extra configure options
cd "$PATH_TO_BUILD_DIR"
echo "=== CONFIGURING ==="
"$PATH_TO_SRC_DIR/configure" "--prefix=$PATH_TO_PACKAGE_DIR" $4
echo "=== BUILDING ==="
make -j6
echo "=== INSTALLING ==="
make install

View File

@ -1,11 +1,11 @@
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -5804,7 +5804,7 @@ @@ -6110,7 +6110,7 @@ enabled libopencore_amrnb && require libopencore_amrnb opencore-amrnb/interf_dec
enabled libopencore_amrwb && require libopencore_amrwb opencore-amrwb/dec_if.h D_IF_init -lopencore-amrwb 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 && enabled libopencv && { check_headers opencv2/core/core_c.h &&
{ use_pkg_config opencv opencv2/core/core_c.h cvCreateImageHeader || { check_pkg_config libopencv opencv opencv2/core/core_c.h cvCreateImageHeader ||
- require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } || - require libopencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core -lopencv_imgproc; } ||
+ require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core341 -lopencv_imgproc341; } || + require opencv opencv2/core/core_c.h cvCreateImageHeader -lopencv_core341 -lopencv_imgproc341; } ||
require_pkg_config opencv opencv/cxcore.h cvCreateImageHeader; } require_pkg_config libopencv opencv opencv/cxcore.h cvCreateImageHeader; }
enabled libopenh264 && require_pkg_config openh264 wels/codec_api.h WelsGetCodecVersion enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
enabled libopenjpeg && { { check_lib openjpeg-2.1/openjpeg.h opj_version -lopenjp2 -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } || enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||

View File

@ -12,14 +12,11 @@ diff --git a/configure b/configure
index a1818dc..1cf2a7c 100755 index a1818dc..1cf2a7c 100755
--- a/configure --- a/configure
+++ b/configure +++ b/configure
@@ -5836,6 +5836,7 @@ enabled openssl && { use_pkg_config openssl openssl/ssl.h OPENSSL_init @@ -6127,6 +6127,7 @@
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto || check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto ||
check_lib openssl/ssl.h SSL_library_init -lssl32 -leay32 || check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 ||
check_lib openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 ||
+ check_lib openssl/ssl.h SSL_library_init -llibeay32 -lssleay32 || + check_lib openssl openssl/ssl.h SSL_library_init -llibeay32 -lssleay32 ||
die "ERROR: openssl not found"; } die "ERROR: openssl not found"; }
enabled qtkit_indev && { check_header_objcc QTKit/QTKit.h || disable qtkit_indev; } enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create &&
require_pkg_config rockchip_mpp "rockchip_mpp >= 1.3.7" rockchip/rk_mpi.h mpp_create &&
--
2.10.1.windows.1

View File

@ -23,12 +23,22 @@ vcpkg_find_acquire_program(YASM)
get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY) get_filename_component(YASM_EXE_PATH ${YASM} DIRECTORY)
set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}") set(ENV{PATH} "$ENV{PATH};${YASM_EXE_PATH}")
if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") if (WIN32)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make) if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
else() vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make)
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make) else()
vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make)
endif()
endif() endif()
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
if (WIN32)
set(BASH ${MSYS_ROOT}/usr/bin/bash.exe)
set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh)
else()
set(BASH bash)
set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/build_linux.sh)
endif()
set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}") set(ENV{INCLUDE} "${CURRENT_INSTALLED_DIR}/include;$ENV{INCLUDE}")
set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}") set(ENV{LIB} "${CURRENT_INSTALLED_DIR}/lib;$ENV{LIB}")
@ -122,18 +132,20 @@ endif()
message(STATUS "Building Options: ${OPTIONS}") message(STATUS "Building Options: ${OPTIONS}")
if(VCPKG_CRT_LINKAGE STREQUAL "dynamic") if(WIN32)
set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd") if(VCPKG_CRT_LINKAGE STREQUAL "dynamic")
set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MD --extra-cxxflags=-MD") set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MDd --extra-cxxflags=-MDd")
else() set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MD --extra-cxxflags=-MD")
set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MTd --extra-cxxflags=-MTd") else()
set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MT --extra-cxxflags=-MT") set(OPTIONS_DEBUG "${OPTIONS_DEBUG} --extra-cflags=-MTd --extra-cxxflags=-MTd")
set(OPTIONS_RELEASE "${OPTIONS_RELEASE} --extra-cflags=-MT --extra-cxxflags=-MT")
endif()
endif() endif()
message(STATUS "Building ${_csc_PROJECT_PATH} for Release") message(STATUS "Building ${_csc_PROJECT_PATH} for Release")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel)
vcpkg_execute_required_process( vcpkg_execute_required_process(
COMMAND ${BASH} --noprofile --norc "${CMAKE_CURRENT_LIST_DIR}\\build.sh" COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" # BUILD DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel" # BUILD DIR
"${SOURCE_PATH}" # SOURCE DIR "${SOURCE_PATH}" # SOURCE DIR
"${CURRENT_PACKAGES_DIR}" # PACKAGE DIR "${CURRENT_PACKAGES_DIR}" # PACKAGE DIR
@ -145,7 +157,7 @@ vcpkg_execute_required_process(
message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") message(STATUS "Building ${_csc_PROJECT_PATH} for Debug")
file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg)
vcpkg_execute_required_process( vcpkg_execute_required_process(
COMMAND ${BASH} --noprofile --norc "${CMAKE_CURRENT_LIST_DIR}\\build.sh" COMMAND ${BASH} --noprofile --norc "${BUILD_SCRIPT}"
"${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" # BUILD DIR "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" # BUILD DIR
"${SOURCE_PATH}" # SOURCE DIR "${SOURCE_PATH}" # SOURCE DIR
"${CURRENT_PACKAGES_DIR}/debug" # PACKAGE DIR "${CURRENT_PACKAGES_DIR}/debug" # PACKAGE DIR