Skip to content

Commit

Permalink
[expat] Fix a few details with expat. (#13022)
Browse files Browse the repository at this point in the history
Co-authored-by: NancyLi1013 <46708020+NancyLi1013@users.noreply.github.com>
  • Loading branch information
Neumann-A and NancyLi1013 committed Aug 28, 2020
1 parent 2f52c7c commit 53a47bc
Show file tree
Hide file tree
Showing 27 changed files with 109 additions and 263 deletions.
45 changes: 0 additions & 45 deletions ports/exiv2/expat.patch

This file was deleted.

5 changes: 0 additions & 5 deletions ports/exiv2/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
#https://github.com/Exiv2/exiv2/issues/1063
vcpkg_fail_port_install(ON_TARGET "uwp")

if("xmp" IN_LIST FEATURES)
set(EXPAT_PATCH ${CMAKE_CURRENT_LIST_DIR}/expat.patch)
endif()

vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO Exiv2/exiv2
REF 194bb65ac568a5435874c9d9d73b1c8a68e4edec #v0.27.3
SHA512 35a5a41e0a6cfe04d1ed005c8116ad4430516402b925db3d4f719e2385e2cfb09359eb7ab51853bc560138f221900778cd2e2d39f108c513b3e7d22dbb9bf503
HEAD_REF master
PATCHES ${EXPAT_PATCH}
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
4 changes: 2 additions & 2 deletions ports/expat/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: expat
Version: 2.2.9
Version: 2020-08-18
Homepage: https://github.com/libexpat/libexpat
Description: XML parser library written in C
Description: XML parser library written in C
40 changes: 0 additions & 40 deletions ports/expat/fix-find-package-by-cmake.patch

This file was deleted.

15 changes: 15 additions & 0 deletions ports/expat/pkgconfig.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/expat/CMakeLists.txt b/expat/CMakeLists.txt
index a67f081b1..cc220f2a1 100644
--- a/expat/CMakeLists.txt
+++ b/expat/CMakeLists.txt
@@ -294,7 +294,9 @@ expat_install(FILES lib/expat.h lib/expat_external.h DESTINATION ${CMAKE_INSTALL
#
# pkg-config file
#
+string(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UPPER)
+set(_EXPAT_OUTPUT_NAME ${_EXPAT_OUTPUT_NAME}${CMAKE_${BUILD_TYPE_UPPER}_POSTFIX})
-if(NOT MSVC)
+if(1)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix "\${prefix}")
set(libdir "\${exec_prefix}/${CMAKE_INSTALL_LIBDIR}")
19 changes: 8 additions & 11 deletions ports/expat/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO libexpat/libexpat
REF a7bc26b69768f7fb24f0c7976fae24b157b85b13 #tag 2.2.9
SHA512 18842d5c9ff89654c5beeb9daba7ff5a911da318d419735fb14a5acbe0d1b4ac07077822c70cfa5c845892bcec2d72f8f265b9a259fe459092864f4d1754f8dd
REF c092d40c300c6d219cb3b111932a824022265370 #Head from commit 2020-08-18
SHA512 5a5d41b500f5602a32aea8f4e15593e639206bb3f97553497e80b2975360cac88ac90386f5efc11728614f24bbb620fb908a3c8ca71c9e7b312f6157b2477afe
HEAD_REF master
PATCHES
fix-find-package-by-cmake.patch
pkgconfig.patch
)

if(VCPKG_LIBRARY_LINKAGE STREQUAL dynamic)
Expand All @@ -26,17 +26,12 @@ vcpkg_configure_cmake(

vcpkg_install_cmake()

vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/expat)
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/expat-2.2.9)
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)

file(GLOB EXE ${CURRENT_PACKAGES_DIR}/bin/*.exe)
file(GLOB DEBUG_EXE ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe)
if(EXE OR DEBUG_EXE)
file(REMOVE ${EXE} ${DEBUG_EXE})
endif()

if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
vcpkg_replace_string(${CURRENT_PACKAGES_DIR}/include/expat_external.h
"! defined(XML_STATIC)"
Expand All @@ -47,4 +42,6 @@ endif()
vcpkg_copy_pdbs()

#Handle copyright
file(INSTALL ${SOURCE_PATH}/expat/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL ${SOURCE_PATH}/expat/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)

file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
27 changes: 27 additions & 0 deletions ports/expat/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
include(SelectLibraryConfigurations)

set(EXPATNAMES expat expatw libexpat libexpatw)
set(DEBUGNAMES)
foreach(_CRT "" MT MD)
foreach(name IN LISTS EXPATNAMES)
list(APPEND EXPATNAMES ${name}${_CRT})
list(APPEND DEBUGNAMES ${name}d${_CRT})
endforeach()
endforeach()

find_library(EXPAT_LIBRARY_DEBUG NAMES ${DEBUGNAMES} ${EXPATNAMES} NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH)
find_library(EXPAT_LIBRARY_RELEASE NAMES ${EXPATNAMES} NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH)
select_library_configurations(EXPAT)
set(EXPAT_LIBRARY "${EXPAT_LIBRARIES}" CACHE STRING "" FORCE)
_find_package(${ARGS})
if(EXPAT_FOUND AND TARGET EXPAT::EXPAT)
if(EXPAT_LIBRARY_DEBUG)
set_target_properties(EXPAT::EXPAT PROPERTIES IMPORTED_LOCATION_DEBUG "${EXPAT_LIBRARY_DEBUG}")
endif()
if(EXPAT_LIBRARY_RELEASE)
set_target_properties(EXPAT::EXPAT PROPERTIES IMPORTED_LOCATION_RELEASE "${EXPAT_LIBRARY_RELEASE}")
endif()
endif()

unset(EXPATNAMES)
unset(DEBUGNAMES)
6 changes: 1 addition & 5 deletions ports/fontconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,7 @@ else()
target_include_directories(fontconfig PRIVATE ${FC_INCLUDE_DIR}/unix)
endif()

if(WIN32 AND NOT MINGW)
target_link_libraries(fontconfig PRIVATE unofficial::iconv::libiconv Freetype::Freetype expat::libexpat)
else()
target_link_libraries(fontconfig PRIVATE unofficial::iconv::libiconv Freetype::Freetype expat::expat)
endif()
target_link_libraries(fontconfig PRIVATE unofficial::iconv::libiconv Freetype::Freetype expat::expat)

install(TARGETS fontconfig
EXPORT fontconfig-targets
Expand Down
2 changes: 1 addition & 1 deletion ports/fontconfig/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: fontconfig
Version: 2.12.4
Port-Version: 12
Port-Version: 13
Homepage: https://www.freedesktop.org/software/fontconfig/front.html
Description: Library for configuring and customizing font access.
Build-Depends: freetype, expat, libiconv, dirent
Expand Down
2 changes: 1 addition & 1 deletion ports/gdcm/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: gdcm
Version: 3.0.5
Port-Version: 1
Port-Version: 2
Homepage: https://github.com/malaterre/GDCM
Description: Grassroots DICOM library
Build-Depends: zlib, expat, openjpeg
Expand Down
1 change: 0 additions & 1 deletion ports/gdcm/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ vcpkg_from_github(
use-openjpeg-config.patch
fix-share-path.patch
Fix-Cmake_DIR.patch
use-expat-config.patch
)

file(REMOVE ${SOURCE_PATH}/CMake/FindOpenJPEG.cmake)
Expand Down
13 changes: 0 additions & 13 deletions ports/gdcm/use-expat-config.patch

This file was deleted.

2 changes: 1 addition & 1 deletion ports/itk/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: itk
Version: 5.1.0
Port-Version: 1
Port-Version: 2
Description: Insight Segmentation and Registration Toolkit (ITK) is used for image processing and analysis.
Homepage: https://github.com/InsightSoftwareConsortium/ITK
Build-Depends: double-conversion, libjpeg-turbo, zlib, libpng, tiff, expat, eigen3, hdf5[core,cpp], openjpeg[core], fftw3[core], gtest, gdcm, icu, minc
Expand Down
54 changes: 0 additions & 54 deletions ports/itk/expat.patch

This file was deleted.

1 change: 0 additions & 1 deletion ports/itk/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ vcpkg_from_github(
python_gpu_wrapping.patch
opencl.patch
cufftw.patch
expat.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
Expand Down
2 changes: 1 addition & 1 deletion ports/libkml/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: libkml
Version: 1.3.0
Port-Version: 5
Port-Version: 6
Homepage: https://github.com/libkml/libkml
Description: Reference implementation of OGC KML 2.2
Build-Depends: zlib, expat, minizip[bzip2], uriparser, boost-smart-ptr
20 changes: 0 additions & 20 deletions ports/libkml/fix-expat.patch

This file was deleted.

1 change: 0 additions & 1 deletion ports/libkml/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ vcpkg_from_github(
HEAD_REF master
PATCHES
patch_empty_literal_on_vc.patch
fix-expat.patch
)

file(REMOVE ${SOURCE_PATH}/cmake/External_boost.cmake)
Expand Down
2 changes: 1 addition & 1 deletion ports/poco/CONTROL
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Source: poco
Version: 1.9.2
Port-Version: 3
Port-Version: 4
Build-Depends: expat, libpq, pcre, sqlite3, zlib, libpng
Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems.
Homepage: https://github.com/pocoproject/poco
Expand Down
1 change: 0 additions & 1 deletion ports/poco/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ vcpkg_from_github(
# Add the support of arm64-windows
arm64_pcre.patch
fix_foundation_link.patch
use-vcpkg-expat.patch
)

# define Poco linkage type
Expand Down
18 changes: 0 additions & 18 deletions ports/poco/use-vcpkg-expat.patch

This file was deleted.

Loading

0 comments on commit 53a47bc

Please sign in to comment.