From 2017886818a9a88d303548b53709f5ef922efb39 Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Thu, 6 Jun 2024 09:48:31 +0200 Subject: [PATCH] [alsa,fdk-aac,ffmpeg,libsrt,snappy,x265] Code cleanup, fix and use pkg-config (#39077) - Setup and use pkg-config for ffmpeg dependencies. https://github.com/microsoft/vcpkg/pull/38011#discussion_r1623174355. - Export actual c++ link libraries for fdk-aac via pkg-config. (Same pattern as lerc, geos.) - Rectify link libraries in pkg-config for alsa, libsrt, snappy, x265. - Burn-in dllimport for libsrt and x265. - Pass detected STRIP to ffmpeg. Fixes https://github.com/microsoft/vcpkg/issues/36852. --- ports/alsa/libdl.diff | 12 ++++ ports/alsa/portfile.cmake | 1 + ports/alsa/vcpkg.json | 2 +- ports/fdk-aac/cxx-linkage-pkgconfig.patch | 20 +++++++ ports/fdk-aac/portfile.cmake | 21 +++++-- ports/fdk-aac/vcpkg.json | 2 +- ...Features.patch => 0004-dependencies.patch} | 47 ++++++++------- ports/ffmpeg/0004-fix-debug-build.patch | 40 ------------- ports/ffmpeg/0007-fix-lib-naming.patch | 6 +- ports/ffmpeg/0009-Fix-fdk-detection.patch | 14 ----- ports/ffmpeg/0011-Fix-x265-detection.patch | 15 ----- ports/ffmpeg/0015-Fix-xml2-detection.patch | 17 ------ ports/ffmpeg/0022-fix-iconv.patch | 14 ----- ports/ffmpeg/0023-fix-qsv-init.patch | 22 ------- ports/ffmpeg/portfile.cmake | 34 ++++++----- ports/ffmpeg/vcpkg.json | 2 +- ports/libsrt/fix-dependency-install.patch | 39 ------------- ports/libsrt/pkgconfig.diff | 16 +++++ ports/libsrt/portfile.cmake | 30 +++++++--- ports/libsrt/vcpkg.json | 1 + ports/snappy/pkgconfig.diff | 23 ++++++++ ports/snappy/portfile.cmake | 18 ++---- ports/snappy/snappy.pc.in | 11 ++-- ports/snappy/vcpkg.json | 1 + ports/x265/disable-install-pdb.patch | 35 +++++------ ports/x265/linkage.diff | 18 ++++++ ports/x265/pkgconfig.diff | 58 +++++++++++++++++++ ports/x265/portfile.cmake | 32 ++-------- ports/x265/vcpkg.json | 1 + versions/a-/alsa.json | 5 ++ versions/baseline.json | 12 ++-- versions/f-/fdk-aac.json | 5 ++ versions/f-/ffmpeg.json | 5 ++ versions/l-/libsrt.json | 5 ++ versions/s-/snappy.json | 5 ++ versions/x-/x265.json | 5 ++ 36 files changed, 304 insertions(+), 290 deletions(-) create mode 100644 ports/alsa/libdl.diff create mode 100644 ports/fdk-aac/cxx-linkage-pkgconfig.patch rename ports/ffmpeg/{0006-fix-StaticFeatures.patch => 0004-dependencies.patch} (60%) delete mode 100644 ports/ffmpeg/0004-fix-debug-build.patch delete mode 100644 ports/ffmpeg/0009-Fix-fdk-detection.patch delete mode 100644 ports/ffmpeg/0011-Fix-x265-detection.patch delete mode 100644 ports/ffmpeg/0015-Fix-xml2-detection.patch delete mode 100644 ports/ffmpeg/0022-fix-iconv.patch delete mode 100644 ports/ffmpeg/0023-fix-qsv-init.patch delete mode 100644 ports/libsrt/fix-dependency-install.patch create mode 100644 ports/libsrt/pkgconfig.diff create mode 100644 ports/snappy/pkgconfig.diff create mode 100644 ports/x265/linkage.diff create mode 100644 ports/x265/pkgconfig.diff diff --git a/ports/alsa/libdl.diff b/ports/alsa/libdl.diff new file mode 100644 index 00000000000000..f2d721b025a67f --- /dev/null +++ b/ports/alsa/libdl.diff @@ -0,0 +1,12 @@ +diff --git a/configure.ac b/configure.ac +index 7a152a4..324adf8 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -261,6 +261,7 @@ HAVE_LIBDL= + if test "$have_libdl" = "yes"; then + AC_SEARCH_LIBS([dlsym], [dl], [HAVE_LIBDL="yes"]) + if test "$HAVE_LIBDL" = "yes" ; then ++ ALSA_DEPLIBS="$ALSA_DEPLIBS -ldl" + AC_DEFINE([HAVE_LIBDL], 1, [Have libdl]) + fi + else diff --git a/ports/alsa/portfile.cmake b/ports/alsa/portfile.cmake index e60bf0817c58c8..1b6922c12d3ad2 100644 --- a/ports/alsa/portfile.cmake +++ b/ports/alsa/portfile.cmake @@ -25,6 +25,7 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-plugin-dir.patch + libdl.diff ${ALSA_VERSION_SCRIPT_PATCH} ) diff --git a/ports/alsa/vcpkg.json b/ports/alsa/vcpkg.json index 50c18047db9a29..57d4b63c17e6f0 100644 --- a/ports/alsa/vcpkg.json +++ b/ports/alsa/vcpkg.json @@ -1,7 +1,7 @@ { "name": "alsa", "version": "1.2.11", - "port-version": 1, + "port-version": 2, "description": "The Advanced Linux Sound Architecture (ALSA) - library", "homepage": "https://www.alsa-project.org/", "license": "LGPL-2.1-or-later", diff --git a/ports/fdk-aac/cxx-linkage-pkgconfig.patch b/ports/fdk-aac/cxx-linkage-pkgconfig.patch new file mode 100644 index 00000000000000..4f8bdd158724ca --- /dev/null +++ b/ports/fdk-aac/cxx-linkage-pkgconfig.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4db8c7e..da3297c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -528,6 +528,15 @@ if(FDK_AAC_INSTALL_PKGCONFIG_MODULE) + set(LIBS_PUBLIC "-lm") + endif() + endif() ++ foreach(lib IN LISTS CMAKE_CXX_IMPLICIT_LINK_LIBRARIES) ++ if(lib IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES) ++ continue() ++ elseif(EXISTS "${lib}") ++ string(APPEND LIBS_PRIVATE " ${CMAKE_LINK_LIBRARY_FILE_FLAG}${lib}") ++ else() ++ string(APPEND LIBS_PRIVATE " ${CMAKE_LINK_LIBRARY_FLAG}${lib}") ++ endif() ++ endforeach() + configure_file(fdk-aac.pc.in fdk-aac.pc @ONLY) + install( + FILES diff --git a/ports/fdk-aac/portfile.cmake b/ports/fdk-aac/portfile.cmake index 81b4f0e8f1a491..5fb648546f5d56 100644 --- a/ports/fdk-aac/portfile.cmake +++ b/ports/fdk-aac/portfile.cmake @@ -3,6 +3,7 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES he-aac HE_AAC ) +set(legal_notes "NOTICE") if(HE_AAC) vcpkg_from_github( REPO mstorsjo/fdk-aac @@ -10,27 +11,35 @@ if(HE_AAC) SHA512 616207e85035d1659a2b7808ca6ec02ef53c1c4b39eb280fe861f82a4cf548e5db2ac381c496bad37dfc2b8c6677fe704d9fd8449e43d1f93d3e636239e0191b HEAD_REF master OUT_SOURCE_PATH SOURCE_PATH + PATCHES + cxx-linkage-pkgconfig.patch ) else() + list(PREPEND legal_notes "README.fedora") vcpkg_from_gitlab( GITLAB_URL https://gitlab.freedesktop.org/ REPO wtaymans/fdk-aac-stripped - REF 585981a49f2186b0d2e47c64bf6b5abf539395f8 # corresponds to v2.0.2 tag in mstorsjo/fdk-aac GitHub repository + REF 529b87452cd33d45e1d0a5066d20b64f10b38845 # corresponds to v2.0.2 tag in mstorsjo/fdk-aac GitHub repository HEAD_REF stripped4 - SHA512 e0e56396ed0be427302ed4b54fc6e8dc522a172c288b7c1ec40cc3a9ceb13518ca7bbb874bc71b88b2a91e0bbbe4ad0bab6910efa1db63d91e6370976641bac4 + SHA512 0c37f8fd1bd0e817d2b3970138bef5b2a7a3150ab1a772273c8f5cba09be04afa2f31780f0ea063dd786a71844aa4cb5821349a4bcc5ebe70e827c3561eda2a9 OUT_SOURCE_PATH SOURCE_PATH + PATCHES + cxx-linkage-pkgconfig.patch ) endif() vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS_RELEASE -DBUILD_PROGRAMS=OFF + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DBUILD_PROGRAMS=OFF ) vcpkg_cmake_install() vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/${PORT}") vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() -vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}") -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/NOTICE") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +list(TRANSFORM legal_notes PREPEND "${SOURCE_PATH}/") +vcpkg_install_copyright(FILE_LIST ${legal_notes}) diff --git a/ports/fdk-aac/vcpkg.json b/ports/fdk-aac/vcpkg.json index c8d7762d2b8576..bc2eb0a1e869f5 100644 --- a/ports/fdk-aac/vcpkg.json +++ b/ports/fdk-aac/vcpkg.json @@ -1,7 +1,7 @@ { "name": "fdk-aac", "version-semver": "2.0.2", - "port-version": 3, + "port-version": 4, "description": "A standalone Third-Party Modified Version of the Fraunhofer FDK AAC Codec Library for Android. Uses a fork without HE-AAC, HE-AACv2, or xHE-AAC support to avoid patent licensing and GPL compatibility issues when built without the he-aac option.", "homepage": "https://gitlab.freedesktop.org/wtaymans/fdk-aac-stripped", "license": "FDK-AAC", diff --git a/ports/ffmpeg/0006-fix-StaticFeatures.patch b/ports/ffmpeg/0004-dependencies.patch similarity index 60% rename from ports/ffmpeg/0006-fix-StaticFeatures.patch rename to ports/ffmpeg/0004-dependencies.patch index 76a649654ad3a3..e2d929a7a79de3 100644 --- a/ports/ffmpeg/0006-fix-StaticFeatures.patch +++ b/ports/ffmpeg/0004-dependencies.patch @@ -1,8 +1,15 @@ diff --git a/configure b/configure -index 6d3f31fc95..f5f4a769cc 100644 ---- a/configure -+++ b/configure -@@ -6761,7 +6761,8 @@ if enabled libmfx; then +index 3243e23021..6d3f31fc95 100755 +@@ -6630,7 +6630,7 @@ fi + + 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 bzlib && require_pkg_config bzlib bzip2 bzlib.h BZ2_bzlibVersion + enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma + + enabled zlib && test_exec $zlib_extralibs <= 2019. + 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++ -enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr -+enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr -lm ++enabled libsnappy && require_pkg_config libsnappy snappy snappy-c.h snappy_compress ++enabled libsoxr && require libsoxr soxr.h soxr_create -lsoxr $libm_extralibs enabled libssh && require_pkg_config libssh "libssh >= 0.6.0" 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 -@@ -6888,6 +6889,8 @@ enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h" +@@ -6884,6 +6885,8 @@ enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h" 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 || @@ -30,20 +39,16 @@ index 6d3f31fc95..f5f4a769cc 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)" || -@@ -6914,6 +6917,7 @@ enabled openssl && { { check_pkg_config openssl "openssl >= 3.0.0" ope - 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 || -+ check_lib openssl openssl/ssl.h OPENSSL_init_ssl -llibssl -llibcrypto -lws2_32 -lgdi32 -lcrypt32 -lAdvapi32 -lUser32|| - 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 && -@@ -7215,7 +7219,7 @@ enabled amf && - if enabled libc_iconv; then +@@ -7208,10 +7211,10 @@ enabled amf && + "(AMF_VERSION_MAJOR << 48 | AMF_VERSION_MINOR << 32 | AMF_VERSION_RELEASE << 16 | AMF_VERSION_BUILD_NUM) >= 0x00010004001d0000" + + # Funny iconv installations are not unusual, so check it after all flags have been set +-if enabled libc_iconv; then ++if enabled libc_iconv && disabled 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 ++ check_func_headers iconv.h iconv || check_lib iconv iconv.h iconv -liconv || check_lib iconv iconv.h iconv -liconv -lcharset fi enabled debug && add_cflags -g"$debuglevel" && add_asflags -g"$debuglevel" diff --git a/ports/ffmpeg/0004-fix-debug-build.patch b/ports/ffmpeg/0004-fix-debug-build.patch deleted file mode 100644 index 1c7056c4cc0907..00000000000000 --- a/ports/ffmpeg/0004-fix-debug-build.patch +++ /dev/null @@ -1,40 +0,0 @@ -diff --git a/configure b/configure -index 3243e23021..6d3f31fc95 100644 ---- a/configure -+++ b/configure -@@ -4284,6 +4284,9 @@ for opt do - --libfuzzer=*) - libfuzzer_path="$optval" - ;; -+ --debug) -+ enable debug_configure -+ ;; - *) - optname="${opt%%=*}" - optname="${optname#--}" -@@ -6630,7 +6633,11 @@ fi - - 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 -+if enabled debug_configure; then -+ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2d -+else -+ enabled bzlib && check_lib bzlib bzlib.h BZ2_bzlibVersion -lbz2 -+fi - enabled lzma && check_lib lzma lzma.h lzma_version_number -llzma - - enabled zlib && test_exec $zlib_extralibs <= 2019. - 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 -lsnappy -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 >= 0.6.0" libssh/sftp.h sftp_init - enabled libspeex && require_pkg_config libspeex speex speex/speex.h speex_decoder_init diff --git a/ports/ffmpeg/0007-fix-lib-naming.patch b/ports/ffmpeg/0007-fix-lib-naming.patch index ef9d74614e1ec1..d25f6039a970b3 100644 --- a/ports/ffmpeg/0007-fix-lib-naming.patch +++ b/ports/ffmpeg/0007-fix-lib-naming.patch @@ -2,15 +2,11 @@ diff --git a/configure b/configure index d6c4388..75b96c3 100644 --- a/configure +++ b/configure -@@ -4378,6 +4378,11 @@ msvc_common_flags(){ +@@ -4378,6 +4378,7 @@ msvc_common_flags(){ -march=*) ;; -lz) echo zlib.lib ;; -lx264) echo libx264.lib ;; -+ -lx265) echo libx265.lib ;; + -lmp3lame) echo libmp3lame.lib ;; -+ -liconv) echo iconv.lib ;; -+ -llibcharset) echo charset.lib ;; -+ -lm) ;; -lstdc++) ;; -l*) echo ${flag#-l}.lib ;; -LARGEADDRESSAWARE) echo $flag ;; diff --git a/ports/ffmpeg/0009-Fix-fdk-detection.patch b/ports/ffmpeg/0009-Fix-fdk-detection.patch deleted file mode 100644 index 3d280fd2b33aa5..00000000000000 --- a/ports/ffmpeg/0009-Fix-fdk-detection.patch +++ /dev/null @@ -1,14 +0,0 @@ -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/0011-Fix-x265-detection.patch b/ports/ffmpeg/0011-Fix-x265-detection.patch deleted file mode 100644 index 8c3e10d951ed2a..00000000000000 --- a/ports/ffmpeg/0011-Fix-x265-detection.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff --git a/configure b/configure ---- a/configure -+++ b/configure -@@ -6730,7 +6730,10 @@ - [ "$toolchain" != "msvc" ] || - require_cpp_condition libx264 x264.h "X264_BUILD >= 158"; } && - 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 || -+ { { check_lib libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++ -lgcc_s -lgcc -lrt -lnuma" || -+ require libx265 x265.h x265_api_get "-lx265 $pthreads_extralibs $libm_extralibs -ldl -lstdc++"; } && -+ warn "using libx265 without pkg-config"; } } && - require_cpp_condition libx265 x265.h "X265_BUILD >= 89" - 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/0015-Fix-xml2-detection.patch b/ports/ffmpeg/0015-Fix-xml2-detection.patch deleted file mode 100644 index 7d2f148b09ea7e..00000000000000 --- a/ports/ffmpeg/0015-Fix-xml2-detection.patch +++ /dev/null @@ -1,17 +0,0 @@ - configure | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/configure b/configure -index 900505756b..8d1388a347 100755 ---- a/configure -+++ b/configure -@@ -6476,7 +6476,7 @@ enabled libzmq && require_pkg_config libzmq "libzmq >= 4.2.1" zmq.h z - enabled libzvbi && require_pkg_config libzvbi zvbi-0.2 libzvbi.h vbi_decoder_new && - { test_cpp_condition libzvbi.h "VBI_VERSION_MAJOR > 0 || VBI_VERSION_MINOR > 2 || VBI_VERSION_MINOR == 2 && VBI_VERSION_MICRO >= 28" || - enabled gpl || die "ERROR: libzvbi requires version 0.2.28 or --enable-gpl."; } --enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml2/libxml/xmlversion.h xmlCheckVersion -+enabled libxml2 && require_pkg_config libxml2 libxml-2.0 libxml/xmlversion.h xmlCheckVersion - enabled mbedtls && { check_pkg_config mbedtls mbedtls mbedtls/x509_crt.h mbedtls_x509_crt_init || - check_pkg_config mbedtls mbedtls mbedtls/ssl.h mbedtls_ssl_init || - check_lib mbedtls mbedtls/ssl.h mbedtls_ssl_init -lmbedtls -lmbedx509 -lmbedcrypto || - diff --git a/ports/ffmpeg/0022-fix-iconv.patch b/ports/ffmpeg/0022-fix-iconv.patch deleted file mode 100644 index 3fc6cf272b2225..00000000000000 --- a/ports/ffmpeg/0022-fix-iconv.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/configure b/configure -index 2829d79..697a504 100755 ---- a/configure -+++ b/configure -@@ -4221,9 +4221,6 @@ - if disabled autodetect; then - -- # Unless iconv is explicitely disabled by the user, we still want to probe -- # for the iconv from the libc. -- disabled iconv || enable libc_iconv - - disable_weak $EXTERNAL_AUTODETECT_LIBRARY_LIST - disable_weak $HWACCEL_AUTODETECT_LIBRARY_LIST - fi diff --git a/ports/ffmpeg/0023-fix-qsv-init.patch b/ports/ffmpeg/0023-fix-qsv-init.patch deleted file mode 100644 index e6d28634049eda..00000000000000 --- a/ports/ffmpeg/0023-fix-qsv-init.patch +++ /dev/null @@ -1,22 +0,0 @@ -Subject: [PATCH] fix d3d11 ---- -Index: qsv.c -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/libavcodec/qsv.c b/libavcodec/qsv.c ---- a/libavcodec/qsv.c -+++ b/libavcodec/qsv.c -@@ -383,7 +383,11 @@ - int ff_qsv_init_internal_session(AVCodecContext *avctx, QSVSession *qs, - const char *load_plugins, int gpu_copy) - { -+#if CONFIG_D3D11VA -+ mfxIMPL impl = MFX_IMPL_AUTO_ANY | MFX_IMPL_VIA_D3D11; -+#else - mfxIMPL impl = MFX_IMPL_AUTO_ANY; -+#endif - mfxVersion ver = { { QSV_VERSION_MINOR, QSV_VERSION_MAJOR } }; - mfxInitParam init_par = { MFX_IMPL_AUTO_ANY }; - diff --git a/ports/ffmpeg/portfile.cmake b/ports/ffmpeg/portfile.cmake index 62de6174334269..72055b06316dfb 100644 --- a/ports/ffmpeg/portfile.cmake +++ b/ports/ffmpeg/portfile.cmake @@ -8,17 +8,12 @@ vcpkg_from_github( 0001-create-lib-libraries.patch 0002-fix-msvc-link.patch #upstreamed in future version 0003-fix-windowsinclude.patch - 0004-fix-debug-build.patch + 0004-dependencies.patch 0005-fix-nasm.patch #upstreamed in future version - 0006-fix-StaticFeatures.patch 0007-fix-lib-naming.patch - 0009-Fix-fdk-detection.patch - 0011-Fix-x265-detection.patch 0012-Fix-ssl-110-detection.patch 0013-define-WINVER.patch - 0015-Fix-xml2-detection.patch 0020-fix-aarch64-libswscale.patch - 0022-fix-iconv.patch 0040-ffmpeg-add-av_stream_get_first_dts-for-chromium.patch # Do not remove this patch. It is required by chromium 0041-add-const-for-opengl-definition.patch ) @@ -154,10 +149,18 @@ if(VCPKG_DETECTED_CMAKE_RANLIB) list(APPEND prog_env "${RANLIB_path}") endif() +if(VCPKG_DETECTED_CMAKE_STRIP) + get_filename_component(STRIP_path "${VCPKG_DETECTED_CMAKE_STRIP}" DIRECTORY) + get_filename_component(STRIP_filename "${VCPKG_DETECTED_CMAKE_STRIP}" NAME) + set(ENV{STRIP} "${STRIP_filename}") + string(APPEND OPTIONS " --strip=${STRIP_filename}") + list(APPEND prog_env "${STRIP_path}") +endif() + list(REMOVE_DUPLICATES prog_env) vcpkg_add_to_path(PREPEND ${prog_env}) -# More? OBJCC STRIP BIN2C +# More? OBJCC BIN2C file(REMOVE_RECURSE "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg" "${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel") @@ -256,11 +259,6 @@ else() set(ENABLE_SWSCALE OFF) endif() -set(STATIC_LINKAGE OFF) -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - set(STATIC_LINKAGE ON) -endif() - if ("alsa" IN_LIST FEATURES) set(OPTIONS "${OPTIONS} --enable-alsa") else() @@ -599,7 +597,7 @@ if(VCPKG_TARGET_IS_UWP) string(APPEND OPTIONS " --extra-ldflags=-APPCONTAINER --extra-ldflags=WindowsApp.lib") endif() -set(OPTIONS_DEBUG "--debug --disable-optimizations") +set(OPTIONS_DEBUG "--disable-optimizations") set(OPTIONS_RELEASE "--enable-optimizations") set(OPTIONS "${OPTIONS} ${OPTIONS_CROSS}") @@ -614,6 +612,8 @@ elseif(VCPKG_TARGET_IS_WINDOWS) set(OPTIONS "${OPTIONS} --extra-cflags=-DHAVE_UNISTD_H=0") endif() +vcpkg_find_acquire_program(PKGCONFIG) +set(OPTIONS "${OPTIONS} --pkg-config=${PKGCONFIG}") if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") set(OPTIONS "${OPTIONS} --pkg-config-flags=--static") endif() @@ -653,12 +653,16 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY) + z_vcpkg_setup_pkgconfig_path(CONFIG RELEASE) + vcpkg_execute_required_process( COMMAND "${SHELL}" ./build.sh WORKING_DIRECTORY "${BUILD_DIR}" LOGNAME "build-${TARGET_TRIPLET}-rel" SAVE_LOG_FILES ffbuild/config.log ) + + z_vcpkg_restore_pkgconfig_path() endif() # Debug build @@ -692,12 +696,16 @@ if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") configure_file("${CMAKE_CURRENT_LIST_DIR}/build.sh.in" "${BUILD_DIR}/build.sh" @ONLY) + z_vcpkg_setup_pkgconfig_path(CONFIG DEBUG) + vcpkg_execute_required_process( COMMAND "${SHELL}" ./build.sh WORKING_DIRECTORY "${BUILD_DIR}" LOGNAME "build-${TARGET_TRIPLET}-dbg" SAVE_LOG_FILES ffbuild/config.log ) + + z_vcpkg_restore_pkgconfig_path() endif() if(VCPKG_TARGET_IS_WINDOWS) diff --git a/ports/ffmpeg/vcpkg.json b/ports/ffmpeg/vcpkg.json index 0901cd571724c6..2360972662e8a0 100644 --- a/ports/ffmpeg/vcpkg.json +++ b/ports/ffmpeg/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ffmpeg", "version": "6.1.1", - "port-version": 6, + "port-version": 7, "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." diff --git a/ports/libsrt/fix-dependency-install.patch b/ports/libsrt/fix-dependency-install.patch deleted file mode 100644 index 2d628e39d8d6cc..00000000000000 --- a/ports/libsrt/fix-dependency-install.patch +++ /dev/null @@ -1,39 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 1492306..3f08b6a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -1133,6 +1133,7 @@ set (INSTALL_SHARED_DIR ${CMAKE_INSTALL_LIBDIR}) - if (CYGWIN) - set (INSTALL_SHARED_DIR ${CMAKE_INSTALL_BINDIR}) - endif() -+set(CMAKE_INSTALL_INCLUDEDIR include) - - message(STATUS "INSTALL DIRS: bin=${CMAKE_INSTALL_BINDIR} lib=${CMAKE_INSTALL_LIBDIR} shlib=${INSTALL_SHARED_DIR} include=${CMAKE_INSTALL_INCLUDEDIR}") - if (NEED_DESTINATION) -@@ -1228,7 +1229,7 @@ macro(srt_add_program name) - if(NOT NEED_DESTINATION) - install(TARGETS ${name} RUNTIME) - elseif (DEFINED CMAKE_INSTALL_BINDIR) -- install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ install(TARGETS ${name} RUNTIME DESTINATION tools) - else() - message(WARNING "No location to install program ${name}") - endif() -@@ -1273,7 +1274,7 @@ macro(srt_add_application name) # ARGN=sources... - if(NOT NEED_DESTINATION) - install(TARGETS ${name} RUNTIME) - elseif (DEFINED CMAKE_INSTALL_BINDIR) -- install(TARGETS ${name} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ install(TARGETS ${name} RUNTIME DESTINATION tools) - else() - message(WARNING "No location to install program ${name}") - endif() -@@ -1483,7 +1484,7 @@ endif() - if(NOT NEED_DESTINATION) - install(PROGRAMS scripts/srt-ffplay TYPE BIN) - elseif (DEFINED CMAKE_INSTALL_BINDIR) -- install(PROGRAMS scripts/srt-ffplay DESTINATION ${CMAKE_INSTALL_BINDIR}) -+ install(PROGRAMS scripts/srt-ffplay DESTINATION tools) - else() - message(WARNING "No location to install scripts/srt-ffplay") - endif() diff --git a/ports/libsrt/pkgconfig.diff b/ports/libsrt/pkgconfig.diff new file mode 100644 index 00000000000000..5235e840daa134 --- /dev/null +++ b/ports/libsrt/pkgconfig.diff @@ -0,0 +1,16 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1492306..69287ec 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1182,7 +1182,11 @@ endif() + # if your build requires it, you'd probably remove -lstdc++ from the list + # obtained by `pkg-config --libs`. + if(ENABLE_CXX_DEPS) ++ cmake_policy(SET CMP0057 NEW) + foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}) ++ if(LIB IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES) ++ continue() ++ endif() + if((IS_ABSOLUTE ${LIB} AND EXISTS ${LIB}) OR (${LIB} MATCHES "^-l")) + set(SRT_LIBS_PRIVATE ${SRT_LIBS_PRIVATE} ${LIB}) + else() diff --git a/ports/libsrt/portfile.cmake b/ports/libsrt/portfile.cmake index 3ccb41ebb5a824..cd4fcce2bce968 100644 --- a/ports/libsrt/portfile.cmake +++ b/ports/libsrt/portfile.cmake @@ -1,12 +1,12 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Haivision/srt - REF "v${VERSION}" - SHA512 5b576d6fd325515e05074e4568e3b65d1ae265e3e971db6e6242e5138243fc1594df1e3a7d90962385dac38abc34c4c4b0a567439050f8c0ff818b3b3d497efc + REF "v${VERSION}" + SHA512 5b576d6fd325515e05074e4568e3b65d1ae265e3e971db6e6242e5138243fc1594df1e3a7d90962385dac38abc34c4c4b0a567439050f8c0ff818b3b3d497efc HEAD_REF master PATCHES - fix-dependency-install.patch fix-static.patch + pkgconfig.diff ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" KEYSTONE_BUILD_STATIC) @@ -15,7 +15,7 @@ string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" KEYSTONE_BUILD_SHARED) vcpkg_check_features( OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES - tool ENABLE_APPS + tool ENABLE_APPS bonding ENABLE_BONDING ) @@ -33,10 +33,24 @@ vcpkg_cmake_install() vcpkg_copy_pdbs() vcpkg_fixup_pkgconfig() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") - -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") +if(ENABLE_APPS) + if(NOT MINGW) + vcpkg_copy_tools(TOOL_NAMES srt-tunnel AUTO_CLEAN) + endif() + vcpkg_copy_tools(TOOL_NAMES srt-file-transmit srt-live-transmit AUTO_CLEAN) + vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}") + file(RENAME "${CURRENT_PACKAGES_DIR}/bin/srt-ffplay" "${CURRENT_PACKAGES_DIR}/tools/${PORT}/srt-ffplay") +endif() +if(KEYSTONE_BUILD_STATIC OR NOT VCPKG_TARGET_IS_WINDOWS) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +else() + file(REMOVE "${CURRENT_PACKAGES_DIR}/bin/srt-ffplay" "${CURRENT_PACKAGES_DIR}/debug/bin/srt-ffplay") endif() -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/srt/srt.h" "#ifdef SRT_DYNAMIC" "#if 1") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/libsrt/vcpkg.json b/ports/libsrt/vcpkg.json index 3114f78c8589c5..46e9c0da8fe85a 100644 --- a/ports/libsrt/vcpkg.json +++ b/ports/libsrt/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libsrt", "version": "1.5.3", + "port-version": 1, "description": "Secure Reliable Transport (SRT) is an open source transport technology that optimizes streaming performance across unpredictable networks, such as the Internet.", "homepage": "https://github.com/Haivision/srt", "license": "MPL-2.0", diff --git a/ports/snappy/pkgconfig.diff b/ports/snappy/pkgconfig.diff new file mode 100644 index 00000000000000..d3fc64739c7692 --- /dev/null +++ b/ports/snappy/pkgconfig.diff @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c3062e2..05477e9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -417,4 +417,18 @@ if(SNAPPY_INSTALL) + "${PROJECT_BINARY_DIR}/cmake/${PROJECT_NAME}ConfigVersion.cmake" + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}" + ) ++ ++ cmake_policy(SET CMP0057 NEW) ++ set(LIBS_PRIVATE "") ++ foreach(lib IN LISTS CMAKE_CXX_IMPLICIT_LINK_LIBRARIES) ++ if(lib IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES) ++ continue() ++ elseif(EXISTS "${lib}") ++ string(APPEND LIBS_PRIVATE " ${CMAKE_LINK_LIBRARY_FILE_FLAG}${lib}") ++ else() ++ string(APPEND LIBS_PRIVATE " ${CMAKE_LINK_LIBRARY_FLAG}${lib}") ++ endif() ++ endforeach() ++ configure_file(snappy.pc.in "${CMAKE_CURRENT_BINARY_DIR}/snappy.pc" @ONLY) ++ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/snappy.pc" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") + endif(SNAPPY_INSTALL) diff --git a/ports/snappy/portfile.cmake b/ports/snappy/portfile.cmake index 0c70980821b23f..0312b2ae14c73b 100644 --- a/ports/snappy/portfile.cmake +++ b/ports/snappy/portfile.cmake @@ -1,16 +1,15 @@ -file(READ "${CURRENT_PORT_DIR}/vcpkg.json" manifest) -string(JSON version GET "${manifest}" version) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/snappy - REF ${version} + REF ${VERSION} SHA512 3578597f1d4ec09104ce0296b825b013590351230dfe56c635081fd282ce7a13a34caf2c283ac77bd24065e2d27af6db068d1f84b98cec2fd39a0e37a0d77070 HEAD_REF master PATCHES fix_clang-cl_build.patch no-werror.patch + pkgconfig.diff ) +file(COPY "${CURRENT_PORT_DIR}/snappy.pc.in" DESTINATION "${SOURCE_PATH}") vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" @@ -29,16 +28,7 @@ vcpkg_cmake_configure( vcpkg_cmake_install() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/Snappy) vcpkg_copy_pdbs() - -string(JSON description GET "${manifest}" description) -set(name "${PORT}") - -configure_file("${CURRENT_PORT_DIR}/${PORT}.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${PORT}.pc" @ONLY) -if(NOT VCPKG_BUILD_TYPE) - configure_file("${CURRENT_PORT_DIR}/${PORT}.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${PORT}.pc" @ONLY) - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${PORT}.pc" "/include" "/../include") -endif() - +vcpkg_fixup_pkgconfig() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") diff --git a/ports/snappy/snappy.pc.in b/ports/snappy/snappy.pc.in index 27384a6b7a2f37..a0b039b0ae5924 100644 --- a/ports/snappy/snappy.pc.in +++ b/ports/snappy/snappy.pc.in @@ -3,8 +3,9 @@ exec_prefix=${prefix} libdir=${prefix}/lib includedir=${prefix}/include -Name: @name@ -Description: @description@ -Version: @version@ -Libs: -L${libdir} -l@name@ -Cflags: -I${includedir} \ No newline at end of file +Name: snappy +Description: A fast compressor/decompressor. +Version: @PROJECT_VERSION@ +Libs: -L${libdir} -lsnappy +Cflags: -I${includedir} +Libs.private: @LIBS_PRIVATE@ \ No newline at end of file diff --git a/ports/snappy/vcpkg.json b/ports/snappy/vcpkg.json index d443c91d69317c..f7f29ba8c1f540 100644 --- a/ports/snappy/vcpkg.json +++ b/ports/snappy/vcpkg.json @@ -1,6 +1,7 @@ { "name": "snappy", "version": "1.1.10", + "port-version": 1, "description": "A fast compressor/decompressor.", "homepage": "https://github.com/google/snappy", "license": null, diff --git a/ports/x265/disable-install-pdb.patch b/ports/x265/disable-install-pdb.patch index 6826fe8558b6a8..093660086f8f9a 100644 --- a/ports/x265/disable-install-pdb.patch +++ b/ports/x265/disable-install-pdb.patch @@ -1,22 +1,13 @@ -diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt -index 33b6523..06e3193 100644 ---- a/source/CMakeLists.txt -+++ b/source/CMakeLists.txt -@@ -580,13 +580,13 @@ endif() - install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include) - if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED)) - if(MSVC_IDE) -- install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) -- install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) -+ #install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) -+ #install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) - install(FILES "${PROJECT_BINARY_DIR}/Debug/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY) - install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY) - else() -- install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) -- install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) -+ #install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) -+ #install(FILES "${PROJECT_BINARY_DIR}/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) - install(FILES "${PROJECT_BINARY_DIR}/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug OPTIONAL NAMELINK_ONLY) - install(FILES "${PROJECT_BINARY_DIR}/libx265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo OPTIONAL NAMELINK_ONLY) - endif() +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index 11512ff..9ac8057 100755 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -603,7 +603,7 @@ if(SVTHEVC_FOUND) + endif() + + install(FILES x265.h "${PROJECT_BINARY_DIR}/x265_config.h" DESTINATION include) +-if((WIN32 AND ENABLE_CLI) OR (WIN32 AND ENABLE_SHARED)) ++if(0) + if(MSVC_IDE) + install(FILES "${PROJECT_BINARY_DIR}/Debug/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS Debug) + install(FILES "${PROJECT_BINARY_DIR}/RelWithDebInfo/x265.pdb" DESTINATION ${BIN_INSTALL_DIR} CONFIGURATIONS RelWithDebInfo) diff --git a/ports/x265/linkage.diff b/ports/x265/linkage.diff new file mode 100644 index 00000000000000..af5e1f337f5a3b --- /dev/null +++ b/ports/x265/linkage.diff @@ -0,0 +1,18 @@ +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index d6f0e3e..11512ff 100755 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -582,9 +582,13 @@ endif() + if(SVTHEVC_FOUND) + target_link_libraries(x265-static ${SVT_HEVC_LIBRARY}) + endif() ++if(ENABLE_SHARED) ++ set_target_properties(x265-static PROPERTIES EXCLUDE_FROM_ALL 1) ++else() + install(TARGETS x265-static + LIBRARY DESTINATION ${LIB_INSTALL_DIR} + ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) ++endif() + + if(ENABLE_HDR10_PLUS) + install(TARGETS hdr10plus-static diff --git a/ports/x265/pkgconfig.diff b/ports/x265/pkgconfig.diff new file mode 100644 index 00000000000000..bb834cf0bcccf0 --- /dev/null +++ b/ports/x265/pkgconfig.diff @@ -0,0 +1,58 @@ +diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt +index a407271..a575642 100755 +--- a/source/CMakeLists.txt ++++ b/source/CMakeLists.txt +@@ -572,6 +572,9 @@ else() + endif() + if(NOT MSVC) + set_target_properties(x265-static PROPERTIES OUTPUT_NAME x265) ++ set(X265_LIB x265) ++else() ++ set(X265_LIB x265-static) + endif() + if(EXTRA_LIB) + target_link_libraries(x265-static ${EXTRA_LIB}) +@@ -655,8 +658,10 @@ if(ENABLE_SHARED) + endif(SVTHEVC_FOUND) + if(MSVC) + set_target_properties(x265-shared PROPERTIES OUTPUT_NAME libx265) ++ set(X265_LIB libx265) + else() + set_target_properties(x265-shared PROPERTIES OUTPUT_NAME x265) ++ set(X265_LIB x265) + endif() + if(UNIX) + set_target_properties(x265-shared PROPERTIES VERSION ${X265_BUILD}) +@@ -693,7 +698,11 @@ endif() + + if(X265_LATEST_TAG) + # convert lists of link libraries into -lstdc++ -lm etc.. ++ cmake_policy(SET CMP0057 NEW) + foreach(LIB ${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES} ${PLATFORM_LIBS}) ++ if(LIB IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES) ++ continue() ++ endif() + if(IS_ABSOLUTE ${LIB} AND EXISTS ${LIB}) + list(APPEND PLIBLIST "${LIB}") + else() +@@ -702,7 +711,7 @@ if(X265_LATEST_TAG) + endforeach() + if(PLIBLIST) + # blacklist of libraries that should not be in Libs.private +- list(REMOVE_ITEM PLIBLIST "-lc" "-lpthread" "-lmingwex" "-lmingwthrd" ++ list(REMOVE_ITEM PLIBLIST "-lc" "-lmingwex" "-lmingwthrd" + "-lmingw32" "-lmoldname" "-lmsvcrt" "-ladvapi32" "-lshell32" + "-luser32" "-lkernel32") + string(REPLACE ";" " " PRIVATE_LIBS "${PLIBLIST}") +diff --git a/source/x265.pc.in b/source/x265.pc.in +index 0bf99e9..fe76d20 100644 +--- a/source/x265.pc.in ++++ b/source/x265.pc.in +@@ -6,6 +6,6 @@ includedir=${prefix}/include + Name: @CMAKE_PROJECT_NAME@ + Description: H.265/HEVC video encoder + Version: @X265_LATEST_TAG@ +-Libs: -L${libdir} -lx265 ++Libs: -L${libdir} -l@X265_LIB@ + Libs.private: @PRIVATE_LIBS@ + Cflags: -I${includedir} diff --git a/ports/x265/portfile.cmake b/ports/x265/portfile.cmake index e4b5bc3534574d..32c76fbd370824 100644 --- a/ports/x265/portfile.cmake +++ b/ports/x265/portfile.cmake @@ -7,6 +7,8 @@ vcpkg_from_bitbucket( PATCHES disable-install-pdb.patch version.patch + linkage.diff + pkgconfig.diff ) set(ASSEMBLY_OPTIONS "-DENABLE_ASSEMBLY=OFF") @@ -32,36 +34,14 @@ vcpkg_cmake_configure( vcpkg_cmake_install() vcpkg_copy_pdbs() +vcpkg_fixup_pkgconfig() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") vcpkg_copy_tools(TOOL_NAMES x265 AUTO_CLEAN) -if(VCPKG_TARGET_IS_MINGW AND ENABLE_SHARED) - file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/libx265.a") - file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/libx265.a") +if(VCPKG_TARGET_IS_WINDOWS AND VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/x265.h" "#ifdef X265_API_IMPORTS" "#if 1") endif() -vcpkg_fixup_pkgconfig() -if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW AND ENABLE_SHARED) - file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/x265-static.lib") - file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/x265-static.lib") -endif() -vcpkg_list(SET pc_files "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/x265.pc") -if(NOT VCPKG_BUILD_TYPE) - vcpkg_list(APPEND pc_files "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/x265.pc") -endif() -foreach(FILE IN LISTS pc_files) - file(READ "${FILE}" _contents) - if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - if (NOT ENABLE_SHARED) - string(REPLACE "-lx265" "-lx265-static" _contents "${_contents}") - endif() - else() - string(REPLACE " -lgcc_s" "" _contents "${_contents}") - string(REPLACE " -lgcc" "" _contents "${_contents}") - endif() - file(WRITE "${FILE}" "${_contents}") -endforeach() +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -# Handle copyright vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING") diff --git a/ports/x265/vcpkg.json b/ports/x265/vcpkg.json index 651eec5e3d9687..6526cc7e026d2b 100644 --- a/ports/x265/vcpkg.json +++ b/ports/x265/vcpkg.json @@ -1,6 +1,7 @@ { "name": "x265", "version": "3.5", + "port-version": 1, "description": "x265 is a H.265 / HEVC video encoder application library, designed to encode video or images into an H.265 / HEVC encoded bitstream.", "homepage": "https://github.com/videolan/x265", "license": "GPL-2.0-or-later", diff --git a/versions/a-/alsa.json b/versions/a-/alsa.json index 897a37e0670d43..6b31734baf95e0 100644 --- a/versions/a-/alsa.json +++ b/versions/a-/alsa.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "7ca33fd13a8aadfd37ec4696181eb98d0226a738", + "version": "1.2.11", + "port-version": 2 + }, { "git-tree": "78ad470e54eac71113219036519aa55ff3489294", "version": "1.2.11", diff --git a/versions/baseline.json b/versions/baseline.json index 00c374d5f750cb..e8dcff01f05606 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -94,7 +94,7 @@ }, "alsa": { "baseline": "1.2.11", - "port-version": 1 + "port-version": 2 }, "amd-adl-sdk": { "baseline": "17.1", @@ -2674,7 +2674,7 @@ }, "fdk-aac": { "baseline": "2.0.2", - "port-version": 3 + "port-version": 4 }, "fdlibm": { "baseline": "5.3", @@ -2682,7 +2682,7 @@ }, "ffmpeg": { "baseline": "6.1.1", - "port-version": 6 + "port-version": 7 }, "ffnvcodec": { "baseline": "12.1.14.0", @@ -5006,7 +5006,7 @@ }, "libsrt": { "baseline": "1.5.3", - "port-version": 0 + "port-version": 1 }, "libsrtp": { "baseline": "2.5.0", @@ -8206,7 +8206,7 @@ }, "snappy": { "baseline": "1.1.10", - "port-version": 0 + "port-version": 1 }, "sndfile": { "baseline": "0", @@ -9438,7 +9438,7 @@ }, "x265": { "baseline": "3.5", - "port-version": 0 + "port-version": 1 }, "x86-simd-sort": { "baseline": "4.0", diff --git a/versions/f-/fdk-aac.json b/versions/f-/fdk-aac.json index c070dd61714832..82451c13eb06e1 100644 --- a/versions/f-/fdk-aac.json +++ b/versions/f-/fdk-aac.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "83ef7219dea393b1777a14abff792d146e0f39fe", + "version-semver": "2.0.2", + "port-version": 4 + }, { "git-tree": "557cf019e07ef3e1c865204c7509bb7920301a89", "version-semver": "2.0.2", diff --git a/versions/f-/ffmpeg.json b/versions/f-/ffmpeg.json index c7e560388d5199..8e5d30d7bac61d 100644 --- a/versions/f-/ffmpeg.json +++ b/versions/f-/ffmpeg.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "43a794215eb84acb9f6e49f2aee3a3ee1ac1af92", + "version": "6.1.1", + "port-version": 7 + }, { "git-tree": "bad8797d669a583736212969fbbf6298497880b2", "version": "6.1.1", diff --git a/versions/l-/libsrt.json b/versions/l-/libsrt.json index 477ff22d97304f..008169aed6487e 100644 --- a/versions/l-/libsrt.json +++ b/versions/l-/libsrt.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0ef5c07af28fb2b9c3ea49b40716593f14c48b8b", + "version": "1.5.3", + "port-version": 1 + }, { "git-tree": "6e18c5142063f271c53bf008d8421192743f968e", "version": "1.5.3", diff --git a/versions/s-/snappy.json b/versions/s-/snappy.json index 06d7e64ac076dd..ba5f229034deaa 100644 --- a/versions/s-/snappy.json +++ b/versions/s-/snappy.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "52d0b0f59c6f6e765c7f8df9e075ff7b90552c1e", + "version": "1.1.10", + "port-version": 1 + }, { "git-tree": "674abac6de71455f63c6649f436ff0801545ae00", "version": "1.1.10", diff --git a/versions/x-/x265.json b/versions/x-/x265.json index 9032e9044cc8dd..06559350db5019 100644 --- a/versions/x-/x265.json +++ b/versions/x-/x265.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "93b9b05210a7eeeb11abdf3f09ad3f949047ed20", + "version": "3.5", + "port-version": 1 + }, { "git-tree": "b234c25f697f72c031c5d243a78be3dbb98c93c2", "version": "3.5",