From 108afe53965be6a7a7555a9676f14993da95238d Mon Sep 17 00:00:00 2001
From: JackBoosY <47264268+JackBoosY@users.noreply.github.com>
Date: Wed, 27 Feb 2019 03:18:26 +0800
Subject: [PATCH] [gsoap]Add new port (#5295)
* [gsoap]Add new port
* Change to use existing binary files to generate binary files.
* fix patch.
---
ports/gsoap/CONTROL | 4 +
ports/gsoap/fix-build-in-windows.patch | 307 +++++++++++++++++++++++++
ports/gsoap/portfile.cmake | 61 +++++
3 files changed, 372 insertions(+)
create mode 100644 ports/gsoap/CONTROL
create mode 100644 ports/gsoap/fix-build-in-windows.patch
create mode 100644 ports/gsoap/portfile.cmake
diff --git a/ports/gsoap/CONTROL b/ports/gsoap/CONTROL
new file mode 100644
index 000000000..2da6f0409
--- /dev/null
+++ b/ports/gsoap/CONTROL
@@ -0,0 +1,4 @@
+Source: gsoap
+Version: 2.8.78-1
+Build-Depends: curl
+Description: The gSOAP toolkit is a C and C++ software development toolkit for SOAP and REST XML Web services and generic C/C++ XML data bindings.
\ No newline at end of file
diff --git a/ports/gsoap/fix-build-in-windows.patch b/ports/gsoap/fix-build-in-windows.patch
new file mode 100644
index 000000000..e661fb7c7
--- /dev/null
+++ b/ports/gsoap/fix-build-in-windows.patch
@@ -0,0 +1,307 @@
+ gsoap/VisualStudio2005/soapcpp2/soapcpp2.sln | 8 +-
+ .../soapcpp2/soapcpp2/soapcpp2.vcxproj | 114 +++++++++++++++++
+ gsoap/VisualStudio2005/wsdl2h/wsdl2h.sln | 8 +-
+ .../VisualStudio2005/wsdl2h/wsdl2h/wsdl2h.vcxproj | 139 +++++++++++++++++++++
+ 4 files changed, 263 insertions(+), 6 deletions(-)
+
+diff --git a/gsoap/VisualStudio2005/soapcpp2/soapcpp2.sln b/gsoap/VisualStudio2005/soapcpp2/soapcpp2.sln
+index 68bacf1..5d74e6b 100644
+--- a/gsoap/VisualStudio2005/soapcpp2/soapcpp2.sln
++++ b/gsoap/VisualStudio2005/soapcpp2/soapcpp2.sln
+@@ -1,7 +1,9 @@
+
+-Microsoft Visual Studio Solution File, Format Version 9.00
+-# Visual C++ Express 2005
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "soapcpp2", "soapcpp2\soapcpp2.vcproj", "{BDD1B293-CE39-4BEC-8E63-8B1621F3EB56}"
++Microsoft Visual Studio Solution File, Format Version 12.00
++# Visual Studio 14
++VisualStudioVersion = 14.0.25420.1
++MinimumVisualStudioVersion = 10.0.40219.1
++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "soapcpp2", "soapcpp2\soapcpp2.vcxproj", "{BDD1B293-CE39-4BEC-8E63-8B1621F3EB56}"
+ EndProject
+ Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+diff --git a/gsoap/VisualStudio2005/soapcpp2/soapcpp2/soapcpp2.vcxproj b/gsoap/VisualStudio2005/soapcpp2/soapcpp2/soapcpp2.vcxproj
+new file mode 100644
+index 0000000..17f1d75
+--- /dev/null
++++ b/gsoap/VisualStudio2005/soapcpp2/soapcpp2/soapcpp2.vcxproj
+@@ -0,0 +1,114 @@
++
++
++
++
++ Debug
++ Win32
++
++
++ Release
++ Win32
++
++
++
++ {BDD1B293-CE39-4BEC-8E63-8B1621F3EB56}
++ soapcpp2
++ Win32Proj
++ 8.1
++
++
++
++ Application
++ v140
++ Unicode
++ true
++
++
++ Application
++ v140
++ Unicode
++
++
++
++
++
++
++
++
++
++
++
++
++ <_ProjectFileVersion>14.0.25431.1
++
++
++ $(SolutionDir)$(Configuration)\
++ $(Configuration)\
++ true
++
++
++ $(SolutionDir)$(Configuration)\
++ $(Configuration)\
++ false
++
++
++
++ Disabled
++ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
++ true
++ EnableFastChecks
++ MultiThreadedDebugDLL
++
++ Level3
++ EditAndContinue
++
++
++ kernel32.lib
++ true
++ Console
++ MachineX86
++
++
++
++
++ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
++ MultiThreaded
++
++ Level3
++ ProgramDatabase
++
++
++ kernel32.lib
++ true
++ Console
++ true
++ true
++ MachineX86
++
++
++
++
++
++
++
++ $(IntDir)%(Filename)1.obj
++ $(IntDir)%(Filename)1.xdc
++ $(IntDir)%(Filename)1.obj
++ $(IntDir)%(Filename)1.xdc
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
+\ No newline at end of file
+diff --git a/gsoap/VisualStudio2005/wsdl2h/wsdl2h.sln b/gsoap/VisualStudio2005/wsdl2h/wsdl2h.sln
+index ffa3fa4..3f23607 100644
+--- a/gsoap/VisualStudio2005/wsdl2h/wsdl2h.sln
++++ b/gsoap/VisualStudio2005/wsdl2h/wsdl2h.sln
+@@ -1,7 +1,9 @@
+
+-Microsoft Visual Studio Solution File, Format Version 9.00
+-# Visual C++ Express 2005
+-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wsdl2h", "wsdl2h\wsdl2h.vcproj", "{6CBC554A-4FFB-461F-91D4-11B358802815}"
++Microsoft Visual Studio Solution File, Format Version 12.00
++# Visual Studio 14
++VisualStudioVersion = 14.0.25420.1
++MinimumVisualStudioVersion = 10.0.40219.1
++Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "wsdl2h", "wsdl2h\wsdl2h.vcxproj", "{6CBC554A-4FFB-461F-91D4-11B358802815}"
+ EndProject
+ Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+diff --git a/gsoap/VisualStudio2005/wsdl2h/wsdl2h/wsdl2h.vcxproj b/gsoap/VisualStudio2005/wsdl2h/wsdl2h/wsdl2h.vcxproj
+new file mode 100644
+index 0000000..abf3ea6
+--- /dev/null
++++ b/gsoap/VisualStudio2005/wsdl2h/wsdl2h/wsdl2h.vcxproj
+@@ -0,0 +1,139 @@
++
++
++
++
++ Debug
++ Win32
++
++
++ Release
++ Win32
++
++
++
++ {6CBC554A-4FFB-461F-91D4-11B358802815}
++ wsdl2h
++ Win32Proj
++ 8.1
++
++
++
++ Application
++ v140
++ Unicode
++ true
++
++
++ Application
++ v140
++ Unicode
++
++
++
++
++
++
++
++
++
++
++
++
++ <_ProjectFileVersion>14.0.25431.1
++
++
++ $(SolutionDir)$(Configuration)\
++ $(Configuration)\
++ true
++
++
++ $(SolutionDir)$(Configuration)\
++ $(Configuration)\
++ false
++
++
++
++ Disabled
++ WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)
++ true
++ EnableFastChecks
++ MultiThreadedDebugDLL
++
++ Level3
++ EditAndContinue
++
++
++ kernel32.lib
++ true
++ Console
++ MachineX86
++
++
++
++
++ WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)
++ MultiThreaded
++
++ Level3
++ ProgramDatabase
++
++
++ kernel32.lib
++ true
++ Console
++ true
++ true
++ MachineX86
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++
++ Parsing WSDL and Schema definitions
++ soapcpp2.exe -SC -pwsdl %(Filename)%(Extension)
++
++ wsdlStub.h wsdlH.h wsdlC.cpp;%(Outputs)
++ Parsing WSDL and Schema definitions
++ soapcpp2.exe -SC -pwsdl %(Filename)%(Extension)
++
++ wsdlStub.h wsdlH.h wsdlC.cpp;%(Outputs)
++
++
++
++
++
++
++
++
++
++
++
++
+\ No newline at end of file
diff --git a/ports/gsoap/portfile.cmake b/ports/gsoap/portfile.cmake
new file mode 100644
index 000000000..8162d6780
--- /dev/null
+++ b/ports/gsoap/portfile.cmake
@@ -0,0 +1,61 @@
+include(vcpkg_common_functions)
+set(GSOAP_VERSION 2.8)
+set(GSOAP_SUB_VERSION .78)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/gsoap-${GSOAP_VERSION})
+
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://ayera.dl.sourceforge.net/project/gsoap2/gsoap-${GSOAP_VERSION}/gsoap_${GSOAP_VERSION}${GSOAP_SUB_VERSION}.zip"
+ FILENAME "gsoap_${GSOAP_VERSION}${GSOAP_SUB_VERSION}.zip"
+ SHA512 c115044d2662c2dd355c4756a974a0013b7213dd28c536aba179e53c19466279bfa34ce16b4426db5aa7a24d94c18e0ed7e7cdf05e799bf89f7b54031aa0874e
+)
+
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ PATCHES
+ "${CMAKE_CURRENT_LIST_DIR}/fix-build-in-windows.patch"
+)
+
+if (VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
+ set(BUILD_ARCH "Win32")
+else()
+ message("gsoap only supported Win32")
+ set(BUILD_ARCH "Win32")
+endif()
+
+# Handle binary files and includes
+file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/tools/gsoap ${CURRENT_PACKAGES_DIR}/debug/tools)
+
+if (WIN32)
+ vcpkg_build_msbuild(
+ USE_VCPKG_INTEGRATION
+ PROJECT_PATH ${SOURCE_PATH}/gsoap/VisualStudio2005/soapcpp2/soapcpp2.sln
+ PLATFORM ${BUILD_ARCH}
+ TARGET Build
+ )
+ vcpkg_build_msbuild(
+ USE_VCPKG_INTEGRATION
+ PROJECT_PATH ${SOURCE_PATH}/gsoap/VisualStudio2005/wsdl2h/wsdl2h.sln
+ PLATFORM ${BUILD_ARCH}
+ TARGET Build
+ )
+
+ file(COPY ${SOURCE_PATH}/gsoap/VisualStudio2005/soapcpp2/release/soapcpp2.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/gsoap/)
+ file(COPY ${SOURCE_PATH}/gsoap/VisualStudio2005/wsdl2h/release/wsdl2h.exe DESTINATION ${CURRENT_PACKAGES_DIR}/tools/gsoap/)
+ file(COPY ${SOURCE_PATH}/gsoap/VisualStudio2005/soapcpp2/debug/soapcpp2.exe DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/gsoap/)
+ file(COPY ${SOURCE_PATH}/gsoap/VisualStudio2005/wsdl2h/debug/wsdl2h.exe DESTINATION ${CURRENT_PACKAGES_DIR}/debug/tools/gsoap/)
+else()
+ message(FATAL_ERROR "Sorry but gsoap only can be build in Windows temporary")
+endif()
+
+
+file(MAKE_DIRECTORY ${CURRENT_PACKAGES_DIR}/include)
+file(COPY ${SOURCE_PATH}/gsoap/stdsoap2.h ${SOURCE_PATH}/gsoap/stdsoap2.c ${SOURCE_PATH}/gsoap/stdsoap2.cpp DESTINATION ${CURRENT_PACKAGES_DIR}/include)
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/LICENSE.txt ${SOURCE_PATH}/INSTALL.txt ${SOURCE_PATH}/README.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/gsoap)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/copyright)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/INSTALL.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/install)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/gsoap/README.txt ${CURRENT_PACKAGES_DIR}/share/gsoap/readme)
+
+vcpkg_copy_pdbs()
\ No newline at end of file