diff options
| author | yurybura <yurybura@gmail.com> | 2018-05-11 13:34:43 +0300 |
|---|---|---|
| committer | yurybura <yurybura@gmail.com> | 2018-05-11 13:34:43 +0300 |
| commit | 7d261fbbc39a1d36027299190920e0a7e222ebd7 (patch) | |
| tree | d9b6745f2e6c670836cbbf61dbd2c4eb9ef857fe /ports/libxmlpp | |
| parent | 50e5ee1e40380cf543ae804775462181984a86dc (diff) | |
| parent | 9535a5631ac212b1c657a02be3ed9398df30c96c (diff) | |
| download | vcpkg-7d261fbbc39a1d36027299190920e0a7e222ebd7.tar.gz vcpkg-7d261fbbc39a1d36027299190920e0a7e222ebd7.zip | |
Merge branch 'master' of https://github.com/yurybura/vcpkg
Diffstat (limited to 'ports/libxmlpp')
| -rw-r--r-- | ports/libxmlpp/CMakeLists.txt | 97 | ||||
| -rw-r--r-- | ports/libxmlpp/CONTROL | 4 | ||||
| -rw-r--r-- | ports/libxmlpp/fixAutoPtrExpired.patch | 114 | ||||
| -rw-r--r-- | ports/libxmlpp/portfile.cmake | 31 |
4 files changed, 246 insertions, 0 deletions
diff --git a/ports/libxmlpp/CMakeLists.txt b/ports/libxmlpp/CMakeLists.txt new file mode 100644 index 000000000..697d6bbc2 --- /dev/null +++ b/ports/libxmlpp/CMakeLists.txt @@ -0,0 +1,97 @@ +cmake_minimum_required(VERSION 3.9)
+project(libxmlpp)
+
+set(CMAKE_CXX_STANDARD 17)
+
+set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS TRUE)
+
+find_path(GLIBMM_INCLUDE_DIR NAMES glibmm.h)
+find_library(GLIBMM_LIBRARY NAMES glibmm)
+find_library(GIOMM_LIBRARY NAMES giomm)
+find_library(GLIB_LIBRARY NAMES glib glib-2.0)
+find_library(GIO_LIBRARY NAMES gio gio-2.0)
+find_library(GMODULE_LIBRARY NAMES gmodule gmodule-2.0)
+find_library(GOBJECT_LIBRARY NAMES gobject gobject-2.0)
+find_library(SIGCPP_LIBRARY NAMES sigc sigc-2.0)
+find_library(FFI_LIBRARY NAMES ffi libffi)
+find_library(PCRE_LIBRARY NAMES pcre libpcre)
+find_package(LibXml2 REQUIRED)
+find_package(LibLZMA REQUIRED)
+find_package(ZLIB REQUIRED)
+
+if(APPLE)
+ find_library(LIBINTL_LIBRARY NAMES intl)
+endif()
+
+find_package(unofficial-iconv REQUIRED)
+link_libraries(${LIBINTL_LIBRARY} unofficial::iconv::libiconv)
+
+if(APPLE)
+ find_library(COREFOUNDATION_LIBRARY CoreFoundation)
+ find_library(CORESERVICES_LIBRARY CoreServices)
+ find_library(FOUNDATION_LIBRARY Foundation)
+ link_libraries(${COREFOUNDATION_LIBRARY} ${CORESERVICES_LIBRARY} ${FOUNDATION_LIBRARY})
+endif()
+
+link_libraries(
+ ${GIOMM_LIBRARY}
+ ${GLIBMM_LIBRARY}
+ ${GMODULE_LIBRARY}
+ ${GOBJECT_LIBRARY}
+ ${GIO_LIBRARY}
+ ${GLIB_LIBRARY}
+ ${SIGCPP_LIBRARY}
+ ${FFI_LIBRARY}
+ ${LIBXML2_LIBRARIES}
+ ${PCRE_LIBRARY}
+ ${LIBLZMA_LIBRARIES}
+ ZLIB::ZLIB
+)
+include_directories(${GLIBMM_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIRS} ${LIBLZMA_INCLUDE_DIRS})
+include_directories(. ${CMAKE_BINARY_DIR}/config)
+if(NOT WIN32)
+ set(THREADS_PREFER_PTHREAD_FLAG ON)
+ find_package(Threads REQUIRED)
+ link_libraries(Threads::Threads ${CMAKE_DL_LIBS})
+endif()
+
+# config file
+if(WIN32)
+ configure_file(MSVC_Net2010/libxml++/libxml++config.h ${CMAKE_BINARY_DIR}/config/libxml++config.h COPYONLY)
+else()
+ set(ENV{GLIBMM_CFLAGS} -I${GLIBMM_INCLUDE_DIR})
+ set(ENV{GLIBMM_LIBS} "${GLIBMM_LIBRARY}")
+ set(ENV{GIOMM_CFLAGS} -I${GLIBMM_INCLUDE_DIR})
+ set(ENV{GIOMM_LIBS} "${GIOMM_LIBRARY}")
+ set(ENV{PKG_CONFIG} "echo")
+
+ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/config)
+ execute_process(
+ COMMAND "${CMAKE_SOURCE_DIR}/configure"
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/config
+ RESULT_VARIABLE res
+ )
+ if(NOT res EQUAL 0)
+ message(FATAL_ERROR "Configure failed.")
+ endif()
+endif()
+
+file(GLOB_RECURSE SOURCES libxml++/*.cc)
+add_library(xml++ ${SOURCES})
+target_compile_definitions(xml++ PRIVATE -DLIBXMLPP_BUILD)
+
+if(NOT DISABLE_INSTALL_HEADERS)
+ install(FILES ${CMAKE_BINARY_DIR}/config/libxml++config.h DESTINATION include)
+ install(DIRECTORY libxml++ DESTINATION include FILES_MATCHING PATTERN *.h)
+endif()
+install(
+ TARGETS xml++
+ RUNTIME DESTINATION bin
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+)
+
+if(NOT DISABLE_EXAMPLES)
+ add_executable(dom_build examples/dom_build/main.cc)
+ target_link_libraries(dom_build xml++)
+endif()
diff --git a/ports/libxmlpp/CONTROL b/ports/libxmlpp/CONTROL new file mode 100644 index 000000000..890d1471d --- /dev/null +++ b/ports/libxmlpp/CONTROL @@ -0,0 +1,4 @@ +Source: libxmlpp +Version: 2.40.1-2 +Description: a C++ wrapper for the libxml XML parser library. +Build-Depends: libxml2, glibmm diff --git a/ports/libxmlpp/fixAutoPtrExpired.patch b/ports/libxmlpp/fixAutoPtrExpired.patch new file mode 100644 index 000000000..98d4df6bc --- /dev/null +++ b/ports/libxmlpp/fixAutoPtrExpired.patch @@ -0,0 +1,114 @@ +diff --git a/libxml++/parsers/saxparser.h b/libxml++/parsers/saxparser.h
+index 1362ca3..0bd36d2 100644
+--- a/libxml++/parsers/saxparser.h
++++ b/libxml++/parsers/saxparser.h
+@@ -221,7 +221,7 @@ private:
+ //TODO: Remove the virtual when we can break ABI?
+ virtual void parse();
+
+- std::auto_ptr<_xmlSAXHandler> sax_handler_;
++ std::unique_ptr<_xmlSAXHandler> sax_handler_;
+
+ // A separate xmlpp::Document that is just used for entity resolution,
+ // and never seen in the API:
+diff --git a/libxml++/parsers/textreader.h b/libxml++/parsers/textreader.h
+index 48901b2..17f0737 100644
+--- a/libxml++/parsers/textreader.h
++++ b/libxml++/parsers/textreader.h
+@@ -257,7 +257,7 @@ class TextReader: NonCopyable
+ void * locator);
+ void check_for_exceptions() const;
+
+- std::auto_ptr<PropertyReader> propertyreader;
++ std::unique_ptr<PropertyReader> propertyreader;
+ _xmlTextReader* impl_;
+ int severity_;
+ Glib::ustring error_;
+diff --git a/libxml++/relaxngschema.h b/libxml++/relaxngschema.h
+index 8df7089..ffe2eaa 100644
+--- a/libxml++/relaxngschema.h
++++ b/libxml++/relaxngschema.h
+@@ -23,7 +23,7 @@
+
+ #include <libxml++/schemabase.h>
+ #include <libxml++/document.h>
+-#include <memory> // std::auto_ptr
++#include <memory> // std::unique_ptr
+
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
+ extern "C" {
+@@ -105,7 +105,7 @@ protected:
+
+ private:
+ struct Impl;
+- std::auto_ptr<Impl> pimpl_;
++ std::unique_ptr<Impl> pimpl_;
+ };
+
+ } // namespace xmlpp
+diff --git a/libxml++/validators/relaxngvalidator.h b/libxml++/validators/relaxngvalidator.h
+index 5cd5ad7..cd29393 100644
+--- a/libxml++/validators/relaxngvalidator.h
++++ b/libxml++/validators/relaxngvalidator.h
+@@ -22,7 +22,7 @@
+ #define __LIBXMLPP_VALIDATOR_RELAXNGVALIDATOR_H
+
+ #include <libxml++/validators/schemavalidatorbase.h>
+-#include <memory> // std::auto_ptr
++#include <memory> // std::unique_ptr
+
+ namespace Glib
+ {
+@@ -156,7 +156,7 @@ protected:
+
+ private:
+ struct Impl;
+- std::auto_ptr<Impl> pimpl_;
++ std::unique_ptr<Impl> pimpl_;
+ };
+
+ } // namespace xmlpp
+diff --git a/libxml++/validators/xsdvalidator.h b/libxml++/validators/xsdvalidator.h
+index 941d7f1..d64b971 100644
+--- a/libxml++/validators/xsdvalidator.h
++++ b/libxml++/validators/xsdvalidator.h
+@@ -20,7 +20,7 @@
+ #define __LIBXMLPP_VALIDATOR_XSDVALIDATOR_H
+
+ #include <libxml++/validators/schemavalidatorbase.h>
+-#include <memory> // std::auto_ptr
++#include <memory> // std::unique_ptr
+
+ namespace Glib
+ {
+@@ -146,7 +146,7 @@ protected:
+
+ private:
+ struct Impl;
+- std::auto_ptr<Impl> pimpl_;
++ std::unique_ptr<Impl> pimpl_;
+ };
+
+ } // namespace xmlpp
+diff --git a/libxml++/xsdschema.h b/libxml++/xsdschema.h
+index 1333025..8220e4e 100644
+--- a/libxml++/xsdschema.h
++++ b/libxml++/xsdschema.h
+@@ -21,7 +21,7 @@
+
+ #include <libxml++/schemabase.h>
+ #include <libxml++/document.h>
+-#include <memory> // std::auto_ptr
++#include <memory> // std::unique_ptr
+
+ #ifndef DOXYGEN_SHOULD_SKIP_THIS
+ extern "C" {
+@@ -96,7 +96,7 @@ protected:
+
+ private:
+ struct Impl;
+- std::auto_ptr<Impl> pimpl_;
++ std::unique_ptr<Impl> pimpl_;
+ };
+
+ } // namespace xmlpp
diff --git a/ports/libxmlpp/portfile.cmake b/ports/libxmlpp/portfile.cmake new file mode 100644 index 000000000..9c39d6397 --- /dev/null +++ b/ports/libxmlpp/portfile.cmake @@ -0,0 +1,31 @@ +include(vcpkg_common_functions) +set(LIBXMLPP_VERSION 2.40.1) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libxml++-${LIBXMLPP_VERSION}) +vcpkg_download_distfile(ARCHIVE + URLS "http://ftp.gnome.org/pub/GNOME/sources/libxml++/2.40/libxml++-${LIBXMLPP_VERSION}.tar.xz" + FILENAME "libxml++-${LIBXMLPP_VERSION}.tar.xz" + SHA512 a4ec2e8182d981c57bdcb8f0a203a3161f8c735ceb59fd212408b7a539d1dc826adf6717bed8f4d544ab08afd9c2fc861efe518e24bbd3a1c4b158e2ca48183a +) +vcpkg_extract_source_archive(${ARCHIVE}) + +file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) + +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/libxml++-${LIBXMLPP_VERSION} + PATCHES "${CMAKE_CURRENT_LIST_DIR}/fixAutoPtrExpired.patch" +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS_DEBUG + -DDISABLE_INSTALL_HEADERS=ON +) + +vcpkg_install_cmake() + +vcpkg_copy_pdbs() + +# Handle copyright and readme +file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/libxmlpp RENAME copyright) +file(INSTALL ${SOURCE_PATH}/README DESTINATION ${CURRENT_PACKAGES_DIR}/share/libxmlpp) |
