Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions ports/ffmpeg/0004-dependencies.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
diff --git a/configure b/configure
index 3243e23021..6d3f31fc95 100755
@@ -6630,7 +6630,7 @@ fi
index a8b74e0..c99f41c 100755
--- a/configure
+++ b/configure
@@ -6633,7 +6633,7 @@ fi

enabled zlib && { check_pkg_config zlib zlib "zlib.h" zlibVersion ||
check_lib zlib zlib.h zlibVersion -lz; }
Expand All @@ -19,7 +21,16 @@ index 3243e23021..6d3f31fc95 100755
enabled libmysofa && { check_pkg_config libmysofa libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine ||
require libmysofa mysofa.h mysofa_neighborhood_init_withstepdefine -lmysofa $zlib_extralibs; }
enabled libnpp && { check_lib libnpp npp.h nppGetLibVersion -lnppig -lnppicc -lnppc -lnppidei -lnppif ||
@@ -6793,8 +6794,8 @@ enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 2019.
@@ -6772,7 +6773,7 @@ enabled libopencv && { check_headers opencv2/core/core_c.h &&
enabled libopenh264 && require_pkg_config libopenh264 openh264 wels/codec_api.h WelsGetCodecVersion
enabled libopenjpeg && { check_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version ||
{ require_pkg_config libopenjpeg "libopenjp2 >= 2.1.0" openjpeg.h opj_version -DOPJ_STATIC && add_cppflags -DOPJ_STATIC; } }
-enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create -lstdc++ && append libopenmpt_extralibs "-lstdc++"
+enabled libopenmpt && require_pkg_config libopenmpt "libopenmpt >= 0.2.6557" libopenmpt/libopenmpt.h openmpt_module_create
enabled libopenvino && { { check_pkg_config libopenvino openvino openvino/c/openvino.h ov_core_create && enable openvino2; } ||
{ check_pkg_config libopenvino openvino c_api/ie_c_api.h ie_c_api_version ||
require libopenvino c_api/ie_c_api.h ie_c_api_version -linference_engine_c_api; } }
@@ -6796,8 +6797,8 @@ enabled libshaderc && require_pkg_config spirv_compiler "shaderc >= 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; }
Expand All @@ -30,7 +41,7 @@ index 3243e23021..6d3f31fc95 100755
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
@@ -6884,6 +6885,8 @@ enabled openal && { check_pkg_config openal "openal >= 1.1" "AL/al.h"
@@ -6880,6 +6881,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 ||
Expand All @@ -39,7 +50,7 @@ index 3243e23021..6d3f31fc95 100755
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)" ||
@@ -7208,10 +7211,10 @@ enabled amf &&
@@ -7204,10 +7207,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
Expand Down
31 changes: 18 additions & 13 deletions ports/ffmpeg/FindFFMPEG.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,22 @@ function(append_dependencies out)
set(config RELEASE)
set(path "${CURRENT_INSTALLED_DIR}/lib/")
endif()
foreach(lib_name ${arg_NAMES})
if("${lib_name}" STREQUAL "-pthread")
list(APPEND ${out} "-pthread")
elseif("${lib_name}" STREQUAL "-pthreads")
list(APPEND ${out} "-pthreads")
elseif("${lib_name}" STREQUAL "gcc")
list(APPEND ${out} "-lgcc")
elseif("${lib_name}" STREQUAL "gcc_s")
list(APPEND ${out} "-lgcc_s")
elseif("${lib_name}" STREQUAL "stdc++")
list(APPEND ${out} "-lstdc++")
elseif("${lib_name}" STREQUAL "atomic")
list(APPEND ${out} "-latomic")
if("${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}" STREQUAL "")
enable_language(CXX)
endif()
set(pass_through
${CMAKE_CXX_IMPLICIT_LINK_LIBRARIES}
bcrypt gdi32 mfuuid ole32 oleaut32 psapi secur32 shlwapi strmiids user32 uuid vfw32 ws2_32
-pthread -pthreads pthread atomic m
)
cmake_policy(SET CMP0057 NEW)
foreach(lib_name IN LISTS arg_NAMES)
if(lib_name IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES)
continue() # implicit even for C
elseif(lib_name IN_LIST pass_through)
list(APPEND ${out} "${lib_name}")
elseif(EXISTS "${lib_name}")
list(APPEND ${out} "${lib_name}")
else()
# first look in ${path} specifically to ensure we find the right release/debug variant
find_library(FFMPEG_DEPENDENCY_${lib_name}_${config} NAMES "${lib_name}" PATHS "${path}" NO_DEFAULT_PATH)
Expand Down Expand Up @@ -158,4 +161,6 @@ endif()

find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_LIBRARIES FFMPEG_LIBRARY_DIRS FFMPEG_INCLUDE_DIRS)

set(z_vcpkg_using_vcpkg_find_ffmpeg ${FFMPEG_FOUND})

endif()
8 changes: 8 additions & 0 deletions ports/ffmpeg/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,14 @@ elseif(VCPKG_TARGET_IS_WINDOWS)
set(OPTIONS "${OPTIONS} --extra-cflags=-DHAVE_UNISTD_H=0")
endif()

set(maybe_needed_libraries -lm)
separate_arguments(standard_libraries NATIVE_COMMAND "${VCPKG_DETECTED_CMAKE_C_STANDARD_LIBRARIES}")
foreach(item IN LISTS standard_libraries)
if(item IN_LIST maybe_needed_libraries)
set(OPTIONS "${OPTIONS} \"--extra-libs=${item}\"")
endif()
endforeach()
Comment on lines +675 to +681

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our android toolchains have -lm in standard libraries, so it isn't always passed as an "extra" requirement in exported configs (e.g. by libwebp). This section makes the ffmpeg build behave similar to cmake builds.


vcpkg_find_acquire_program(PKGCONFIG)
set(OPTIONS "${OPTIONS} --pkg-config=${PKGCONFIG}")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
Expand Down
17 changes: 14 additions & 3 deletions ports/ffmpeg/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
set(FFMPEG_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})

include(SelectLibraryConfigurations)

cmake_policy(SET CMP0012 NEW)

# Detect if we use "our" find module or a vendored one
set(z_vcpkg_using_vcpkg_find_ffmpeg OFF)

# Detect targets created e.g. by VTK/CMake/FindFFMPEG.cmake
set(vcpkg_no_avcodec_target ON)
set(vcpkg_no_avformat_target ON)
set(vcpkg_no_avutil_target ON)
Expand All @@ -24,6 +26,11 @@ endif()

_find_package(${ARGS})

# Fixup of variables and targets for (some) vendored find modules
if(NOT z_vcpkg_using_vcpkg_find_ffmpeg)

include(SelectLibraryConfigurations)

if(WIN32)
set(PKG_CONFIG_EXECUTABLE "${CMAKE_CURRENT_LIST_DIR}/../../../@_HOST_TRIPLET@/tools/pkgconf/pkgconf.exe" CACHE STRING "" FORCE)
endif()
Expand Down Expand Up @@ -282,10 +289,14 @@ if(@WITH_OPENCL@)
endif()
endif()

endif(NOT z_vcpkg_using_vcpkg_find_ffmpeg)
unset(z_vcpkg_using_vcpkg_find_ffmpeg)

set(FFMPEG_LIBRARY ${FFMPEG_LIBRARIES})

set(CMAKE_MODULE_PATH ${FFMPEG_PREV_MODULE_PATH})

unset(vcpkg_no_avformat_target)
unset(vcpkg_no_avcodec_target)
unset(vcpkg_no_avformat_target)
unset(vcpkg_no_avutil_target)
unset(vcpkg_no_swresample_target)
2 changes: 1 addition & 1 deletion ports/ffmpeg/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ffmpeg",
"version": "6.1.1",
"port-version": 10,
"port-version": 11,
"description": [
"a library to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created.",
"FFmpeg is the leading multimedia framework, able to decode, encode, transcode, mux, demux, stream, filter and play pretty much anything that humans and machines have created. It supports the most obscure ancient formats up to the cutting edge. No matter if they were designed by some standards committee, the community or a corporation. It is also highly portable: FFmpeg compiles, runs, and passes our testing infrastructure FATE across Linux, Mac OS X, Microsoft Windows, the BSDs, Solaris, etc. under a wide variety of build environments, machine architectures, and configurations."
Expand Down
40 changes: 23 additions & 17 deletions ports/libmodplug/004-export-pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -1,31 +1,40 @@
From 6a3e539ea26eec1bfc2a6e722e923bd5221f8d26 Mon Sep 17 00:00:00 2001
From: "Matthias C. M. Troffaes" <matthias.troffaes@gmail.com>
Date: Thu, 8 Jul 2021 10:47:30 +0100
Subject: [PATCH] Fix Libs.private in .pc file.

---
CMakeLists.txt | 7 +++++--
libmodplug.pc.in | 2 +-
2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 468f1a3..3164fc6 100644
index 2ada51b..a0a28d5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -141,7 +141,11 @@ if(HAVE_SINF)
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 2.8.0)
+cmake_minimum_required(VERSION 3.5)

project(libmodplug)
add_definitions(-DMODPLUG_BUILD)
@@ -131,7 +131,24 @@ if(HAVE_SINF)
add_definitions(-DHAVE_SINF)
endif(HAVE_SINF)

-if (NOT WIN32)
+if(WIN32)
+ set(LIBS_PRIVATE "-luser32")
+else(WIN32)
+ set(LIBS_PRIVATE "-lstdc++ -lm")
+ set(FAKE_CXX_LINKAGE "")
+ foreach(lib IN LISTS CMAKE_CXX_IMPLICIT_LINK_LIBRARIES)
+ if(lib IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES)
+ continue()
+ elseif(EXISTS "${lib}")
+ string(APPEND FAKE_CXX_LINKAGE " ${CMAKE_LINK_LIBRARY_FILE_FLAG}${lib}")
+ else()
+ string(APPEND FAKE_CXX_LINKAGE " ${CMAKE_LINK_LIBRARY_FLAG}${lib}")
+ endif()
+ endforeach()
+ set(LIBS_PRIVATE " ${FAKE_CXX_LINKAGE} ")
+ if(NOT LIBS_PRIVATE MATCHES " -lm ")
+ string(APPEND LIBS_PRIVATE "-lm")
+ endif()
+endif(WIN32)
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "${CMAKE_INSTALL_PREFIX}")
set(libdir "${CMAKE_INSTALL_PREFIX}/lib")
@@ -152,4 +156,3 @@ if (NOT WIN32)
@@ -142,4 +159,3 @@ if (NOT WIN32)
install(FILES "${PROJECT_BINARY_DIR}/libmodplug.pc"
DESTINATION lib/pkgconfig
)
Expand All @@ -41,6 +50,3 @@ index bbf05f9..e4a43cc 100644
-Libs.private: -lstdc++ -lm
+Libs.private: @LIBS_PRIVATE@
Cflags: -I${includedir}
--
2.21.0.windows.1

2 changes: 1 addition & 1 deletion ports/libmodplug/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ vcpkg_from_github(
${STATIC_PATCH}
002-detect_sinf.patch
003-use-static-cast-for-ctype.patch
004-export-pkgconfig.patch # https://github.com/Konstanty/libmodplug/pull/59
004-export-pkgconfig.patch

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the content of the patch has changed, it is recommended to commit it to upstream for tracking.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically yes. OTOH upstream didn'r accept the original PR in three years.

005-fix-install-paths.patch # https://github.com/Konstanty/libmodplug/pull/61
)

Expand Down
2 changes: 1 addition & 1 deletion ports/libmodplug/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "libmodplug",
"version": "0.8.9.0",
"port-version": 12,
"port-version": 13,
"description": "The ModPlug mod file playing library.",
"homepage": "https://github.com/Konstanty/libmodplug",
"license": null,
Expand Down
12 changes: 11 additions & 1 deletion ports/libopenmpt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,18 @@ target_link_libraries(
ZLIB::ZLIB
)

set(FAKE_CXX_LINKAGE "")
foreach(lib IN LISTS CMAKE_CXX_IMPLICIT_LINK_LIBRARIES)
if(lib IN_LIST CMAKE_C_IMPLICIT_LINK_LIBRARIES)
continue()
elseif(EXISTS "${lib}")
string(APPEND FAKE_CXX_LINKAGE " ${CMAKE_LINK_LIBRARY_FILE_FLAG}${lib}")
else()
string(APPEND FAKE_CXX_LINKAGE " ${CMAKE_LINK_LIBRARY_FLAG}${lib}")
endif()
endforeach()
set(LIBOPENMPT_LIBS_PRIVATE "${FAKE_CXX_LINKAGE}")
set(LIBOPENMPT_REQUIRES_PRIVATE "zlib vorbis vorbisfile libmpg123")
set(LIBOPENMPT_LIBS_PRIVATE "")
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix [[${prefix}]])
set(includedir [[${prefix}/include]])
Expand Down
1 change: 1 addition & 0 deletions ports/libopenmpt/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "libopenmpt",
"version": "0.7.4",
"port-version": 1,
"description": "A cross-platform C++ and C library to decode tracked music files (modules) into a raw PCM audio stream.",
"homepage": "https://openmpt.org/",
"license": "BSD-3-Clause",
Expand Down
5 changes: 5 additions & 0 deletions scripts/ci.baseline.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1292,9 +1292,14 @@ vcpkg-ci-curl:x64-windows-static-md=pass
vcpkg-ci-curl:x64-windows-static=pass
vcpkg-ci-curl:x64-windows=pass
vcpkg-ci-curl:x86-windows=pass
vcpkg-ci-ffmpeg:arm-neon-android=pass
vcpkg-ci-ffmpeg:arm64-android=pass
vcpkg-ci-ffmpeg:arm64-osx=pass
vcpkg-ci-ffmpeg:arm64-uwp=pass
vcpkg-ci-ffmpeg:arm64-windows=pass
vcpkg-ci-ffmpeg:x64-android=pass
vcpkg-ci-ffmpeg:x64-linux=pass
vcpkg-ci-ffmpeg:x64-osx=pass
vcpkg-ci-ffmpeg:x64-uwp=pass
vcpkg-ci-ffmpeg:x64-windows-static-md=pass
vcpkg-ci-ffmpeg:x64-windows-static=pass
Expand Down
24 changes: 16 additions & 8 deletions scripts/test_ports/vcpkg-ci-ffmpeg/vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"avformat",
"avresample",
"bzip2",
"fdk-aac",
"freetype",
"gpl",
"iconv",
Expand Down Expand Up @@ -61,6 +60,7 @@
"default-features": false,
"features": [
"ass",
"ffmpeg",
"fontconfig",
"fribidi",
"modplug",
Expand All @@ -70,6 +70,14 @@
],
"platform": "!uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"fdk-aac"
],
"platform": "!android"
},
{
"name": "ffmpeg",
"default-features": false,
Expand Down Expand Up @@ -122,33 +130,33 @@
"name": "ffmpeg",
"default-features": false,
"features": [
"opengl"
"avisynthplus"
],
"platform": "!uwp & !(arm64 & windows)"
"platform": "windows & !arm & !uwp & !static"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"avisynthplus"
"tesseract"
],
"platform": "windows & !arm & !uwp & !static"
"platform": "!(windows & arm) & !static & !uwp"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"tesseract"
"opengl"
],
"platform": "!(windows & arm) & !static & !uwp"
"platform": "!uwp & !(arm64 & windows) & !android"
},
{
"name": "ffmpeg",
"default-features": false,
"features": [
"nvcodec"
],
"platform": "linux | (!osx & !uwp & !(arm64 & windows))"
"platform": "!android & !osx & !uwp & !(arm64 & windows)"
}
]
}
6 changes: 3 additions & 3 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2694,7 +2694,7 @@
},
"ffmpeg": {
"baseline": "6.1.1",
"port-version": 10
"port-version": 11
},
"ffnvcodec": {
"baseline": "12.1.14.0",
Expand Down Expand Up @@ -4714,7 +4714,7 @@
},
"libmodplug": {
"baseline": "0.8.9.0",
"port-version": 12
"port-version": 13
},
"libmorton": {
"baseline": "0.2.12",
Expand Down Expand Up @@ -4798,7 +4798,7 @@
},
"libopenmpt": {
"baseline": "0.7.4",
"port-version": 0
"port-version": 1
},
"libopensp": {
"baseline": "1.5.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/ffmpeg.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "15b90b33b76e69c2d9b876b32c4c9b47c97846ed",
"version": "6.1.1",
"port-version": 11
},
{
"git-tree": "d72e74de0c3755edace24452e7bc74e0f419d65e",
"version": "6.1.1",
Expand Down
Loading