poco: update to 1.13.0

This commit is contained in:
مهدي شينون (Mehdi Chinoune)
2024-01-27 20:23:38 +01:00
parent 7afd0c8b49
commit aea2e6db70
10 changed files with 75 additions and 357 deletions

View File

@@ -0,0 +1,35 @@
--- a/Foundation/include/Poco/Platform.h
+++ b/Foundation/include/Poco/Platform.h
@@ -240,6 +240,10 @@
#endif
+#if defined (__MINGW32__)
+ #define POCO_COMPILER_MINGW
+#endif
+
#if defined(__clang__)
#define POCO_COMPILER_CLANG
#define POCO_HAVE_CXXABI_H
@@ -248,11 +252,6 @@
#elif defined (__GNUC__)
#define POCO_COMPILER_GCC
#define POCO_HAVE_CXXABI_H
- #if defined (__MINGW32__) || defined (__MINGW64__)
- #define POCO_COMPILER_MINGW
- #endif
-#elif defined (__MINGW32__) || defined (__MINGW64__)
- #define POCO_COMPILER_MINGW
#elif defined (__INTEL_COMPILER) || defined(__ICC) || defined(__ECC) || defined(__ICL)
#define POCO_COMPILER_INTEL
#elif defined (__SUNPRO_CC)
--- a/Foundation/src/Environment_WIN32U.cpp
+++ b/Foundation/src/Environment_WIN32U.cpp
@@ -18,6 +18,7 @@
#include "Poco/Buffer.h"
#include <sstream>
#include <cstring>
+#include <memory>
#include "Poco/UnWindows.h"
#include <winsock2.h>
#include <wincrypt.h>

View File

@@ -1,62 +0,0 @@
From 91c8f61a89346c5874a4009bfb6950db8f560377 Mon Sep 17 00:00:00 2001
From: Luigi 'Comio' Mantellini <luigi.mantellini@gmail.com>
Date: Mon, 24 Mar 2014 08:35:25 +0100
Subject: [PATCH] Format string using ostringstream and avoiding #if/#endef
---
Foundation/src/NumberFormatter.cpp | 31 +++++++++++--------------------
1 file changed, 11 insertions(+), 20 deletions(-)
diff --git a/Foundation/src/NumberFormatter.cpp b/Foundation/src/NumberFormatter.cpp
index b7b27e7..714acab 100644
--- a/Foundation/src/NumberFormatter.cpp
+++ b/Foundation/src/NumberFormatter.cpp
@@ -19,6 +19,8 @@
#include "Poco/NumberFormatter.h"
#include "Poco/MemoryStream.h"
+#include <ios>
+#include <sstream>
#include <iomanip>
#if !defined(POCO_NO_LOCALE)
#include <locale>
@@ -27,16 +29,6 @@
#include <cinttypes>
-#if defined(_MSC_VER) || defined(__MINGW32__)
- #define I64_FMT "I64"
-#elif defined(__APPLE__)
- #define I64_FMT "q"
-#else
- #define I64_FMT "ll"
-#endif
-
-
-
namespace Poco {
@@ -475,13 +467,15 @@
void NumberFormatter::append(std::string& str, const void* ptr)
{
- char buffer[24];
-#if defined(POCO_PTR_IS_64_BIT)
- std::snprintf(buffer, sizeof(buffer), "%016" PRIXPTR, (UIntPtr) ptr);
-#else
- std::snprintf(buffer, sizeof(buffer), "%08" PRIXPTR, (UIntPtr) ptr);
-#endif
- str.append(buffer);
+ std::ostringstream os;
+
+ os << std::hex
+ << std::setw(sizeof(ptr) * 2)
+ << std::setfill('0')
+ << std::setiosflags(std::ios::uppercase)
+ << ptr;
+
+ str.append(os.str());
}

View File

@@ -1,22 +0,0 @@
From 12766ec99d128a919044e5b98b7521ef614de9e0 Mon Sep 17 00:00:00 2001
From: Luigi 'Comio' Mantellini <luigi.mantellini@gmail.com>
Date: Mon, 24 Mar 2014 08:36:24 +0100
Subject: [PATCH] Don't compare signed with unsigned.
---
Foundation/src/Logger.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Foundation/src/Logger.cpp b/Foundation/src/Logger.cpp
index 6037bf9..78afdfc 100644
--- a/Foundation/src/Logger.cpp
+++ b/Foundation/src/Logger.cpp
@@ -245,7 +245,7 @@ void Logger::formatDump(std::string& message, const void* buffer, std::size_t le
message.reserve(message.size() + length*6);
if (!message.empty()) message.append("\n");
unsigned char* base = (unsigned char*) buffer;
- int addr = 0;
+ std::size_t addr = 0;
while (addr < length)
{
if (addr > 0) message.append("\n");

View File

@@ -1,15 +0,0 @@
--- poco-1.10.1-all/Util/CMakeLists.txt.orig 2020-02-21 09:10:46.711376800 +0300
+++ poco-1.10.1-all/Util/CMakeLists.txt 2020-02-21 09:55:09.318313700 +0300
@@ -27,6 +27,12 @@
DEFINE_SYMBOL Util_EXPORTS
)
+if(MINGW)
+ add_definitions(-DUNICODE -D_UNICODE)
+ target_compile_options(Util PUBLIC -municode)
+ target_link_libraries(Util PUBLIC -municode)
+endif()
+
target_link_libraries(Util PUBLIC Poco::Foundation)
if(ENABLE_XML)
target_link_libraries(Util PUBLIC Poco::XML)

View File

@@ -1,90 +0,0 @@
From c13445582f3712b842cdb72427d83e0de856962e Mon Sep 17 00:00:00 2001
From: Luigi 'Comio' Mantellini <luigi.mantellini@gmail.com>
Date: Mon, 24 Mar 2014 13:42:42 +0100
Subject: [PATCH] Add Mingw32-W64 configuration
---
build/config/MinGW32-W64 | 74 ++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 74 insertions(+)
create mode 100644 build/config/MinGW32-W64
diff --git a/build/config/MinGW32-W64 b/build/config/MinGW32-W64
new file mode 100644
index 0000000..95662df
--- /dev/null
+++ b/build/config/MinGW32-W64
@@ -0,0 +1,74 @@
+#
+# $Id: //poco/1.4/build/config/MinGW#2 $
+#
+# MinGW32
+#
+# Make settings for MinGW on WinXP
+#
+
+#
+# General Settings
+#
+LINKMODE = STATIC
+POCO_TARGET_OSNAME = MinGW
+POCO_TARGET_OSARCH = x86_64
+
+#
+# Define Tools
+#
+CC = gcc
+CXX = g++
+LINK = $(CXX)
+LIB = ar -cr
+RANLIB = ranlib
+SHLIB = $(CXX) -shared -o $@ -Wl,--out-implib=$(dir $@)$(subst cyg,lib,$(basename $(notdir $@))).a
+SHLIBLN = $(POCO_BASE)/build/script/shlibln
+STRIP =
+DEP = $(POCO_BASE)/build/script/makedepend.gcc
+SHELL = sh
+RM = rm -rf
+CP = cp
+MKDIR = mkdir -p
+
+#
+# Extension for Shared Libraries
+#
+SHAREDLIBEXT = .dll
+SHAREDLIBLINKEXT = .dll
+
+BINEXT = .exe
+
+#
+# Compiler and Linker Flags
+#
+CFLAGS =
+CFLAGS32 =
+CFLAGS64 =
+CXXFLAGS = -std=c++11
+CXXFLAGS32 =
+CXXFLAGS64 =
+LINKFLAGS = -Wl,--allow-multiple-definition
+LINKFLAGS32 =
+LINKFLAGS64 =
+STATICOPT_CC =
+STATICOPT_CXX =
+STATICOPT_LINK = -static
+SHAREDOPT_CC =
+SHAREDOPT_CXX =
+SHAREDOPT_LINK = -shared
+DEBUGOPT_CC = -Og -D_DEBUG
+DEBUGOPT_CXX = -Og -D_DEBUG
+DEBUGOPT_LINK = -Og
+RELEASEOPT_CC = -O2 -DNDEBUG
+RELEASEOPT_CXX = -O2 -DNDEBUG
+RELEASEOPT_LINK = -O2
+
+#
+# System Specific Flags
+#
+SYSFLAGS = -Wall -m64 -D_WIN64 -DWINVER=0x501 -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC -DPOCO_THREAD_STACK_SIZE -DPOCO_STATIC
+# -DFoundation_Config_INCLUDED
+#
+# System Specific Libraries
+#
+SYSLIBS = -liphlpapi -lssl -lcrypto -lws2_32

View File

@@ -1,59 +0,0 @@
From 1f23a7838000e6fd5f7a1ae6bb85791ce7c08ad7 Mon Sep 17 00:00:00 2001
From: Luigi 'Comio' Mantellini <luigi.mantellini@gmail.com>
Date: Mon, 24 Mar 2014 13:44:04 +0100
Subject: [PATCH] Remove some warning.
---
Foundation/src/NumericString.cpp | 15 +++++++++------
Foundation/src/utils.h | 7 ++++++-
2 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/Foundation/src/NumericString.cpp b/Foundation/src/NumericString.cpp
index 37ecf7f..e5dc939 100644
--- a/Foundation/src/NumericString.cpp
+++ b/Foundation/src/NumericString.cpp
@@ -48,6 +48,9 @@ void pad(std::string& str, int precision, int width, char prefix = ' ', char dec
poco_assert_dbg (precision > 0);
poco_assert_dbg (str.length());
+ std::string::size_type _precision = static_cast<std::string::size_type>(precision);
+ std::string::size_type _width = static_cast<std::string::size_type>(width);
+
std::string::size_type decSepPos = str.find(decSep);
if (decSepPos == std::string::npos)
{
@@ -66,15 +66,15 @@ void pad(std::string& str, int precision, int width, char prefix = ' ', char dec
str = str.substr(0, str.length() - eStr->length());
}
- if (frac != precision)
+ if (frac != _precision)
{
- if (frac < precision)
+ if (frac < _precision)
{
- str.append(precision - frac, '0');
+ str.append(_precision - frac, '0');
}
- else if ((frac > precision) && (decSepPos != std::string::npos))
+ else if ((frac > _precision) && (decSepPos != std::string::npos))
{
- int pos = static_cast<int>(decSepPos) + 1 + precision;
+ int pos = static_cast<int>(decSepPos) + 1 + _precision;
if (str[pos] >= '5') // we must round up
{
char carry = 0;
@@ -107,13 +107,13 @@ void pad(std::string& str, int precision, int width, char prefix = ' ', char dec
}
if (carry) str.insert(str.begin(), 1, '1');
}
- str = str.substr(0, decSepPos + 1 + precision);
+ str = str.substr(0, decSepPos + 1 + _precision);
}
}
if (eStr.get()) str += *eStr;
- if (width && (str.length() < width)) str.insert(str.begin(), width - str.length(), prefix);
+ if (width && (str.length() < width)) str.insert(str.begin(), _width - str.length(), prefix);
}

View File

@@ -1,6 +1,6 @@
--- poco-poco-1.11.6-release/CMakeLists.txt.orig 2014-11-17 12:31:47.705800000 +0300
+++ poco-poco-1.11.6-release/CMakeLists.txt 2014-11-17 12:32:39.209200000 +0300
@@ -459,7 +459,7 @@
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -513,7 +513,7 @@
# Set config script install location in a location that find_package() will
# look for, which is different on MS Windows than for UNIX
# Note: also set in POCO_GENERATE_PACKAGE macro in cmake/PocoMacros.cmake
@@ -8,9 +8,9 @@
+if(MSVC)
set(PocoConfigPackageLocation "cmake")
else()
set(PocoConfigPackageLocation "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}")
--- poco-poco-1.11.6-release/cmake/PocoMacros.cmake.orig 2014-11-17 12:31:47.705800000 +0300
+++ poco-poco-1.11.6-release/cmake/PocoMacros.cmake 2014-11-17 12:32:39.209200000 +0300
set(PocoConfigPackageLocation "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
--- a/cmake/PocoMacros.cmake
+++ b/cmake/PocoMacros.cmake
@@ -40,8 +40,13 @@
endforeach()
endif(X64)
@@ -25,7 +25,7 @@
if(NOT CMAKE_MC_COMPILER)
message(FATAL_ERROR "message compiler not found: required to build")
endif(NOT CMAKE_MC_COMPILER)
@@ -230,7 +230,7 @@
@@ -237,7 +237,7 @@
# Set config script install location in a location that find_package() will
# look for, which is different on MS Windows than for UNIX
# Note: also set in root CMakeLists.txt
@@ -33,17 +33,4 @@
+if(MSVC)
set(PocoConfigPackageLocation "cmake")
else()
set(PocoConfigPackageLocation "lib${LIB_SUFFIX}/cmake/${PROJECT_NAME}")
--- poco-poco-1.11.6-release/Foundation/CMakeLists.txt.orig 2014-11-17 12:31:47.705800000 +0300
+++ poco-poco-1.11.6-release/Foundation/CMakeLists.txt 2014-11-17 12:32:39.209200000 +0300
@@ -187,7 +187,9 @@
POCO_WIN32_UTF8
_WIN32
MINGW32
- WINVER=0x500
+ WINVER=0x501
+ UNICODE
+ _UNICODE
ODBCVER=0x0300
POCO_THREAD_STACK_SIZE
)
set(PocoConfigPackageLocation "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")

View File

@@ -1,12 +0,0 @@
--- poco-1.11.6-all/Net/include/Poco/Net/ICMPv4PacketImpl.h.orig 2020-02-21 09:50:46.432846900 +0300
+++ poco-1.11.6-all/Net/include/Poco/Net/ICMPv4PacketImpl.h 2020-02-21 09:50:49.308908100 +0300
@@ -23,6 +23,9 @@
#include "Poco/Net/ICMPPacketImpl.h"
#include <cstddef>
+#ifdef __MINGW32__
+#undef TIMESTAMP_REQUEST
+#endif
namespace Poco {
namespace Net {

View File

@@ -1,14 +0,0 @@
--- poco-poco-1.11.6-release/build/config/MinGW.orig 2014-11-16 23:36:56.214400000 +0300
+++ poco-poco-1.11.6-release/build/config/MinGW 2014-11-16 23:37:56.180800000 +0300
@@ -65,9 +65,9 @@
#
# System Specific Flags
#
-SYSFLAGS = -D_WIN32 -DMINGW32 -DWINVER=0x501 -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC -DPOCO_THREAD_STACK_SIZE -I/usr/local/include -I/usr/include
+SYSFLAGS = -D_WIN32 -DMINGW32 -DWINVER=0x501 -DPOCO_NO_FPENVIRONMENT -DPCRE_STATIC -DPOCO_THREAD_STACK_SIZE
#
# System Specific Libraries
#
-SYSLIBS = -L/usr/local/lib -L/usr/lib -liphlpapi -lssl -lcrypto -lws2_32
+SYSLIBS = -liphlpapi -lssl -lcrypto -lws2_32

View File

@@ -3,83 +3,52 @@
_realname=poco
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.11.6
pkgrel=2
pkgver=1.13.0
pkgrel=1
pkgdesc="POrtable COmponents C++ Libraries (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
mingw_arch=('mingw64' 'ucrt64' 'clang64')
url="https://pocoproject.org/"
license=('spdx:BSL-1.0')
makedepends=("${MINGW_PACKAGE_PREFIX}-cc"
"${MINGW_PACKAGE_PREFIX}-cmake"
"${MINGW_PACKAGE_PREFIX}-ninja"
"${MINGW_PACKAGE_PREFIX}-pkgconf")
"${MINGW_PACKAGE_PREFIX}-pkgconf"
# workaround lack of windmc in llvm
$([[ ${MINGW_PACKAGE_PREFIX} != *-clang-* ]] || echo "binutils"))
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-apr"
"${MINGW_PACKAGE_PREFIX}-apr-util"
#"${MINGW_PACKAGE_PREFIX}-apr"
#"${MINGW_PACKAGE_PREFIX}-apr-util"
"${MINGW_PACKAGE_PREFIX}-expat"
"${MINGW_PACKAGE_PREFIX}-libmariadbclient"
"${MINGW_PACKAGE_PREFIX}-openssl"
"${MINGW_PACKAGE_PREFIX}-pcre"
"${MINGW_PACKAGE_PREFIX}-pcre2"
"${MINGW_PACKAGE_PREFIX}-postgresql"
"${MINGW_PACKAGE_PREFIX}-sqlite3"
"${MINGW_PACKAGE_PREFIX}-zlib")
source=(https://pocoproject.org/releases/${_realname}-${pkgver}/${_realname}-${pkgver}-all.tar.gz
004-format-string-using-ostringstream.patch
005-dont-compare-signed-unsigned.patch
007-mingw-wide-character-startup-module.patch
008-Add-Mingw32-W64-configuration.patch
010-remove-warnings.patch
011-cmake-mingw.patch
012-fix-mingw-redefinition.patch
100-fix-mingw-config.patch)
sha256sums=('f1f8004a3d304861d78b3341458d298d37c7d3d84938fb019e0ce3002dde951d'
'94bf2a9ddfa00d0ec804283d6fd4cd0c13c9001e0beb44f16ac5250b5b90845e'
'ec37e78bd3f57403b9e4d69a4ad016c451c8552c88b4e3b319e61b015190206c'
'8c89571920fb5d0ecaae1b890854335fb5d310243baa4723233fe46544cf4f1b'
'61979c75b5577b9b0bf3fb96045b3c299a38c5dfc5048895ade73400831eb975'
'542abadbead21f4539a3aad118bfb08f63e531a70db6f17bc08da1b171c4563e'
'a566cdc7cbeedb1666f108d0e339b9c3d7d3b1fb8e9b99c1c2f2566548e6ffbf'
'6ba1dcf47a6976496467965bb9eafd1453ae373d0fc52997c1c32ff799372ad2'
'861cc9dfae04c1843ac7d1010eb7f31596b123624bcd3cee5dbef0ac4394f9b1')
source=(https://pocoproject.org/releases/${_realname}-${pkgver}/${_realname}-${pkgver}-all.tar.bz2
001-fix-build-on-mingw.patch
011-cmake-mingw.patch)
sha256sums=('93d3a810064c25f1e8b24452602e42bc528474258458f388f9de2f787d5170ab'
'daf531ab8ed72a86a02ddfcb916e113155b7a872b65116907f4d3be6e4997afe'
'8b4c1abc1fc635229333632a36c3f7850f2de70b9ba91db06d7c9aebcecc5ef1')
case ${MSYSTEM} in
CLANG*)
# work around lack of windmc in llvm
makedepends+=("binutils")
;;
esac
_apply_patch_with_msg() {
for _patch in "$@"
do
msg2 "Applying ${_patch}"
patch -p1 -i "${srcdir}/${_patch}"
done
}
prepare() {
cd "${srcdir}"/${_realname}-${pkgver}-all
patch -p1 -i ${srcdir}/004-format-string-using-ostringstream.patch
patch -p1 -i ${srcdir}/005-dont-compare-signed-unsigned.patch
patch -p1 -i ${srcdir}/007-mingw-wide-character-startup-module.patch
patch -p1 -i ${srcdir}/008-Add-Mingw32-W64-configuration.patch
patch -p1 -i ${srcdir}/010-remove-warnings.patch
patch -p1 -i ${srcdir}/011-cmake-mingw.patch
patch -p1 -i ${srcdir}/012-fix-mingw-redefinition.patch
patch -p1 -i ${srcdir}/100-fix-mingw-config.patch
_apply_patch_with_msg \
001-fix-build-on-mingw.patch \
011-cmake-mingw.patch
}
build() {
local _config=
case "${CARCH}" in
i686)
_config=MinGW
;;
x86_64)
_config=MinGW32-W64
;;
esac
case {$MSYSTEM} in
CLANG*)
makedepends+=("binutils")
;;
esac
declare -a _extra_config
if check_option "debug" "n"; then
_extra_config+=("-DCMAKE_BUILD_TYPE=Release")
@@ -89,17 +58,18 @@ build() {
mkdir -p "${srcdir}/build-${MSYSTEM}-static" && cd "${srcdir}/build-${MSYSTEM}-static"
CFLAGS+=" -DPCRE2_STATIC" \
CXXFLAGS+=" -DPCRE2_STATIC" \
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
${_extra_config[@]} \
-DCMAKE_C_FLAGS="${CPPFLAGS} -DPCRE_STATIC ${CFLAGS}" \
-DCMAKE_CXX_FLAGS="${CPPFLAGS} -DPCRE_STATIC ${CXXFLAGS}" \
"${_extra_config[@]}" \
-DBUILD_SHARED_LIBS=OFF \
-DPOCO_UNBUNDLED=ON \
-DENABLE_MONGODB=OFF \
-DENABLE_DATA_ODBC=OFF \
-DPOCO_DATA_NO_SQL_PARSER=ON \
../${_realname}-${pkgver}-all
${MINGW_PREFIX}/bin/cmake.exe --build ./
@@ -110,13 +80,13 @@ build() {
${MINGW_PREFIX}/bin/cmake \
-GNinja \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
${_extra_config[@]} \
-DCMAKE_C_FLAGS="${CPPFLAGS} ${CFLAGS}" \
-DCMAKE_CXX_FLAGS="${CPPFLAGS} ${CXXFLAGS}" \
"${_extra_config[@]}" \
-DBUILD_SHARED_LIBS=ON \
-DCMAKE_DLL_NAME_WITH_SOVERSION=ON \
-DPOCO_UNBUNDLED=ON \
-DENABLE_MONGODB=OFF \
-DENABLE_DATA_ODBC=OFF \
-DPOCO_DATA_NO_SQL_PARSER=ON \
../${_realname}-${pkgver}-all
${MINGW_PREFIX}/bin/cmake.exe --build ./