Skip to content

Commit

Permalink
[ffmpeg] Warn/fail when selecting unsupported features. (#17153)
Browse files Browse the repository at this point in the history
* [ffmpeg] Warn/fail when selecting unsupported features.

* Update ffmpeg.json

* Bump port-version

* Update ffmpeg.json

* [ffmpeg] Check for gpl/nonfree aswell as all option.

* avisynth now support static linking

* fixup typo

* Update ffmpeg.json

* Revert to fatal error on even when all is selected

* Update ffmpeg.json

* [ffmpeg] Disable openh264 on uwp

* update

* Update versions/f-/ffmpeg.json

* update

* Update ffmpeg.json

* update

* update

* Update

Co-authored-by: Billy Robert ONeal III <[email protected]>
Co-authored-by: Jack·Boos·Yu <[email protected]>
  • Loading branch information
3 people authored Jun 17, 2021
1 parent a94c58d commit 6e024e7
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 15 deletions.
153 changes: 141 additions & 12 deletions ports/ffmpeg/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,3 +1,132 @@
#Check for unsupported features

if("ffmpeg" IN_LIST FEATURES)
vcpkg_fail_port_install(ON_TARGET "UWP" MESSAGE "Feature 'ffmpeg' does not support 'uwp'")
endif()

if("ffplay" IN_LIST FEATURES)
vcpkg_fail_port_install(ON_TARGET "UWP" MESSAGE "Feature 'ffplay' does not support 'uwp'")
endif()

if("ffprobe" IN_LIST FEATURES)
vcpkg_fail_port_install(ON_TARGET "UWP" MESSAGE "Feature 'ffprobe' does not support 'uwp'")
endif()


if("ass" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_IS_UWP)
message(FATAL_ERROR "Feature 'ass' does not support 'uwp | arm'")
endif()
endif()

if("avisynthplus" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR (NOT VCPKG_TARGET_IS_WINDOWS))
message(FATAL_ERROR "Feature 'avisynthplus' does not support '!windows | arm | uwp'")
endif()
endif()

if("dav1d" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86" OR VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_OSX)
message(FATAL_ERROR "Feature 'dav1d' does not support 'uwp | arm | x86 | osx'")
endif()
endif()

if("fdk-aac" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_IS_UWP)
message(FATAL_ERROR "Feature 'fdk-aac' does not support 'uwp | arm'")
endif()
endif()

if("fontconfig" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_IS_UWP OR (VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static"))
message(FATAL_ERROR "Feature 'fontconfig' does not support 'uwp | arm | (windows & static)'")
endif()
endif()

if("fribidi" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_IS_UWP)
message(FATAL_ERROR "Feature 'fribidi' does not support 'uwp | arm'")
endif()
endif()

if("ilbc" IN_LIST FEATURES)
if ((VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") AND VCPKG_TARGET_IS_UWP)
message(FATAL_ERROR "Feature 'ilbc' does not support 'uwp & arm'")
endif()
endif()

if("modplug" IN_LIST FEATURES)
if (VCPKG_TARGET_IS_UWP OR (VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "static"))
message(FATAL_ERROR "Feature 'modplug' does not support 'uwp | (windows & static)'")
endif()
endif()

if("nvcodec" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR ((NOT VCPKG_TARGET_IS_WINDOWS) AND (NOT VCPKG_TARGET_IS_LINUX)))
message(FATAL_ERROR "Feature 'nvcodec' does not support '!(windows | linux) | uwp | arm'")
endif()
endif()

if("opencl" IN_LIST FEATURES)
vcpkg_fail_port_install(ON_TARGET "UWP" MESSAGE "Feature 'opencl' does not support 'uwp'")
endif()

if("opengl" IN_LIST FEATURES)
if (((VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") AND VCPKG_TARGET_IS_WINDOWS) OR VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_OSX)
message(FATAL_ERROR "Feature 'opengl' does not support 'uwp | (windows & arm) | osx'")
endif()
endif()

if("openh264" IN_LIST FEATURES)
vcpkg_fail_port_install(ON_TARGET "UWP" MESSAGE "Feature 'openh264' does not support 'uwp'")
endif()

if("sdl2" IN_LIST FEATURES)
vcpkg_fail_port_install(ON_TARGET "OSX" MESSAGE "Feature 'sdl2' does not support 'osx'")
endif()

if("ssh" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_IS_UWP OR VCPKG_LIBRARY_LINKAGE STREQUAL "static")
message(FATAL_ERROR "Feature 'ssh' does not support 'uwp | arm | static'")
endif()
endif()

if("tensorflow" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_IS_UWP OR VCPKG_LIBRARY_LINKAGE STREQUAL "static" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
message(FATAL_ERROR "Feature 'tensorflow' does not support 'x86 | arm | uwp | static'")
endif()
endif()

if("tesseract" IN_LIST FEATURES)
if (((VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") AND VCPKG_TARGET_IS_WINDOWS) OR VCPKG_TARGET_IS_UWP OR VCPKG_LIBRARY_LINKAGE STREQUAL "static")
message(FATAL_ERROR "Feature 'tesseract' does not support 'uwp | (windows & arm) | static'")
endif()
endif()

if("wavpack" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
message(FATAL_ERROR "Feature 'wavpack' does not support 'arm'")
endif()
endif()

if("x264" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
message(FATAL_ERROR "Feature 'x264' does not support 'arm'")
endif()
endif()

if("x265" IN_LIST FEATURES)
if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64" OR VCPKG_TARGET_IS_UWP)
message(FATAL_ERROR "Feature 'x265' does not support 'uwp | arm'")
endif()
endif()

if("xml2" IN_LIST FEATURES)
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
message(FATAL_ERROR "Feature 'xml2' does not support 'static'")
endif()
endif()

if(VCPKG_TARGET_IS_WINDOWS)
set(PATCHES 0017-Patch-for-ticket-9019-CUDA-Compile-Broken-Using-MSVC.patch) # https://trac.ffmpeg.org/ticket/9019
endif()
Expand Down Expand Up @@ -234,18 +363,6 @@ else()
set(OPTIONS "${OPTIONS} --disable-libdav1d")
endif()

if("iconv" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-iconv")
else()
set(OPTIONS "${OPTIONS} --disable-iconv")
endif()

if("ilbc" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libilbc")
else()
set(OPTIONS "${OPTIONS} --disable-libilbc")
endif()

if("fdk-aac" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libfdk-aac")
else()
Expand All @@ -270,6 +387,18 @@ else()
set(OPTIONS "${OPTIONS} --disable-libfribidi")
endif()

if("iconv" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-iconv")
else()
set(OPTIONS "${OPTIONS} --disable-iconv")
endif()

if("ilbc" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-libilbc")
else()
set(OPTIONS "${OPTIONS} --disable-libilbc")
endif()

if("lzma" IN_LIST FEATURES)
set(OPTIONS "${OPTIONS} --enable-lzma")
else()
Expand Down
4 changes: 2 additions & 2 deletions ports/ffmpeg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ffmpeg",
"version": "4.4",
"port-version": 4,
"port-version": 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."
Expand Down Expand Up @@ -183,7 +183,7 @@
"features": [
"avisynthplus"
],
"platform": "windows & !arm & !uwp & !static"
"platform": "windows & !arm & !uwp"
}
]
},
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -1982,7 +1982,7 @@
},
"ffmpeg": {
"baseline": "4.4",
"port-version": 4
"port-version": 5
},
"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": "234eb0e352d2a7be0a3b34fb9eb8a9f0417ffe94",
"version": "4.4",
"port-version": 5
},
{
"git-tree": "dfea2c203835c55baec68138cc7e8c65ebcce33a",
"version": "4.4",
Expand Down

0 comments on commit 6e024e7

Please sign in to comment.