From 5213bc8a6d696d56d20ff5cd23e1d534f7326462 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sat, 9 May 2020 21:42:39 +1000 Subject: [PATCH 01/48] [zlib] Fix unistd.h being required --- ...id-inclusions-when-HAVE_-is-set-to-0.patch | 53 +++++++++++++++++++ ports/zlib/CONTROL | 2 +- ports/zlib/portfile.cmake | 1 + 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch diff --git a/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch b/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch new file mode 100644 index 00000000000000..8fe2b2f5a6683c --- /dev/null +++ b/ports/zlib/0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch @@ -0,0 +1,53 @@ +diff --git a/zconf.h.cmakein b/zconf.h.cmakein +index a7f24cc..a1b359b 100644 +--- a/zconf.h.cmakein ++++ b/zconf.h.cmakein +@@ -434,11 +434,19 @@ typedef uLong FAR uLongf; + #endif + + #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_UNISTD_H ++# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 ++# define Z_HAVE_UNISTD_H ++# elif HAVE_UNISTD_H != 0 ++# define Z_HAVE_UNISTD_H ++# endif + #endif + + #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_STDARG_H ++# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 ++# define Z_HAVE_STDARG_H ++# elif HAVE_STDARG_H != 0 ++# define Z_HAVE_STDARG_H ++# endif + #endif + + #ifdef STDC +diff --git a/zconf.h.in b/zconf.h.in +index 5e1d68a..32f53c8 100644 +--- a/zconf.h.in ++++ b/zconf.h.in +@@ -432,11 +432,19 @@ typedef uLong FAR uLongf; + #endif + + #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_UNISTD_H ++# if ~(~HAVE_UNISTD_H + 0) == 0 && ~(~HAVE_UNISTD_H + 1) == 1 ++# define Z_HAVE_UNISTD_H ++# elif HAVE_UNISTD_H != 0 ++# define Z_HAVE_UNISTD_H ++# endif + #endif + + #ifdef HAVE_STDARG_H /* may be set to #if 1 by ./configure */ +-# define Z_HAVE_STDARG_H ++# if ~(~HAVE_STDARG_H + 0) == 0 && ~(~HAVE_STDARG_H + 1) == 1 ++# define Z_HAVE_STDARG_H ++# elif HAVE_STDARG_H != 0 ++# define Z_HAVE_STDARG_H ++# endif + #endif + + #ifdef STDC + diff --git a/ports/zlib/CONTROL b/ports/zlib/CONTROL index b02b948ad50f87..3196577b552b85 100644 --- a/ports/zlib/CONTROL +++ b/ports/zlib/CONTROL @@ -1,5 +1,5 @@ Source: zlib Version: 1.2.11 -Port-Version: 7 +Port-Version: 8 Homepage: https://www.zlib.net/ Description: A compression library diff --git a/ports/zlib/portfile.cmake b/ports/zlib/portfile.cmake index c05e7e252aceab..22750131a5006d 100644 --- a/ports/zlib/portfile.cmake +++ b/ports/zlib/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_extract_source_archive_ex( REF ${VERSION} PATCHES "cmake_dont_build_more_than_needed.patch" + "0001-Prevent-invalid-inclusions-when-HAVE_-is-set-to-0.patch" ) # This is generated during the cmake build From 8f5de7dbf1ea0fa414ff658c72e60de0682a0dc9 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sun, 10 May 2020 02:23:57 +1000 Subject: [PATCH 02/48] [ffmpeg] Fix zlib. Closes #7084 --- ports/ffmpeg/0004-fix-debug-build.patch | 12 +++++++++--- ports/ffmpeg/0007-fix-lib-naming.patch | 12 ++++++++++++ ports/ffmpeg/CONTROL | 7 +++++-- ports/ffmpeg/portfile.cmake | 7 +++++++ 4 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 ports/ffmpeg/0007-fix-lib-naming.patch diff --git a/ports/ffmpeg/0004-fix-debug-build.patch b/ports/ffmpeg/0004-fix-debug-build.patch index 6fe0780db17aff..e1e7b7df079292 100644 --- a/ports/ffmpeg/0004-fix-debug-build.patch +++ b/ports/ffmpeg/0004-fix-debug-build.patch @@ -12,16 +12,22 @@ index bd2de34..fba948a 100755 *) optname="${opt%%=*}" optname="${optname#--}" -@@ -6152,8 +6155,13 @@ fi +@@ -6150,10 +6153,17 @@ + fi + fi - enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || - check_lib zlib zlib.h zlibVersion -lz; } +-enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || +- check_lib zlib zlib.h zlibVersion -lz; } -enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 -enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma +if enabled debug_configure; then ++ enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || ++ check_lib zlib zlib.h zlibVersion -lzd; } + enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2d + enabled lzma && check_lib lzma lzma.h lzma_version_number -llzmad +else ++ enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || ++ check_lib zlib zlib.h zlibVersion -lz; } + enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 + enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma +fi diff --git a/ports/ffmpeg/0007-fix-lib-naming.patch b/ports/ffmpeg/0007-fix-lib-naming.patch new file mode 100644 index 00000000000000..d2a688cf5068bc --- /dev/null +++ b/ports/ffmpeg/0007-fix-lib-naming.patch @@ -0,0 +1,12 @@ +diff --git a/configure b/configure +index d6c4388..75b96c3 100644 +--- a/configure ++++ b/configure +@@ -4378,6 +4378,7 @@ msvc_common_flags(){ + -march=*) ;; + -lz) echo zlib.lib ;; ++ -lzd) echo zlibd.lib ;; + -lx264) echo libx264.lib ;; + -lstdc++) ;; + -l*) echo ${flag#-l}.lib ;; + -LARGEADDRESSAWARE) echo $flag ;; diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index b48e2d42bfaf79..a1306babd99c88 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,7 +1,6 @@ Source: ffmpeg Version: 4.2 -Port-Version: 14 -Build-Depends: zlib +Port-Version: 15 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. @@ -62,3 +61,7 @@ Description: Hardware accelerated codecs Feature: avisynthplus Build-Depends: avisynthplus, ffmpeg[gpl] Description: avisynthplus support in ffmpeg + +Feature: zlib +Build-Depends: zlib +Description: zlib support in ffmpeg diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 14eb4ae100299b..727042af023cdd 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_github( 0004-fix-debug-build.patch 0005-fix-libvpx-linking.patch 0006-fix-StaticFeatures.patch + 0007-fix-lib-naming.patch ) if (${SOURCE_PATH} MATCHES " ") @@ -147,6 +148,12 @@ else() set(OPTIONS "${OPTIONS} --disable-avisynth") endif() +if("zlib" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-zlib") +else() + set(OPTIONS "${OPTIONS} --disable-zlib") +endif() + set(OPTIONS_CROSS "") if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") From fbc02376ef8b4460010dea946da89afec16e7b1a Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sun, 10 May 2020 02:56:49 +1000 Subject: [PATCH 03/48] [ffmpeg] Add iconv, fdk-aac, mp3lame, opus, soxr, theora support. Closes #9671 --- ports/ffmpeg/0007-fix-lib-naming.patch | 5 +- ports/ffmpeg/CONTROL | 78 ++++++++++++------- ports/ffmpeg/portfile.cmake | 100 +++++++++++++++++-------- 3 files changed, 123 insertions(+), 60 deletions(-) diff --git a/ports/ffmpeg/0007-fix-lib-naming.patch b/ports/ffmpeg/0007-fix-lib-naming.patch index d2a688cf5068bc..f4cc5e94efcbbd 100644 --- a/ports/ffmpeg/0007-fix-lib-naming.patch +++ b/ports/ffmpeg/0007-fix-lib-naming.patch @@ -2,11 +2,14 @@ diff --git a/configure b/configure index d6c4388..75b96c3 100644 --- a/configure +++ b/configure -@@ -4378,6 +4378,7 @@ msvc_common_flags(){ +@@ -4378,6 +4378,10 @@ msvc_common_flags(){ -march=*) ;; -lz) echo zlib.lib ;; + -lzd) echo zlibd.lib ;; -lx264) echo libx264.lib ;; ++ -lx265) echo libx265.lib ;; ++ -lmp3lame) echo libmp3lame.lib ;; ++ -liconv) echo libiconv.lib ;; -lstdc++) ;; -l*) echo ${flag#-l}.lib ;; -LARGEADDRESSAWARE) echo $flag ;; diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index a1306babd99c88..d669ede748b3b6 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -18,49 +18,73 @@ Description: ffplay appplication support in ffmpeg Feature: ffprobe Description: ffprobe appplication support in ffmpeg -Feature: openssl -Build-Depends: openssl, ffmpeg[nonfree] -Description: openssl support in ffmpeg +Feature: avresample +Description: Libav audio resampling library support in ffmpeg -Feature: lzma -Build-Depends: liblzma -Description: lzma support in ffmpeg +Feature: nonfree +Description: allow nonfree and unredistributable libraries + +Feature: gpl +Description: allow GPL licensed libraries + +Feature: version3 +Description: upgrade (L)GPL to version 3 + +Feature: avisynthplus +Build-Depends: avisynthplus, ffmpeg[gpl] +Description: avisynthplus support in ffmpeg Feature: bzip2 Build-Depends: bzip2 Description: bzip2 support in ffmpeg -Feature: vpx -Build-Depends: libvpx -Description: WebM VP8/VP9 support in ffmpeg +Feature: iconv +Build-Depends: libiconv +Description: iconv support in ffmpeg -Feature: x264 -Build-Depends: x264, ffmpeg[gpl] -Description: x264 support in ffmpeg +Feature: fdk-aac +Build-Depends: fdk-aac, ffmpeg[nonfree] +Description: AAC de/encoding via libfdk-aac support in ffmpeg + +Feature: lzma +Build-Depends: liblzma +Description: lzma support in ffmpeg + +Feature: mp3lame +Build-Depends: mp3lame +Description: MP3 encoding via libmp3lame support in ffmpeg + +Feature: nvcodec +Build-Depends: ffnvcodec, cuda +Description: Hardware accelerated codecs Feature: opencl Build-Depends: opencl -Description: opencl support in ffmpeg +Description: OpenCL processing support in ffmpeg -Feature: nonfree -Description: allow nonfree and unredistributable libraries +Feature: openssl +Build-Depends: openssl, ffmpeg[nonfree] +Description: openssl support in ffmpeg -Feature: gpl -Description: allow GPL licensed libraries +Feature: opus +Build-Depends: opus +Description: Opus de/encoding via libopus support in ffmpeg -Feature: version3 -Description: upgrade (L)GPL to version 3 +Feature: soxr +Build-Depends: soxr +Description: libsoxr resampling support in ffmpeg -Feature: avresample -Description: Libav audio resampling library support in ffmpeg +Feature: theora +Build-Depends: libtheora +Description: Theora encoding via libtheora support in ffmpeg -Feature: nvcodec -Build-Depends: ffnvcodec, cuda -Description: Hardware accelerated codecs +Feature: vpx +Build-Depends: libvpx +Description: VP8 and VP9 de/encoding via libvpx support in ffmpeg -Feature: avisynthplus -Build-Depends: avisynthplus, ffmpeg[gpl] -Description: avisynthplus support in ffmpeg +Feature: x264 +Build-Depends: x264, ffmpeg[gpl] +Description: H.264 encoding via x264 support in ffmpeg Feature: zlib Build-Depends: zlib diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 727042af023cdd..5bb7d21cc2fca5 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -37,9 +37,9 @@ if(VCPKG_TARGET_IS_WINDOWS) set(BUILD_SCRIPT ${CMAKE_CURRENT_LIST_DIR}\\build.sh) if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") - vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES perl gcc diffutils make pkg-config) else() - vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make) + vcpkg_acquire_msys(MSYS_ROOT PACKAGES diffutils make pkg-config) endif() set(BASH ${MSYS_ROOT}/usr/bin/bash.exe) @@ -70,12 +70,6 @@ if("version3" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-version3") endif() -if("openssl" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-openssl") -else() - set(OPTIONS "${OPTIONS} --disable-openssl") -endif() - if("ffmpeg" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-ffmpeg") else() @@ -94,22 +88,34 @@ else() set(OPTIONS "${OPTIONS} --disable-ffprobe") endif() -if("vpx" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-libvpx") +if("avresample" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avresample") +endif() + +if("avisynthplus" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-avisynth") else() - set(OPTIONS "${OPTIONS} --disable-libvpx") + set(OPTIONS "${OPTIONS} --disable-avisynth") endif() -if("x264" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-libx264") +set (ENABLE_BZIP2 OFF) +if("bzip2" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-bzlib") + set (ENABLE_BZIP2 ON) #necessary for configuring FFMPEG CMake Module else() - set(OPTIONS "${OPTIONS} --disable-libx264") + set(OPTIONS "${OPTIONS} --disable-bzlib") endif() -if("opencl" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-opencl") +if("iconv" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-iconv") else() - set(OPTIONS "${OPTIONS} --disable-opencl") + set(OPTIONS "${OPTIONS} --disable-iconv") +endif() + +if("fdk-aac" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libfdk-aac") +else() + set(OPTIONS "${OPTIONS} --disable-libfdk-aac") endif() set (ENABLE_LZMA OFF) @@ -120,32 +126,58 @@ else() set(OPTIONS "${OPTIONS} --disable-lzma") endif() -set (ENABLE_BZIP2 OFF) -if("bzip2" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-bzlib") - set (ENABLE_BZIP2 ON) #necessary for configuring FFMPEG CMake Module +if("mp3lame" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libmp3lame") else() - set(OPTIONS "${OPTIONS} --disable-bzlib") + set(OPTIONS "${OPTIONS} --disable-libmp3lame") endif() -if("avresample" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avresample") +if("nvcodec" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-cuvid --disable-libnpp") +else() + set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp") endif() -if (VCPKG_TARGET_IS_OSX) - set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX +if("opencl" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-opencl") +else() + set(OPTIONS "${OPTIONS} --disable-opencl") endif() -if("nvcodec" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-cuvid --disable-libnpp") +if("openssl" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-openssl") else() - set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp") + set(OPTIONS "${OPTIONS} --disable-openssl") endif() -if("avisynthplus" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-avisynth") +if("opus" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libopus") else() - set(OPTIONS "${OPTIONS} --disable-avisynth") + set(OPTIONS "${OPTIONS} --disable-libopus") +endif() + +if("soxr" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libsoxr") +else() + set(OPTIONS "${OPTIONS} --disable-libsoxr") +endif() + +if("theora" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libtheora") +else() + set(OPTIONS "${OPTIONS} --disable-libtheora") +endif() + +if("vpx" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libvpx") +else() + set(OPTIONS "${OPTIONS} --disable-libvpx") +endif() + +if("x264" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libx264") +else() + set(OPTIONS "${OPTIONS} --disable-libx264") endif() if("zlib" IN_LIST FEATURES) @@ -154,6 +186,10 @@ else() set(OPTIONS "${OPTIONS} --disable-zlib") endif() +if (VCPKG_TARGET_IS_OSX) + set(OPTIONS "${OPTIONS} --disable-vdpau") # disable vdpau in OSX +endif() + set(OPTIONS_CROSS "") if (VCPKG_TARGET_ARCHITECTURE STREQUAL "arm" OR VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64") From 32220e089d0b7887d264c1f158a2598d7fda7473 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 30 Jun 2020 20:10:13 +1000 Subject: [PATCH 04/48] [ffmpeg] Add x265 support. --- ports/ffmpeg/CONTROL | 4 ++++ ports/ffmpeg/portfile.cmake | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index d669ede748b3b6..4073264d66f6b8 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -86,6 +86,10 @@ Feature: x264 Build-Depends: x264, ffmpeg[gpl] Description: H.264 encoding via x264 support in ffmpeg +Feature: x265 +Build-Depends: x265, ffmpeg[gpl] +Description: HEVC encoding via x265 support in ffmpeg + Feature: zlib Build-Depends: zlib Description: zlib support in ffmpeg diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 5bb7d21cc2fca5..c2710a4a2af346 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -180,6 +180,12 @@ else() set(OPTIONS "${OPTIONS} --disable-libx264") endif() +if("x265" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libx265") +else() + set(OPTIONS "${OPTIONS} --disable-libx265") +endif() + if("zlib" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-zlib") else() From 2f884e99a62394236a850d24049516184b9fefe3 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 16:04:55 +1000 Subject: [PATCH 05/48] [ffmpeg] Fix zlib detection on linux --- ports/ffmpeg/0004-fix-debug-build.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/ffmpeg/0004-fix-debug-build.patch b/ports/ffmpeg/0004-fix-debug-build.patch index e1e7b7df079292..bd9bf928d2a61e 100644 --- a/ports/ffmpeg/0004-fix-debug-build.patch +++ b/ports/ffmpeg/0004-fix-debug-build.patch @@ -12,7 +12,7 @@ index bd2de34..fba948a 100755 *) optname="${opt%%=*}" optname="${optname#--}" -@@ -6150,10 +6153,17 @@ +@@ -6150,10 +6153,18 @@ fi fi @@ -22,7 +22,8 @@ index bd2de34..fba948a 100755 -enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma +if enabled debug_configure; then + enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || -+ check_lib zlib zlib.h zlibVersion -lzd; } ++ check_lib zlib zlib.h zlibVersion -lzd || ++ check_lib zlib zlib.h zlibVersion -lz; } + enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2d + enabled lzma && check_lib lzma lzma.h lzma_version_number -llzmad +else From a8accec276c854ae39731becbc9cf91db1784fd0 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 06:19:19 +1000 Subject: [PATCH 06/48] [libogg] Enable creation of pkg-config file --- ports/libogg/CONTROL | 2 +- ports/libogg/portfile.cmake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/libogg/CONTROL b/ports/libogg/CONTROL index bc36d27b6f9304..2a5a5ebe6a3cc1 100644 --- a/ports/libogg/CONTROL +++ b/ports/libogg/CONTROL @@ -1,4 +1,4 @@ Source: libogg -Version: 1.3.4 +Version: 1.3.4-1 Description: Ogg is a multimedia container format, and the native file and stream format for the Xiph.org multimedia codecs. Homepage: https://github.com/xiph/ogg diff --git a/ports/libogg/portfile.cmake b/ports/libogg/portfile.cmake index 476feb7d2d307e..e0014ab6cae897 100644 --- a/ports/libogg/portfile.cmake +++ b/ports/libogg/portfile.cmake @@ -11,7 +11,7 @@ vcpkg_from_github( vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DINSTALL_DOCS=0 -DINSTALL_PKG_CONFIG_MODULE=0 + OPTIONS -DINSTALL_DOCS=0 -DINSTALL_PKG_CONFIG_MODULE=1 ) vcpkg_install_cmake() From fdc43ffacbc09944914a58322cc065deec7d19cd Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 06:21:34 +1000 Subject: [PATCH 07/48] [ffmpeg] Add vorbis feature --- ports/ffmpeg/0007-fix-lib-naming.patch | 3 ++- ports/ffmpeg/CONTROL | 4 ++++ ports/ffmpeg/portfile.cmake | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ports/ffmpeg/0007-fix-lib-naming.patch b/ports/ffmpeg/0007-fix-lib-naming.patch index f4cc5e94efcbbd..c1271f50407c8b 100644 --- a/ports/ffmpeg/0007-fix-lib-naming.patch +++ b/ports/ffmpeg/0007-fix-lib-naming.patch @@ -2,7 +2,7 @@ diff --git a/configure b/configure index d6c4388..75b96c3 100644 --- a/configure +++ b/configure -@@ -4378,6 +4378,10 @@ msvc_common_flags(){ +@@ -4378,6 +4378,11 @@ msvc_common_flags(){ -march=*) ;; -lz) echo zlib.lib ;; + -lzd) echo zlibd.lib ;; @@ -10,6 +10,7 @@ index d6c4388..75b96c3 100644 + -lx265) echo libx265.lib ;; + -lmp3lame) echo libmp3lame.lib ;; + -liconv) echo libiconv.lib ;; ++ -lm) ;; -lstdc++) ;; -l*) echo ${flag#-l}.lib ;; -LARGEADDRESSAWARE) echo $flag ;; diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 4073264d66f6b8..9be08b86074e14 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -78,6 +78,10 @@ Feature: theora Build-Depends: libtheora Description: Theora encoding via libtheora support in ffmpeg +Feature: vorbis +Build-Depends: libvorbis +Description: Vorbis en/decoding via libvorbis support in ffmpeg + Feature: vpx Build-Depends: libvpx Description: VP8 and VP9 de/encoding via libvpx support in ffmpeg diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index c2710a4a2af346..edcaeccc993cdd 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -168,6 +168,12 @@ else() set(OPTIONS "${OPTIONS} --disable-libtheora") endif() +if("vorbis" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libvorbis") +else() + set(OPTIONS "${OPTIONS} --disable-libvorbis") +endif() + if("vpx" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libvpx") else() From 170912266ad517d3fab14885b5bf8489d8284d6d Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 09:14:09 +1000 Subject: [PATCH 08/48] [speex] Enable creation of pkg-config file --- ...ake-pkg-config-lib-name-configurable.patch | 13 ++++++++ ports/speex/CMakeLists.txt | 31 +++++++++++++++++++ ports/speex/CONTROL | 2 +- ports/speex/portfile.cmake | 2 ++ 4 files changed, 47 insertions(+), 1 deletion(-) create mode 100644 ports/speex/0001-make-pkg-config-lib-name-configurable.patch diff --git a/ports/speex/0001-make-pkg-config-lib-name-configurable.patch b/ports/speex/0001-make-pkg-config-lib-name-configurable.patch new file mode 100644 index 00000000000000..72b61f4cc5a4e3 --- /dev/null +++ b/ports/speex/0001-make-pkg-config-lib-name-configurable.patch @@ -0,0 +1,13 @@ +diff --git a/speex.pc.in b/speex.pc.in +index 97bba4f..52a1d3c 100644 +--- a/speex.pc.in ++++ b/speex.pc.in +@@ -10,6 +10,6 @@ Description: Speex is an audio codec tuned for speech + Version: @SPEEX_VERSION@ + Requires: + Conflicts: +-Libs: -L${libdir} -lspeex ++Libs: -L${libdir} -l@SPEEXLIB@ + Libs.private: @LIBM@ + Cflags: -I${includedir} + diff --git a/ports/speex/CMakeLists.txt b/ports/speex/CMakeLists.txt index bdce0b3c3389d9..b151b2439f7077 100644 --- a/ports/speex/CMakeLists.txt +++ b/ports/speex/CMakeLists.txt @@ -1,6 +1,9 @@ cmake_minimum_required (VERSION 3.8.0) project (libspeex C) +include(GNUInstallDirs) +include(CheckLibraryExists) + option(USE_SSE "USE_SSE used Note: USE_SSE and FIXED_POINT are mutually exclusive." ON) if(MSVC) add_definitions(-DHAVE_CONFIG_H) @@ -28,6 +31,15 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/libspeex.def" "speex_header_free\n" ) +file(STRINGS "configure.ac" + _speex_version_defines REGEX "SPEEX_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$") +foreach(ver ${_speex_version_defines}) + if(ver MATCHES "SPEEX_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$") + set(SPEEX_${CMAKE_MATCH_1}_VERSION "${CMAKE_MATCH_2}" CACHE INTERNAL "") + endif() +endforeach() +set(SPEEX_VERSION ${SPEEX_MAJOR_VERSION}.${SPEEX_MINOR_VERSION}.${SPEEX_MICRO_VERSION}) + set(SRC "libspeex/bits.c" "libspeex/cb_search.c" @@ -78,3 +90,22 @@ install( if(NOT DISABLE_INSTALL_HEADERS) install(DIRECTORY include/ DESTINATION include FILES_MATCHING PATTERN "*.h") endif() + +# pkgconfig file +set(prefix ${CMAKE_INSTALL_PREFIX}) +set(exec_prefix ${CMAKE_INSTALL_PREFIX}) +set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}) +set(includedir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) +set(LIBM ) +check_library_exists(m ceil "" LIBMEXIST) +if(LIBMEXIST) + list(APPEND LIBM -lm) +endif() +set(SPEEXLIB "${CMAKE_PROJECT_NAME}") +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(SPEEXLIB "${CMAKE_PROJECT_NAME}d") +endif() +configure_file(speex.pc.in speex.pc @ONLY) +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/speex.pc + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) diff --git a/ports/speex/CONTROL b/ports/speex/CONTROL index 3291927c2888ba..88a6599e753034 100644 --- a/ports/speex/CONTROL +++ b/ports/speex/CONTROL @@ -1,4 +1,4 @@ Source: speex -Version: 1.2.0-4 +Version: 1.2.0-5 Homepage: https://github.com/xiph/speex Description: Speex is an Open Source/Free Software patent-free audio compression format designed for speech. diff --git a/ports/speex/portfile.cmake b/ports/speex/portfile.cmake index 271c2bc8873c5f..a70aa49293e38a 100644 --- a/ports/speex/portfile.cmake +++ b/ports/speex/portfile.cmake @@ -6,6 +6,8 @@ vcpkg_from_github( REF Speex-1.2.0 SHA512 612dfd67a9089f929b7f2a613ed3a1d2fda3d3ec0a4adafe27e2c1f4542de1870b42b8042f0dcb16d52e08313d686cc35b76940776419c775417f5bad18b448f HEAD_REF master + PATCHES + 0001-make-pkg-config-lib-name-configurable.patch ) file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) From 06f073622ab0bfcc8895fd972ffac7af5789d9e8 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 09:17:45 +1000 Subject: [PATCH 09/48] [ffmpeg] Add speex feature --- ports/ffmpeg/CONTROL | 4 ++++ ports/ffmpeg/portfile.cmake | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 9be08b86074e14..94f18763964345 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -74,6 +74,10 @@ Feature: soxr Build-Depends: soxr Description: libsoxr resampling support in ffmpeg +Feature: speex +Build-Depends: speex +Description: Speex de/encoding via libspeex support in ffmpeg + Feature: theora Build-Depends: libtheora Description: Theora encoding via libtheora support in ffmpeg diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index edcaeccc993cdd..7f86c812764c5a 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -162,6 +162,12 @@ else() set(OPTIONS "${OPTIONS} --disable-libsoxr") endif() +if("speex" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libspeex") +else() + set(OPTIONS "${OPTIONS} --disable-libspeex") +endif() + if("theora" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libtheora") else() From 97cf69a77005c508031c590356c7248b24df8cbf Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 09:51:18 +1000 Subject: [PATCH 10/48] [ffmpeg] Add snappy feature --- ports/ffmpeg/0004-fix-debug-build.patch | 13 +++++++++++++ ports/ffmpeg/CONTROL | 4 ++++ ports/ffmpeg/portfile.cmake | 6 ++++++ 3 files changed, 23 insertions(+) diff --git a/ports/ffmpeg/0004-fix-debug-build.patch b/ports/ffmpeg/0004-fix-debug-build.patch index bd9bf928d2a61e..5d595a743f4426 100644 --- a/ports/ffmpeg/0004-fix-debug-build.patch +++ b/ports/ffmpeg/0004-fix-debug-build.patch @@ -35,3 +35,16 @@ index bd2de34..fba948a 100755 # On some systems dynamic loading requires no extra linker flags check_lib libdl dlfcn.h "dlopen dlsym" || check_lib libdl dlfcn.h "dlopen dlsym" -ldl +@@ -6350,7 +6350,11 @@ enabled librubberband && require_pkg_config librubberband "rubberband >= 1.8 + enabled libshine && require_pkg_config libshine shine shine/layer3.h shine_encode_buffer + enabled libsmbclient && { check_pkg_config libsmbclient smbclient libsmbclient.h smbc_init || + require libsmbclient libsmbclient.h smbc_init -lsmbclient; } +-enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ ++if enabled debug_configure; then ++ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappyd -lstdc++ ++else ++ enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ ++fi + enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr + enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init + enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 94f18763964345..ab49c4e25c7b5e 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -70,6 +70,10 @@ Feature: opus Build-Depends: opus Description: Opus de/encoding via libopus support in ffmpeg +Feature: snappy +Build-Depends: snappy +Description: Snappy compression, needed for hap encoding support in ffmpeg + Feature: soxr Build-Depends: soxr Description: libsoxr resampling support in ffmpeg diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 7f86c812764c5a..e4c16cc0b8cafd 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -156,6 +156,12 @@ else() set(OPTIONS "${OPTIONS} --disable-libopus") endif() +if("snappy" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libsnappy") +else() + set(OPTIONS "${OPTIONS} --disable-libsnappy") +endif() + if("soxr" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libsoxr") else() From 59192011bddc1f07e377219ee7b932f4af5b0374 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 10:48:38 +1000 Subject: [PATCH 11/48] [ffmpeg] Add wavpack feature --- ports/ffmpeg/0008-Fix-wavpack-detection.patch | 27 +++++++++++++++++++ ports/ffmpeg/CONTROL | 4 +++ ports/ffmpeg/portfile.cmake | 7 +++++ 3 files changed, 38 insertions(+) create mode 100644 ports/ffmpeg/0008-Fix-wavpack-detection.patch diff --git a/ports/ffmpeg/0008-Fix-wavpack-detection.patch b/ports/ffmpeg/0008-Fix-wavpack-detection.patch new file mode 100644 index 00000000000000..bb7baf4f511110 --- /dev/null +++ b/ports/ffmpeg/0008-Fix-wavpack-detection.patch @@ -0,0 +1,27 @@ +diff --git a/configure b/configure +index e7162dbc56..0f04af2a81 100755 +--- a/configure ++++ b/configure +@@ -6391,7 +6391,7 @@ enabled libvpx && { + fi + } + +-enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack ++enabled libwavpack && { check_lib libwavpack wavpack.h WavpackOpenFileOutput -lwavpack || check_lib libwavpack wavpack.h WavpackOpenFileOutput -llibwavpack || require libwavpack wavpack.h WavpackOpenFileOutput -lwavpackdll; } + enabled libwebp && { + enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion + enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } +diff --git a/libavcodec/libwavpackenc.c b/libavcodec/libwavpackenc.c +index e84b074893..9adf39861b 100644 +--- a/libavcodec/libwavpackenc.c ++++ b/libavcodec/libwavpackenc.c +@@ -16,7 +16,7 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +-#include ++#include + #include + + #include "libavutil/attributes.h" + diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index ab49c4e25c7b5e..577c0c588f6f7e 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -94,6 +94,10 @@ Feature: vpx Build-Depends: libvpx Description: VP8 and VP9 de/encoding via libvpx support in ffmpeg +Feature: wavpack +Build-Depends: wavpack +Description: wavpack encoding via libwavpack support in ffmpeg + Feature: x264 Build-Depends: x264, ffmpeg[gpl] Description: H.264 encoding via x264 support in ffmpeg diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index e4c16cc0b8cafd..df2cb2163dc50a 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -11,6 +11,7 @@ vcpkg_from_github( 0005-fix-libvpx-linking.patch 0006-fix-StaticFeatures.patch 0007-fix-lib-naming.patch + 0008-Fix-wavpack-detection.patch ) if (${SOURCE_PATH} MATCHES " ") @@ -192,6 +193,12 @@ else() set(OPTIONS "${OPTIONS} --disable-libvpx") endif() +if("wavpack" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-libwavpack") +else() + set(OPTIONS "${OPTIONS} --disable-libwavpack") +endif() + if("x264" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libx264") else() From a4a6df7c34fd5fea6634af170f417c6116a6f896 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 16:03:18 +1000 Subject: [PATCH 12/48] [ffmpeg] Fix linking to static dependencies using pkg-config --- ports/ffmpeg/portfile.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index df2cb2163dc50a..9196a87794f7b9 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -266,6 +266,10 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() endif() +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + set(OPTIONS "${OPTIONS} --pkg-config-flags=--static") +endif() + set(ENV_LIB_PATH "$ENV{${LIB_PATH_VAR}}") set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig") From 28c664f84529aab59daad6862c5618791858f661 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 16:04:01 +1000 Subject: [PATCH 13/48] [ffmpeg] Fix opencl detection on linux --- ports/ffmpeg/0006-fix-StaticFeatures.patch | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ports/ffmpeg/0006-fix-StaticFeatures.patch b/ports/ffmpeg/0006-fix-StaticFeatures.patch index 9fffd9d7e51ae4..e31de6a2493a66 100644 --- a/ports/ffmpeg/0006-fix-StaticFeatures.patch +++ b/ports/ffmpeg/0006-fix-StaticFeatures.patch @@ -2,15 +2,16 @@ diff --git a/configure b/configure index 3bdcfc6..00b2f13 100644 --- a/configure +++ b/configure -@@ -6360,6 +6360,7 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" +@@ -6360,6 +6360,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel || check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL || check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL || + check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -lAdvapi32 -lOle32 -lCfgmgr32|| ++ check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL -pthread -ldl || die "ERROR: opencl not found"; } && { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" || test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" || -@@ -6379,6 +6380,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP +@@ -6379,6 +6381,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || From f2416cbd1149ddca5b43ecf19db78c24807f7544 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 11 May 2020 16:04:24 +1000 Subject: [PATCH 14/48] [ffmpeg] Fix soxr linking on linux --- ports/ffmpeg/0006-fix-StaticFeatures.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/ffmpeg/0006-fix-StaticFeatures.patch b/ports/ffmpeg/0006-fix-StaticFeatures.patch index e31de6a2493a66..ade0efc4a660e5 100644 --- a/ports/ffmpeg/0006-fix-StaticFeatures.patch +++ b/ports/ffmpeg/0006-fix-StaticFeatures.patch @@ -2,6 +2,15 @@ diff --git a/configure b/configure index 3bdcfc6..00b2f13 100644 --- a/configure +++ b/configure +@@ -6292,7 +6292,7 @@ if enabled debug_configure; then + else + enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ + fi +-enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr ++enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr -lm + enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init + enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init + enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket @@ -6360,6 +6360,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel || check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL || From 4992c67d509f59d6d2faf03a5b6304427dd2d216 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 12 May 2020 16:45:57 +1000 Subject: [PATCH 15/48] [ffmpeg] Fix FindFFmpeg.cmake * Adds postproc to list of searched libs * Adds missing windows dependency libs * Fixes detection of seperate debug/release libs --- ports/ffmpeg/FindFFMPEG.cmake.in | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index 413c2bee7fa695..65bc36b412c8a2 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -55,20 +55,30 @@ endif() # Platform dependent libraries required by FFMPEG if(WIN32) if(NOT CYGWIN) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 secur32 bcrypt) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS wsock32 ws2_32 secur32 bcrypt strmiids Vfw32 Shlwapi) endif() else() list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS m) endif() +# Compute the installation prefix relative to this file. +get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) +if(_IMPORT_PREFIX STREQUAL "/") + set(_IMPORT_PREFIX "") +endif() + +set(_IMPORT_PREFIX) + macro(FFMPEG_FIND varname shortname headername) if(NOT FFMPEG_${varname}_INCLUDE_DIRS) - find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATH_SUFFIXES ffmpeg) + find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATHS ${_IMPORT_PREFIX}/include NO_DEFAULT_PATH) endif() if(NOT FFMPEG_${varname}_LIBRARY) - find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATH_SUFFIXES ffmpeg ffmpeg/lib) + find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname} PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) get_filename_component(FFMPEG_${varname}_LIBRARY_RELEASE_DIR ${FFMPEG_${varname}_LIBRARY_RELEASE} DIRECTORY) - find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS debug PATH_SUFFIXES ffmpeg ffmpeg/lib ffmpeg/debug/lib debug/ffmpeg/lib) get_filename_component(FFMPEG_${varname}_LIBRARY_DEBUG_DIR ${FFMPEG_${varname}_LIBRARY_DEBUG} DIRECTORY) select_library_configurations(FFMPEG_${varname}) endif() @@ -139,6 +149,7 @@ FFMPEG_FIND(libavresample avresample avresample.h) FFMPEG_FIND(libavutil avutil avutil.h) FFMPEG_FIND(libswresample swresample swresample.h) FFMPEG_FIND(libswscale swscale swscale.h) +FFMPEG_FIND(libpostproc postproc postprocess.h) if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_FOUND AND FFMPEG_libavformat_FOUND AND FFMPEG_libavutil_FOUND AND FFMPEG_libswresample_FOUND AND FFMPEG_libswscale_FOUND AND FFMPEG_libzlib_FOUND) list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS} ${FFMPEG_libavdevice_INCLUDE_DIRS} ${FFMPEG_libavcodec_INCLUDE_DIRS} ${FFMPEG_libavutil_INCLUDE_DIRS} ${FFMPEG_libswscale_INCLUDE_DIRS}) From d9c1675b0d5780fd691bdc8e4a8a0a4cdc34e80e Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 12 May 2020 16:47:51 +1000 Subject: [PATCH 16/48] [ffmpeg] Add optional dependencies to FindFFmpeg.cmake --- ports/ffmpeg/FindFFMPEG.cmake.in | 185 ++++++++++++++++++++++--------- ports/ffmpeg/portfile.cmake | 45 +++++++- 2 files changed, 174 insertions(+), 56 deletions(-) diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index 65bc36b412c8a2..8a223b178fbf37 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -33,11 +33,7 @@ set(FFMPEG_VERSION "4.2") find_dependency(Threads) if(UNIX) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread) -endif() - -if(UNIX AND NOT APPLE) - list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -lX11) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS -pthread -lX11) endif() if(@ENABLE_BZIP2@) @@ -47,11 +43,137 @@ if(@ENABLE_BZIP2@) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${BZip2_LIBRARY_DEBUG}>$<$:${BZip2_LIBRARY_RELEASE}>") endif() +if(@ENABLE_ICONV@) + find_dependency(unofficial-iconv) + get_target_property(ICONV_LIBRARY_RELEASE unofficial::iconv::libiconv IMPORTED_LOCATION_RELEASE) + get_target_property(ICONV_LIBRARY_DEBUG unofficial::iconv::libiconv IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${ICONV_LIBRARY_DEBUG}>$<$:${ICONV_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_FDKAAC@) + find_library(FDK_LIBRARY_RELEASE NAMES fdk-aac PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(FDK_LIBRARY_DEBUG NAMES fdk-aac PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(FDK) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${FDK_LIBRARY_DEBUG}>$<$:${FDK_LIBRARY_RELEASE}>") +endif() + if(@ENABLE_LZMA@) find_dependency(LibLZMA) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${LibLZMA_LIBRARY_DEBUG}>$<$:${LibLZMA_LIBRARY_RELEASE}>") endif() +if(@ENABLE_LAME@) + find_dependency(mp3lame) + get_target_property(LAME_LIBRARY_RELEASE mp3lame::mp3lame IMPORTED_LOCATION_RELEASE) + get_target_property(LAME_LIBRARY_DEBUG mp3lame::mp3lame IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${LAME_LIBRARY_DEBUG}>$<$:${LAME_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_OPENCL@) + find_dependency(OpenCL) + get_target_property(OPENCL_LIBRARY_RELEASE OpenCL::OpenCL IMPORTED_LOCATION_RELEASE) + get_target_property(OPENCL_LIBRARY_DEBUG OpenCL::OpenCL IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${OPENCL_LIBRARY_DEBUG}>$<$:${OPENCL_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_OPENSSL@) + find_dependency(OpenSSL) + get_target_property(LIBSSL_LIBRARY_RELEASE OpenSSL::SSL IMPORTED_LOCATION_RELEASE) + get_target_property(LIBSSL_LIBRARY_DEBUG OpenSSL::SSL IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${LIBSSL_LIBRARY_DEBUG}>$<$:${LIBSSL_LIBRARY_RELEASE}>") + get_target_property(LIBCRYPTO_LIBRARY_RELEASE OpenSSL::Crypto IMPORTED_LOCATION_RELEASE) + get_target_property(LIBCRYPTO_LIBRARY_DEBUG OpenSSL::Crypto IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${LIBCRYPTO_LIBRARY_DEBUG}>$<$:${LIBCRYPTO_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_OPUS@) + find_dependency(Opus) + get_target_property(OPUS_LIBRARY_RELEASE Opus::opus IMPORTED_LOCATION_RELEASE) + get_target_property(OPUS_LIBRARY_DEBUG Opus::opus IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${OPUS_LIBRARY_DEBUG}>$<$:${OPUS_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SNAPPY@) + find_dependency(Snappy) + get_target_property(SNAPPY_LIBRARY_RELEASE Snappy::snappy IMPORTED_LOCATION_RELEASE) + get_target_property(SNAPPY_LIBRARY_DEBUG Snappy::snappy IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${SNAPPY_LIBRARY_DEBUG}>$<$:${SNAPPY_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SOXR@) + find_library(SOXR_LIBRARY_RELEASE NAMES soxr PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(SOXR_LIBRARY_DEBUG NAMES soxr PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(SOXR) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${SOXR_LIBRARY_DEBUG}>$<$:${SOXR_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_SPEEX@) + find_library(SPEEX_LIBRARY_RELEASE NAMES speex libspeex PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(SPEEX_LIBRARY_DEBUG NAMES speex libspeex PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(SPEEX) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${SPEEX_LIBRARY_DEBUG}>$<$:${SPEEX_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_THEORA@) + find_library(THEORA_LIBRARY_RELEASE NAMES theora PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(THEORA_LIBRARY_DEBUG NAMES theora PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(SPEEX) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${THEORA_LIBRARY_DEBUG}>$<$:${THEORA_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_VORBIS@) + find_dependency(Vorbis) + get_target_property(VORBIS_LIBRARY_RELEASE Vorbis::vorbis IMPORTED_LOCATION_RELEASE) + get_target_property(VORBIS_LIBRARY_DEBUG Vorbis::vorbis IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${VORBIS_LIBRARY_DEBUG}>$<$:${VORBIS_LIBRARY_RELEASE}>") + get_target_property(VORBISENC_LIBRARY_RELEASE Vorbis::vorbisenc IMPORTED_LOCATION_RELEASE) + get_target_property(VORBISENC_LIBRARY_DEBUG Vorbis::vorbisenc IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${VORBISENC_LIBRARY_DEBUG}>$<$:${VORBISENC_LIBRARY_RELEASE}>") + get_target_property(VORBIS_DEP_LIBRARIES Vorbis::vorbis INTERFACE_LINK_LIBRARIES) + foreach(deps ${VORBIS_DEP_LIBRARIES}) + if(TARGET ${deps}) + get_target_property(VORBIS_DEP_LIBRARY_RELEASE ${deps} IMPORTED_LOCATION_RELEASE) + get_target_property(VORBIS_DEP_LIBRARY_DEBUG ${deps} INTERFACE_LINK_LIBRARIES) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${VORBIS_DEP_LIBRARY_DEBUG}>$<$:${VORBIS_DEP_LIBRARY_RELEASE}>") + endif() + endforeach() +endif() + +if(@ENABLE_VPX@) + find_library(VPX_LIBRARY_RELEASE NAMES vpx vpxmt PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(VPX_LIBRARY_DEBUG NAMES vpx vpxmt PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(VPX) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${VPX_LIBRARY_DEBUG}>$<$:${VPX_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_WAVPACK@) + find_dependency(wavpack) + get_target_property(WAVPACK_LIBRARY_RELEASE Wavpack::wavpack IMPORTED_LOCATION_RELEASE) + get_target_property(WAVPACK_LIBRARY_DEBUG Wavpack::wavpack IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${WAVPACK_LIBRARY_DEBUG}>$<$:${WAVPACK_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_X264@) + find_library(X264_LIBRARY_RELEASE NAMES x264 libx264 PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(X264_LIBRARY_DEBUG NAMES x264 libx264 PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(X264) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${X264_LIBRARY_DEBUG}>$<$:${X264_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_X265@) + find_library(X265_LIBRARY_RELEASE NAMES x265 x265-static PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(X265_LIBRARY_DEBUG NAMES x265 x265-static PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + select_library_configurations(X265) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${X265_LIBRARY_DEBUG}>$<$:${X265_LIBRARY_RELEASE}>") +endif() + +if(@ENABLE_ZLIB@) + find_dependency(ZLIB) + get_target_property(ZLIB_LIBRARY_RELEASE ZLIB::ZLIB IMPORTED_LOCATION_RELEASE) + get_target_property(ZLIB_LIBRARY_DEBUG ZLIB::ZLIB IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${ZLIB_LIBRARY_DEBUG}>$<$:${ZLIB_LIBRARY_RELEASE}>") +endif() + # Platform dependent libraries required by FFMPEG if(WIN32) if(NOT CYGWIN) @@ -83,35 +205,13 @@ macro(FFMPEG_FIND varname shortname headername) select_library_configurations(FFMPEG_${varname}) endif() if (FFMPEG_${varname}_LIBRARY AND FFMPEG_${varname}_INCLUDE_DIRS) - set(FFMPEG_${varname}_FOUND 1) + set(FFMPEG_${varname}_FOUND TRUE BOOL) + list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_${varname}_INCLUDE_DIRS}) + list(APPEND FFMPEG_LIBRARIES ${FFMPEG_${varname}_LIBRARY}) list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR}) endif() endmacro(FFMPEG_FIND) -macro(FFMPEG_FIND_GENEX varname shortname headername) - if(NOT FFMPEG_${varname}_INCLUDE_DIRS) - find_path(FFMPEG_${varname}_INCLUDE_DIRS NAMES lib${shortname}/${headername} ${headername} PATH_SUFFIXES ffmpeg) - endif() - if(NOT FFMPEG_${varname}_LIBRARY) - find_library(FFMPEG_${varname}_LIBRARY_RELEASE NAMES ${shortname} PATH_SUFFIXES ffmpeg ffmpeg/lib) - get_filename_component(FFMPEG_${varname}_LIBRARY_RELEASE_DIR ${FFMPEG_${varname}_LIBRARY_RELEASE} DIRECTORY) - find_library(FFMPEG_${varname}_LIBRARY_DEBUG NAMES ${shortname}d ${shortname} PATHS debug PATH_SUFFIXES ffmpeg ffmpeg/lib ffmpeg/debug/lib debug/ffmpeg/lib) - get_filename_component(FFMPEG_${varname}_LIBRARY_DEBUG_DIR ${FFMPEG_${varname}_LIBRARY_DEBUG} DIRECTORY) - set(FFMPEG_${varname}_LIBRARY "$<$:${FFMPEG_${varname}_LIBRARY_DEBUG}>$<$:${FFMPEG_${varname}_LIBRARY_RELEASE}>" CACHE STRING "") - set(FFMPEG_${varname}_LIBRARIES ${FFMPEG_${varname}_LIBRARY} CACHE STRING "") - endif() - if (FFMPEG_${varname}_LIBRARY AND FFMPEG_${varname}_INCLUDE_DIRS) - set(FFMPEG_${varname}_FOUND 1) - list(APPEND FFMPEG_LIBRARY_DIRS ${FFMPEG_${varname}_LIBRARY_RELEASE_DIR} ${FFMPEG_${varname}_LIBRARY_DEBUG_DIR}) - endif() -endmacro(FFMPEG_FIND_GENEX) - -if(WIN32) - FFMPEG_FIND_GENEX(libzlib zlib zlib.h) -else() - FFMPEG_FIND_GENEX(libzlib z zlib.h) -endif() - if(APPLE) find_library(VT_UNIT VideoToolbox) if (NOT VT_UNIT) @@ -151,36 +251,17 @@ FFMPEG_FIND(libswresample swresample swresample.h) FFMPEG_FIND(libswscale swscale swscale.h) FFMPEG_FIND(libpostproc postproc postprocess.h) -if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_FOUND AND FFMPEG_libavformat_FOUND AND FFMPEG_libavutil_FOUND AND FFMPEG_libswresample_FOUND AND FFMPEG_libswscale_FOUND AND FFMPEG_libzlib_FOUND) - list(APPEND FFMPEG_INCLUDE_DIRS ${FFMPEG_libavformat_INCLUDE_DIRS} ${FFMPEG_libavdevice_INCLUDE_DIRS} ${FFMPEG_libavcodec_INCLUDE_DIRS} ${FFMPEG_libavutil_INCLUDE_DIRS} ${FFMPEG_libswscale_INCLUDE_DIRS}) +if (FFMPEG_libavcodec_FOUND AND FFMPEG_libavdevice_FOUND AND FFMPEG_libavfilter_FOUND AND FFMPEG_libavformat_FOUND AND FFMPEG_libavutil_FOUND AND FFMPEG_libswresample_FOUND AND FFMPEG_libswscale_FOUND AND FFMPEG_libpostproc_FOUND) list(REMOVE_DUPLICATES FFMPEG_INCLUDE_DIRS) list(REMOVE_DUPLICATES FFMPEG_LIBRARY_DIRS) - set(FFMPEG_libavcodec_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavdevice_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavfilter_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libavformat_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - if(FFMPEG_libavresample_FOUND) - set(FFMPEG_libavresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - endif() - set(FFMPEG_libavutil_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libswresample_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - set(FFMPEG_libswscale_VERSION "${FFMPEG_VERSION}" CACHE STRING "") - list(APPEND FFMPEG_LIBRARIES - ${FFMPEG_libavdevice_LIBRARY} - ${FFMPEG_libavfilter_LIBRARY} - ${FFMPEG_libavformat_LIBRARY} - ${FFMPEG_libswscale_LIBRARY} - ${FFMPEG_libavcodec_LIBRARY} - ${FFMPEG_libswresample_LIBRARY} - ${FFMPEG_libavresample_LIBRARY} - ${FFMPEG_libavutil_LIBRARY} - ${FFMPEG_libzlib_LIBRARY} ${FFMPEG_PLATFORM_DEPENDENT_LIBS} ) + set(FFMPEG_LIBRARY ${FFMPEG_LIBRARIES}) + set(FFMPEG_FOUND TRUE CACHE BOOL "") set(FFMPEG_LIBRARIES ${FFMPEG_LIBRARIES} CACHE STRING "") set(FFMPEG_INCLUDE_DIRS ${FFMPEG_INCLUDE_DIRS} CACHE STRING "") set(FFMPEG_LIBRARY_DIRS ${FFMPEG_LIBRARY_DIRS} CACHE STRING "") diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 9196a87794f7b9..05113d00deed15 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -99,36 +99,47 @@ else() set(OPTIONS "${OPTIONS} --disable-avisynth") endif() -set (ENABLE_BZIP2 OFF) +set(STATIC_LINKAGE OFF) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") +set(STATIC_LINKAGE ON) +endif() + +set(ENABLE_BZIP2 OFF) if("bzip2" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-bzlib") - set (ENABLE_BZIP2 ON) #necessary for configuring FFMPEG CMake Module + set(ENABLE_BZIP2 ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-bzlib") endif() +set(ENABLE_ICONV OFF) if("iconv" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-iconv") + set(ENABLE_ICONV ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-iconv") endif() +set(ENABLE_FDKAAC OFF) if("fdk-aac" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libfdk-aac") + set(ENABLE_FDKAAC ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libfdk-aac") endif() -set (ENABLE_LZMA OFF) +set(ENABLE_LZMA OFF) if("lzma" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-lzma") - set (ENABLE_LZMA ON) #necessary for configuring FFMPEG CMake Module + set(ENABLE_LZMA ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-lzma") endif() +set(ENABLE_LAME OFF) if("mp3lame" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libmp3lame") + set(ENABLE_LAME ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libmp3lame") endif() @@ -139,80 +150,106 @@ else() set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp") endif() +set(ENABLE_OPENCL OFF) if("opencl" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-opencl") + set(ENABLE_OPENCL ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-opencl") endif() +set(ENABLE_OPENSSL OFF) if("openssl" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-openssl") + set(ENABLE_OPENSSL ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-openssl") endif() +set(ENABLE_OPUS OFF) if("opus" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libopus") + set(ENABLE_OPUS ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libopus") endif() +set(ENABLE_SNAPPY OFF) if("snappy" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libsnappy") + set(ENABLE_SNAPPY ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libsnappy") endif() +set(ENABLE_SOXR OFF) if("soxr" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libsoxr") + set(ENABLE_SOXR ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libsoxr") endif() +set(ENABLE_SPEEX OFF) if("speex" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libspeex") + set(ENABLE_SPEEX ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libspeex") endif() +set(ENABLE_THEORA OFF) if("theora" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libtheora") + set(ENABLE_THEORA ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libtheora") endif() +set(ENABLE_VORBIS OFF) if("vorbis" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libvorbis") + set(ENABLE_VORBIS ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libvorbis") endif() +set(ENABLE_VPX OFF) if("vpx" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libvpx") + set(ENABLE_VPX ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libvpx") endif() +set(ENABLE_WAVPACK OFF) if("wavpack" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libwavpack") + set(ENABLE_WAVPACK ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libwavpack") endif() +set(ENABLE_X264 OFF) if("x264" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libx264") + set(ENABLE_X264 ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libx264") endif() +set(ENABLE_X265 OFF) if("x265" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libx265") + set(ENABLE_X265 ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-libx265") endif() +set(ENABLE_ZLIB OFF) if("zlib" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-zlib") + set(ENABLE_ZLIB ${STATIC_LINKAGE}) else() set(OPTIONS "${OPTIONS} --disable-zlib") endif() From 4e1ac0ccc2ea3cf31556d0b27c4bc1aafd50f4b3 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 12 May 2020 19:45:31 +1000 Subject: [PATCH 17/48] [fdkaac] Correct header installation directory This matches the installation directory used by the default fdkaac build scripts and is required for other existing projects attempting to find it. --- ports/fdk-aac/CMakeLists.txt | 2 +- ports/fdk-aac/CONTROL | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/fdk-aac/CMakeLists.txt b/ports/fdk-aac/CMakeLists.txt index a7f6c09b2c197a..67db1b323093fc 100644 --- a/ports/fdk-aac/CMakeLists.txt +++ b/ports/fdk-aac/CMakeLists.txt @@ -198,6 +198,6 @@ if(NOT DISABLE_INSTALL_HEADERS) libSYS/include/FDK_audio.h libSYS/include/genericStds.h libSYS/include/machine_type.h - DESTINATION include + DESTINATION include/fdk-aac ) endif() diff --git a/ports/fdk-aac/CONTROL b/ports/fdk-aac/CONTROL index c7262f86132d2b..fe523b9b8101b3 100644 --- a/ports/fdk-aac/CONTROL +++ b/ports/fdk-aac/CONTROL @@ -1,4 +1,4 @@ Source: fdk-aac -Version: 2018-07-08-1 +Version: 2018-07-08-2 Homepage: https://github.com/mstorsjo/fdk-aac Description: A standalone library of the Fraunhofer FDK AAC code From fb36501bc0a79817391dfae18a087899cbf3bc3b Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 12 May 2020 20:13:22 +1000 Subject: [PATCH 18/48] [sdl2] Enable creation of pkg-config file on windows --- ...-creation-of-pkg-cfg-file-on-windows.patch | 33 +++++++++++++++++++ ports/sdl2/CONTROL | 2 +- ports/sdl2/portfile.cmake | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 ports/sdl2/0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch diff --git a/ports/sdl2/0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch b/ports/sdl2/0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch new file mode 100644 index 00000000000000..064885b08cded4 --- /dev/null +++ b/ports/sdl2/0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch @@ -0,0 +1,33 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 7dfd35389..7944f401b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1916,9 +1916,10 @@ listtostr(EXTRA_CFLAGS _EXTRA_CFLAGS) + set(EXTRA_CFLAGS ${_EXTRA_CFLAGS}) + + # Compat helpers for the configuration files +-if(NOT WINDOWS OR CYGWIN) + # TODO: we need a Windows script, too ++ if(NOT WINDOWS OR CYGWIN) + execute_process(COMMAND sh ${SDL2_SOURCE_DIR}/build-scripts/updaterev.sh) ++ endif() + + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(exec_prefix "\${prefix}") +@@ -1960,7 +1961,6 @@ if(NOT WINDOWS OR CYGWIN) + "${SDL2_BINARY_DIR}/sdl2-config" @ONLY) + configure_file("${SDL2_SOURCE_DIR}/SDL2.spec.in" + "${SDL2_BINARY_DIR}/SDL2.spec" @ONLY) +-endif() + + ##### Info output ##### + message(STATUS "") +@@ -2198,6 +2198,7 @@ if(NOT (WINDOWS OR CYGWIN)) + # TODO: what about the .spec file? Is it only needed for RPM creation? + install(FILES "${SDL2_SOURCE_DIR}/sdl2.m4" DESTINATION "${CMAKE_INSTALL_FULL_DATAROOTDIR}/aclocal") + endif() ++install(FILES ${SDL2_BINARY_DIR}/sdl2.pc DESTINATION "lib${LIB_SUFFIX}/pkgconfig") + + ##### Uninstall target ##### + + diff --git a/ports/sdl2/CONTROL b/ports/sdl2/CONTROL index f9bdadb699e4d8..aad1ec4077fb66 100644 --- a/ports/sdl2/CONTROL +++ b/ports/sdl2/CONTROL @@ -1,5 +1,5 @@ Source: sdl2 -Version: 2.0.12-1 +Version: 2.0.12-2 Homepage: https://www.libsdl.org/download-2.0.php Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index 366ad1e3ad8a04..c974d23dbbec4f 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -15,6 +15,7 @@ vcpkg_extract_source_archive_ex( fix-space-in-path.patch disable-wcslcpy-and-wcslcat-for-windows.patch fix-EventToken-header-reference.patch + 0006-sdl2-Enable-creation-of-pkg-cfg-file-on-windows.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" SDL_STATIC) From 9c63f83100b4d9b46067647df8d1ab01d26162cc Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 12 May 2020 20:35:50 +1000 Subject: [PATCH 19/48] [ffmpeg] Add sdl2 feature --- ports/ffmpeg/CONTROL | 5 +++++ ports/ffmpeg/FindFFMPEG.cmake.in | 7 +++++++ ports/ffmpeg/portfile.cmake | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index 577c0c588f6f7e..eee679528da248 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -13,6 +13,7 @@ Feature: ffserver Description: ffserver appplication support in ffmpeg Feature: ffplay +Build-Depends: ffmpeg[sdl2] Description: ffplay appplication support in ffmpeg Feature: ffprobe @@ -70,6 +71,10 @@ Feature: opus Build-Depends: opus Description: Opus de/encoding via libopus support in ffmpeg +Feature: sdl2 +Build-Depends: sdl2 +Description: sdl2 support in ffmpeg + Feature: snappy Build-Depends: snappy Description: Snappy compression, needed for hap encoding support in ffmpeg diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index 8a223b178fbf37..fa20d745870a04 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -93,6 +93,13 @@ if(@ENABLE_OPUS@) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${OPUS_LIBRARY_DEBUG}>$<$:${OPUS_LIBRARY_RELEASE}>") endif() +if(@ENABLE_SDL2@) + find_dependency(SDL2) + get_target_property(SDL2_LIBRARY_RELEASE SDL2::SDL2 IMPORTED_LOCATION_RELEASE) + get_target_property(SDL2_LIBRARY_DEBUG SDL2::SDL2 IMPORTED_LOCATION_DEBUG) + list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${SDL2_LIBRARY_DEBUG}>$<$:${SDL2_LIBRARY_RELEASE}>") +endif() + if(@ENABLE_SNAPPY@) find_dependency(Snappy) get_target_property(SNAPPY_LIBRARY_RELEASE Snappy::snappy IMPORTED_LOCATION_RELEASE) diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 05113d00deed15..c95288a0359f78 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -174,6 +174,14 @@ else() set(OPTIONS "${OPTIONS} --disable-libopus") endif() +set(ENABLE_SDL2 OFF) +if("sdl2" IN_LIST FEATURES) + set(OPTIONS "${OPTIONS} --enable-sdl2") + set(ENABLE_SDL2 ${STATIC_LINKAGE}) +else() + set(OPTIONS "${OPTIONS} --disable-sdl2") +endif() + set(ENABLE_SNAPPY OFF) if("snappy" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-libsnappy") From 56b9d8ff64c7af3fb5d1304d2c74a1cf6590f5f4 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 12 May 2020 21:33:40 +1000 Subject: [PATCH 20/48] [ffmpeg] Fix detection of static mp3lame --- ports/ffmpeg/0006-fix-StaticFeatures.patch | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/ports/ffmpeg/0006-fix-StaticFeatures.patch b/ports/ffmpeg/0006-fix-StaticFeatures.patch index ade0efc4a660e5..49d06eff346370 100644 --- a/ports/ffmpeg/0006-fix-StaticFeatures.patch +++ b/ports/ffmpeg/0006-fix-StaticFeatures.patch @@ -2,7 +2,17 @@ diff --git a/configure b/configure index 3bdcfc6..00b2f13 100644 --- a/configure +++ b/configure -@@ -6292,7 +6292,7 @@ if enabled debug_configure; then +@@ -6251,7 +6251,8 @@ if enabled libmfx; then + enabled libmfx && { check_pkg_config libmfx libmfx "mfx/mfxvideo.h" MFXInit || + { require libmfx "mfx/mfxvideo.h" MFXInit "-llibmfx $advapi32_extralibs" && warn "using libmfx without pkg-config"; } } + enabled libmodplug && require_pkg_config libmodplug libmodplug libmodplug/modplug.h ModPlug_Load +-enabled libmp3lame && require "libmp3lame >= 3.98.3" lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs ++enabled libmp3lame && { check_lib libmp3lame lame/lame.h lame_set_VBR_quality -lmp3lame $libm_extralibs || ++ require libmp3lame lame/lame.h lame_set_VBR_quality -llibmp3lame-static -llibmpghip-static $libm_extralibs; } + enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_load || + require libmysofa mysofa.h mysofa_load -lmysofa $zlib_extralibs; } + enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei || +@@ -6292,7 +6293,7 @@ if enabled debug_configure; then else enabled libsnappy && require libsnappy snappy-c.h snappy_compress -lsnappy -lstdc++ fi @@ -11,7 +21,7 @@ index 3bdcfc6..00b2f13 100644 enabled libssh && require_pkg_config libssh libssh libssh/sftp.h sftp_init enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init enabled libsrt && require_pkg_config libsrt "srt >= 1.3.0" srt/srt.h srt_socket -@@ -6360,6 +6360,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" +@@ -6360,6 +6361,8 @@ enabled openal && { { for al_extralibs in "${OPENAL_LIBS}" "-lopenal" enabled opencl && { check_pkg_config opencl OpenCL CL/cl.h clEnqueueNDRangeKernel || check_lib opencl OpenCL/cl.h clEnqueueNDRangeKernel -Wl,-framework,OpenCL || check_lib opencl CL/cl.h clEnqueueNDRangeKernel -lOpenCL || @@ -20,7 +30,7 @@ index 3bdcfc6..00b2f13 100644 die "ERROR: opencl not found"; } && { test_cpp_condition "OpenCL/cl.h" "defined(CL_VERSION_1_2)" || test_cpp_condition "CL/cl.h" "defined(CL_VERSION_1_2)" || -@@ -6379,6 +6381,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP +@@ -6379,6 +6382,7 @@ enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OP check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || From 3cce5c37ec97df96e331d86d2af4d27f54fe3988 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 12 May 2020 21:35:05 +1000 Subject: [PATCH 21/48] [ffmpeg] Fix detection of static iconv --- ports/ffmpeg/0006-fix-StaticFeatures.patch | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ports/ffmpeg/0006-fix-StaticFeatures.patch b/ports/ffmpeg/0006-fix-StaticFeatures.patch index 49d06eff346370..bec0303681b9dc 100644 --- a/ports/ffmpeg/0006-fix-StaticFeatures.patch +++ b/ports/ffmpeg/0006-fix-StaticFeatures.patch @@ -38,3 +38,12 @@ index 3bdcfc6..00b2f13 100644 die "ERROR: openssl not found"; } enabled pocketsphinx && require_pkg_config pocketsphinx pocketsphinx pocketsphinx/pocketsphinx.h ps_init enabled rkmpp && { require_pkg_config rkmpp rockchip_mpp rockchip/rk_mpi.h mpp_create && +@@ -6707,7 +6711,7 @@ enabled amf && + if enabled libc_iconv; then + check_func_headers iconv.h iconv + elif enabled iconv; then +- check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv ++ check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv || check_lib iconv iconv.h iconv -liconv -llibcharset + fi + + enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" From d6020391ca5c7f4120ac33d6d3d5316ea41cbfd8 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Thu, 25 Jun 2020 20:51:14 +1000 Subject: [PATCH 22/48] [ffmpeg] Use newer libvpx package detection. --- ports/ffmpeg/FindFFMPEG.cmake.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index fa20d745870a04..927d9b488f8dc7 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -147,9 +147,9 @@ if(@ENABLE_VORBIS@) endif() if(@ENABLE_VPX@) - find_library(VPX_LIBRARY_RELEASE NAMES vpx vpxmt PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) - find_library(VPX_LIBRARY_DEBUG NAMES vpx vpxmt PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) - select_library_configurations(VPX) + find_dependency(unofficial-libvpx) + get_target_property(VPX_LIBRARY_RELEASE unofficial::libvpx::libvpx IMPORTED_LOCATION_RELEASE) + get_target_property(VPX_LIBRARY_DEBUG unofficial::libvpx::libvpx IMPORTED_LOCATION_DEBUG) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${VPX_LIBRARY_DEBUG}>$<$:${VPX_LIBRARY_RELEASE}>") endif() From fddb5e3ea69f1b07f31dc269ab7f11de56ca4262 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Fri, 17 Jul 2020 12:25:24 +1000 Subject: [PATCH 23/48] [ffmpeg] Use newer zlib pkg-config detection. --- ports/ffmpeg/0004-fix-debug-build.patch | 13 +++---------- ports/ffmpeg/0007-fix-lib-naming.patch | 3 +-- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/ports/ffmpeg/0004-fix-debug-build.patch b/ports/ffmpeg/0004-fix-debug-build.patch index 5d595a743f4426..f1ea01e6b513e5 100644 --- a/ports/ffmpeg/0004-fix-debug-build.patch +++ b/ports/ffmpeg/0004-fix-debug-build.patch @@ -12,23 +12,16 @@ index bd2de34..fba948a 100755 *) optname="${opt%%=*}" optname="${optname#--}" -@@ -6150,10 +6153,18 @@ - fi - fi +@@ -6152,8 +6153,13 @@ --enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || -- check_lib zlib zlib.h zlibVersion -lz; } + enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || + check_lib zlib zlib.h zlibVersion -lz; } -enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 -enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma +if enabled debug_configure; then -+ enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || -+ check_lib zlib zlib.h zlibVersion -lzd || -+ check_lib zlib zlib.h zlibVersion -lz; } + enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2d + enabled lzma && check_lib lzma lzma.h lzma_version_number -llzmad +else -+ enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion || -+ check_lib zlib zlib.h zlibVersion -lz; } + enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 + enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma +fi diff --git a/ports/ffmpeg/0007-fix-lib-naming.patch b/ports/ffmpeg/0007-fix-lib-naming.patch index c1271f50407c8b..c9fb9db216ec13 100644 --- a/ports/ffmpeg/0007-fix-lib-naming.patch +++ b/ports/ffmpeg/0007-fix-lib-naming.patch @@ -2,10 +2,9 @@ diff --git a/configure b/configure index d6c4388..75b96c3 100644 --- a/configure +++ b/configure -@@ -4378,6 +4378,11 @@ msvc_common_flags(){ +@@ -4378,6 +4378,10 @@ msvc_common_flags(){ -march=*) ;; -lz) echo zlib.lib ;; -+ -lzd) echo zlibd.lib ;; -lx264) echo libx264.lib ;; + -lx265) echo libx265.lib ;; + -lmp3lame) echo libmp3lame.lib ;; From 6b889d5e205958f75eaec0a6cd17e5e0d805ff63 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sat, 18 Jul 2020 20:20:05 +1000 Subject: [PATCH 24/48] [ffmpeg] Fix detection of 'prefix' in pkgconfig Required to get current output from vcpkg_fixup_pkgconfig to work with ffmpegs configure script. --- .../0009-fix-pkg-config-var-passing.patch | 31 +++++++++++++++++++ ports/ffmpeg/portfile.cmake | 5 ++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 ports/ffmpeg/0009-fix-pkg-config-var-passing.patch diff --git a/ports/ffmpeg/0009-fix-pkg-config-var-passing.patch b/ports/ffmpeg/0009-fix-pkg-config-var-passing.patch new file mode 100644 index 00000000000000..3da5a355fb3183 --- /dev/null +++ b/ports/ffmpeg/0009-fix-pkg-config-var-passing.patch @@ -0,0 +1,31 @@ +diff --git a/configure b/configure +index bdfd731602..cadff85f84 100755 +--- a/configure ++++ b/configure +@@ -1441,7 +1441,7 @@ test_pkg_config(){ + funcs="$4" + shift 4 + disable $name +- test_cmd $pkg_config --exists --print-errors $pkg_version || return ++ test_cmd $pkg_config $pkg_config_flags --exists --print-errors $pkg_version || return + pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg) + pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg) + check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && +@@ -2494,7 +2494,6 @@ CMDLINE_SET=" + nvcc + nvccflags + pkg_config +- pkg_config_flags + progs_suffix + random_seed + ranlib +@@ -2519,6 +2518,7 @@ CMDLINE_APPEND=" + extra_cxxflags + extra_objcflags + host_cppflags ++ pkg_config_flags + " + + # code dependency declarations +-- + diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index c95288a0359f78..505f4e82a60224 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( 0006-fix-StaticFeatures.patch 0007-fix-lib-naming.patch 0008-Fix-wavpack-detection.patch + 0009-fix-pkg-config-var-passing.patch ) if (${SOURCE_PATH} MATCHES " ") @@ -312,7 +313,9 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(OPTIONS "${OPTIONS} --pkg-config-flags=--static") + set(OPTIONS "${OPTIONS} --pkg-config-flags=--static --pkg-config-flags=--define-variable=prefix=${CURRENT_INSTALLED_DIR}") +else() + set(OPTIONS "${OPTIONS} --pkg-config-flags=--define-variable=prefix=${CURRENT_INSTALLED_DIR}") endif() set(ENV_LIB_PATH "$ENV{${LIB_PATH_VAR}}") From 688e90545b85bd97ec5ae54e6274745dc9ea698b Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sat, 18 Jul 2020 20:20:25 +1000 Subject: [PATCH 25/48] [ffnvcodec] Use vcpkg_fixup_pkgconfig. --- ports/ffnvcodec/CONTROL | 3 ++- ports/ffnvcodec/portfile.cmake | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/ffnvcodec/CONTROL b/ports/ffnvcodec/CONTROL index 4a2ce6d71c70d8..17dbb2f238a120 100644 --- a/ports/ffnvcodec/CONTROL +++ b/ports/ffnvcodec/CONTROL @@ -1,4 +1,5 @@ Source: ffnvcodec -Version: 9.1.23.1-1 +Version: 9.1.23.1 +Port-Version: 2 Homepage: https://github.com/FFmpeg/nv-codec-headers Description: FFmpeg version of Nvidia Codec SDK headers. diff --git a/ports/ffnvcodec/portfile.cmake b/ports/ffnvcodec/portfile.cmake index 66d8bcb18c2c25..3a41854c5ff4d6 100644 --- a/ports/ffnvcodec/portfile.cmake +++ b/ports/ffnvcodec/portfile.cmake @@ -51,3 +51,5 @@ endif() # Install the files to their default vcpkg locations file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR}) file(INSTALL ${CURRENT_PORT_DIR}/copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) + +vcpkg_fixup_pkgconfig() From 31e56547499bb4760396ca76d58fb66247ec2c95 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sat, 18 Jul 2020 20:20:37 +1000 Subject: [PATCH 26/48] [libogg] Use vcpkg_fixup_pkgconfig. --- ports/libogg/CONTROL | 3 ++- ports/libogg/portfile.cmake | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/libogg/CONTROL b/ports/libogg/CONTROL index 2a5a5ebe6a3cc1..c89497a19fa74f 100644 --- a/ports/libogg/CONTROL +++ b/ports/libogg/CONTROL @@ -1,4 +1,5 @@ Source: libogg -Version: 1.3.4-1 +Version: 1.3.4 +Port-Version: 2 Description: Ogg is a multimedia container format, and the native file and stream format for the Xiph.org multimedia codecs. Homepage: https://github.com/xiph/ogg diff --git a/ports/libogg/portfile.cmake b/ports/libogg/portfile.cmake index e0014ab6cae897..617a8a65aac206 100644 --- a/ports/libogg/portfile.cmake +++ b/ports/libogg/portfile.cmake @@ -21,6 +21,7 @@ vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Ogg TARGET_PATH share/ogg) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) From 5e35577812cf2c151563ff50bc25905c90ecdbf6 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sat, 18 Jul 2020 20:21:09 +1000 Subject: [PATCH 27/48] [sdl2] Correct pkgconfig debug suffix. --- ports/sdl2/CONTROL | 3 ++- ports/sdl2/portfile.cmake | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ports/sdl2/CONTROL b/ports/sdl2/CONTROL index aad1ec4077fb66..7ea6329358b48f 100644 --- a/ports/sdl2/CONTROL +++ b/ports/sdl2/CONTROL @@ -1,5 +1,6 @@ Source: sdl2 -Version: 2.0.12-2 +Version: 2.0.12 +Port-Version: 3 Homepage: https://www.libsdl.org/download-2.0.php Description: Simple DirectMedia Layer is a cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D. diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index c974d23dbbec4f..a17e69e96c0da9 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -84,3 +84,7 @@ endif() file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) configure_file(${SOURCE_PATH}/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_copy_pdbs() + +vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2" "-lSDL2d") + +vcpkg_fixup_pkgconfig(IGNORE_FLAGS "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib" "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib" "-Wl,--enable-new-dtags" "-Wl,--no-undefined") From f69cf7ba486cfd3cb2aac49e3b338aefccbd29c3 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sat, 18 Jul 2020 20:22:05 +1000 Subject: [PATCH 28/48] [speex] Use vcpkg_fixup_pkgconfig. --- ports/speex/CONTROL | 3 ++- ports/speex/portfile.cmake | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/speex/CONTROL b/ports/speex/CONTROL index 88a6599e753034..1a6b9d14912a14 100644 --- a/ports/speex/CONTROL +++ b/ports/speex/CONTROL @@ -1,4 +1,5 @@ Source: speex -Version: 1.2.0-5 +Version: 1.2.0 +Port-Version: 6 Homepage: https://github.com/xiph/speex Description: Speex is an Open Source/Free Software patent-free audio compression format designed for speech. diff --git a/ports/speex/portfile.cmake b/ports/speex/portfile.cmake index a70aa49293e38a..f1deabc793fec8 100644 --- a/ports/speex/portfile.cmake +++ b/ports/speex/portfile.cmake @@ -26,4 +26,6 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") file(WRITE "${CURRENT_PACKAGES_DIR}/include/speex/speex.h" "${_contents}") endif() +vcpkg_fixup_pkgconfig() + file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/speex RENAME copyright) From db76315adaa35990ca1c4846bdeb3311f263ceaa Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sat, 18 Jul 2020 20:22:40 +1000 Subject: [PATCH 29/48] [x265] Fix pkgconfig windows static lib naming. --- ports/x265/CONTROL | 3 ++- ports/x265/portfile.cmake | 12 ++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ports/x265/CONTROL b/ports/x265/CONTROL index 31ba77050f0aa1..1a1ebae223866a 100644 --- a/ports/x265/CONTROL +++ b/ports/x265/CONTROL @@ -1,4 +1,5 @@ Source: x265 -Version: 3.2-4 +Version: 3.2 +Port-Version: 5 Homepage: https://bitbucket.org/multicoreware/x265 Description: x265 is a H.265 / HEVC video encoder application library, designed to encode video or images into an H.265 / HEVC encoded bitstream. diff --git a/ports/x265/portfile.cmake b/ports/x265/portfile.cmake index eaef036f1e22f7..6343383f2784fd 100644 --- a/ports/x265/portfile.cmake +++ b/ports/x265/portfile.cmake @@ -50,6 +50,18 @@ endif() vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/x265) +if(WIN32 AND (NOT MINGW)) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x265.pc" "-lx265" "-lx265-static") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x265.pc" "-lx265" "-lx265-static") + endif() +endif() +if(UNIX) + vcpkg_fixup_pkgconfig(SYSTEM_LIBRARIES numa) +else() + vcpkg_fixup_pkgconfig() +endif() + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/x265) file(RENAME ${CURRENT_PACKAGES_DIR}/share/x265/COPYING ${CURRENT_PACKAGES_DIR}/share/x265/copyright) From 549d6b1fe44f0f409ae2e823a5c859b7480bb946 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sat, 18 Jul 2020 20:26:20 +1000 Subject: [PATCH 30/48] [wavpack] Fix pkgconfig windows dll naming. --- ports/wavpack/CONTROL | 3 ++- ports/wavpack/portfile.cmake | 9 +++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ports/wavpack/CONTROL b/ports/wavpack/CONTROL index e8edf703e09939..888c3943782451 100644 --- a/ports/wavpack/CONTROL +++ b/ports/wavpack/CONTROL @@ -1,4 +1,5 @@ Source: wavpack -Version: 5.2.0 +Version: 5.2.0 +Port-Version: 2 Homepage: https://github.com/dbry/WavPack Description: WavPack encode/decode library, command-line programs, and several plugins diff --git a/ports/wavpack/portfile.cmake b/ports/wavpack/portfile.cmake index c59374aa36524d..e279149545a30f 100644 --- a/ports/wavpack/portfile.cmake +++ b/ports/wavpack/portfile.cmake @@ -32,5 +32,14 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +if(WIN32 AND (NOT MINGW)) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/wavpack.pc" "-lwavpack" "-lwavpackdll") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/wavpack.pc" "-lwavpack" "-lwavpackdll") + endif() +endif() + +vcpkg_fixup_pkgconfig() + # Post-build test for cmake libraries # vcpkg_test_cmake(PACKAGE_NAME wavpack) From 2efd01ed43b108ed1fccd0d418fa3a107e412e12 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 20 Jul 2020 19:53:33 +1000 Subject: [PATCH 31/48] [ffnvcodec] Install pkgconfig file in debug. --- ports/ffnvcodec/CONTROL | 2 +- ports/ffnvcodec/portfile.cmake | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ports/ffnvcodec/CONTROL b/ports/ffnvcodec/CONTROL index 17dbb2f238a120..38a58cc5a118a8 100644 --- a/ports/ffnvcodec/CONTROL +++ b/ports/ffnvcodec/CONTROL @@ -1,5 +1,5 @@ Source: ffnvcodec Version: 9.1.23.1 -Port-Version: 2 +Port-Version: 3 Homepage: https://github.com/FFmpeg/nv-codec-headers Description: FFmpeg version of Nvidia Codec SDK headers. diff --git a/ports/ffnvcodec/portfile.cmake b/ports/ffnvcodec/portfile.cmake index 3a41854c5ff4d6..1c8b59be48c2a0 100644 --- a/ports/ffnvcodec/portfile.cmake +++ b/ports/ffnvcodec/portfile.cmake @@ -29,6 +29,8 @@ if(NOT VCPKG_CMAKE_SYSTEM_NAME OR VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET} LOGNAME build-${TARGET_TRIPLET} ) + + file(INSTALL ${SOURCE_PATH}/ffnvcodec.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) # Linux, etc. else() @@ -46,6 +48,7 @@ else() # FFmpeg uses pkgconfig to find ffnvcodec.pc, so install it where # FFMpeg's call to pkgconfig expects to find it. file(INSTALL ${SOURCE_PATH}/ffnvcodec.pc DESTINATION ${CURRENT_PACKAGES_DIR}/lib/pkgconfig) + file(INSTALL ${SOURCE_PATH}/ffnvcodec.pc DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig) endif() # Install the files to their default vcpkg locations From 390d613958b17211ac5044c336f2a34509d7f9ed Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 20 Jul 2020 19:53:55 +1000 Subject: [PATCH 32/48] [libvorbis] Fixup pkgconfig file. --- ports/libvorbis/CONTROL | 1 + ports/libvorbis/portfile.cmake | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/libvorbis/CONTROL b/ports/libvorbis/CONTROL index 8ea6bbc44886dd..13273ff70b2713 100644 --- a/ports/libvorbis/CONTROL +++ b/ports/libvorbis/CONTROL @@ -1,5 +1,6 @@ Source: libvorbis Version: 1.3.6-4d963fe +Port-Version: 2 Homepage: https://github.com/xiph/vorbis Description: Ogg Vorbis is a fully open, non-proprietary, patent-and-royalty-free, general-purpose compressed audio format. Build-Depends: libogg diff --git a/ports/libvorbis/portfile.cmake b/ports/libvorbis/portfile.cmake index cf6b86a5cb7671..fe641f8e860ac9 100644 --- a/ports/libvorbis/portfile.cmake +++ b/ports/libvorbis/portfile.cmake @@ -24,4 +24,10 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright configure_file(${SOURCE_PATH}/COPYING ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) -vcpkg_copy_pdbs() +vcpkg_copy_pdbs() + +if(WIN32 AND (NOT MINGW)) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/vorbis.pc" "-lm" "") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/vorbis.pc" "-lm" "") +endif() +vcpkg_fixup_pkgconfig() From e57089112d9e4df64d5740205ec4fe88d2b2ad94 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 20 Jul 2020 19:54:17 +1000 Subject: [PATCH 33/48] [opus] Use vcpkg_fixup_pkgconfig. --- ports/opus/CONTROL | 3 ++- ports/opus/portfile.cmake | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ports/opus/CONTROL b/ports/opus/CONTROL index cf2fdfa0152b89..1576fd3c997053 100644 --- a/ports/opus/CONTROL +++ b/ports/opus/CONTROL @@ -1,5 +1,6 @@ Source: opus -Version: 1.3.1-3 +Version: 1.3.1 +Port-Version: 4 Homepage: https://github.com/xiph/opus Description: Totally open, royalty-free, highly versatile audio codec diff --git a/ports/opus/portfile.cmake b/ports/opus/portfile.cmake index 24be07b6f0a22d..eb7b90cead26d2 100644 --- a/ports/opus/portfile.cmake +++ b/ports/opus/portfile.cmake @@ -21,6 +21,7 @@ vcpkg_configure_cmake( vcpkg_install_cmake() vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/Opus) vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() file(INSTALL ${SOURCE_PATH}/COPYING From d93c795bab3998c4878461d2b072a93c37a77108 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Mon, 20 Jul 2020 19:55:07 +1000 Subject: [PATCH 34/48] [ffmpeg] Correctly set debug lib folder with pkgconfig. --- .../0009-fix-pkg-config-var-passing.patch | 31 ------------------- ports/ffmpeg/portfile.cmake | 8 ++--- 2 files changed, 3 insertions(+), 36 deletions(-) delete mode 100644 ports/ffmpeg/0009-fix-pkg-config-var-passing.patch diff --git a/ports/ffmpeg/0009-fix-pkg-config-var-passing.patch b/ports/ffmpeg/0009-fix-pkg-config-var-passing.patch deleted file mode 100644 index 3da5a355fb3183..00000000000000 --- a/ports/ffmpeg/0009-fix-pkg-config-var-passing.patch +++ /dev/null @@ -1,31 +0,0 @@ -diff --git a/configure b/configure -index bdfd731602..cadff85f84 100755 ---- a/configure -+++ b/configure -@@ -1441,7 +1441,7 @@ test_pkg_config(){ - funcs="$4" - shift 4 - disable $name -- test_cmd $pkg_config --exists --print-errors $pkg_version || return -+ test_cmd $pkg_config $pkg_config_flags --exists --print-errors $pkg_version || return - pkg_cflags=$($pkg_config --cflags $pkg_config_flags $pkg) - pkg_libs=$($pkg_config --libs $pkg_config_flags $pkg) - check_func_headers "$headers" "$funcs" $pkg_cflags $pkg_libs "$@" && -@@ -2494,7 +2494,6 @@ CMDLINE_SET=" - nvcc - nvccflags - pkg_config -- pkg_config_flags - progs_suffix - random_seed - ranlib -@@ -2519,6 +2518,7 @@ CMDLINE_APPEND=" - extra_cxxflags - extra_objcflags - host_cppflags -+ pkg_config_flags - " - - # code dependency declarations --- - diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 505f4e82a60224..def573a8c83cb1 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -12,7 +12,6 @@ vcpkg_from_github( 0006-fix-StaticFeatures.patch 0007-fix-lib-naming.patch 0008-Fix-wavpack-detection.patch - 0009-fix-pkg-config-var-passing.patch ) if (${SOURCE_PATH} MATCHES " ") @@ -313,13 +312,10 @@ if(VCPKG_TARGET_IS_WINDOWS) endif() if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(OPTIONS "${OPTIONS} --pkg-config-flags=--static --pkg-config-flags=--define-variable=prefix=${CURRENT_INSTALLED_DIR}") -else() - set(OPTIONS "${OPTIONS} --pkg-config-flags=--define-variable=prefix=${CURRENT_INSTALLED_DIR}") + set(OPTIONS "${OPTIONS} --pkg-config-flags=--static") endif() set(ENV_LIB_PATH "$ENV{${LIB_PATH_VAR}}") -set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig") message(STATUS "Building Options: ${OPTIONS}") @@ -329,6 +325,7 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL release) set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/lib${SEP}${ENV_LIB_PATH}") set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE}") set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/lib/pkgconfig") message(STATUS "Building ${_csc_PROJECT_PATH} for Release") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel) vcpkg_execute_required_process( @@ -348,6 +345,7 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL debug) set(ENV{${LIB_PATH_VAR}} "${CURRENT_INSTALLED_DIR}/debug/lib${SEP}${ENV_LIB_PATH}") set(ENV{CFLAGS} "${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG}") set(ENV{LDFLAGS} "${VCPKG_LINKER_FLAGS}") + set(ENV{PKG_CONFIG_PATH} "${CURRENT_INSTALLED_DIR}/debug/lib/pkgconfig") message(STATUS "Building ${_csc_PROJECT_PATH} for Debug") file(MAKE_DIRECTORY ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg) vcpkg_execute_required_process( From 9184e8adf2cfb52c0a4708ea4ffffc46d2bf07f7 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Sun, 26 Jul 2020 20:05:48 +1000 Subject: [PATCH 35/48] [vcpkg/scripts/pkgconfig] Add additional common definitions --- scripts/cmake/vcpkg_common_definitions.cmake | 46 +++++++++++++++++++- 1 file changed, 45 insertions(+), 1 deletion(-) diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index 4ea0a361d07e9b..b5c7385848cfc0 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -122,12 +122,56 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX) endif() # Platforms with libm -if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD) +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_OSX) list(APPEND VCPKG_SYSTEM_LIBRARIES m) endif() +# Platforms with pthread +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES pthread) +endif() + +# Platforms with libstdc++ +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES [=[stdc\+\+]=]) +endif() + +# Platforms with libc++ +if(VCPKG_TARGET_IS_OSX) + list(APPEND VCPKG_SYSTEM_LIBRARIES [=[c\+\+]=]) +endif() + +# Platforms with librt +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES rt) +endif() + +# Platforms with GCC libs +if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VCPKG_TARGET_IS_FREEBSD OR VCPKG_TARGET_IS_MINGW) + list(APPEND VCPKG_SYSTEM_LIBRARIES gcc) + list(APPEND VCPKG_SYSTEM_LIBRARIES gcc_s) +endif() + # Windows system libs if(VCPKG_TARGET_IS_WINDOWS) + list(APPEND VCPKG_SYSTEM_LIBRARIES advapi32) + list(APPEND VCPKG_SYSTEM_LIBRARIES bcrypt) + list(APPEND VCPKG_SYSTEM_LIBRARIES dinput8) + list(APPEND VCPKG_SYSTEM_LIBRARIES gdi32) + list(APPEND VCPKG_SYSTEM_LIBRARIES imm32) + list(APPEND VCPKG_SYSTEM_LIBRARIES oleaut32) + list(APPEND VCPKG_SYSTEM_LIBRARIES ole32) + list(APPEND VCPKG_SYSTEM_LIBRARIES psapi) + list(APPEND VCPKG_SYSTEM_LIBRARIES secur32) + list(APPEND VCPKG_SYSTEM_LIBRARIES setupapi) + list(APPEND VCPKG_SYSTEM_LIBRARIES shell32) + list(APPEND VCPKG_SYSTEM_LIBRARIES shlwapi) + list(APPEND VCPKG_SYSTEM_LIBRARIES strmiids) + list(APPEND VCPKG_SYSTEM_LIBRARIES user32) + list(APPEND VCPKG_SYSTEM_LIBRARIES uuid) + list(APPEND VCPKG_SYSTEM_LIBRARIES version) + list(APPEND VCPKG_SYSTEM_LIBRARIES vfw32) + list(APPEND VCPKG_SYSTEM_LIBRARIES winmm) list(APPEND VCPKG_SYSTEM_LIBRARIES wsock32) list(APPEND VCPKG_SYSTEM_LIBRARIES Ws2_32) endif() From d25e73c98109beb1294a04e2fc3386e08f114e71 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 4 Aug 2020 16:20:31 +1000 Subject: [PATCH 36/48] [sdl2] Fix pkgconfig on osx. --- ports/sdl2/portfile.cmake | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ports/sdl2/portfile.cmake b/ports/sdl2/portfile.cmake index a17e69e96c0da9..ef287e3011c826 100644 --- a/ports/sdl2/portfile.cmake +++ b/ports/sdl2/portfile.cmake @@ -85,6 +85,13 @@ file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURR configure_file(${SOURCE_PATH}/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY) vcpkg_copy_pdbs() +set(DYLIB_COMPATIBILITY_VERSION_REGEX "set\\(DYLIB_COMPATIBILITY_VERSION (.+)\\)") +set(DYLIB_CURRENT_VERSION_REGEX "set\\(DYLIB_CURRENT_VERSION (.+)\\)") +file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_COMPATIBILITY_VERSION REGEX ${DYLIB_COMPATIBILITY_VERSION_REGEX}) +file(STRINGS "${SOURCE_PATH}/CMakeLists.txt" DYLIB_CURRENT_VERSION REGEX ${DYLIB_CURRENT_VERSION_REGEX}) +string(REGEX REPLACE ${DYLIB_COMPATIBILITY_VERSION_REGEX} "\\1" DYLIB_COMPATIBILITY_VERSION "${DYLIB_COMPATIBILITY_VERSION}") +string(REGEX REPLACE ${DYLIB_CURRENT_VERSION_REGEX} "\\1" DYLIB_CURRENT_VERSION "${DYLIB_CURRENT_VERSION}") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/sdl2.pc" "-lSDL2" "-lSDL2d") -vcpkg_fixup_pkgconfig(IGNORE_FLAGS "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib" "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib" "-Wl,--enable-new-dtags" "-Wl,--no-undefined") +vcpkg_fixup_pkgconfig(IGNORE_FLAGS "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/lib/pkgconfig/../../lib" "-Wl,-rpath,${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/../../lib" "-Wl,--enable-new-dtags" "-Wl,--no-undefined" "-Wl,-undefined,error" "-Wl,-compatibility_version,${DYLIB_COMPATIBILITY_VERSION}" "-Wl,-current_version,${DYLIB_CURRENT_VERSION}" "-Wl,-weak_framework,Metal" "-Wl,-weak_framework,QuartzCore") From 7f4c4f69634a3848525678ad44a65f5ed64d59f8 Mon Sep 17 00:00:00 2001 From: Matthew Oliver Date: Wed, 5 Aug 2020 15:02:04 +1000 Subject: [PATCH 37/48] [ffmpeg] Correctly detect fdkac on linux. Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com> --- ports/ffmpeg/FindFFMPEG.cmake.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index 927d9b488f8dc7..b15a36af4d9969 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -51,8 +51,8 @@ if(@ENABLE_ICONV@) endif() if(@ENABLE_FDKAAC@) - find_library(FDK_LIBRARY_RELEASE NAMES fdk-aac PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) - find_library(FDK_LIBRARY_DEBUG NAMES fdk-aac PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) + find_library(FDK_LIBRARY_RELEASE NAMES fdk-aac libfdk-aac PATHS ${_IMPORT_PREFIX}/lib/ NO_DEFAULT_PATH) + find_library(FDK_LIBRARY_DEBUG NAMES fdk-aac libfdk-aac PATHS ${_IMPORT_PREFIX}/debug/lib/ NO_DEFAULT_PATH) select_library_configurations(FDK) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${FDK_LIBRARY_DEBUG}>$<$:${FDK_LIBRARY_RELEASE}>") endif() From 6cca774bcaba0f19225d002197904b1964a19987 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Wed, 5 Aug 2020 15:31:22 +1000 Subject: [PATCH 38/48] [vcpkg/scripts/pkgconfig] Add iconv as system lib on osx. --- scripts/cmake/vcpkg_common_definitions.cmake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/cmake/vcpkg_common_definitions.cmake b/scripts/cmake/vcpkg_common_definitions.cmake index b5c7385848cfc0..03aad6f7e83f3f 100644 --- a/scripts/cmake/vcpkg_common_definitions.cmake +++ b/scripts/cmake/vcpkg_common_definitions.cmake @@ -152,6 +152,11 @@ if(VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_ANDROID OR VCPKG_TARGET_IS_OSX OR VC list(APPEND VCPKG_SYSTEM_LIBRARIES gcc_s) endif() +# Platforms with system iconv +if(VCPKG_TARGET_IS_OSX) + list(APPEND VCPKG_SYSTEM_LIBRARIES iconv) +endif() + # Windows system libs if(VCPKG_TARGET_IS_WINDOWS) list(APPEND VCPKG_SYSTEM_LIBRARIES advapi32) From 4fbaba42f7a83e8d442845ee72196257ac32c53f Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Wed, 5 Aug 2020 17:03:09 +1000 Subject: [PATCH 39/48] [ffmpeg] Fix fdk detection on linux. --- ports/ffmpeg/0009-Fix-fdk-detection.patch | 14 ++++++++++++++ ports/ffmpeg/portfile.cmake | 1 + 2 files changed, 15 insertions(+) create mode 100644 ports/ffmpeg/0009-Fix-fdk-detection.patch diff --git a/ports/ffmpeg/0009-Fix-fdk-detection.patch b/ports/ffmpeg/0009-Fix-fdk-detection.patch new file mode 100644 index 00000000000000..3d280fd2b33aa5 --- /dev/null +++ b/ports/ffmpeg/0009-Fix-fdk-detection.patch @@ -0,0 +1,14 @@ +diff --git a/configure b/configure +index b137669dd3..34c92230f4 100755 +--- a/configure ++++ b/configure +@@ -6331,7 +6331,7 @@ enabled libdavs2 && require_pkg_config libdavs2 "davs2 >= 1.6.0" davs2. + enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new + enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion + enabled libfdk_aac && { check_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen || +- { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac && ++ { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac -lm -lstdc++ && + warn "using libfdk without pkg-config"; } } + flite_extralibs="-lflite_cmu_time_awb -lflite_cmu_us_awb -lflite_cmu_us_kal -lflite_cmu_us_kal16 -lflite_cmu_us_rms -lflite_cmu_us_slt -lflite_usenglish -lflite_cmulex -lflite" + enabled libflite && require libflite "flite/flite.h" flite_init $flite_extralibs + diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index def573a8c83cb1..70160e7da93221 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -12,6 +12,7 @@ vcpkg_from_github( 0006-fix-StaticFeatures.patch 0007-fix-lib-naming.patch 0008-Fix-wavpack-detection.patch + 0009-Fix-fdk-detection.patch ) if (${SOURCE_PATH} MATCHES " ") From c0cf19ec93c7a220e1462934b05bbc963c58a14e Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Wed, 5 Aug 2020 17:13:21 +1000 Subject: [PATCH 40/48] [ffmpeg] Fix x264 detection on linux. --- ports/ffmpeg/0010-Fix-x264-detection.patch | 14 ++++++++++++++ ports/ffmpeg/portfile.cmake | 1 + 2 files changed, 15 insertions(+) create mode 100644 ports/ffmpeg/0010-Fix-x264-detection.patch diff --git a/ports/ffmpeg/0010-Fix-x264-detection.patch b/ports/ffmpeg/0010-Fix-x264-detection.patch new file mode 100644 index 00000000000000..2cbf85eaf81a8b --- /dev/null +++ b/ports/ffmpeg/0010-Fix-x264-detection.patch @@ -0,0 +1,14 @@ +diff --git a/configure b/configure +index b137669dd3..34a2e644c4 100755 +--- a/configure ++++ b/configure +@@ -6443,7 +6443,7 @@ enabled libwebp && { + enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion + enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } + enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x264_encoder_encode || +- { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs" && ++ { require libx264 "stdint.h x264.h" x264_encoder_encode "-lx264 $pthreads_extralibs $libm_extralibs -ldl" && + warn "using libx264 without pkg-config"; } } && + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && + check_cpp_condition libx262 x264.h "X264_MPEG2" + diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 70160e7da93221..c4114561d1ea2d 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -13,6 +13,7 @@ vcpkg_from_github( 0007-fix-lib-naming.patch 0008-Fix-wavpack-detection.patch 0009-Fix-fdk-detection.patch + 0010-Fix-x264-detection.patch ) if (${SOURCE_PATH} MATCHES " ") From a721fdcb3b67a49ecdfe2ff5781ba233ff47330a Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Wed, 5 Aug 2020 17:38:08 +1000 Subject: [PATCH 41/48] [ffmpeg] Fix x265 detection on linux. --- ports/ffmpeg/0011-Fix-x265-detection.patch | 16 ++++++++++++++++ ports/ffmpeg/portfile.cmake | 1 + 2 files changed, 17 insertions(+) create mode 100644 ports/ffmpeg/0011-Fix-x265-detection.patch diff --git a/ports/ffmpeg/0011-Fix-x265-detection.patch b/ports/ffmpeg/0011-Fix-x265-detection.patch new file mode 100644 index 00000000000000..805f85e327c619 --- /dev/null +++ b/ports/ffmpeg/0011-Fix-x265-detection.patch @@ -0,0 +1,16 @@ +diff --git a/configure b/configure +index 34a2e644c4..0ea64bd306 100755 +--- a/configure ++++ b/configure +@@ -6447,7 +6447,9 @@ enabled libx264 && { check_pkg_config libx264 x264 "stdint.h x264.h" x + warn "using libx264 without pkg-config"; } } && + require_cpp_condition libx264 x264.h "X264_BUILD >= 118" && + check_cpp_condition libx262 x264.h "X264_MPEG2" +-enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && ++enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get || ++ { require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt" && ++ warn "using libx265 without pkg-config"; } } && + require_cpp_condition libx265 x265.h "X265_BUILD >= 68" + enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs" + enabled libxavs2 && require_pkg_config libxavs2 "xavs2 >= 1.3.0" "stdint.h xavs2.h" xavs2_api_get + diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index c4114561d1ea2d..3b1963bd33da48 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -14,6 +14,7 @@ vcpkg_from_github( 0008-Fix-wavpack-detection.patch 0009-Fix-fdk-detection.patch 0010-Fix-x264-detection.patch + 0011-Fix-x265-detection.patch ) if (${SOURCE_PATH} MATCHES " ") From 289a0c49adec0c67374c95797fbd8640f5ee779a Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Wed, 5 Aug 2020 18:14:00 +1000 Subject: [PATCH 42/48] [ffmpeg] Fix detection of OpenSSL 1.1.0+ on linux. --- ports/ffmpeg/0012-Fix-ssl-110-detection.patch | 13 +++++++++++++ ports/ffmpeg/portfile.cmake | 1 + 2 files changed, 14 insertions(+) create mode 100644 ports/ffmpeg/0012-Fix-ssl-110-detection.patch diff --git a/ports/ffmpeg/0012-Fix-ssl-110-detection.patch b/ports/ffmpeg/0012-Fix-ssl-110-detection.patch new file mode 100644 index 00000000000000..b8666e6b0588d3 --- /dev/null +++ b/ports/ffmpeg/0012-Fix-ssl-110-detection.patch @@ -0,0 +1,13 @@ +diff --git a/configure b/configure +index 2be953f7e7..e075949ffc 100755 +--- a/configure ++++ b/configure +@@ -6497,6 +6497,7 @@ enabled omx_rpi && { test_code cc OMX_Core.h OMX_IndexConfigBrcmVideoR + die "ERROR: OpenMAX IL headers not found"; } && enable omx + enabled openssl && { check_pkg_config openssl openssl openssl/ssl.h OPENSSL_init_ssl || + check_pkg_config openssl openssl openssl/ssl.h SSL_library_init || ++ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -lssl -lcrypto $pthreads_extralibs -ldl || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto || + check_lib openssl openssl/ssl.h SSL_library_init -lssl32 -leay32 || + check_lib openssl openssl/ssl.h SSL_library_init -lssl -lcrypto -lws2_32 -lgdi32 || + diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 3b1963bd33da48..c1c68499ada760 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -15,6 +15,7 @@ vcpkg_from_github( 0009-Fix-fdk-detection.patch 0010-Fix-x264-detection.patch 0011-Fix-x265-detection.patch + 0012-Fix-ssl-110-detection.patch ) if (${SOURCE_PATH} MATCHES " ") From 87c7bf6ff191d273f28399b00066822c9de342c0 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Wed, 5 Aug 2020 19:17:26 +1000 Subject: [PATCH 43/48] [ffmpeg] Remove nvcodec dependency on cuda. --- ports/ffmpeg/CONTROL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/ffmpeg/CONTROL b/ports/ffmpeg/CONTROL index aed18aec36bfda..7fc78babcbe14e 100644 --- a/ports/ffmpeg/CONTROL +++ b/ports/ffmpeg/CONTROL @@ -1,6 +1,6 @@ Source: ffmpeg Version: 4.2 -Port-Version: 17 +Port-Version: 18 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. @@ -56,7 +56,7 @@ Build-Depends: mp3lame Description: MP3 encoding via libmp3lame support in ffmpeg Feature: nvcodec -Build-Depends: ffnvcodec, cuda +Build-Depends: ffnvcodec Description: Hardware accelerated codecs Feature: opencl From 84f4c653b979aa2d85d14c7d0e32921d9b11e384 Mon Sep 17 00:00:00 2001 From: Matthew Oliver Date: Fri, 7 Aug 2020 14:58:09 +1000 Subject: [PATCH 44/48] [ffmpeg] Use WavPack instead of Wavpack in cmake. Co-authored-by: Phoebe <20694052+PhoebeHui@users.noreply.github.com> --- ports/ffmpeg/FindFFMPEG.cmake.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/ffmpeg/FindFFMPEG.cmake.in b/ports/ffmpeg/FindFFMPEG.cmake.in index b15a36af4d9969..24beaec7d65e6c 100644 --- a/ports/ffmpeg/FindFFMPEG.cmake.in +++ b/ports/ffmpeg/FindFFMPEG.cmake.in @@ -155,8 +155,8 @@ endif() if(@ENABLE_WAVPACK@) find_dependency(wavpack) - get_target_property(WAVPACK_LIBRARY_RELEASE Wavpack::wavpack IMPORTED_LOCATION_RELEASE) - get_target_property(WAVPACK_LIBRARY_DEBUG Wavpack::wavpack IMPORTED_LOCATION_DEBUG) + get_target_property(WAVPACK_LIBRARY_RELEASE WavPack::wavpack IMPORTED_LOCATION_RELEASE) + get_target_property(WAVPACK_LIBRARY_DEBUG WavPack::wavpack IMPORTED_LOCATION_DEBUG) list(APPEND FFMPEG_PLATFORM_DEPENDENT_LIBS "$<$:${WAVPACK_LIBRARY_DEBUG}>$<$:${WAVPACK_LIBRARY_RELEASE}>") endif() From dc4e432ed3cdee3c5d0b2094ba698c32dd8bb3b2 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Fri, 7 Aug 2020 15:16:32 +1000 Subject: [PATCH 45/48] [ffmpeg] Remove libnpp feature from nvcodec. This feature is entirely unrelated and should be added in a new PR. --- ports/ffmpeg/portfile.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index c1c68499ada760..91164fa23fc7ec 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -149,9 +149,9 @@ else() endif() if("nvcodec" IN_LIST FEATURES) - set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-cuvid --disable-libnpp") + set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid") else() - set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-cuvid --disable-libnpp") + set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid") endif() set(ENABLE_OPENCL OFF) From a280e11fcd28b10220a47299560975cbd38ff9e7 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Fri, 7 Aug 2020 18:53:49 +1000 Subject: [PATCH 46/48] [ffmpeg] Add comment about cuda options not requiring the cuda port as dependency. --- ports/ffmpeg/portfile.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 26dcc919868cce..f93527728e4178 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -151,6 +151,7 @@ else() endif() if("nvcodec" IN_LIST FEATURES) + #Note: the --enable-cuda option does not actually require the cuda sdk or toolset port dependency as ffmpeg uses runtime detection and dynamic loading set(OPTIONS "${OPTIONS} --enable-cuda --enable-nvenc --enable-nvdec --enable-cuvid") else() set(OPTIONS "${OPTIONS} --disable-cuda --disable-nvenc --disable-nvdec --disable-cuvid") From 5f3e768d8032c744f93dcf50ac33f88ef9bf82b9 Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Tue, 11 Aug 2020 22:30:18 +1000 Subject: [PATCH 47/48] [ffmpeg] Fix static linking of wavpack on linux. --- ports/ffmpeg/0008-Fix-wavpack-detection.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ffmpeg/0008-Fix-wavpack-detection.patch b/ports/ffmpeg/0008-Fix-wavpack-detection.patch index bb7baf4f511110..959ee8a1bf54e9 100644 --- a/ports/ffmpeg/0008-Fix-wavpack-detection.patch +++ b/ports/ffmpeg/0008-Fix-wavpack-detection.patch @@ -7,7 +7,7 @@ index e7162dbc56..0f04af2a81 100755 } -enabled libwavpack && require libwavpack wavpack/wavpack.h WavpackOpenFileOutput -lwavpack -+enabled libwavpack && { check_lib libwavpack wavpack.h WavpackOpenFileOutput -lwavpack || check_lib libwavpack wavpack.h WavpackOpenFileOutput -llibwavpack || require libwavpack wavpack.h WavpackOpenFileOutput -lwavpackdll; } ++enabled libwavpack && { check_pkg_config libwavpack wavpack wavpack.h WavpackOpenFileOutput || check_lib libwavpack wavpack.h WavpackOpenFileOutput -lwavpack || check_lib libwavpack wavpack.h WavpackOpenFileOutput -llibwavpack || require libwavpack wavpack.h WavpackOpenFileOutput -lwavpackdll; } enabled libwebp && { enabled libwebp_encoder && require_pkg_config libwebp "libwebp >= 0.2.0" webp/encode.h WebPGetEncoderVersion enabled libwebp_anim_encoder && check_pkg_config libwebp_anim_encoder "libwebpmux >= 0.4.0" webp/mux.h WebPAnimEncoderOptionsInit; } From f3f8d1e08461d4a00c59822febc485d9e4eba62d Mon Sep 17 00:00:00 2001 From: Matt Oliver Date: Wed, 12 Aug 2020 00:28:57 +1000 Subject: [PATCH 48/48] [ffmpeg] Fix x265 detection when using numa on linux. --- ports/ffmpeg/0011-Fix-x265-detection.patch | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/ffmpeg/0011-Fix-x265-detection.patch b/ports/ffmpeg/0011-Fix-x265-detection.patch index 805f85e327c619..54a216ac242813 100644 --- a/ports/ffmpeg/0011-Fix-x265-detection.patch +++ b/ports/ffmpeg/0011-Fix-x265-detection.patch @@ -8,7 +8,7 @@ index 34a2e644c4..0ea64bd306 100755 check_cpp_condition libx262 x264.h "X264_MPEG2" -enabled libx265 && require_pkg_config libx265 x265 x265.h x265_api_get && +enabled libx265 && { check_pkg_config libx265 x265 x265.h x265_api_get || -+ { require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt" && ++ { require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" && + warn "using libx265 without pkg-config"; } } && require_cpp_condition libx265 x265.h "X265_BUILD >= 68" enabled libxavs && require libxavs "stdint.h xavs.h" xavs_encoder_encode "-lxavs $pthreads_extralibs $libm_extralibs"