diff options
Diffstat (limited to 'vcpkg/ports/libopensp')
| -rw-r--r-- | vcpkg/ports/libopensp/opensp.pc.in | 12 | ||||
| -rw-r--r-- | vcpkg/ports/libopensp/opensp_1.5.2-13.diff | 37 | ||||
| -rw-r--r-- | vcpkg/ports/libopensp/portfile.cmake | 59 | ||||
| -rw-r--r-- | vcpkg/ports/libopensp/use-cpp-using-declarations.patch | 72 | ||||
| -rw-r--r-- | vcpkg/ports/libopensp/uwp_getenv_fix.diff | 13 | ||||
| -rw-r--r-- | vcpkg/ports/libopensp/vcpkg.json | 24 | ||||
| -rw-r--r-- | vcpkg/ports/libopensp/windows_cmake_build.diff | 133 |
7 files changed, 350 insertions, 0 deletions
diff --git a/vcpkg/ports/libopensp/opensp.pc.in b/vcpkg/ports/libopensp/opensp.pc.in new file mode 100644 index 0000000..2b659bd --- /dev/null +++ b/vcpkg/ports/libopensp/opensp.pc.in @@ -0,0 +1,12 @@ +prefix=@PREFIX@ +exec_prefix=${prefix} +libdir=${prefix}/lib +includedir=${prefix}/include/OpenSP + +Name: opensp +Description: SGML parser algorithm library +Version: @VERSION@ +Libs: -L${libdir} -losp +Libs.private: @EXTRA_LIBS@ +Cflags: -I${includedir} +Cflags.private: diff --git a/vcpkg/ports/libopensp/opensp_1.5.2-13.diff b/vcpkg/ports/libopensp/opensp_1.5.2-13.diff new file mode 100644 index 0000000..9278123 --- /dev/null +++ b/vcpkg/ports/libopensp/opensp_1.5.2-13.diff @@ -0,0 +1,37 @@ +--- opensp-1.5.2.orig/sx/XmlOutputEventHandler.cxx ++++ opensp-1.5.2/sx/XmlOutputEventHandler.cxx +@@ -1199,12 +1199,22 @@ + // Check to make sure we haven't passed outside of the + // output directory + char *dirs = strdup (filePath); ++#ifdef MAXPATHLEN + char realDirs[MAXPATHLEN]; + char realOutputDir[MAXPATHLEN]; ++#else ++ char *realDirs; ++ char *realOutputDir; ++#endif + char *outputDir = strdup(outputDir_); + ++#ifdef MAXPATHLEN + realpath((const char *)dirname(dirs), realDirs); + realpath((const char *)dirname(outputDir), realOutputDir); ++#else ++ realDirs = realpath((const char *)dirname(dirs), NULL); ++ realOutputDir = realpath((const char *)dirname(outputDir), NULL); ++#endif + + if (strncmp(realDirs, realOutputDir, strlen (realOutputDir)) != 0) { + app_->message(XmlOutputMessages::pathOutsideOutputDirectory, +@@ -1214,6 +1224,11 @@ + } + } + ++#ifndef MAXPATHLEN ++ free(realDirs); ++ free(realOutputDir); ++#endif ++ + // Make the necessary directories + maybeCreateDirectories(dirname(dirs)); + diff --git a/vcpkg/ports/libopensp/portfile.cmake b/vcpkg/ports/libopensp/portfile.cmake new file mode 100644 index 0000000..5466e20 --- /dev/null +++ b/vcpkg/ports/libopensp/portfile.cmake @@ -0,0 +1,59 @@ +set(PATCHES
+ opensp_1.5.2-13.diff # http://deb.debian.org/debian/pool/main/o/opensp/opensp_1.5.2-13.diff.gz
+ use-cpp-using-declarations.patch
+)
+if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
+ list(APPEND PATCHES windows_cmake_build.diff) # https://invent.kde.org/packaging/craft-blueprints-kde/-/tree/master/libs/libopensp
+endif()
+if (VCPKG_TARGET_IS_UWP)
+ list(APPEND PATCHES uwp_getenv_fix.diff)
+endif()
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://downloads.sourceforge.net/project/openjade/opensp/${VERSION}/OpenSP-${VERSION}.tar.gz"
+ FILENAME "OpenSP-${VERSION}.tar.gz"
+ SHA512 a7dcc246ba7f58969ecd6d107c7b82dede811e65f375b7aa3e683621f2c6ff3e7dccefdd79098fcadad6cca8bb94c2933c63f4701be2c002f9a56f1bbe6b047e
+)
+
+vcpkg_extract_source_archive(
+ SOURCE_PATH
+ ARCHIVE "${ARCHIVE}"
+ SOURCE_BASE ${VERSION}
+ PATCHES ${PATCHES}
+)
+
+if (VCPKG_TARGET_IS_WINDOWS OR VCPKG_TARGET_IS_UWP)
+ vcpkg_cmake_configure(
+ SOURCE_PATH "${SOURCE_PATH}"
+ )
+
+ vcpkg_cmake_install()
+else()
+ if(VCPKG_TARGET_IS_OSX)
+ # libintl links to those
+ set(EXTRA_LIBS "-framework CoreFoundation -lintl -liconv")
+ endif()
+
+ vcpkg_configure_make(
+ AUTOCONFIG
+ SOURCE_PATH "${SOURCE_PATH}"
+ OPTIONS
+ --disable-doc-build
+ "LDFLAGS=${EXTRA_LIBS} \$LDFLAGS"
+ )
+
+ vcpkg_install_make()
+endif()
+
+configure_file("${CMAKE_CURRENT_LIST_DIR}/opensp.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/opensp.pc" @ONLY)
+vcpkg_fixup_pkgconfig()
+vcpkg_copy_pdbs()
+
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
+endif()
+
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+
+vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/COPYING")
diff --git a/vcpkg/ports/libopensp/use-cpp-using-declarations.patch b/vcpkg/ports/libopensp/use-cpp-using-declarations.patch new file mode 100644 index 0000000..4a6e8bd --- /dev/null +++ b/vcpkg/ports/libopensp/use-cpp-using-declarations.patch @@ -0,0 +1,72 @@ +diff --git a/include/IList.h b/include/IList.h +index e66cd00..c94cfed 100644 +--- a/include/IList.h ++++ b/include/IList.h +@@ -26,7 +26,9 @@ public: + void swap(IList<T> &list) { IListBase::swap(list); } + T *head() const { return (T *)IListBase::head(); } + T *get() { return (T *)IListBase::get(); } ++ using + IListBase::clear; ++ using + IListBase::empty; + friend class IListIter<T>; + private: +diff --git a/include/IListIter.h b/include/IListIter.h +index 74e1bd6..d322bf8 100644 +--- a/include/IListIter.h ++++ b/include/IListIter.h +@@ -17,7 +17,9 @@ public: + IListIter(const IList<T> &list) : IListIterBase(list) { } + T *cur() const { return (T *)IListIterBase::cur(); } + ++ using + IListIterBase::next; ++ using + IListIterBase::done; + }; + +diff --git a/include/Ptr.h b/include/Ptr.h +index c6b2767..5dda0ca 100644 +--- a/include/Ptr.h ++++ b/include/Ptr.h +@@ -69,7 +69,9 @@ public: + const T *operator->() const { return Ptr<T>::pointer(); } + const T &operator*() const { return *Ptr<T>::pointer(); } + void swap(ConstPtr<T> &p) { Ptr<T>::swap(p); } ++ using + Ptr<T>::isNull; ++ using + Ptr<T>::clear; + Boolean operator==(const Ptr<T> &p) const { return Ptr<T>::operator==(p); } + Boolean operator!=(const Ptr<T> &p) const { return Ptr<T>::operator!=(p); } +diff --git a/lib/Parser.h b/lib/Parser.h +index e721000..c6c41b2 100644 +--- a/lib/Parser.h ++++ b/lib/Parser.h +@@ -62,15 +62,25 @@ public: + Parser(const SgmlParser::Params &); + Event *nextEvent(); + void parseAll(EventHandler &, const volatile sig_atomic_t *cancelPtr); ++ using + ParserState::sdPointer; ++ using + ParserState::instanceSyntaxPointer; ++ using + ParserState::prologSyntaxPointer; ++ using + ParserState::activateLinkType; ++ using + ParserState::allLinkTypesActivated; ++ using + ParserState::entityManager; ++ using + ParserState::entityCatalog; ++ using + ParserState::baseDtd; ++ using + ParserState::options; ++ using + ParserState::instantiateDtd; + friend class PiAttspecParser; + private: diff --git a/vcpkg/ports/libopensp/uwp_getenv_fix.diff b/vcpkg/ports/libopensp/uwp_getenv_fix.diff new file mode 100644 index 0000000..806ac1b --- /dev/null +++ b/vcpkg/ports/libopensp/uwp_getenv_fix.diff @@ -0,0 +1,13 @@ +diff --git a/config.h b/config.h +index 6a2b097..7db8a93 100644 +--- a/config.h ++++ b/config.h +@@ -64,6 +64,8 @@ + #pragma warning ( disable : 4251 ) // __declspec(dllexport) + #pragma warning ( disable : 4275 ) + #pragma warning ( disable : 4237 ) // future reserved keyword ++#pragma warning ( disable : 4996 ) // 'getenv': This function or variable may be unsafe (on UWP) ++#pragma warning ( disable : 4703 ) // potentially uninitialized local pointer variable 'declaredValue' + #define huge verybig + #if _MSC_VER == 900 + #define SP_DECLARE_PLACEMENT_OPERATOR_NEW diff --git a/vcpkg/ports/libopensp/vcpkg.json b/vcpkg/ports/libopensp/vcpkg.json new file mode 100644 index 0000000..51799fd --- /dev/null +++ b/vcpkg/ports/libopensp/vcpkg.json @@ -0,0 +1,24 @@ +{ + "name": "libopensp", + "version": "1.5.2", + "port-version": 4, + "description": "SGML parser algorithm", + "homepage": "https://openjade.sourceforge.net", + "license": "MIT", + "dependencies": [ + { + "name": "gettext", + "platform": "!(windows | uwp)" + }, + { + "name": "vcpkg-cmake", + "host": true, + "platform": "windows" + }, + { + "name": "vcpkg-cmake-config", + "host": true, + "platform": "windows" + } + ] +} diff --git a/vcpkg/ports/libopensp/windows_cmake_build.diff b/vcpkg/ports/libopensp/windows_cmake_build.diff new file mode 100644 index 0000000..bac0b15 --- /dev/null +++ b/vcpkg/ports/libopensp/windows_cmake_build.diff @@ -0,0 +1,133 @@ +diff -Nru -x '*~' OpenSP-1.5.2.orig/CMakeLists.txt OpenSP-1.5.2/CMakeLists.txt +--- OpenSP-1.5.2.orig/CMakeLists.txt 1970-01-01 02:00:00.000000000 +0200 ++++ OpenSP-1.5.2/CMakeLists.txt 2014-08-24 17:23:19.941495700 +0300 +@@ -0,0 +1,20 @@ ++project(opensp) ++ ++cmake_minimum_required(VERSION 2.6) ++ ++include_directories( ++ . ++ include ++ generic ++) ++ ++file(GLOB SRC_SOURCES lib/*.cxx) ++file(GLOB libopensp_HEADERS config.h generic/*.h include/*.h) ++ ++add_library(opensp ${SRC_SOURCES}) ++set_target_properties(opensp PROPERTIES OUTPUT_NAME "osp") ++target_link_libraries(opensp) ++ ++install(TARGETS opensp RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib) ++install(FILES ${libopensp_HEADERS} DESTINATION include/opensp) ++ +diff -Nru -x '*~' OpenSP-1.5.2.orig/config.h OpenSP-1.5.2/config.h +--- OpenSP-1.5.2.orig/config.h 2005-12-23 16:16:30.000000000 +0200 ++++ OpenSP-1.5.2/config.h 2014-08-24 17:26:33.724698900 +0300 +@@ -26,6 +26,12 @@ + #endif + #endif /* __GNUG__ */ + ++#ifdef __MINGW32__ ++#define SP_HAVE_BOOL ++#define SP_HAVE_TYPENAME ++#define SP_DEFINE_TEMPLATES ++#endif /* __MINGW32__ */ ++ + #if defined(sun) || defined(__sun) + // struct stat has st_blksize member + #define SP_STAT_BLKSIZE +@@ -80,6 +86,11 @@ + #define SP_HAVE_TYPENAME + #endif + ++#if _MSC_VER >=1800 ++// Visual Studio 2013 ++#define SP_ANSI_FOR_SCOPE ++#endif ++ + #define SP_HAVE_SETMODE + #define SP_DLLEXPORT __declspec(dllexport) + #define SP_DLLIMPORT __declspec(dllimport) +@@ -301,12 +312,5 @@ + #define PATH_SEPARATOR ':' + #endif + +- +-/* new stuff */ +- +-#ifndef HAVE_MUTABLE +-#define mutable +-#endif +- + // NOTE: This is processed as a Makefile, not as a header by autoconf. + #define SP_PACKAGE "OpenSP" +diff -Nru -x '*~' OpenSP-1.5.2.orig/generic/SGMLApplication.h OpenSP-1.5.2/generic/SGMLApplication.h +--- OpenSP-1.5.2.orig/generic/SGMLApplication.h 2005-05-14 12:17:41.000000000 +0300 ++++ OpenSP-1.5.2/generic/SGMLApplication.h 2014-08-24 17:23:19.957120700 +0300 +@@ -269,6 +269,7 @@ + unsigned count_; + friend class OpenEntityPtr; + }; ++ SGMLApplication(); + virtual ~SGMLApplication(); + virtual void appinfo(const AppinfoEvent &); + virtual void startDtd(const StartDtdEvent &); +diff -Nru -x '*~' OpenSP-1.5.2.orig/include/OutputCharStream.h OpenSP-1.5.2/include/OutputCharStream.h +--- OpenSP-1.5.2.orig/include/OutputCharStream.h 2005-07-21 17:04:39.000000000 +0300 ++++ OpenSP-1.5.2/include/OutputCharStream.h 2014-08-24 17:23:19.957120700 +0300 +@@ -31,6 +31,7 @@ + OutputCharStream &operator<<(const char *); + OutputCharStream &operator<<(const StringC &); + OutputCharStream &operator<<(unsigned long); ++ OutputCharStream &operator<<(unsigned long long); + OutputCharStream &operator<<(int); + OutputCharStream &operator<<(Newline); + private: +diff -Nru -x '*~' OpenSP-1.5.2.orig/lib/MessageReporter.cxx OpenSP-1.5.2/lib/MessageReporter.cxx +--- OpenSP-1.5.2.orig/lib/MessageReporter.cxx 2005-07-21 17:05:17.000000000 +0300 ++++ OpenSP-1.5.2/lib/MessageReporter.cxx 2014-08-24 17:23:19.957120700 +0300 +@@ -123,7 +123,11 @@ + os() << ':'; + } + if (options_ & messageNumbers) ++#ifdef _WIN64 ++ os() << (unsigned long long)message.type->module() << "." ++#else + os() << (unsigned long)message.type->module() << "." ++#endif + << (unsigned long)message.type->number() << ":"; + switch (message.type->severity()) { + case MessageType::info: +diff -Nru -x '*~' OpenSP-1.5.2.orig/lib/OutputCharStream.cxx OpenSP-1.5.2/lib/OutputCharStream.cxx +--- OpenSP-1.5.2.orig/lib/OutputCharStream.cxx 2005-07-21 17:05:17.000000000 +0300 ++++ OpenSP-1.5.2/lib/OutputCharStream.cxx 2014-08-24 17:23:19.957120700 +0300 +@@ -61,6 +61,13 @@ + return *this << buf; + } + ++OutputCharStream &OutputCharStream::operator<<(unsigned long long n) ++{ ++ char buf[sizeof(unsigned long long)*3 + 1]; ++ sprintf(buf, "%I64u", n); ++ return *this << buf; ++} ++ + OutputCharStream &OutputCharStream::operator<<(int n) + { + char buf[sizeof(int)*3 + 2]; +diff -Nru -x '*~' OpenSP-1.5.2.orig/lib/SGMLApplication.cxx OpenSP-1.5.2/lib/SGMLApplication.cxx +--- OpenSP-1.5.2.orig/lib/SGMLApplication.cxx 2005-07-21 17:05:18.000000000 +0300 ++++ OpenSP-1.5.2/lib/SGMLApplication.cxx 2014-08-24 17:23:19.972745700 +0300 +@@ -9,6 +9,10 @@ + #include "Boolean.h" + #include "SGMLApplication.h" + ++SGMLApplication::SGMLApplication() ++{ ++} ++ + SGMLApplication::~SGMLApplication() + { + } |