From 5e3917d4ba45169237efb634ee49e0d1e5df621f Mon Sep 17 00:00:00 2001 From: autoantwort <41973254+autoantwort@users.noreply.github.com> Date: Thu, 13 Apr 2023 23:50:45 +0200 Subject: [PATCH] [libavif] add missing find_dependency (#30824) --- ports/libavif/find-dependency.patch | 51 +++++++++++++++++++++++++++++ ports/libavif/portfile.cmake | 2 ++ ports/libavif/vcpkg.json | 1 + versions/baseline.json | 2 +- versions/l-/libavif.json | 5 +++ 5 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 ports/libavif/find-dependency.patch diff --git a/ports/libavif/find-dependency.patch b/ports/libavif/find-dependency.patch new file mode 100644 index 0000000000..0da3946482 --- /dev/null +++ b/ports/libavif/find-dependency.patch @@ -0,0 +1,51 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 29d7d60..7e28ba4 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -555,7 +555,7 @@ endif() + if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) + install( + TARGETS avif +- EXPORT ${PROJECT_NAME}-config ++ EXPORT ${PROJECT_NAME}-targets + RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" +@@ -563,7 +563,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) +- install(EXPORT ${PROJECT_NAME}-config DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) ++ install(EXPORT ${PROJECT_NAME}-targets DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) + + include(CMakePackageConfigHelpers) + write_basic_package_version_file( +@@ -572,6 +572,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) ++ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake.in " ++ include(CMakeFindDependencyMacro) ++ set(CMAKE_THREAD_PREFER_PTHREADS ON) ++ set(THREADS_PREFER_PTHREAD_FLAG ON) ++ find_dependency(Threads) ++ ") ++ endif() ++ file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake.in "include(\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}-targets.cmake)") ++ ++ # Install CMake configuration export file. ++ configure_package_config_file( ++ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake.in ++ ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake ++ INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ NO_SET_AND_CHECK_MACRO NO_CHECK_REQUIRED_COMPONENTS_MACRO ++ ) ++ install( ++ FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ++ ) + endif() + + configure_file(libavif.pc.cmake ${CMAKE_CURRENT_BINARY_DIR}/libavif.pc @ONLY) diff --git a/ports/libavif/portfile.cmake b/ports/libavif/portfile.cmake index 6ff442f0a9..6617340bb3 100644 --- a/ports/libavif/portfile.cmake +++ b/ports/libavif/portfile.cmake @@ -7,6 +7,7 @@ vcpkg_from_github( PATCHES disable-source-utf8.patch fix-compiler-warnings.patch + find-dependency.patch # from https://github.com/AOMediaCodec/libavif/pull/1339 ) vcpkg_cmake_configure( @@ -14,6 +15,7 @@ vcpkg_cmake_configure( OPTIONS -DAVIF_CODEC_AOM=ON -DAVIF_BUILD_APPS=OFF + -DCMAKE_REQUIRE_FIND_PACKAGE_libyuv=ON ) vcpkg_cmake_install() diff --git a/ports/libavif/vcpkg.json b/ports/libavif/vcpkg.json index 5b97bb38d5..3b0d1d49aa 100644 --- a/ports/libavif/vcpkg.json +++ b/ports/libavif/vcpkg.json @@ -1,6 +1,7 @@ { "name": "libavif", "version-semver": "0.11.1", + "port-version": 1, "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/versions/baseline.json b/versions/baseline.json index 521ea0e50a..210215fb3c 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3794,7 +3794,7 @@ }, "libavif": { "baseline": "0.11.1", - "port-version": 0 + "port-version": 1 }, "libb2": { "baseline": "0.98.1", diff --git a/versions/l-/libavif.json b/versions/l-/libavif.json index b90ae2bb86..29aee2f4e9 100644 --- a/versions/l-/libavif.json +++ b/versions/l-/libavif.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "775b04db12d2353cc6e69d54faef89b857dd32eb", + "version-semver": "0.11.1", + "port-version": 1 + }, { "git-tree": "11db2c9c2c399768d55d5b54f203e1f789d06936", "version-semver": "0.11.1",