diff --git a/ports/libavif/find-dependency.patch b/ports/libavif/find-dependency.patch index 42498eaf9f5e37..4a4e93c0786e36 100644 --- a/ports/libavif/find-dependency.patch +++ b/ports/libavif/find-dependency.patch @@ -1,8 +1,20 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 46c6059..c0c047a 100644 +index aca5d6f..48a26c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -660,7 +660,7 @@ endif() +@@ -156,7 +156,10 @@ if(AVIF_LOCAL_LIBYUV) + set(libyuv_FOUND TRUE) + message(STATUS "libavif: local libyuv found; libyuv-based fast paths enabled.") + else(AVIF_LOCAL_LIBYUV) +- find_package(libyuv QUIET) # not required ++ find_package(libyuv_config NAMES libyuv CONFIG REQUIRED) ++ set(LIBYUV_INCLUDE_DIR "${libyuv_INCLUDE_DIRS}") ++ set(LIBYUV_LIBRARY "yuv") ++ find_package(libyuv MODULE REQUIRED) + if(libyuv_FOUND) + # libyuv 1755 exposed all of the I*Matrix() functions, which libavif relies on. + # libyuv 1774 exposed ScalePlane_12 function, which libavif can use for some additional optimizations. +@@ -660,7 +663,7 @@ endif() if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) install( TARGETS avif @@ -11,7 +23,7 @@ index 46c6059..c0c047a 100644 RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" -@@ -668,7 +668,7 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) +@@ -668,7 +671,7 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) # Enable CMake configs in VCPKG mode if(BUILD_SHARED_LIBS OR VCPKG_TARGET_TRIPLET) @@ -20,15 +32,15 @@ index 46c6059..c0c047a 100644 include(CMakePackageConfigHelpers) write_basic_package_version_file( -@@ -677,6 +677,28 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) +@@ -677,6 +680,28 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) + file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake.in "@PACKAGE_INIT@\n") -+ if(UNIX AND NOT BUILD_SHARED_LIBS) ++ if(NOT BUILD_SHARED_LIBS) + file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake.in " + include(CMakeFindDependencyMacro) -+ set(CMAKE_THREAD_PREFER_PTHREADS ON) ++ find_dependency(libyuv CONFIG) + set(THREADS_PREFER_PTHREAD_FLAG ON) + find_dependency(Threads) + ") diff --git a/ports/libavif/portfile.cmake b/ports/libavif/portfile.cmake index aaa9dfcdd48f1b..3129b86ab07ac0 100644 --- a/ports/libavif/portfile.cmake +++ b/ports/libavif/portfile.cmake @@ -19,7 +19,7 @@ vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" OPTIONS -DAVIF_BUILD_APPS=OFF - -DCMAKE_REQUIRE_FIND_PACKAGE_libyuv=ON + -DCMAKE_DISABLE_FIND_PACKAGE_libsharpyuv=ON ${FEATURE_OPTIONS} ) diff --git a/ports/libavif/vcpkg.json b/ports/libavif/vcpkg.json index ff8e9c058c0ad5..6dda17fd5416fe 100644 --- a/ports/libavif/vcpkg.json +++ b/ports/libavif/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libavif", "version-semver": "1.0.4", - "port-version": 1, + "port-version": 2, "description": "Library for encoding and decoding AVIF files", "homepage": "https://github.com/AOMediaCodec/libavif", "license": "BSD-2-Clause AND Apache-2.0", diff --git a/ports/libyuv/cmake.diff b/ports/libyuv/cmake.diff new file mode 100644 index 00000000000000..e50b60077bc95e --- /dev/null +++ b/ports/libyuv/cmake.diff @@ -0,0 +1,46 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9a20941..945c5a4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -4,8 +4,8 @@ + + include(CheckCSourceCompiles) + ++cmake_minimum_required(VERSION 3.12) + project ( YUV C CXX ) # "C" is required even for C++ projects +-cmake_minimum_required( VERSION 2.8.12 ) + option( UNIT_TEST "Built unit tests" OFF ) + + set ( ly_base_dir ${PROJECT_SOURCE_DIR} ) +@@ -164,7 +164,8 @@ target_link_libraries ( yuvconstants ${ly_lib_static} ) + find_package ( JPEG ) + if (JPEG_FOUND) + include_directories( ${JPEG_INCLUDE_DIR} ) +- target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} ) ++ target_link_libraries( ${ly_lib_static} PRIVATE JPEG::JPEG ) ++ target_link_libraries( ${ly_lib_shared} PRIVATE JPEG::JPEG ) + add_definitions( -DHAVE_JPEG ) + endif() + +@@ -211,9 +212,18 @@ endif() + + + # install the conversion tool, .so, .a, and all the header files +-install ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) +-install ( TARGETS ${ly_lib_static} DESTINATION lib ) +-install ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) ++install(TARGETS yuvconvert) ++if(BUILD_SHARED_LIBS) ++ target_include_directories(${ly_lib_shared} PUBLIC $) ++ install(TARGETS ${ly_lib_shared} EXPORT libyuv-targets) ++ set_target_properties(${ly_lib_shared} PROPERTIES EXPORT_NAME "${ly_lib_static}") # vcpkg legacy ++ add_definitions(-DLIBYUV_BUILDING_SHARED_LIBRARY) ++else() ++ target_include_directories(${ly_lib_static} PUBLIC $) ++ install(TARGETS ${ly_lib_static} EXPORT libyuv-targets) ++ set_target_properties(${ly_lib_shared} PROPERTIES EXCLUDE_FROM_ALL 1) ++endif() ++install(EXPORT libyuv-targets DESTINATION share/libyuv) + install ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) + + # create the .deb and .rpm packages using cpack diff --git a/ports/libyuv/fix-cmakelists.patch b/ports/libyuv/fix-cmakelists.patch deleted file mode 100644 index 1f094c42ee9d8a..00000000000000 --- a/ports/libyuv/fix-cmakelists.patch +++ /dev/null @@ -1,89 +0,0 @@ -Subject: [PATCH] patch cmakelist for vcpkg ---- -Index: CMakeLists.txt -IDEA additional info: -Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP -<+>UTF-8 -=================================================================== -diff --git a/CMakeLists.txt b/CMakeLists.txt ---- a/CMakeLists.txt (revision 010dea8ba4158896e5608a52dd4372ca7f57cdca) -+++ b/CMakeLists.txt (revision da9ae4ff969b9722ce90b800d514fa26ad1fdf87) -@@ -2,18 +2,21 @@ - # Originally created for "roxlu build system" to compile libyuv on windows - # Run with -DTEST=ON to build unit tests - -+CMAKE_MINIMUM_REQUIRED( VERSION 3.12) -+ - PROJECT ( YUV C CXX ) # "C" is required even for C++ projects --CMAKE_MINIMUM_REQUIRED( VERSION 2.8.12 ) - OPTION( TEST "Built unit tests" OFF ) - -+SET( CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON ) -+ - SET ( ly_base_dir ${PROJECT_SOURCE_DIR} ) - SET ( ly_src_dir ${ly_base_dir}/source ) - SET ( ly_inc_dir ${ly_base_dir}/include ) - SET ( ly_tst_dir ${ly_base_dir}/unit_test ) - SET ( ly_lib_name yuv ) - SET ( ly_lib_static ${ly_lib_name} ) --SET ( ly_lib_shared ${ly_lib_name}_shared ) - -+FILE ( GLOB_RECURSE ly_include_files ${ly_inc_dir}/libyuv/*.h ) - FILE ( GLOB_RECURSE ly_source_files ${ly_src_dir}/*.cc ) - LIST ( SORT ly_source_files ) - -@@ -28,27 +31,20 @@ - - # this creates the static library (.a) - ADD_LIBRARY ( ${ly_lib_static} STATIC ${ly_source_files} ) -- --# this creates the shared library (.so) --ADD_LIBRARY ( ${ly_lib_shared} SHARED ${ly_source_files} ) --SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES OUTPUT_NAME "${ly_lib_name}" ) --SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES PREFIX "lib" ) --if(WIN32) -- SET_TARGET_PROPERTIES ( ${ly_lib_shared} PROPERTIES IMPORT_PREFIX "lib" ) --endif() -+SET_TARGET_PROPERTIES ( ${ly_lib_static} PROPERTIES PUBLIC_HEADER include/libyuv.h ) - - # this creates the conversion tool --ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) --TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) -+ADD_EXECUTABLE ( yuvconvert ${ly_base_dir}/util/yuvconvert.cc ) -+TARGET_LINK_LIBRARIES ( yuvconvert ${ly_lib_static} ) - - # this creates the yuvconstants tool --ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c ) --TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} ) -+ADD_EXECUTABLE ( yuvconstants ${ly_base_dir}/util/yuvconstants.c ) -+TARGET_LINK_LIBRARIES ( yuvconstants ${ly_lib_static} ) - - find_package ( JPEG ) - if (JPEG_FOUND) -- include_directories( ${JPEG_INCLUDE_DIR} ) -- target_link_libraries( ${ly_lib_shared} ${JPEG_LIBRARY} ) -+ include_directories( ${JPEG_INCLUDE_DIR}) -+ target_link_libraries(${ly_lib_static} PUBLIC ${JPEG_LIBRARY}) - add_definitions( -DHAVE_JPEG ) - endif() - -@@ -87,14 +83,13 @@ - target_link_libraries(libyuv_unittest gflags) - add_definitions(-DLIBYUV_USE_GFLAGS) - endif() --endif() -+endif() - -- - # install the conversion tool, .so, .a, and all the header files --INSTALL ( PROGRAMS ${CMAKE_BINARY_DIR}/yuvconvert DESTINATION bin ) --INSTALL ( TARGETS ${ly_lib_static} DESTINATION lib ) --INSTALL ( TARGETS ${ly_lib_shared} LIBRARY DESTINATION lib RUNTIME DESTINATION bin ) --INSTALL ( DIRECTORY ${PROJECT_SOURCE_DIR}/include/ DESTINATION include ) -+INSTALL ( TARGETS yuvconvert DESTINATION bin ) -+INSTALL ( FILES ${ly_include_files} DESTINATION include/libyuv ) -+INSTALL ( TARGETS ${ly_lib_static} EXPORT libyuv-targets DESTINATION lib INCLUDES DESTINATION include PUBLIC_HEADER DESTINATION include ) -+INSTALL( EXPORT libyuv-targets DESTINATION share/cmake/libyuv/ EXPORT_LINK_INTERFACE_LIBRARIES ) - - # create the .deb and .rpm packages using cpack - INCLUDE ( CM_linux_packages.cmake ) diff --git a/ports/libyuv/portfile.cmake b/ports/libyuv/portfile.cmake index 8d596aa2fc34c6..b13afab86c58cc 100644 --- a/ports/libyuv/portfile.cmake +++ b/ports/libyuv/portfile.cmake @@ -1,39 +1,41 @@ -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_git( OUT_SOURCE_PATH SOURCE_PATH URL https://chromium.googlesource.com/libyuv/libyuv - REF 0faf8dd0e004520a61a603a4d2996d5ecc80dc3f + REF c21dda06dd8d19b6e50168c28c324c1f32e94407 # 6 commits after switch to 1895, reason: CMake changes # Check https://chromium.googlesource.com/libyuv/libyuv/+/refs/heads/main/include/libyuv/version.h for a version! PATCHES - fix-cmakelists.patch + cmake.diff ) vcpkg_cmake_configure( - SOURCE_PATH ${SOURCE_PATH} - OPTIONS - ${BUILD_OPTIONS} - OPTIONS_DEBUG - -DCMAKE_DEBUG_POSTFIX=d + SOURCE_PATH "${SOURCE_PATH}" ) vcpkg_cmake_install() +vcpkg_cmake_config_fixup() vcpkg_copy_pdbs() - -vcpkg_cmake_config_fixup(CONFIG_PATH share/cmake/libyuv) vcpkg_copy_tools(TOOL_NAMES yuvconvert AUTO_CLEAN) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) -file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) +if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/libyuv/basic_types.h" "defined(LIBYUV_USING_SHARED_LIBRARY)" "1") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -configure_file(${CMAKE_CURRENT_LIST_DIR}/libyuv-config.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT} COPYONLY) -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) +file(COPY "${CMAKE_CURRENT_LIST_DIR}/libyuv-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(COPY "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") vcpkg_cmake_get_vars(cmake_vars_file) include("${cmake_vars_file}") -if (VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - message(WARNING "Use MSVC to compile libyuv results in a very slow library. (https://github.com/microsoft/vcpkg/issues/28446)") - file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage-msvc" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME "usage") -else () - file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") -endif () \ No newline at end of file +if(VCPKG_DETECTED_CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") + file(APPEND "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" [[ + +Attention: +You are using MSVC to compile libyuv. This build won't compile any +of the acceleration codes, which results in a very slow library. +See workarounds: https://github.com/microsoft/vcpkg/issues/28446 +]]) +endif() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/libyuv/usage b/ports/libyuv/usage index fa0be3879ab14f..b4c7d12f9904ea 100644 --- a/ports/libyuv/usage +++ b/ports/libyuv/usage @@ -1,4 +1,5 @@ libyuv provides CMake targets: - find_package(libyuv CONFIG REQUIRED) - target_link_libraries(main PRIVATE yuv) \ No newline at end of file + # Unofficial config package and target from vcpkg + find_package(libyuv CONFIG REQUIRED) + target_link_libraries(main PRIVATE yuv) diff --git a/ports/libyuv/usage-msvc b/ports/libyuv/usage-msvc deleted file mode 100644 index 009c5b6d099467..00000000000000 --- a/ports/libyuv/usage-msvc +++ /dev/null @@ -1,9 +0,0 @@ -libyuv provides CMake targets: - - find_package(libyuv CONFIG REQUIRED) - target_link_libraries(main PRIVATE yuv) - - # WARNING - # You are using MSVC to compile libyuv, which results in a very slow library. - # MSVC won't compile any of the acceleration codes. - # See workarounds: https://github.com/microsoft/vcpkg/issues/28446 diff --git a/ports/libyuv/vcpkg.json b/ports/libyuv/vcpkg.json index b60af1037be4fa..2bd7dc3316aa8c 100644 --- a/ports/libyuv/vcpkg.json +++ b/ports/libyuv/vcpkg.json @@ -1,7 +1,6 @@ { "name": "libyuv", - "version": "1857", - "port-version": 1, + "version": "1895", "description": "libyuv is an open source project that includes YUV scaling and conversion functionality", "homepage": "https://chromium.googlesource.com/libyuv/libyuv", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index 269f723741b0e9..f5bf78fd060411 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4266,7 +4266,7 @@ }, "libavif": { "baseline": "1.0.4", - "port-version": 1 + "port-version": 2 }, "libb2": { "baseline": "0.98.1", @@ -5397,8 +5397,8 @@ "port-version": 5 }, "libyuv": { - "baseline": "1857", - "port-version": 1 + "baseline": "1895", + "port-version": 0 }, "libzen": { "baseline": "0.4.41", diff --git a/versions/l-/libavif.json b/versions/l-/libavif.json index a3042025418645..2b4c1a1231a29a 100644 --- a/versions/l-/libavif.json +++ b/versions/l-/libavif.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "30218a66d9e44d06cd55a1e7d29e501ceeba42da", + "version-semver": "1.0.4", + "port-version": 2 + }, { "git-tree": "5464a231b3a83e3d8a076b339d93c5247d04b36b", "version-semver": "1.0.4", diff --git a/versions/l-/libyuv.json b/versions/l-/libyuv.json index 16f58ca9ec10d8..b3e31c6ec49322 100644 --- a/versions/l-/libyuv.json +++ b/versions/l-/libyuv.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8248e631c414a1497fe1c8100a658b6f9f180a4d", + "version": "1895", + "port-version": 0 + }, { "git-tree": "a814249d5f2638de96bece573dfddddadec7527c", "version": "1857",