From 100a6d7fc03c83edb2703c0dba984e1df466723e Mon Sep 17 00:00:00 2001 From: Alexpux Date: Tue, 18 Nov 2014 00:02:48 +0300 Subject: [PATCH] poco: WIP cmake --- .../008-Add-Mingw32-W64-configuration.patch | 8 ++--- mingw-w64-poco/011-cmake-mingw.patch | 29 +++++++++++++++++++ mingw-w64-poco/PKGBUILD | 27 ++++++++++++----- 3 files changed, 53 insertions(+), 11 deletions(-) create mode 100644 mingw-w64-poco/011-cmake-mingw.patch diff --git a/mingw-w64-poco/008-Add-Mingw32-W64-configuration.patch b/mingw-w64-poco/008-Add-Mingw32-W64-configuration.patch index f9b58dfe1c..baad4f0434 100644 --- a/mingw-w64-poco/008-Add-Mingw32-W64-configuration.patch +++ b/mingw-w64-poco/008-Add-Mingw32-W64-configuration.patch @@ -72,9 +72,9 @@ index 0000000..95662df +SHAREDOPT_CC = +SHAREDOPT_CXX = +SHAREDOPT_LINK = -shared -+DEBUGOPT_CC = -g -D_DEBUG -+DEBUGOPT_CXX = -g -D_DEBUG -+DEBUGOPT_LINK = -g ++DEBUGOPT_CC = -Og -D_DEBUG ++DEBUGOPT_CXX = -Og -D_DEBUG ++DEBUGOPT_LINK = -Og +RELEASEOPT_CC = -O2 -DNDEBUG +RELEASEOPT_CXX = -O2 -DNDEBUG +RELEASEOPT_LINK = -O2 @@ -87,4 +87,4 @@ index 0000000..95662df +# +# System Specific Libraries +# -+SYSLIBS = -liphlpapi -lws2_32 ++SYSLIBS = -liphlpapi -lssl -lcrypto -lws2_32 diff --git a/mingw-w64-poco/011-cmake-mingw.patch b/mingw-w64-poco/011-cmake-mingw.patch new file mode 100644 index 0000000000..9bdd42e1f8 --- /dev/null +++ b/mingw-w64-poco/011-cmake-mingw.patch @@ -0,0 +1,29 @@ +--- poco-poco-1.5.4-release/CMakeLists.txt.orig 2014-11-17 11:55:04.044400000 +0300 ++++ poco-poco-1.5.4-release/CMakeLists.txt 2014-11-17 11:55:44.370400000 +0300 +@@ -151,9 +151,7 @@ + + if (CMAKE_COMPILER_IS_MINGW) + add_definitions(-DWC_NO_BEST_FIT_CHARS=0x400 -DPOCO_WIN32_UTF8) +- add_definitions(-mno-cygwin -D_WIN32 -DMINGW32 -DWINVER=0x500 -DODBCVER=0x0300 -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED ) +- link_directories(/usr/local/lib /usr/lib) +- include_directories(/usr/local/include /usr/include) ++ add_definitions(-D_WIN32 -DMINGW32 -DWINVER=0x500 -DPOCO_NO_FPENVIRONMENT -DODBCVER=0x0300 -DPOCO_THREAD_STACK_SIZE -DFoundation_Config_INCLUDED ) + endif (CMAKE_COMPILER_IS_MINGW) + + if (CMAKE_COMPILER_IS_CYGWIN) +--- poco-poco-1.5.4-release/cmake/PocoMacros.cmake.orig 2014-11-17 12:31:47.705800000 +0300 ++++ poco-poco-1.5.4-release/cmake/PocoMacros.cmake 2014-11-17 12:32:39.209200000 +0300 +@@ -24,8 +24,13 @@ + set(kit_bindir "${kit_dir}/bin/x86") + endif (X64) + endif () ++ if(MINGW) ++ find_program(CMAKE_MC_COMPILER windmc.exe HINTS "${sdk_bindir}" "${kit_bindir}" ++ DOC "path to message compiler") ++ else() + find_program(CMAKE_MC_COMPILER mc.exe HINTS "${sdk_bindir}" "${kit_bindir}" + DOC "path to message compiler") ++ endif() + if (NOT CMAKE_MC_COMPILER) + message(FATAL_ERROR "message compiler not found: required to build") + endif (NOT CMAKE_MC_COMPILER) diff --git a/mingw-w64-poco/PKGBUILD b/mingw-w64-poco/PKGBUILD index bb736cfbe2..2e596e0d62 100644 --- a/mingw-w64-poco/PKGBUILD +++ b/mingw-w64-poco/PKGBUILD @@ -27,6 +27,7 @@ source=(https://github.com/pocoproject/poco/archive/${_realname}-${pkgver}-relea 008-Add-Mingw32-W64-configuration.patch 009-Fix-compilation-on-WIN64-target.patch 010-remove-warnings.patch + 011-cmake-mingw.patch 100-fix-mingw-config.patch) md5sums=('cf045f4f64d2d439294686ff7dcc6fd6' 'dc6b7d75f579fa97b28ab6c07e62517e' @@ -36,9 +37,10 @@ md5sums=('cf045f4f64d2d439294686ff7dcc6fd6' '5be1be3d1e5b8b72c7efdc09aa1ceff7' 'f5847e1ff54fba6ff87eb3620a8ed717' '07a7c3fa639ad38cb0b005825255b5db' - '818e9ab8d24ec74a944b9b96addeb34f' + 'edf178d3fb8c02c1a7da81ce89a193fd' 'f3aa357f69168abb2919ddb912664c1e' 'cb90582b6bbae7b1231ad5cdd290eeb0' + '9ab977d32e32d0e0306486508ae6b8f1' 'cee49c612b14edb3ae57d0e0b9329f3c') prepare() { @@ -53,6 +55,7 @@ prepare() { patch -p1 -i ${srcdir}/008-Add-Mingw32-W64-configuration.patch patch -p1 -i ${srcdir}/009-Fix-compilation-on-WIN64-target.patch patch -p1 -i ${srcdir}/010-remove-warnings.patch + patch -p1 -i ${srcdir}/011-cmake-mingw.patch patch -p1 -i ${srcdir}/100-fix-mingw-config.patch } @@ -68,15 +71,25 @@ build() { ;; esac + CXXFLAGS+=" -std=c++11" mkdir -p "${srcdir}/build-${MINGW_CHOST}" cd "${srcdir}/build-${MINGW_CHOST}" - "${srcdir}"/${_realname}-${_realname}-${pkgver}-release/configure \ - --prefix=${MINGW_PREFIX} \ - --config=${_config} \ - --static \ - --shared + ${MINGW_PREFIX}/bin/cmake \ + -G"MSYS Makefiles" \ + -DCMAKE_INSTALL_PREFIX=${pkgdir}${MINGW_PREFIX} \ + -DCMAKE_BUILD_TYPE=Release \ + -DPOCO_UNBUNDLED=OFF \ + -DENABLE_MONGODB=OFF \ + ../${_realname}-${_realname}-${pkgver}-release + + + #"${srcdir}"/${_realname}-${_realname}-${pkgver}-release/configure \ + # --prefix=${MINGW_PREFIX} \ + # --config=${_config} \ + # --shared # --unbundled + # --static make } @@ -87,5 +100,5 @@ check() { package() { cd "${srcdir}/build-${MINGW_CHOST}" - make DESTDIR="$pkgdir" install + make #DESTDIR="$pkgdir" install }