From c36e905c050f3cc59ef3100887affbf248aa7003 Mon Sep 17 00:00:00 2001 From: Thomas1664 <46387399+Thomas1664@users.noreply.github.com> Date: Mon, 18 Dec 2023 22:27:22 +0100 Subject: [PATCH] [tmxlite] Fixes and Update to 1.4.4 (#35760) --- ports/tmxlite/dependencies.patch | 29 +++++++++++++++++++++++++++++ ports/tmxlite/portfile.cmake | 29 +++++++++++++++++++++++------ ports/tmxlite/vcpkg.json | 9 ++++++--- scripts/ci.baseline.txt | 3 --- versions/baseline.json | 4 ++-- versions/t-/tmxlite.json | 5 +++++ 6 files changed, 65 insertions(+), 14 deletions(-) create mode 100644 ports/tmxlite/dependencies.patch diff --git a/ports/tmxlite/dependencies.patch b/ports/tmxlite/dependencies.patch new file mode 100644 index 0000000000..e06180650a --- /dev/null +++ b/ports/tmxlite/dependencies.patch @@ -0,0 +1,29 @@ +diff --git a/tmxlite/CMakeLists.txt b/tmxlite/CMakeLists.txt +index a1b1882..8c0aad6 100644 +--- a/tmxlite/CMakeLists.txt ++++ b/tmxlite/CMakeLists.txt +@@ -68,10 +68,9 @@ if(USE_EXTLIBS) + SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/modules/") + + find_package(ZLIB REQUIRED) +- find_package(PUGIXML REQUIRED) +- find_package(Zstd REQUIRED) ++ find_package(pugixml CONFIG REQUIRED) ++ find_package(zstd CONFIG REQUIRED) + +- include_directories(${ZLIB_INCLUDE_DIRS} ${PUGIXML_INCLUDE_DIR} ${ZSTD_INCLUDE_DIR}) + + else() + #add miniz and pugixml from source +@@ -102,7 +101,10 @@ else() + endif() + + if(USE_EXTLIBS) +- target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES} ${PUGIXML_LIBRARY} ${ZSTD_LIBRARY}) ++ target_link_libraries(${PROJECT_NAME} PRIVATE ++ $,zstd::libzstd_shared,zstd::libzstd_static> ++ pugixml::pugixml ++ ZLIB::ZLIB) + else() + if(USE_ZSTD) + target_link_libraries(${PROJECT_NAME} ${ZSTD_LIBRARY}) diff --git a/ports/tmxlite/portfile.cmake b/ports/tmxlite/portfile.cmake index aaf079cb77..592746d265 100644 --- a/ports/tmxlite/portfile.cmake +++ b/ports/tmxlite/portfile.cmake @@ -1,21 +1,38 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO fallahn/tmxlite - REF v1.3.0 + REF "v${VERSION}" HEAD_REF master - SHA512 3D432152080F7FDDD14A150FF87C34932695C96D7F676399C7610FF373972223CE54C9483BD9A872FD53668C113E334FCBF8596AE21CFDAF83B6159C7287A4A3 + SHA512 0ffe0505329f00ef9872998673a7c220a9a5352f830688ef17952c0c4f001e0c2994a3a28f0e7de60cc82fff2701561cccbc2143fd51984bf4870e7d1fd0a2ba + PATCHES + dependencies.patch ) +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" TMXLITE_STATIC_LIB) + vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}/tmxlite" + OPTIONS + -DTMXLITE_STATIC_LIB=${TMXLITE_STATIC_LIB} + -DUSE_EXTLIBS=ON + -DPKGCONF_REQ_PUB=pugixml ) vcpkg_cmake_install() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +vcpkg_fixup_pkgconfig() +vcpkg_copy_pdbs() -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") +set(STATIC_POSTFIX "") +if(TMXLITE_STATIC_LIB) + set(STATIC_POSTFIX "-s") + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/lib/pkgconfig/tmxlite.pc" "-ltmxlite" "-ltmxlite${STATIC_POSTFIX}") endif() -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +if(NOT VCPKG_BUILD_TYPE) + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/tmxlite.pc" "-ltmxlite" "-ltmxlite${STATIC_POSTFIX}-d") +endif() + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/tmxlite/vcpkg.json b/ports/tmxlite/vcpkg.json index fdecfa92ae..80a34c80ba 100644 --- a/ports/tmxlite/vcpkg.json +++ b/ports/tmxlite/vcpkg.json @@ -1,10 +1,11 @@ { "name": "tmxlite", - "version": "1.3.0", - "port-version": 1, + "version": "1.4.4", "description": "A lightweight C++14 parsing library for tmx map files created with the Tiled map editor.", + "homepage": "https://github.com/fallahn/tmxlite", "license": "Zlib", "dependencies": [ + "pugixml", { "name": "vcpkg-cmake", "host": true @@ -12,6 +13,8 @@ { "name": "vcpkg-cmake-config", "host": true - } + }, + "zlib", + "zstd" ] } diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index 782cbfc26e..97db342bd6 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1152,9 +1152,6 @@ tinycthread:x64-android=fail tlx:arm-neon-android=fail tlx:arm64-android=fail tlx:x64-android=fail -tmxlite:arm-neon-android=fail -tmxlite:arm64-android=fail -tmxlite:x64-android=fail torch-th:arm-neon-android=fail torch-th:arm64-android=fail torch-th:arm64-windows=fail diff --git a/versions/baseline.json b/versions/baseline.json index cb78551a62..71b7669005 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -8553,8 +8553,8 @@ "port-version": 2 }, "tmxlite": { - "baseline": "1.3.0", - "port-version": 1 + "baseline": "1.4.4", + "port-version": 0 }, "tmxparser": { "baseline": "2019-10-14", diff --git a/versions/t-/tmxlite.json b/versions/t-/tmxlite.json index 2469531f20..45f9bcb295 100644 --- a/versions/t-/tmxlite.json +++ b/versions/t-/tmxlite.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b18995c78b7b6057c2a1d69eba2118bfcb17fa36", + "version": "1.4.4", + "port-version": 0 + }, { "git-tree": "b176cf2abbb6262dc616d68625f90f35e65fe4c1", "version": "1.3.0",