Skip to content

Commit

Permalink
[ffmpeg] add -fPIC (#17298)
Browse files Browse the repository at this point in the history
* [ffmpeg] enable position-independent-code

* [ffmpeg] update version refs

* [ffmpeg] fix regressions

* [ffmpeg] fix refs
  • Loading branch information
cenit authored Apr 15, 2021
1 parent 2bdc34f commit a267ab1
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion ports/ffmpeg/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: ffmpeg
Version: 4.3.2
Port-Version: 3
Port-Version: 4
Homepage: https://ffmpeg.org
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 Down
20 changes: 15 additions & 5 deletions ports/ffmpeg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,17 @@ else()
set(LIB_PATH_VAR "LIBRARY_PATH")
endif()

set(OPTIONS "--enable-asm --enable-x86asm --disable-doc --enable-debug --enable-runtime-cpudetect")
set(OPTIONS "--enable-pic --disable-doc --enable-debug --enable-runtime-cpudetect")

if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(OPTIONS "${OPTIONS} --disable-asm --disable-x86asm")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
set(OPTIONS "${OPTIONS} --enable-asm --disable-x86asm")
endif()
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
set(OPTIONS "${OPTIONS} --enable-asm --enable-x86asm")
endif()

if(VCPKG_TARGET_IS_WINDOWS)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
Expand Down Expand Up @@ -575,7 +585,7 @@ endif()

if(VCPKG_TARGET_IS_WINDOWS)
file(GLOB DEF_FILES ${CURRENT_PACKAGES_DIR}/lib/*.def ${CURRENT_PACKAGES_DIR}/debug/lib/*.def)

if(NOT VCPKG_TARGET_IS_MINGW)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm")
set(LIB_MACHINE_ARG /machine:ARM)
Expand Down Expand Up @@ -603,7 +613,7 @@ if(VCPKG_TARGET_IS_WINDOWS)
)
endforeach()
endif()

file(GLOB EXP_FILES ${CURRENT_PACKAGES_DIR}/lib/*.exp ${CURRENT_PACKAGES_DIR}/debug/lib/*.exp)
file(GLOB LIB_FILES ${CURRENT_PACKAGES_DIR}/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX} ${CURRENT_PACKAGES_DIR}/debug/bin/*${VCPKG_TARGET_STATIC_LIBRARY_SUFFIX})
if(VCPKG_TARGET_IS_MINGW)
Expand Down Expand Up @@ -636,7 +646,7 @@ vcpkg_copy_pdbs()
if (VCPKG_TARGET_IS_WINDOWS)
# Translate cygpath to local path
set(CYGPATH_CMD "${MSYS_ROOT}/usr/bin/cygpath.exe" -w)

foreach(PKGCONFIG_PATH "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig")
file(GLOB PKGCONFIG_FILES "${PKGCONFIG_PATH}/*.pc")
foreach(PKGCONFIG_FILE IN LISTS PKGCONFIG_FILES)
Expand Down Expand Up @@ -665,7 +675,7 @@ if (VCPKG_TARGET_IS_WINDOWS)
)
string(REPLACE "\n" "" FIXED_INCLUDE_PATH "${FIXED_INCLUDE_PATH}")
file(TO_CMAKE_PATH ${FIXED_INCLUDE_PATH} FIXED_INCLUDE_PATH)

vcpkg_replace_string("${PKGCONFIG_FILE}" "${prefix_cygpath}" "${FIXED_PREFIX_PATH}")
vcpkg_replace_string("${PKGCONFIG_FILE}" "${libdir_cygpath}" "${FIXED_LIBDIR_PATH}")
vcpkg_replace_string("${PKGCONFIG_FILE}" "${includedir_cygpath}" "${FIXED_INCLUDE_PATH}")
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1942,7 +1942,7 @@
},
"ffmpeg": {
"baseline": "4.3.2",
"port-version": 3
"port-version": 4
},
"ffnvcodec": {
"baseline": "10.0.26.0",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/ffmpeg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "993a1a305ccef12934ba4b72648ba205498841f7",
"version-string": "4.3.2",
"port-version": 4
},
{
"git-tree": "d70a90e893854dbcb0efbe740f286baf47adafef",
"version-string": "4.3.2",
Expand Down

0 comments on commit a267ab1

Please sign in to comment.