Skip to content

Commit

Permalink
[expat] Update to 2.6.1+patch (microsoft#37362)
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt authored Mar 11, 2024
1 parent e2dcca9 commit 34b3636
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 12 deletions.
24 changes: 14 additions & 10 deletions ports/expat/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
string(REPLACE "." "_" REF "R_${VERSION}")

vcpkg_download_distfile(CVE-2024-28757
URLS "https://github.com/libexpat/libexpat/commit/5026213864ba1a11ef03ba2e8111af8654e9404d.diff?full_index=1"
FILENAME libexpat-CVE-2024-28757.patch
SHA512 0d697b26116c89dd72d946ad04eb8f02ace970a435bbd67ba31841a13309d6a43e2cfa2dea8f6e7d53b478a508f7642dd9ff8c8f367d0d0205e982041f62f849
)

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libexpat/libexpat
REF "${REF}"
SHA512 773703165d51170485503e54be47d56cbf19cb7383cb3daf5e5b5d7e2671ec7a9f2f9b4d26c85edd07c36eba9f7e7d02c1d7d178481695abdc35e3a69a67c07e
SHA512 cf6c64fc0ca55dd172ca8a6ca10d1fb2c915d0f941b0068f42cb90488022dea73e04119c49a1bd4ab9a5d425ddc132ae5f22260ff6d2e25204637a1169e7bd4f
HEAD_REF master
PATCHES
${CVE-2024-28757}
)

string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" EXPAT_LINKAGE)
Expand All @@ -21,11 +29,12 @@ vcpkg_cmake_configure(
-DEXPAT_SHARED_LIBS=${EXPAT_LINKAGE}
-DEXPAT_MSVC_STATIC_CRT=${EXPAT_CRT_LINKAGE}
-DEXPAT_BUILD_PKGCONFIG=ON
MAYBE_UNUSED_VARIABLES EXPAT_MSVC_STATIC_CRT
MAYBE_UNUSED_VARIABLES
EXPAT_MSVC_STATIC_CRT
)

vcpkg_cmake_install()

vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH "lib/cmake/expat-${VERSION}")
vcpkg_fixup_pkgconfig()

Expand All @@ -34,13 +43,8 @@ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/doc")

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/expat_external.h"
"! defined(XML_STATIC)"
"/* vcpkg static build ! defined(XML_STATIC) */ 0"
)
vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/expat_external.h" "! defined(XML_STATIC)" "0")
endif()

vcpkg_copy_pdbs()

file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/expat/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/expat/COPYING")
2 changes: 1 addition & 1 deletion ports/expat/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "expat",
"version": "2.6.0",
"version": "2.6.1",
"description": "XML parser library written in C",
"homepage": "https://github.com/libexpat/libexpat",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2533,7 +2533,7 @@
"port-version": 1
},
"expat": {
"baseline": "2.6.0",
"baseline": "2.6.1",
"port-version": 0
},
"expected-lite": {
Expand Down
5 changes: 5 additions & 0 deletions versions/e-/expat.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "8deb84860eca4c337d83da3051340336d01dc57f",
"version": "2.6.1",
"port-version": 0
},
{
"git-tree": "324f8ee85bcf8dc7f2c8969d3d0f2af4d78be9a2",
"version": "2.6.0",
Expand Down

0 comments on commit 34b3636

Please sign in to comment.