From aff26af2f4d740bd2cabbc0fa694b813615a6b0b Mon Sep 17 00:00:00 2001 From: sdcb Date: Wed, 16 Nov 2016 15:10:40 +0800 Subject: [PATCH 1/3] Add poco. --- ports/poco/CONTROL | 4 +++ ports/poco/config_h.patch | 13 ++++++++ ports/poco/portfile.cmake | 66 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 83 insertions(+) create mode 100644 ports/poco/CONTROL create mode 100644 ports/poco/config_h.patch create mode 100644 ports/poco/portfile.cmake diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL new file mode 100644 index 00000000000..ee43ac2d382 --- /dev/null +++ b/ports/poco/CONTROL @@ -0,0 +1,4 @@ +Source: poco +Version: 1.7.6 +Build-Depends: openssl, libmariadb +Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/config_h.patch b/ports/poco/config_h.patch new file mode 100644 index 00000000000..1387fd0c956 --- /dev/null +++ b/ports/poco/config_h.patch @@ -0,0 +1,13 @@ +diff --git a/Foundation/include/Poco/Config.h b/Foundation/include/Poco/Config.h +index 003b6dc..55b8eed 100644 +--- a/Foundation/include/Poco/Config.h ++++ b/Foundation/include/Poco/Config.h +@@ -31,7 +31,7 @@ + + + // Define to disable implicit linking +-// #define POCO_NO_AUTOMATIC_LIBS ++#define POCO_NO_AUTOMATIC_LIBS + + + // Define to disable automatic initialization diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake new file mode 100644 index 00000000000..e32126f6097 --- /dev/null +++ b/ports/poco/portfile.cmake @@ -0,0 +1,66 @@ +include(vcpkg_common_functions) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/poco-1.7.6-all) + +vcpkg_download_distfile(ARCHIVE + URLS "https://pocoproject.org/releases/poco-1.7.6/poco-1.7.6-all.zip" + FILENAME "poco-1.7.6-all.zip" + SHA512 ed15c6ab69157d3caf3f5fcd861396ddbe3a98c1f3d513c2670e81601c176fb17549791836bd50014d9fb58aa3983e262312848f197e9c487af962cc27556df5 +) +vcpkg_extract_source_archive(${ARCHIVE}) + +vcpkg_apply_patches( + SOURCE_PATH ${SOURCE_PATH} + PATCHES + ${CMAKE_CURRENT_LIST_DIR}/config_h.patch +) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + set(POCO_STATIC ON) + set(POCO_MT ON) +endif() + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + OPTIONS + -DPOCO_STATIC=${POCO_STATIC} + -DPOCO_MT=${POCO_MT} + + -DFORCE_OPENSSL=ON + -DENABLE_TESTS=OFF + -DENABLE_MSVC_MP=ON + -DPOCO_UNBUNDLED=OFF # OFF means: using internal copy of sqlite, libz, pcre, expat, ... +) + +vcpkg_install_cmake() + +file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/cpspc.exe ${CURRENT_PACKAGES_DIR}/tools/cpspc.exe) +file(RENAME ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.exe ${CURRENT_PACKAGES_DIR}/tools/f2cpsp.exe) + +if (VCPKG_LIBRARY_LINKAGE STREQUAL static) + file(REMOVE_RECURSE + ${CURRENT_PACKAGES_DIR}/bin + ${CURRENT_PACKAGES_DIR}/debug/bin) +endif() + +file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.pdb) + +file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll + ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) + +# copy license +file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/poco) +file(RENAME ${CURRENT_PACKAGES_DIR}/share/poco/LICENSE ${CURRENT_PACKAGES_DIR}/share/poco/copyright) \ No newline at end of file From 857f76b6b9f39c383c43b6b018882149d1d27b3a Mon Sep 17 00:00:00 2001 From: sdcb Date: Wed, 16 Nov 2016 17:40:45 +0800 Subject: [PATCH 2/3] [poco] Remove useless depends, Add 7zip, drop POCO_MT. --- ports/poco/CONTROL | 2 +- ports/poco/portfile.cmake | 42 ++++++++++++++++++--------------------- 2 files changed, 20 insertions(+), 24 deletions(-) diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index ee43ac2d382..71e55eb6c83 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,4 @@ Source: poco Version: 1.7.6 -Build-Depends: openssl, libmariadb +Build-Depends: Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index e32126f6097..cb5b7f1391f 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -1,10 +1,10 @@ include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/poco-1.7.6-all) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/poco-poco-1.7.6-release) vcpkg_download_distfile(ARCHIVE - URLS "https://pocoproject.org/releases/poco-1.7.6/poco-1.7.6-all.zip" - FILENAME "poco-1.7.6-all.zip" - SHA512 ed15c6ab69157d3caf3f5fcd861396ddbe3a98c1f3d513c2670e81601c176fb17549791836bd50014d9fb58aa3983e262312848f197e9c487af962cc27556df5 + URLS "https://github.com/pocoproject/poco/archive/poco-1.7.6-release.tar.gz" + FILENAME "poco-poco-1.7.6-release.tar.gz" + SHA512 a02b7ff66acf080942517b3b8644d6e5c7136c5edc6e58fd13083a74b97b5619253fc9db7863284a565226f95410ad4da1fa9738d14885f560aeb03c1f7c18aa ) vcpkg_extract_source_archive(${ARCHIVE}) @@ -16,18 +16,14 @@ vcpkg_apply_patches( if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(POCO_STATIC ON) - set(POCO_MT ON) endif() vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS -DPOCO_STATIC=${POCO_STATIC} - -DPOCO_MT=${POCO_MT} - - -DFORCE_OPENSSL=ON + -DENABLE_SEVENZIP=ON -DENABLE_TESTS=OFF - -DENABLE_MSVC_MP=ON -DPOCO_UNBUNDLED=OFF # OFF means: using internal copy of sqlite, libz, pcre, expat, ... ) @@ -41,22 +37,22 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin) +else() + file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.pdb + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.pdb) + + file(REMOVE + ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll + ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll + ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) endif() -file(REMOVE - ${CURRENT_PACKAGES_DIR}/bin/cpspc.pdb - ${CURRENT_PACKAGES_DIR}/bin/f2cpsp.pdb - ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/cpspc.pdb - ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.exe - ${CURRENT_PACKAGES_DIR}/debug/bin/f2cpsp.pdb) - -file(REMOVE - ${CURRENT_PACKAGES_DIR}/bin/vcruntime140.dll - ${CURRENT_PACKAGES_DIR}/bin/msvcp140.dll - ${CURRENT_PACKAGES_DIR}/debug/bin/vcruntime140.dll - ${CURRENT_PACKAGES_DIR}/debug/bin/msvcp140.dll) - file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/lib/cmake) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/lib/cmake) From 22108321c032c7417e98ba6afc0d72f91042a40a Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Thu, 17 Nov 2016 00:28:54 -0800 Subject: [PATCH 3/3] [pcre] [poco] Hardcode value of PCRE_STATIC into the pcre headers. Switch poco to use unbundled libs. --- ports/pcre/CONTROL | 2 +- ports/pcre/portfile.cmake | 10 ++++++++++ ports/poco/CONTROL | 4 ++-- ports/poco/portfile.cmake | 7 +------ 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/ports/pcre/CONTROL b/ports/pcre/CONTROL index eb6863b3856..cf6d6c2a5fe 100644 --- a/ports/pcre/CONTROL +++ b/ports/pcre/CONTROL @@ -1,4 +1,4 @@ Source: pcre -Version: 8.38 +Version: 8.38-1 Description: Perl Compatible Regular Expresions Build-Depends: zlib diff --git a/ports/pcre/portfile.cmake b/ports/pcre/portfile.cmake index 0dcc8a97c14..8fd6c881907 100644 --- a/ports/pcre/portfile.cmake +++ b/ports/pcre/portfile.cmake @@ -32,6 +32,16 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +foreach(FILE ${CURRENT_PACKAGES_DIR}/include/pcre.h ${CURRENT_PACKAGES_DIR}/include/pcreposix.h) + file(READ ${FILE} PCRE_H) + if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") + string(REPLACE "defined(PCRE_STATIC)" "1" PCRE_H "${PCRE_H}") + else() + string(REPLACE "defined(PCRE_STATIC)" "0" PCRE_H "${PCRE_H}") + endif() + file(WRITE ${FILE} "${PCRE_H}") +endforeach() + file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) diff --git a/ports/poco/CONTROL b/ports/poco/CONTROL index 71e55eb6c83..2265e1f0837 100644 --- a/ports/poco/CONTROL +++ b/ports/poco/CONTROL @@ -1,4 +1,4 @@ Source: poco -Version: 1.7.6 -Build-Depends: +Version: 1.7.6-1 +Build-Depends: zlib, pcre, sqlite3, expat Description: Modern, powerful open source C++ class libraries for building network and internet-based applications that run on desktop, server, mobile and embedded systems. \ No newline at end of file diff --git a/ports/poco/portfile.cmake b/ports/poco/portfile.cmake index cb5b7f1391f..d89323a2a2c 100644 --- a/ports/poco/portfile.cmake +++ b/ports/poco/portfile.cmake @@ -14,17 +14,12 @@ vcpkg_apply_patches( ${CMAKE_CURRENT_LIST_DIR}/config_h.patch ) -if (VCPKG_LIBRARY_LINKAGE STREQUAL static) - set(POCO_STATIC ON) -endif() - vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} OPTIONS - -DPOCO_STATIC=${POCO_STATIC} -DENABLE_SEVENZIP=ON -DENABLE_TESTS=OFF - -DPOCO_UNBUNDLED=OFF # OFF means: using internal copy of sqlite, libz, pcre, expat, ... + -DPOCO_UNBUNDLED=ON # OFF means: using internal copy of sqlite, libz, pcre, expat, ... ) vcpkg_install_cmake()