From be3b12a118abac35feeb2961f8dbcf7f9d09f27f Mon Sep 17 00:00:00 2001 From: Lily Wang <94091114+LilyWangLL@users.noreply.github.com> Date: Wed, 21 Feb 2024 09:39:38 -0800 Subject: [PATCH] [ptex] Update to 2.4.2 (#36842) Fixes #36806 Usage passed on `x64-windows`. - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [x] SHA512s are updated for each updated download. - [ ] ~~The "supports" clause reflects platforms that may be fixed by this new version.~~ - [ ] Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file. - [x] Any patches that are no longer applied are deleted from the port's directory. - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file. --------- Co-authored-by: Lily Wang --- ports/ptex/fix-build.patch | 95 ++++++------------------------- ports/ptex/fix-config.cmake.patch | 18 ------ ports/ptex/portfile.cmake | 21 +++---- ports/ptex/usage | 4 ++ ports/ptex/vcpkg.json | 4 +- versions/baseline.json | 4 +- versions/p-/ptex.json | 5 ++ 7 files changed, 38 insertions(+), 113 deletions(-) delete mode 100644 ports/ptex/fix-config.cmake.patch create mode 100644 ports/ptex/usage diff --git a/ports/ptex/fix-build.patch b/ports/ptex/fix-build.patch index 9c74eeda8f..752febf205 100644 --- a/ports/ptex/fix-build.patch +++ b/ports/ptex/fix-build.patch @@ -1,99 +1,40 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index c708153..0e004da 100644 +index 2f8c3af..d4d4425 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -60,10 +60,11 @@ include(GNUInstallDirs) +@@ -27,7 +27,9 @@ set(THREADS_PREFER_PTHREAD_FLAG ON) + include(GNUInstallDirs) + include(CTest) - include(FindThreads) - -+find_package(ZLIB REQUIRED) -+if (0) - # Use pkg-config to create a PkgConfig::Ptex_ZLIB imported target - find_package(PkgConfig REQUIRED) - pkg_checK_modules(Ptex_ZLIB REQUIRED zlib IMPORTED_TARGET) -- ++if(0) enable_testing() - - if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) -@@ -77,6 +78,7 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING "type of build" FORCE) - endif () - endif () +endif() - if (NOT WIN32) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic") -@@ -99,7 +101,9 @@ endif () + # Setup platform-specific threading flags. + find_package(Threads REQUIRED) +@@ -112,7 +114,9 @@ endif () include_directories(src/ptex) add_subdirectory(src/ptex) -+if (0) ++if(0) add_subdirectory(src/utils) add_subdirectory(src/tests) add_subdirectory(src/doc) +endif() add_subdirectory(src/build) diff --git a/src/ptex/CMakeLists.txt b/src/ptex/CMakeLists.txt -index ba3a3cc..1619ff1 100644 +index 4dfe372..4572dd5 100644 --- a/src/ptex/CMakeLists.txt +++ b/src/ptex/CMakeLists.txt -@@ -1,6 +1,8 @@ --if (WIN32) -- add_definitions(/DPTEX_EXPORTS) --endif (WIN32) -+if (BUILD_SHARED_LIBS) -+ add_definitions(-DPTEX_EXPORTS) -+else () -+ add_definitions(-DPTEX_STATIC) -+endif () - - configure_file(PtexVersion.h.in - ${CMAKE_CURRENT_SOURCE_DIR}/PtexVersion.h @ONLY) -@@ -18,29 +20,35 @@ set(SRCS - PtexWriter.cpp) - - if(PTEX_BUILD_STATIC_LIBS) -- add_library(Ptex_static STATIC ${SRCS}) -- set_target_properties(Ptex_static PROPERTIES OUTPUT_NAME Ptex) -- target_include_directories(Ptex_static -+ add_library(Ptex STATIC ${SRCS}) -+ target_include_directories(Ptex - PUBLIC - $ - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}) -- target_link_libraries(Ptex_static -- PUBLIC ${CMAKE_THREAD_LIBS_INIT} PkgConfig::Ptex_ZLIB) -- install(TARGETS Ptex_static EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ target_link_libraries(Ptex -+ PUBLIC ${CMAKE_THREAD_LIBS_INIT} ZLIB::ZLIB) -+ install(TARGETS Ptex EXPORT Ptex -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib -+ ) - endif() - - if(PTEX_BUILD_SHARED_LIBS) -- add_library(Ptex_dynamic SHARED ${SRCS}) -- set_target_properties(Ptex_dynamic PROPERTIES OUTPUT_NAME Ptex) -- target_include_directories(Ptex_dynamic -+ add_library(Ptex SHARED ${SRCS}) -+ target_include_directories(Ptex - PUBLIC - $ - PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}) -- target_link_libraries(Ptex_dynamic -- PUBLIC ${CMAKE_THREAD_LIBS_INIT} PkgConfig::Ptex_ZLIB) +@@ -40,7 +40,10 @@ if(PTEX_BUILD_SHARED_LIBS) + target_compile_definitions(Ptex_dynamic PRIVATE PTEX_EXPORTS) + target_link_libraries(Ptex_dynamic + PUBLIC Threads::Threads ZLIB::ZLIB) - install(TARGETS Ptex_dynamic EXPORT Ptex DESTINATION ${CMAKE_INSTALL_LIBDIR}) -+ target_link_libraries(Ptex -+ PUBLIC ${CMAKE_THREAD_LIBS_INIT} ZLIB::ZLIB) -+ install(TARGETS Ptex EXPORT Ptex -+ RUNTIME DESTINATION bin -+ LIBRARY DESTINATION lib -+ ARCHIVE DESTINATION lib -+ ) ++ install(TARGETS Ptex_dynamic EXPORT Ptex ++ RUNTIME DESTINATION ${BIN_INSTALL_DIR} ++ LIBRARY DESTINATION ${LIB_INSTALL_DIR} ++ ARCHIVE DESTINATION ${LIB_INSTALL_DIR}) endif() install(FILES diff --git a/ports/ptex/fix-config.cmake.patch b/ports/ptex/fix-config.cmake.patch deleted file mode 100644 index d635d4e05c..0000000000 --- a/ports/ptex/fix-config.cmake.patch +++ /dev/null @@ -1,18 +0,0 @@ -diff --git a/src/build/ptex-config.cmake b/src/build/ptex-config.cmake -index f95df9e..2d3f58f 100644 ---- a/src/build/ptex-config.cmake -+++ b/src/build/ptex-config.cmake -@@ -1,11 +1,11 @@ - @PACKAGE_INIT@ - -+include(CMakeFindDependencyMacro) - include("${CMAKE_CURRENT_LIST_DIR}/ptex-version.cmake") - include("${CMAKE_CURRENT_LIST_DIR}/ptex-exports.cmake") - - # Provide PkgConfig::ZLIB to downstream dependents --find_package(PkgConfig REQUIRED) --pkg_checK_modules(Ptex_ZLIB REQUIRED zlib IMPORTED_TARGET) -+find_dependency(ZLIB REQUIRED) - - set_and_check(Ptex_DIR @PACKAGE_CMAKE_INSTALL_PREFIX@) - set_and_check(Ptex_LIBRARY_DIRS @PACKAGE_CMAKE_INSTALL_LIBDIR@) diff --git a/ports/ptex/portfile.cmake b/ports/ptex/portfile.cmake index 057dfc089d..3cb67e48d7 100644 --- a/ports/ptex/portfile.cmake +++ b/ports/ptex/portfile.cmake @@ -1,29 +1,21 @@ -set(PTEX_VER 2.3.2) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO wdas/ptex - REF 1b8bc985a71143317ae9e4969fa08e164da7c2e5 - SHA512 37f2df9ec195f3d69d9526d0dea6a93ef49d69287bfae6ccd9671477491502ea760ed14e3b206b4f488831ab728dc749847b7d176c9b8439fb58b0a0466fe6c5 + REF "v${VERSION}" + SHA512 3b9607b7803e7c857bb00a6d4d8bbe108810c622a3593fb5d655183f3e6689f274ee5e79bcaab6928de38daf05cf25eb56125f39477f134131a8ad45071551b3 HEAD_REF master PATCHES fix-build.patch - fix-config.cmake.patch ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) - set(BUILD_SHARED_LIB ON) - set(BUILD_STATIC_LIB OFF) -else() - set(BUILD_SHARED_LIB OFF) - set(BUILD_STATIC_LIB ON) -endif() +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIB) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" BUILD_SHARED_LIB) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" DISABLE_PARALLEL_CONFIGURE OPTIONS - -DPTEX_VER=v${PTEX_VER} + "-DPTEX_VER=v${VERSION}" -DPTEX_BUILD_SHARED_LIBS=${BUILD_SHARED_LIB} -DPTEX_BUILD_STATIC_LIBS=${BUILD_STATIC_LIB} ) @@ -44,4 +36,5 @@ endforeach() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") -file(INSTALL "${SOURCE_PATH}/src/doc/License.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/ptex/usage b/ports/ptex/usage new file mode 100644 index 0000000000..82fd687467 --- /dev/null +++ b/ports/ptex/usage @@ -0,0 +1,4 @@ +Ptex provides CMake targets: + + find_package(ptex CONFIG REQUIRED) + target_link_libraries(main PRIVATE $,Ptex::Ptex_dynamic,Ptex::Ptex_static>) diff --git a/ports/ptex/vcpkg.json b/ports/ptex/vcpkg.json index 636cea5191..2af40aa872 100644 --- a/ports/ptex/vcpkg.json +++ b/ports/ptex/vcpkg.json @@ -1,9 +1,9 @@ { "name": "ptex", - "version": "2.3.2", - "port-version": 4, + "version": "2.4.2", "description": "Per-Face Texture Mapping for Production Rendering.", "homepage": "https://github.com/wdas/ptex", + "license": "BSD-3-Clause", "supports": "!uwp", "dependencies": [ { diff --git a/versions/baseline.json b/versions/baseline.json index d29938cb8f..b41894b4e7 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -6909,8 +6909,8 @@ "port-version": 1 }, "ptex": { - "baseline": "2.3.2", - "port-version": 4 + "baseline": "2.4.2", + "port-version": 0 }, "pthread": { "baseline": "3.0.0", diff --git a/versions/p-/ptex.json b/versions/p-/ptex.json index 4c8c95a674..3744082ce1 100644 --- a/versions/p-/ptex.json +++ b/versions/p-/ptex.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "64ba10b1e0174e06bcb2821e395d411641d1611e", + "version": "2.4.2", + "port-version": 0 + }, { "git-tree": "3f04f712745e5fb558f79324199b3fe8c1a00b84", "version": "2.3.2",