diff --git a/ports/commsdsl/fix-dependency-libxml2.patch b/ports/commsdsl/fix-dependency-libxml2.patch new file mode 100644 index 00000000000000..9fe4743752161a --- /dev/null +++ b/ports/commsdsl/fix-dependency-libxml2.patch @@ -0,0 +1,38 @@ +diff --git a/lib/src/CMakeLists.txt b/lib/src/CMakeLists.txt +index eaacb7a..de2cab4 100644 +--- a/lib/src/CMakeLists.txt ++++ b/lib/src/CMakeLists.txt +@@ -6,10 +6,10 @@ while (TRUE) + break() + endif () + +- find_package(LibXml2 QUIET) +- if (LIBXML2_FOUND) ++ find_package(libxml2 CONFIG QUIET) ++ if (libxml2_FOUND) + # Find again just to display info +- find_package(LibXml2 REQUIRED) ++ find_package(libxml2 CONFIG REQUIRED) + break() + endif () + +@@ -52,8 +52,8 @@ while (TRUE) + break() + endwhile () + +-if (NOT LIBXML2_FOUND) +- find_package(LibXml2 REQUIRED) ++if (NOT libxml2_FOUND) ++ find_package(libxml2 CONFIG REQUIRED) + endif () + + set ( +@@ -123,7 +123,7 @@ endif () + set_target_properties(${PROJECT_NAME} PROPERTIES VERSION ${COMMSDSL_VERSION}) + + target_include_directories(${PROJECT_NAME} +- PRIVATE ${LIBXML2_INCLUDE_DIR} ++ PRIVATE ${LIBXML2_INCLUDE_DIRS} + PUBLIC $ + INTERFACE $ + ) diff --git a/ports/commsdsl/portfile.cmake b/ports/commsdsl/portfile.cmake index 95ec1b4d0ea88f..b919c0b3faf97b 100644 --- a/ports/commsdsl/portfile.cmake +++ b/ports/commsdsl/portfile.cmake @@ -7,7 +7,8 @@ vcpkg_from_github( SHA512 f9e908f42e11e30aefe07f1b37d65545be2074758f054fb0d519e1a01f0b7060b309d2667459a5a6918a9ad9f535d0c0a0cc2cd0d4a281e78c2c48a6b8ae4a5d HEAD_REF master PATCHES - "fix-cmake-cmakedir-path.patch" + fix-cmake-cmakedir-path.patch + fix-dependency-libxml2.patch ) vcpkg_configure_cmake( diff --git a/ports/commsdsl/vcpkg.json b/ports/commsdsl/vcpkg.json index d373944b00b674..da1f1cca09a1d3 100644 --- a/ports/commsdsl/vcpkg.json +++ b/ports/commsdsl/vcpkg.json @@ -1,6 +1,7 @@ { "name": "commsdsl", "version-string": "3.5.3", + "port-version": 1, "description": "DSL schemas parser and code generator for CommsChampion Ecosystem", "homepage": "https://commschamp.github.io/", "documentation": "https://github.com/commschamp/commsdsl", diff --git a/ports/gdal/CONTROL b/ports/gdal/CONTROL index 89bf2d2af9ffc1..97fb4d37ae5d5e 100644 --- a/ports/gdal/CONTROL +++ b/ports/gdal/CONTROL @@ -1,6 +1,6 @@ Source: gdal Version: 2.4.1 -Port-Version: 14 +Port-Version: 15 Homepage: https://gdal.org/ Description: The Geographic Data Abstraction Library for reading and writing geospatial raster and vector data. Build-Depends: proj4, libpng, geos, sqlite3, curl, expat, libpq, openjpeg, libwebp, libxml2, liblzma, netcdf-c, hdf5, zlib diff --git a/ports/gdal/portfile.cmake b/ports/gdal/portfile.cmake index 8c3650629eb945..52abc7cd869abf 100644 --- a/ports/gdal/portfile.cmake +++ b/ports/gdal/portfile.cmake @@ -135,9 +135,11 @@ if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP) file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/webpd.lib" WEBP_LIBRARY_DBG) # Setup libxml2 libraries + include path - file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" XML2_INCLUDE_DIR) - file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib" XML2_LIBRARY_REL) - file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2.lib" XML2_LIBRARY_DBG) + find_library(XML2_LIBRARY_REL NAMES libxml2 libxml2s PATHS ${CURRENT_INSTALLED_DIR}/lib) + find_library(XML2_LIBRARY_DBG NAMES libxml2d libxml2sd PATHS ${CURRENT_INSTALLED_DIR}/debug/lib) + file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include/libxml2" XML2_INCLUDE_DIR) + file(TO_NATIVE_PATH ${XML2_LIBRARY_REL} XML2_LIBRARY_REL) + file(TO_NATIVE_PATH ${XML2_LIBRARY_DBG} XML2_LIBRARY_DBG) # Setup liblzma libraries + include path file(TO_NATIVE_PATH "${CURRENT_INSTALLED_DIR}/include" LZMA_INCLUDE_DIR) diff --git a/ports/libarchive/CONTROL b/ports/libarchive/CONTROL index e15f1da44e99cd..a16b6179e27b2f 100644 --- a/ports/libarchive/CONTROL +++ b/ports/libarchive/CONTROL @@ -1,6 +1,6 @@ Source: libarchive Version: 3.4.3 -Port-Version: 2 +Port-Version: 3 Homepage: https://github.com/libarchive/libarchive Description: Library for reading and writing streaming archives Build-Depends: zlib diff --git a/ports/libarchive/fix-dependencies.patch b/ports/libarchive/fix-dependencies.patch index 0d3213c6766f52..da9b8dab6a17b3 100644 --- a/ports/libarchive/fix-dependencies.patch +++ b/ports/libarchive/fix-dependencies.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 39b5333..8164d8f 100644 +index 39b5333..b6c6674 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -433,7 +433,7 @@ MARK_AS_ADVANCED(CLEAR ZLIB_LIBRARY) @@ -69,7 +69,7 @@ index 39b5333..8164d8f 100644 # # TODO: test for static library. # -@@ -586,25 +566,20 @@ IF(ENABLE_ZSTD) +@@ -586,25 +567,20 @@ IF(ENABLE_ZSTD) SET(ZSTD_FIND_QUIETLY TRUE) ENDIF (ZSTD_INCLUDE_DIR) @@ -105,7 +105,7 @@ index 39b5333..8164d8f 100644 ENDIF(ZSTD_FOUND) MARK_AS_ADVANCED(CLEAR ZSTD_INCLUDE_DIR) MARK_AS_ADVANCED(CLEAR ZSTD_LIBRARY) -@@ -773,11 +742,11 @@ ENDIF(ENABLE_NETTLE) +@@ -773,11 +749,11 @@ ENDIF(ENABLE_NETTLE) # (Except on Mac, where OpenSSL is deprecated.) # IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") @@ -121,7 +121,7 @@ index 39b5333..8164d8f 100644 ENDIF(OPENSSL_FOUND) ELSE() SET(OPENSSL_FOUND FALSE) # Override cached value -@@ -896,7 +865,6 @@ main(int argc, char **argv) +@@ -896,7 +872,6 @@ main(int argc, char **argv) IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_LIBRARIES}) @@ -129,16 +129,23 @@ index 39b5333..8164d8f 100644 ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) -@@ -1128,7 +1096,7 @@ ENDIF(ENABLE_ICONV) +@@ -1128,13 +1103,13 @@ ENDIF(ENABLE_ICONV) # Find Libxml2 # IF(ENABLE_LIBXML2) - FIND_PACKAGE(LibXml2) -+ FIND_PACKAGE(LibXml2 REQUIRED) ++ FIND_PACKAGE(libxml2 CONFIG REQUIRED) ELSE() SET(LIBXML2_FOUND FALSE) ENDIF() -@@ -1432,8 +1400,7 @@ CHECK_C_SOURCE_COMPILES( + IF(LIBXML2_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables +- INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIR}) ++ INCLUDE_DIRECTORIES(${LIBXML2_INCLUDE_DIRS}) + LIST(APPEND ADDITIONAL_LIBS ${LIBXML2_LIBRARIES}) + SET(HAVE_LIBXML2 1) + # libxml2's include files use iconv.h +@@ -1432,8 +1407,7 @@ CHECK_C_SOURCE_COMPILES( MAJOR_IN_SYSMACROS) CMAKE_PUSH_CHECK_STATE() diff --git a/ports/librsvg/CMakeLists.txt b/ports/librsvg/CMakeLists.txt index b3b3ca892e4763..d3b70ffe7e72e8 100644 --- a/ports/librsvg/CMakeLists.txt +++ b/ports/librsvg/CMakeLists.txt @@ -4,7 +4,7 @@ project(librsvg C) find_package(unofficial-cairo CONFIG REQUIRED) find_package(unofficial-libcroco CONFIG REQUIRED) find_package(unofficial-glib CONFIG REQUIRED) -find_package(LibXml2 REQUIRED) +find_package(libxml2 CONFIG REQUIRED) if(CMAKE_SYSTEM_NAME MATCHES "Windows") find_library(PANGO_LIB pango-1.0) find_library(PANGO_CAIRO_LIB pangocairo-1.0) @@ -100,6 +100,7 @@ add_library(rsvg-2.40 ${LIBRSVG_SOURCES}) add_library(pixbufloader-svg ${PIXBUFLOADERSVG_SOURCES}) target_compile_definitions(rsvg-2.40 PRIVATE -DRSVG_COMPILATION -D_CRT_SECURE_NO_WARNINGS -DSRCDIR="${CMAKE_CURRENT_SOURCE_DIR}") +target_include_directories(rsvg-2.40 PRIVATE ${LIBXML2_INCLUDE_DIRS}) target_include_directories(pixbufloader-svg PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) target_compile_definitions(pixbufloader-svg PRIVATE diff --git a/ports/librsvg/CONTROL b/ports/librsvg/CONTROL index 380186c6eccec0..b26ed9d696424a 100644 --- a/ports/librsvg/CONTROL +++ b/ports/librsvg/CONTROL @@ -1,5 +1,6 @@ Source: librsvg -Version: 2.40.20-2 +Version: 2.40.20 +Port-Version: 3 Homepage: https://gitlab.gnome.org/GNOME/librsvg Description: A small library to render Scalable Vector Graphics (SVG) Build-Depends: cairo, pango, gdk-pixbuf, libcroco \ No newline at end of file diff --git a/ports/libsbml/CONTROL b/ports/libsbml/CONTROL index 654ea75bd13702..1d3a17e0a909ef 100644 --- a/ports/libsbml/CONTROL +++ b/ports/libsbml/CONTROL @@ -1,5 +1,6 @@ Source: libsbml Version: 5.18.0 +Port-Version: 1 Description: A library for reading / writing SBML files Default-Features: expat,comp,fbc,groups,layout,render,libxml2 Supports: !uwp diff --git a/ports/libsbml/fix-dependency-libxml2.patch b/ports/libsbml/fix-dependency-libxml2.patch new file mode 100644 index 00000000000000..45b12c70fdbfe3 --- /dev/null +++ b/ports/libsbml/fix-dependency-libxml2.patch @@ -0,0 +1,34 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index ceb8f18..a8bc6c8 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -464,6 +464,7 @@ endif(WITH_EXPAT) + # + set(USE_LIBXML OFF) + if(WITH_LIBXML) ++ if (0) + if (NOT LIBXML_LIBRARY) + find_library(LIBXML_LIBRARY + NAMES libxml2.lib xml2 +@@ -485,7 +486,11 @@ if(WITH_LIBXML) + DOC "The directory containing the libxml2 include files." + ) + endif() +- ++ else() ++ find_package(libxml2 CONFIG REQUIRED) ++ set(LIBXML_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS}) ++ set(LIBXML_LIBRARY ${LIBXML2_LIBRARIES}) ++ endif() + add_definitions( -DUSE_LIBXML ) + list(APPEND SWIG_EXTRA_ARGS -DUSE_LIBXML) + set(USE_LIBXML ON) +@@ -494,7 +499,7 @@ if(WITH_LIBXML) + set(LIBSBML_XML_LIBRARY_INCLUDE ${LIBXML_INCLUDE_DIR}) + set(LIBSBML_XML_LIBRARY_LIBS ${LIBXML_LIBRARY}) + +- if(NOT EXISTS "${LIBXML_INCLUDE_DIR}/libxml/parser.h") ++ if(0) + message(FATAL_ERROR + "The include directory specified for libxml appears to be invalid. + It should contain the file libxml/parser.h, but it does not.") diff --git a/ports/libsbml/portfile.cmake b/ports/libsbml/portfile.cmake index ed7749daa979b7..c3e05cf2fddfd2 100644 --- a/ports/libsbml/portfile.cmake +++ b/ports/libsbml/portfile.cmake @@ -7,7 +7,9 @@ vcpkg_download_distfile(ARCHIVE vcpkg_extract_source_archive_ex( OUT_SOURCE_PATH SOURCE_PATH ARCHIVE ${ARCHIVE} - PATCHES fix-linkage-type.patch + PATCHES + fix-linkage-type.patch + fix-dependency-libxml2.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_RUNTIME) diff --git a/ports/libspatialite/CONTROL b/ports/libspatialite/CONTROL index 38b4041f1e6eb4..9cedf5f1748dd8 100644 --- a/ports/libspatialite/CONTROL +++ b/ports/libspatialite/CONTROL @@ -1,6 +1,6 @@ Source: libspatialite Version: 4.3.0a -Port-Version: 6 +Port-Version: 7 Homepage: https://www.gaia-gis.it/gaia-sins/libspatialite-sources Description: SpatiaLite is an open source library intended to extend the SQLite core to support fully fledged Spatial SQL capabilities. Build-Depends: libxml2, sqlite3, geos, proj4, zlib, freexl, libiconv diff --git a/ports/libspatialite/fix-dependency-libxml2.patch b/ports/libspatialite/fix-dependency-libxml2.patch new file mode 100644 index 00000000000000..bd73a566b11a04 --- /dev/null +++ b/ports/libspatialite/fix-dependency-libxml2.patch @@ -0,0 +1,13 @@ +diff --git a/makefile.vc b/makefile.vc +index f510b4f..9791621 100644 +--- a/makefile.vc ++++ b/makefile.vc +@@ -59,7 +59,7 @@ LIBOBJ = src\gaiaaux\gg_sqlaux.obj src\gaiaaux\gg_utf8.obj \ + src\versioninfo\version.obj src\virtualtext\virtualtext.obj + SPATIALITE_DLL = spatialite$(VERSION).dll + +-CFLAGS = /nologo -I.\src\headers -I. -I$(INSTALLED_ROOT)\include $(OPTFLAGS) ++CFLAGS = /nologo -I.\src\headers -I. -I$(INSTALLED_ROOT)\include -I$(LIBXML2_INCLUDES) $(OPTFLAGS) + + default: all + diff --git a/ports/libspatialite/portfile.cmake b/ports/libspatialite/portfile.cmake index 9f1f3d6bd11e2a..9bd8459a68ab8f 100644 --- a/ports/libspatialite/portfile.cmake +++ b/ports/libspatialite/portfile.cmake @@ -15,25 +15,28 @@ if (VCPKG_TARGET_IS_WINDOWS) fix-makefiles.patch fix-sources.patch fix-latin-literals.patch + fix-dependency-libxml2.patch ) # fix most of the problems when spacebar is in the path + find_library(LIBXML2_LIBS_REL NAMES libxml2 libxml2s PATHS ${CURRENT_INSTALLED_DIR}/lib NO_DEFAULT_PATH) + find_library(LIBXML2_LIBS_DBG NAMES libxml2d libxml2sd PATHS ${CURRENT_INSTALLED_DIR}/debug/lib NO_DEFAULT_PATH) + set(CURRENT_INSTALLED_DIR "\"${CURRENT_INSTALLED_DIR}\"") + set(LIBXML2_INCLUDE_DIR "\"${CURRENT_INSTALLED_DIR}\"\\include\\libxml2") if(VCPKG_CRT_LINKAGE STREQUAL dynamic) set(CL_FLAGS_DBG "/MDd /Zi /DACCEPT_USE_OF_DEPRECATED_PROJ_API_H") set(CL_FLAGS_REL "/MD /Ox /DACCEPT_USE_OF_DEPRECATED_PROJ_API_H") set(GEOS_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib") set(GEOS_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib") - set(LIBXML2_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib") - set(LIBXML2_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2.lib") else() set(CL_FLAGS_DBG "/MTd /Zi /DACCEPT_USE_OF_DEPRECATED_PROJ_API_H") set(CL_FLAGS_REL "/MT /Ox /DACCEPT_USE_OF_DEPRECATED_PROJ_API_H") set(GEOS_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/geos_c.lib ${CURRENT_INSTALLED_DIR}/lib/geos.lib") set(GEOS_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/geos_cd.lib ${CURRENT_INSTALLED_DIR}/debug/lib/geosd.lib") - set(LIBXML2_LIBS_REL "${CURRENT_INSTALLED_DIR}/lib/libxml2.lib ${CURRENT_INSTALLED_DIR}/lib/lzma.lib ws2_32.lib") - set(LIBXML2_LIBS_DBG "${CURRENT_INSTALLED_DIR}/debug/lib/libxml2.lib ${CURRENT_INSTALLED_DIR}/debug/lib/lzmad.lib ws2_32.lib") + set(LIBXML2_LIBS_REL "${LIBXML2_LIBS_REL} ${CURRENT_INSTALLED_DIR}/lib/lzma.lib ws2_32.lib") + set(LIBXML2_LIBS_DBG "${LIBXML2_LIBS_DBG} ${CURRENT_INSTALLED_DIR}/debug/lib/lzmad.lib ws2_32.lib") endif() set(LIBS_ALL_DBG @@ -67,7 +70,7 @@ if (VCPKG_TARGET_IS_WINDOWS) vcpkg_execute_required_process( COMMAND ${NMAKE} -f makefile.vc clean install - "INST_DIR=\"${INST_DIR_DBG}\"" INSTALLED_ROOT=${CURRENT_INSTALLED_DIR} "LINK_FLAGS=/debug" "CL_FLAGS=${CL_FLAGS_DBG}" "LIBS_ALL=${LIBS_ALL_DBG}" + "INST_DIR=\"${INST_DIR_DBG}\"" INSTALLED_ROOT=${CURRENT_INSTALLED_DIR} LIBXML2_INCLUDES=${LIBXML2_INCLUDE_DIR} "LINK_FLAGS=/debug" "CL_FLAGS=${CL_FLAGS_DBG}" "LIBS_ALL=${LIBS_ALL_DBG}" WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME nmake-build-${TARGET_TRIPLET}-debug ) @@ -84,7 +87,7 @@ if (VCPKG_TARGET_IS_WINDOWS) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR_REL) vcpkg_execute_required_process( COMMAND ${NMAKE} -f makefile.vc clean install - "INST_DIR=\"${INST_DIR_REL}\"" INSTALLED_ROOT=${CURRENT_INSTALLED_DIR} "LINK_FLAGS=" "CL_FLAGS=${CL_FLAGS_REL}" "LIBS_ALL=${LIBS_ALL_REL}" + "INST_DIR=\"${INST_DIR_REL}\"" INSTALLED_ROOT=${CURRENT_INSTALLED_DIR} LIBXML2_INCLUDES=${LIBXML2_INCLUDE_DIR} "LINK_FLAGS=" "CL_FLAGS=${CL_FLAGS_REL}" "LIBS_ALL=${LIBS_ALL_REL}" WORKING_DIRECTORY ${SOURCE_PATH} LOGNAME nmake-build-${TARGET_TRIPLET}-release ) @@ -147,7 +150,7 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) # Build in UNIX LOGNAME config-${TARGET_TRIPLET}-rel ) vcpkg_execute_required_process( - COMMAND "${SOURCE_PATH_RELEASE}/configure" --prefix=${OUT_PATH_RELEASE} "CFLAGS=-I${includedir} ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" "LDFLAGS=-L${libdir}" "LIBS=-lpthread -ldl -lproj" "--with-geosconfig=${SOURCE_PATH_RELEASE}/geos-config" "LIBXML2_LIBS=-lxml2 -llzma" "LIBXML2_CFLAGS=${includedir}" + COMMAND "${SOURCE_PATH_RELEASE}/configure" --prefix=${OUT_PATH_RELEASE} "CFLAGS=-I${includedir} -I${includedir}\libxml2 ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_RELEASE} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" "LDFLAGS=-L${libdir}" "LIBS=-lpthread -ldl -lproj" "--with-geosconfig=${SOURCE_PATH_RELEASE}/geos-config" "LIBXML2_LIBS=-lxml2 -llzma" "LIBXML2_CFLAGS=${includedir}" WORKING_DIRECTORY ${SOURCE_PATH_RELEASE} LOGNAME config-${TARGET_TRIPLET}-rel ) @@ -206,7 +209,7 @@ elseif (VCPKG_TARGET_IS_LINUX OR VCPKG_TARGET_IS_OSX) # Build in UNIX LOGNAME config-${TARGET_TRIPLET}-debug ) vcpkg_execute_required_process( - COMMAND "${SOURCE_PATH_DEBUG}/configure" --prefix=${OUT_PATH_DEBUG} "CFLAGS=-I${includedir} ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" "LDFLAGS=-L${libdir}" "LIBS=-lpthread -ldl -lproj" "--with-geosconfig=${SOURCE_PATH_DEBUG}/geos-config" "LIBXML2_LIBS=-lxml2 -llzmad" "LIBXML2_CFLAGS=${includedir}" + COMMAND "${SOURCE_PATH_DEBUG}/configure" --prefix=${OUT_PATH_DEBUG} "CFLAGS=-I${includedir} -I${includedir}\libxml2 ${VCPKG_C_FLAGS} ${VCPKG_C_FLAGS_DEBUG} -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H" "LDFLAGS=-L${libdir}" "LIBS=-lpthread -ldl -lproj" "--with-geosconfig=${SOURCE_PATH_DEBUG}/geos-config" "LIBXML2_LIBS=-lxml2 -llzmad" "LIBXML2_CFLAGS=${includedir}" WORKING_DIRECTORY ${SOURCE_PATH_DEBUG} LOGNAME config-${TARGET_TRIPLET}-debug ) diff --git a/ports/libxml2/CMakeLists.txt b/ports/libxml2/CMakeLists.txt deleted file mode 100644 index 323f64c34eb60d..00000000000000 --- a/ports/libxml2/CMakeLists.txt +++ /dev/null @@ -1,161 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(libxml2 C) - -option(INSTALL_HEADERS "Install public header files" ON) - -set(CMAKE_SHARED_LIBRARY_PREFIX) -set(CMAKE_STATIC_LIBRARY_PREFIX) - -find_package(ZLIB REQUIRED) -find_package(LibLZMA REQUIRED) -find_package(Iconv REQUIRED) - -file(GLOB SOURCES *.c) -list(FILTER SOURCES EXCLUDE REGEX "/(run|test|trio)[^/]*$") -list(FILTER SOURCES EXCLUDE REGEX "xml(lint|catalog).c$") -list(FILTER SOURCES EXCLUDE REGEX "rngparser\.c$") - -# Generate xmlexports with fixed definition of LIBXML_STATIC -file(READ include/libxml/xmlexports.h XMLEXPORTS_H) -if(BUILD_SHARED_LIBS) - string(REPLACE "!defined(LIBXML_STATIC)" "1" XMLEXPORTS_H "${XMLEXPORTS_H}") -else() - string(REPLACE "!defined(LIBXML_STATIC)" "0" XMLEXPORTS_H "${XMLEXPORTS_H}") -endif() -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/xmlexports.h "${XMLEXPORTS_H}") - -if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - configure_file(include/win32config.h config.h COPYONLY) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - configure_file("${PORT_DIR}/config.osx.h" config.h COPYONLY) -elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - configure_file("${PORT_DIR}/config.linux.h" config.h COPYONLY) -else() - message(FATAL_ERROR "No config.h checked in for the target platform. Please run ./configure for libxml2 and add the resulting config.h into this port.") -endif() - -message(STATUS "Reading version info from configure.ac") - -file(STRINGS "configure.ac" - _libxml_version_defines REGEX "LIBXML_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$") - -foreach(ver ${_libxml_version_defines}) - if(ver MATCHES "LIBXML_(MAJOR|MINOR|MICRO)_VERSION=([0-9]+)$") - set(LIBXML_${CMAKE_MATCH_1}_VERSION "${CMAKE_MATCH_2}" CACHE INTERNAL "") - endif() -endforeach() - -set(VERSION ${LIBXML_MAJOR_VERSION}.${LIBXML_MINOR_VERSION}.${LIBXML_MICRO_VERSION}) -math(EXPR LIBXML_VERSION_NUMBER - "${LIBXML_MAJOR_VERSION} * 10000 + ${LIBXML_MINOR_VERSION} * 100 + ${LIBXML_MICRO_VERSION}") - -message(STATUS "LIBXML_MAJOR_VERSION: ${LIBXML_MAJOR_VERSION}") -message(STATUS "LIBXML_MINOR_VERSION: ${LIBXML_MINOR_VERSION}") -message(STATUS "LIBXML_MICRO_VERSION: ${LIBXML_MICRO_VERSION}") -message(STATUS "VERSION: ${VERSION}") -message(STATUS "LIBXML_VERSION_NUMBER: ${LIBXML_VERSION_NUMBER}") - -set(WITH_TRIO 0) -set(WITH_THREADS 1) -set(WITH_THREAD_ALLOC 0) -set(WITH_TREE 1) -set(WITH_OUTPUT 1) -set(WITH_PUSH 1) -set(WITH_READER 1) -set(WITH_PATTERN 1) -set(WITH_WRITER 1) -set(WITH_SAX1 1) -set(WITH_FTP 1) -set(WITH_HTTP 1) -set(WITH_VALID 1) -set(WITH_HTML 1) -set(WITH_LEGACY 1) -set(WITH_C14N 1) -set(WITH_CATALOG 1) -set(WITH_DOCB 1) -set(WITH_XPATH 1) -set(WITH_XPTR 1) -set(WITH_XINCLUDE 1) -set(WITH_ICONV 1) -set(WITH_ICU 0) -set(WITH_ISO8859X 1) -set(WITH_DEBUG 1) -set(WITH_MEM_DEBUG 0) -set(WITH_RUN_DEBUG 0) -set(WITH_REGEXPS 1) -set(WITH_SCHEMAS 1) -set(WITH_SCHEMATRON 1) -set(WITH_MODULES 1) -set(MODULE_EXTENSION ".so") -set(WITH_ZLIB 1) -set(WITH_LZMA 1) - -if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - set(WITH_CATALOG 0) - set(WITH_MODULES 0) -endif() - -message(STATUS "Generating xmlversion.h") - -configure_file(include/libxml/xmlversion.h.in include/libxml/xmlversion.h) - -add_library(libxml2 ${SOURCES}) -if(INSTALL_HEADERS) - file(GLOB PUBLIC_HEADERS include/libxml/*.h ${CMAKE_CURRENT_BINARY_DIR}/include/libxml/xmlversion.h) - list(FILTER PUBLIC_HEADERS EXCLUDE REGEX "xmlexports\\.h$") - list(APPEND PUBLIC_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/xmlexports.h) - - set_target_properties(libxml2 PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}") -endif() -target_include_directories(libxml2 PRIVATE ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/include include ${LIBLZMA_INCLUDE_DIRS}) -target_link_libraries(libxml2 PRIVATE - Iconv::Iconv - ZLIB::ZLIB - ${LIBLZMA_LIBRARIES} -) -if(CMAKE_SYSTEM_NAME STREQUAL "Windows" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - target_include_directories(libxml2 PRIVATE win32/vc10) - target_link_libraries(libxml2 PRIVATE - wsock32.lib - ws2_32.lib - ) - target_compile_definitions(libxml2 PRIVATE - -DHAVE_WIN32_THREADS - _WINSOCK_DEPRECATED_NO_WARNINGS - ) - target_sources(libxml2 PRIVATE win32/libxml2.rc) - set_source_files_properties(win32/libxml2.rc PROPERTIES COMPILE_FLAGS "-DLIBXML_MAJOR_VERSION=${LIBXML_MAJOR_VERSION} -DLIBXML_MINOR_VERSION=${LIBXML_MINOR_VERSION} -DLIBXML_MICRO_VERSION=${LIBXML_MICRO_VERSION} -DLIBXML_DOTTED_VERSION=\\\"${VERSION}\\\"") -endif() - -target_compile_definitions(libxml2 PRIVATE - -D_CRT_SECURE_NO_DEPRECATE - -D_CRT_NONSTDC_NO_DEPRECATE - -D_REENTRANT - -DNOLIBTOOL - -DHAVE_ZLIB_H - -DHAVE_LZMA_H -) -if(NOT BUILD_SHARED_LIBS) - target_compile_definitions(libxml2 PRIVATE -DLIBXML_STATIC) -endif() - -set(TARGET_INSTALL_OPTIONS) -if(INSTALL_HEADERS) - set(TARGET_INSTALL_OPTIONS PUBLIC_HEADER DESTINATION include/libxml) -endif() - -install(TARGETS libxml2 - RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib - ${TARGET_INSTALL_OPTIONS} -) - -# pkgconfig -set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix "\${prefix}") -set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR}) -set(includedir ${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) - -configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY) -install(FILES ${CMAKE_BINARY_DIR}/libxml-2.0.pc DESTINATION lib/pkgconfig) \ No newline at end of file diff --git a/ports/libxml2/CONTROL b/ports/libxml2/CONTROL index 462ecfec676d6e..6e0a2899fc71b9 100644 --- a/ports/libxml2/CONTROL +++ b/ports/libxml2/CONTROL @@ -1,6 +1,5 @@ Source: libxml2 -Version: 2.9.10 -Port-Version: 1 +Version: 2020-11-16 Homepage: https://xmlsoft.org/ Description: Libxml2 is the XML C parser and toolkit developed for the Gnome project (but usable outside of the Gnome platform) Build-Depends: zlib, libiconv, liblzma diff --git a/ports/libxml2/RemoveIncludeFromWindowsRcFile.patch b/ports/libxml2/RemoveIncludeFromWindowsRcFile.patch deleted file mode 100644 index ce5a3fcbe0b2d1..00000000000000 --- a/ports/libxml2/RemoveIncludeFromWindowsRcFile.patch +++ /dev/null @@ -1,10 +0,0 @@ -diff --git a/win32/libxml2.rc b/win32/libxml2.rc -index c774a5ee..08e2da1e 100644 ---- a/win32/libxml2.rc -+++ b/win32/libxml2.rc -@@ -1,5 +1,4 @@ - #include --#include "rcVersion.h" - - VS_VERSION_INFO VERSIONINFO - FILEVERSION LIBXML_MAJOR_VERSION,LIBXML_MINOR_VERSION,LIBXML_MICRO_VERSION,0 diff --git a/ports/libxml2/config.linux.h b/ports/libxml2/config.linux.h deleted file mode 100644 index d029e95cfa5d11..00000000000000 --- a/ports/libxml2/config.linux.h +++ /dev/null @@ -1,56 +0,0 @@ -#define GETHOSTBYNAME_ARG_CAST /**/ -#define HAVE_ANSIDECL_H 1 -#define HAVE_ARPA_INET_H 1 -#define HAVE_ARPA_NAMESER_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_DIRENT_H 1 -#define HAVE_DLFCN_H 1 -#define HAVE_DLOPEN /**/ -#define HAVE_ERRNO_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_FTIME 1 -#define HAVE_GETADDRINFO /**/ -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_ISASCII 1 -#define HAVE_LIMITS_H 1 -#define HAVE_LOCALTIME 1 -#define HAVE_LZMA_H 1 -#define HAVE_MALLOC_H 1 -#define HAVE_MATH_H 1 -#define HAVE_MMAP 1 -#define HAVE_NETDB_H 1 -#define HAVE_NETINET_IN_H 1 -#define HAVE_POLL_H 1 -#define HAVE_PTHREAD_H /**/ -#define HAVE_PUTENV 1 -#define HAVE_RAND 1 -#define HAVE_RAND_R 1 -#define HAVE_RESOLV_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_SRAND 1 -#define HAVE_STAT 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRFTIME 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_MMAN_H 1 -#define HAVE_SYS_SELECT_H 1 -#define HAVE_SYS_SOCKET_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TIMEB_H 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TIME 1 -#define HAVE_TIME_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_VA_COPY 1 -#define HAVE_ZLIB_H 1 -#define ICONV_CONST -#define SEND_ARG2_CAST /**/ -#define SUPPORT_IP6 /**/ -#define VA_LIST_IS_ARRAY 1 -#define XML_SOCKLEN_T socklen_t diff --git a/ports/libxml2/config.osx.h b/ports/libxml2/config.osx.h deleted file mode 100644 index 95d83edc1fd232..00000000000000 --- a/ports/libxml2/config.osx.h +++ /dev/null @@ -1,54 +0,0 @@ -#define GETHOSTBYNAME_ARG_CAST /**/ -#define HAVE_ARPA_INET_H 1 -#define HAVE_ARPA_NAMESER_H 1 -#define HAVE_CTYPE_H 1 -#define HAVE_DIRENT_H 1 -#define HAVE_DLFCN_H 1 -#define HAVE_DLOPEN /**/ -#define HAVE_ERRNO_H 1 -#define HAVE_FCNTL_H 1 -#define HAVE_FLOAT_H 1 -#define HAVE_FTIME 1 -#define HAVE_GETADDRINFO /**/ -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_ISASCII 1 -#define HAVE_LIMITS_H 1 -#define HAVE_LOCALTIME 1 -#define HAVE_LZMA_H 1 -#define HAVE_MATH_H 1 -#define HAVE_MMAP 1 -#define HAVE_NETDB_H 1 -#define HAVE_NETINET_IN_H 1 -#define HAVE_POLL_H 1 -#define HAVE_PTHREAD_H /**/ -#define HAVE_PUTENV 1 -#define HAVE_RAND 1 -#define HAVE_RAND_R 1 -#define HAVE_RESOLV_H 1 -#define HAVE_SIGNAL_H 1 -#define HAVE_SRAND 1 -#define HAVE_STAT 1 -#define HAVE_STDARG_H 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDLIB_H 1 -#define HAVE_STRFTIME 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 -#define HAVE_SYS_MMAN_H 1 -#define HAVE_SYS_SELECT_H 1 -#define HAVE_SYS_SOCKET_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TIMEB_H 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TIME 1 -#define HAVE_TIME_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_VA_COPY 1 -#define HAVE_ZLIB_H 1 -#define ICONV_CONST -#define SEND_ARG2_CAST /**/ -#define SUPPORT_IP6 /**/ -#define VA_LIST_IS_ARRAY 1 -#define XML_SOCKLEN_T socklen_t diff --git a/ports/libxml2/fix-dependencies.patch b/ports/libxml2/fix-dependencies.patch new file mode 100644 index 00000000000000..d2a37560f48d41 --- /dev/null +++ b/ports/libxml2/fix-dependencies.patch @@ -0,0 +1,122 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1686344..f59c98a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -21,12 +21,24 @@ set(LIBXML_VERSION_STRING "${LIBXML_VERSION}") + set(LIBXML_VERSION_EXTRA "") + set(LIBXML_VERSION_NUMBER ${LIBXML_VERSION}) + +-find_package(Iconv) +-find_package(ICU) +-find_package(LibLZMA) +-find_package(Python COMPONENTS Interpreter Development) +-find_package(Threads) +-find_package(ZLIB) ++if (LIBXML2_WITH_ICONV) ++find_package(Iconv REQUIRED) ++endif() ++if (LIBXML2_WITH_ICU) ++find_package(ICU REQUIRED) ++endif() ++if (LIBXML2_WITH_LZMA) ++find_package(LibLZMA CONFIG REQUIRED) ++endif() ++if (LIBXML2_WITH_PYTHON) ++find_package(Python COMPONENTS Interpreter Development REQUIRED) ++endif() ++if (LIBXML2_WITH_THREADS) ++find_package(Threads REQUIRED) ++endif() ++if (LIBXML2_WITH_ZLIB) ++find_package(ZLIB REQUIRED) ++endif() + + option(BUILD_SHARED_LIBS "Build shared libraries" ON) + set(LIBXML2_WITH_AUTOMATA ON) +@@ -39,27 +51,9 @@ option(LIBXML2_WITH_FTP "Add the FTP support" ON) + option(LIBXML2_WITH_HTML "Add the HTML support" ON) + option(LIBXML2_WITH_HTTP "Add the HTTP support" ON) + +-if(Iconv_FOUND) +- option(LIBXML2_WITH_ICONV "Add ICONV support" ON) +-else() +- set(LIBXML2_WITH_ICONV OFF) +-endif() +- +-if(ICU_FOUND) +- option(LIBXML2_WITH_ICU "Add ICU support" OFF) +-else() +- set(LIBXML2_WITH_ICU OFF) +-endif() +- + option(LIBXML2_WITH_ISO8859X "Add ISO8859X support if no iconv" ON) + option(LIBXML2_WITH_LEGACY "Add deprecated APIs for compatibility" ON) + +-if(LIBLZMA_FOUND) +- option(LIBXML2_WITH_LZMA "Use liblzma" ON) +-else() +- set(LIBXML2_WITH_LZMA OFF) +-endif() +- + option(LIBXML2_WITH_MEM_DEBUG "Add the memory debugging module" OFF) + option(LIBXML2_WITH_MODULES "Add the dynamic modules support" ON) + option(LIBXML2_WITH_OUTPUT "Add the serialization support" ON) +@@ -82,12 +76,6 @@ option(LIBXML2_WITH_SCHEMAS "Add Relax-NG and Schemas support" ON) + option(LIBXML2_WITH_SCHEMATRON "Add Schematron support" ON) + option(LIBXML2_WITH_TESTS "Build tests" ON) + +-if(Threads_FOUND) +- option(LIBXML2_WITH_THREADS "Add multithread support" ON) +-else() +- set(LIBXML2_WITH_THREADS OFF) +-endif() +- + option(LIBXML2_WITH_THREAD_ALLOC "Add per-thread memory" OFF) + option(LIBXML2_WITH_TREE "Add the DOM like tree manipulation APIs" ON) + set(LIBXML2_WITH_TRIO OFF) +@@ -98,12 +86,6 @@ option(LIBXML2_WITH_XINCLUDE "Add the XInclude support" ON) + option(LIBXML2_WITH_XPATH "Add the XPATH support" ON) + option(LIBXML2_WITH_XPTR "Add the XPointer support" ON) + +-if(ZLIB_FOUND) +- option(LIBXML2_WITH_ZLIB "Use libz" ON) +-else() +- set(LIBXML2_WITH_ZLIB OFF) +-endif() +- + set(LIBXML2_XMLCONF_WORKING_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH "Working directory for XML Conformance Test Suite") + + foreach(VARIABLE IN ITEMS WITH_AUTOMATA WITH_C14N WITH_CATALOG WITH_DEBUG WITH_DOCB WITH_EXPR WITH_FTP WITH_HTML WITH_HTTP WITH_ICONV WITH_ICU WITH_ISO8859X WITH_LEGACY WITH_LZMA WITH_MEM_DEBUG WITH_MODULES WITH_OUTPUT WITH_PATTERN WITH_PUSH WITH_READER WITH_REGEXPS WITH_RUN_DEBUG WITH_SAX1 WITH_SCHEMAS WITH_SCHEMATRON WITH_THREADS WITH_THREAD_ALLOC WITH_TREE WITH_TRIO WITH_UNICODE WITH_VALID WITH_WRITER WITH_XINCLUDE WITH_XPATH WITH_XPTR WITH_ZLIB) +diff --git a/libxml2-config.cmake.cmake.in b/libxml2-config.cmake.cmake.in +index 6e6fc7a..b8f4579 100644 +--- a/libxml2-config.cmake.cmake.in ++++ b/libxml2-config.cmake.cmake.in +@@ -57,8 +57,7 @@ include(CMakeFindDependencyMacro) + + if(@LIBXML2_WITH_ICONV@) + find_dependency(Iconv) +- list(APPEND LIBXML2_LIBRARIES ${Iconv_LIBRARIES}) +- list(APPEND LIBXML2_INCLUDE_DIRS ${Iconv_INCLUDE_DIRS}) ++ list(APPEND LIBXML2_LIBRARIES Iconv::Iconv) + endif() + + if(NOT @BUILD_SHARED_LIBS@) +@@ -74,15 +73,13 @@ if(NOT @BUILD_SHARED_LIBS@) + endif() + + if(@LIBXML2_WITH_LZMA@) +- find_dependency(LibLZMA) +- list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES}) +- list(APPEND LIBXML2_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIRS}) ++ find_dependency(LibLZMA CONFIG) ++ list(APPEND LIBXML2_LIBRARIES LibLZMA::LibLZMA) + endif() + + if(@LIBXML2_WITH_ZLIB@) + find_dependency(ZLIB) +- list(APPEND LIBXML2_LIBRARIES ${ZLIB_LIBRARIES}) +- list(APPEND LIBXML2_INCLUDE_DIRS ${ZLIB_INCLUDE_DIRS}) ++ list(APPEND LIBXML2_LIBRARIES ZLIB::ZLIB) + endif() + + if(UNIX) diff --git a/ports/libxml2/fix-docs-path.patch b/ports/libxml2/fix-docs-path.patch new file mode 100644 index 00000000000000..0e04ddc9171c05 --- /dev/null +++ b/ports/libxml2/fix-docs-path.patch @@ -0,0 +1,19 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index db46dc6..1686344 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -659,10 +659,10 @@ if(LIBXML2_WITH_PYTHON) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml2.py DESTINATION ${LIBXML2_PYTHON_INSTALL_DIR} COMPONENT runtime) + endif() + +-install(FILES libxml.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/man3 COMPONENT documentation) +-install(FILES doc/xmlcatalog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation) +-install(FILES doc/xmllint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 COMPONENT documentation) +-install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/libxml2 COMPONENT documentation PATTERN Makefile.* EXCLUDE) ++install(FILES libxml.3 DESTINATION ${CMAKE_INSTALL_MANDIR}/libxml2/man3 COMPONENT documentation) ++install(FILES doc/xmlcatalog.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/libxml2/man1 COMPONENT documentation) ++install(FILES doc/xmllint.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/libxml2/man1 COMPONENT documentation) ++install(DIRECTORY doc/ DESTINATION ${CMAKE_INSTALL_DATADIR}/libxml2/doc/libxml2 COMPONENT documentation PATTERN Makefile.* EXCLUDE) + + configure_package_config_file( + libxml2-config.cmake.cmake.in libxml2-config.cmake diff --git a/ports/libxml2/fix-pkgconfig.patch b/ports/libxml2/fix-pkgconfig.patch new file mode 100644 index 00000000000000..251769829a6a8d --- /dev/null +++ b/ports/libxml2/fix-pkgconfig.patch @@ -0,0 +1,54 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index f59c98a..adc80ef 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -478,6 +478,9 @@ if(WIN32) + PROPERTIES + DEBUG_POSTFIX d + ) ++ if (CMAKE_BUILD_TYPE STREQUAL Debug) ++ set(DEBUG_POSTFIX d) ++ endif() + else() + set_target_properties( + LibXml2 +@@ -487,6 +490,9 @@ if(WIN32) + RELEASE_POSTFIX s + RELWITHDEBINFO_POSTFIX s + ) ++ if (CMAKE_BUILD_TYPE STREQUAL Debug) ++ set(DEBUG_POSTFIX sd) ++ endif() + endif() + endif() + +@@ -685,6 +691,17 @@ if(MSVC) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml/xmlwin32version.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/libxml2/libxml COMPONENT development) + endif() + ++# pkgconfig ++set(prefix "${CMAKE_INSTALL_PREFIX}") ++set(exec_prefix "\${prefix}") ++set(libdir ${prefix}/${CMAKE_INSTALL_LIBDIR}) ++set(includedir ${prefix}/${CMAKE_INSTALL_INCLUDEDIR}) ++ ++configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY) ++configure_file(libxml-2.0-uninstalled.pc.in libxml-2.0-uninstalled.pc @ONLY) ++install(FILES ${CMAKE_BINARY_DIR}/libxml-2.0.pc DESTINATION lib/pkgconfig) ++#install(FILES ${CMAKE_BINARY_DIR}/libxml-2.0-uninstalled.pc DESTINATION lib/pkgconfig) ++ + if(LIBXML2_WITH_PYTHON) + set(prefix "${CMAKE_INSTALL_PREFIX}") + configure_file(python/setup.py.in setup.py @ONLY) +diff --git a/libxml-2.0.pc.in b/libxml-2.0.pc.in +index 2653a7c..fb57c5c 100644 +--- a/libxml-2.0.pc.in ++++ b/libxml-2.0.pc.in +@@ -8,6 +8,6 @@ Name: libXML + Version: @VERSION@ + Description: libXML library version2. + Requires: +-Libs: -L${libdir} -lxml2 ++Libs: -L${libdir} -lxml2@DEBUG_POSTFIX@ + Libs.private: @ICU_LIBS@ @THREAD_LIBS@ @Z_LIBS@ @LZMA_LIBS@ @ICONV_LIBS@ @M_LIBS@ @WIN32_EXTRA_LIBADD@ @LIBS@ + Cflags: @XML_INCLUDEDIR@ @XML_CFLAGS@ diff --git a/ports/libxml2/fix-uwp-build.patch b/ports/libxml2/fix-uwp-build.patch new file mode 100644 index 00000000000000..59cf87a6d9c2a8 --- /dev/null +++ b/ports/libxml2/fix-uwp-build.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c918125..db46dc6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -422,6 +422,10 @@ if(LIBXML2_WITH_TRIO) + list(APPEND LIBXML2_SRCS trio.c triostr.c) + endif() + ++if (MSVC) ++ add_definitions(-D_CRT_NONSTDC_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS) ++endif() ++ + add_library(LibXml2 ${LIBXML2_HDRS} ${LIBXML2_SRCS}) + + if(LIBXML2_WITH_THREADS) diff --git a/ports/libxml2/portfile.cmake b/ports/libxml2/portfile.cmake index 43aae1de5a4b20..f07049234d7c03 100644 --- a/ports/libxml2/portfile.cmake +++ b/ports/libxml2/portfile.cmake @@ -1,31 +1,45 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO GNOME/libxml2 - REF v2.9.10 - SHA512 de8d7c6c90f9d0441747deec320c4887faee1fd8aff9289115caf7ce51ab73b6e2c4628ae7eaad4a33a64561d23a92fd5e8a5afa7fa74183bdcd9a7b06bc67f1 + REF 7c06d99e1f4f853e3c5b307c0dc79c8a32a09855 + SHA512 8879649231ab5288497b9ed56cfed3ffb288a689c739acfd7094ddefdd0e4c140c34ebc821d0ebf70322bddb8fb34b04af87ebae87ae2b235bf318945dcf9dc2 HEAD_REF master PATCHES - RemoveIncludeFromWindowsRcFile.patch + fix-uwp-build.patch + fix-docs-path.patch + fix-dependencies.patch + fix-pkgconfig.patch ) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA - OPTIONS -DPORT_DIR=${CMAKE_CURRENT_LIST_DIR} - OPTIONS_DEBUG -DINSTALL_HEADERS=OFF + OPTIONS + -DLIBXML2_WITH_ZLIB=ON + -DLIBXML2_WITH_ICONV=ON + -DLIBXML2_WITH_LZMA=ON + -DLIBXML2_WITH_ZLIB=ON + -DLIBXML2_WITH_ICU=OFF + -DLIBXML2_WITH_THREADS=ON + -DLIBXML2_WITH_PYTHON=OFF + -DLIBXML2_WITH_PROGRAMS=ON + -DLIBXML2_WITH_RUN_DEBUG=OFF + -DLIBXML2_WITH_TESTS=OFF + OPTIONS_DEBUG + -DLIBXML2_WITH_DEBUG=ON ) vcpkg_install_cmake() +vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/libxml2-2.9.10 TARGET_PATH share/libxml2) + vcpkg_fixup_pkgconfig() vcpkg_copy_pdbs() -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - file(COPY ${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) -endif() +vcpkg_copy_tools(TOOL_NAMES xmlcatalog xmllint AUTO_CLEAN) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include ${CURRENT_PACKAGES_DIR}/debug/share) -file(COPY ${CMAKE_CURRENT_LIST_DIR}/usage DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}) +configure_file(${CURRENT_PORT_DIR}/usage ${CURRENT_PACKAGES_DIR}/share/${PORT}/usage @ONLY) file(INSTALL ${SOURCE_PATH}/Copyright DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file diff --git a/ports/libxml2/usage b/ports/libxml2/usage index fd94c4b4e442da..084f63645f3dba 100644 --- a/ports/libxml2/usage +++ b/ports/libxml2/usage @@ -1,5 +1,5 @@ -The package libxml2 is compatible with built-in CMake targets: +The package libxml2:@TARGET_TRIPLET@ provides CMake targets: - find_package(LibXml2 REQUIRED) - target_include_directories(main PRIVATE ${LIBXML2_INCLUDE_DIR}) + find_package(libxml2 CONFIG REQUIRED) + target_include_directories(main PRIVATE ${LIBXML2_INCLUDE_DIRS}) target_link_libraries(main PRIVATE ${LIBXML2_LIBRARIES}) diff --git a/ports/libxml2/vcpkg-cmake-wrapper.cmake b/ports/libxml2/vcpkg-cmake-wrapper.cmake deleted file mode 100644 index 405b94670762ea..00000000000000 --- a/ports/libxml2/vcpkg-cmake-wrapper.cmake +++ /dev/null @@ -1,33 +0,0 @@ -_find_package(${ARGS}) -if(LibXml2_FOUND) - find_package(LibLZMA) - find_package(ZLIB) - include(SelectLibraryConfigurations) - find_library(ICONV_LIBRARY_DEBUG NAMES iconvd libiconvd iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_INSTALLED_DIR}/debug" NO_DEFAULT_PATH) - find_library(ICONV_LIBRARY_RELEASE NAMES iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) - find_library(ICONV_LIBRARY_RELEASE NAMES iconv libiconv NAMES_PER_DIR PATH_SUFFIXES lib) - find_library(CHARSET_LIBRARY_DEBUG NAMES charsetd libcharsetd charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH) - find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH) - find_library(CHARSET_LIBRARY_RELEASE NAMES charset libcharset NAMES_PER_DIR PATH_SUFFIXES lib) - select_library_configurations(ICONV) - select_library_configurations(CHARSET) - list(APPEND LIBXML2_LIBRARIES ${LIBLZMA_LIBRARIES} ${ZLIB_LIBRARIES}) - if(CMAKE_SYSTEM_NAME STREQUAL "Linux") - list(APPEND LIBXML2_LIBRARIES m) - endif() - if(ICONV_LIBRARIES) - list(APPEND LIBXML2_LIBRARIES ${ICONV_LIBRARIES}) - if(TARGET LibXml2::LibXml2) - target_link_libraries(LibXml2::LibXml2 INTERFACE ${ICONV_LIBRARIES} ) - endif() - endif() - if(CHARSET_LIBRARIES) - list(APPEND LIBXML2_LIBRARIES ${CHARSET_LIBRARIES}) - if(TARGET LibXml2::LibXml2) - target_link_libraries(LibXml2::LibXml2 INTERFACE ${CHARSET_LIBRARIES}) - endif() - endif() - if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - list(APPEND LIBXML2_LIBRARIES ws2_32) - endif() -endif() diff --git a/ports/libxmlmm/CMakeLists.txt b/ports/libxmlmm/CMakeLists.txt index 721641a64be0bc..adced07547277d 100644 --- a/ports/libxmlmm/CMakeLists.txt +++ b/ports/libxmlmm/CMakeLists.txt @@ -4,7 +4,7 @@ project(libxmlmm CXX) set(CMAKE_SHARED_LIBRARY_PREFIX) set(CMAKE_STATIC_LIBRARY_PREFIX) -find_package(LibXml2 REQUIRED) +find_package(libxml2 CONFIG REQUIRED) set(HEADERS_LIBXMLMM libxmlmm/Attribute.h @@ -38,7 +38,7 @@ set(SOURCES_LIBXMLMM ) add_library(libxmlmm ${SOURCES_LIBXMLMM}) -include_directories(${LIBXML2_INCLUDE_DIR}) +include_directories(${LIBXML2_INCLUDE_DIRS}) target_link_libraries (libxmlmm ${LIBXML2_LIBRARIES}) set_target_properties(libxmlmm PROPERTIES diff --git a/ports/libxmlmm/CONTROL b/ports/libxmlmm/CONTROL index a943bcf289eec9..18d16ee4104e6b 100644 --- a/ports/libxmlmm/CONTROL +++ b/ports/libxmlmm/CONTROL @@ -1,5 +1,6 @@ Source: libxmlmm Version: 0.6.0 +Port-Version: 1 Homepage: https://github.com/rioki/libxmlmm Description: Libxmlmm is a C++ wrapper for libxml 2.0 that only relies on standard C++ and libxml2. Build-Depends: libxml2 diff --git a/ports/libxslt/0003-Fix-libxml2.patch b/ports/libxslt/0003-Fix-libxml2.patch new file mode 100644 index 00000000000000..e9e8c4152cd8eb --- /dev/null +++ b/ports/libxslt/0003-Fix-libxml2.patch @@ -0,0 +1,99 @@ +diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc +index d4eed51..2817156 100644 +--- a/win32/Makefile.msvc ++++ b/win32/Makefile.msvc +@@ -63,8 +63,10 @@ LDFLAGS = $(LDFLAGS) /LIBPATH:$(BINDIR) /LIBPATH:$(LIBPREFIX) + LIBS = wsock32.lib iconv.lib charset.lib + !if "$(DEBUG)" == "1" + LIBS = $(LIBS) zlibd.lib lzmad.lib ++XML2LIB = $(XML2_LIB_DBG) + !else + LIBS = $(LIBS) zlib.lib lzma.lib ++XML2LIB = $(XML2_LIB_REL) + !endif + + # The archiver and its options. +@@ -249,14 +251,14 @@ $(BINDIR)\$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS) $(XSLT_INTDIR)\$(XSLT_DEF) + $(LD) $(LDFLAGS) /DLL \ + /VERSION:$(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION) \ + /IMPLIB:$(BINDIR)\$(XSLT_IMP) /OUT:$(BINDIR)\$(XSLT_SO) \ +- $(XSLT_OBJS) $(LIBS) libxml2.lib ++ $(XSLT_OBJS) $(LIBS) $(XML2LIB) + @$(_VC_MANIFEST_EMBED_DLL) + + #$(BINDIR)\$(XSLT_SO) : $(BINDIR) $(XSLT_OBJS) $(XSLT_INTDIR)\$(XSLT_DEF) + # $(LD) $(LDFLAGS) /DLL /DEF:$(XSLT_INTDIR)\$(XSLT_DEF) \ + # /VERSION:$(LIBXSLT_MAJOR_VERSION).$(LIBXSLT_MINOR_VERSION) \ + # /IMPLIB:$(BINDIR)\$(XSLT_IMP) /OUT:$(BINDIR)\$(XSLT_SO) \ +-# $(XSLT_OBJS) $(LIBS) libxml2.lib ++# $(XSLT_OBJS) $(LIBS) $(XML2LIB) + + # Creates the libxslt archive. + $(BINDIR)\$(XSLT_A) : $(BINDIR) $(XSLT_OBJS_A) +@@ -295,14 +297,14 @@ $(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) $(EXSLT_INTDIR)\$(EXSLT_DEF) lib + $(LD) $(LDFLAGS) /DLL \ + /VERSION:$(LIBEXSLT_MAJOR_VERSION).$(LIBEXSLT_MINOR_VERSION) \ + /IMPLIB:$(BINDIR)\$(EXSLT_IMP) /OUT:$(BINDIR)\$(EXSLT_SO) \ +- $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) libxml2.lib ++ $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) $(XML2LIB) + @$(_VC_MANIFEST_EMBED_DLL) + + #$(BINDIR)\$(EXSLT_SO) : $(BINDIR) $(EXSLT_OBJS) $(EXSLT_INTDIR)\$(EXSLT_DEF) libxslt + # $(LD) $(LDFLAGS) /DLL /DEF:$(EXSLT_INTDIR)\$(EXSLT_DEF) \ + # /VERSION:$(LIBEXSLT_MAJOR_VERSION).$(LIBEXSLT_MINOR_VERSION) \ + # /IMPLIB:$(BINDIR)\$(EXSLT_IMP) /OUT:$(BINDIR)\$(EXSLT_SO) \ +-# $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) libxml2.lib ++# $(EXSLT_OBJS) $(XSLT_IMP) $(LIBS) $(XML2LIB) + + # Creates the libexslt archive. + $(BINDIR)\$(EXSLT_A) : $(BINDIR) $(EXSLT_OBJS_A) libxslta +@@ -316,14 +318,14 @@ $(UTILS_INTDIR) : + # An implicit rule for xsltproc and friends. + APPLIBS = $(LIBS) + !if "$(STATIC)" == "1" +-APPLIBS = $(LIBS) libxml2.lib ++APPLIBS = $(LIBS) $(XML2LIB) + {$(UTILS_SRCDIR)}.c{$(BINDIR)}.exe: + $(CC) /D "LIBXML_STATIC" /D "LIBXSLT_STATIC" /D "LIBEXSLT_STATIC" \ + $(CFLAGS) /Fo$(UTILS_INTDIR)\ /c $< + $(LD) $(LDFLAGS) /OUT:$@ $(XSLT_A) $(EXSLT_A) $(APPLIBS) $(UTILS_INTDIR)\$(