aboutsummaryrefslogtreecommitdiff
path: root/ports/libproxy/support-windows.patch
diff options
context:
space:
mode:
authorJackBoosY <47264268+JackBoosY@users.noreply.github.com>2019-11-26 18:40:32 +0800
committerVictor Romero <romerosanchezv@gmail.com>2019-11-26 02:40:32 -0800
commit506299a173c565f64976be2a2d24a9efbc4f7117 (patch)
tree84846643a26e7d2af439289c6e8e4fa139e42e42 /ports/libproxy/support-windows.patch
parent61dc5580d6e57ad4ad025a7d47d0af3de7998007 (diff)
downloadvcpkg-506299a173c565f64976be2a2d24a9efbc4f7117.tar.gz
vcpkg-506299a173c565f64976be2a2d24a9efbc4f7117.zip
[libmodman, libproxy] Add new ports (#8931)
* [libproxy]Add new port. * [libmodman]Add new port. * [libproxy]Support windows, set dependency libmodman. * Add usage, add vcpkg-cmake-wrapper.cmake to libproxy. * add empty line to usage. * [libmodman]Fix undefined typeid in Visual Studio 2019. * [libproxy]Fix install libproxy.py error when it not exist. * Disable arm/uwp build. * Enable static build on UNIX. * [libproxy]Re-generate patches, delete default feature tools and use system libmodman. * [libproxy]Disable install libproxy.py. * [libproxy]Disable install Libproxy.pm and PLlibproxy. * [libproxy]DISABLE PARALLEL CONFIGURE * [libproxy]Revert 6f233cced1a51a086e5fea5bf290565d9847d4b7 * [libmodman/libproxy]Fix arm build.
Diffstat (limited to 'ports/libproxy/support-windows.patch')
-rw-r--r--ports/libproxy/support-windows.patch83
1 files changed, 83 insertions, 0 deletions
diff --git a/ports/libproxy/support-windows.patch b/ports/libproxy/support-windows.patch
new file mode 100644
index 000000000..fdbe801a0
--- /dev/null
+++ b/ports/libproxy/support-windows.patch
@@ -0,0 +1,83 @@
+diff --git a/cmake/paths.cmk b/cmake/paths.cmk
+index 593ebc1..bbf8754 100644
+--- a/cmake/paths.cmk
++++ b/cmake/paths.cmk
+@@ -1,4 +1,4 @@
+-if(WIN32 AND NOT MINGW)
++if(0)
+ set(CMAKE_INSTALL_PREFIX "" CACHE PATH "Install prefix")
+ set(BIN_INSTALL_DIR . CACHE PATH "Binary install dir")
+ set(LIB_INSTALL_DIR . CACHE PATH "Library install dir")
+diff --git a/libproxy/cmake/devfiles.cmk b/libproxy/cmake/devfiles.cmk
+index 0301dce..0eb5f83 100644
+--- a/libproxy/cmake/devfiles.cmk
++++ b/libproxy/cmake/devfiles.cmk
+@@ -1,4 +1,4 @@
+-if(NOT WIN32 OR MINGW)
++if(1)
+ # PkgConfig file
+ set (PKGCONFIG_PREFIX ${CMAKE_INSTALL_PREFIX})
+
+diff --git a/libproxy/cmake/libproxy.cmk b/libproxy/cmake/libproxy.cmk
+index aab7593..465685f 100644
+--- a/libproxy/cmake/libproxy.cmk
++++ b/libproxy/cmake/libproxy.cmk
+@@ -21,5 +21,5 @@ set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/proxy.cpp
+ set_target_properties(libproxy PROPERTIES PREFIX "" VERSION 1.0.0 SOVERSION 1)
+ set_target_properties(libproxy PROPERTIES INTERFACE_LINK_LIBRARIES "")
+ set_target_properties(libproxy PROPERTIES LINK_INTERFACE_LIBRARIES "")
+-install(TARGETS libproxy DESTINATION ${LIB_INSTALL_DIR})
++install(TARGETS libproxy RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
+ install(FILES proxy.h DESTINATION ${INCLUDE_INSTALL_DIR})
+diff --git a/libproxy/modules/config_kde.cpp b/libproxy/modules/config_kde.cpp
+index b9bd241..73b978e 100644
+--- a/libproxy/modules/config_kde.cpp
++++ b/libproxy/modules/config_kde.cpp
+@@ -19,7 +19,9 @@
+ ******************************************************************************/
+
+ #include <sys/stat.h>
++#if !defined(WIN32)
+ #include <unistd.h>
++#endif
+
+ #include <algorithm>
+ #include <cstdlib>
+@@ -137,7 +139,11 @@ private:
+ string command_output(const string &cmdline) throw (runtime_error) {
+ // Capture stderr as well
+ const string command = "(" + cmdline + ")2>&1";
++#if !defined(WIN32)
+ FILE *pipe = popen(command.c_str(), "r");
++#else
++ FILE *pipe = _popen(command.c_str(), "r");
++#endif
+ if (!pipe)
+ throw runtime_error("Unable to run command");
+
+@@ -148,7 +154,11 @@ private:
+ result += buffer; // TODO: If this throws bad_alloc, pipe is leaked
+ }
+
++#if !defined(WIN32)
+ if(pclose(pipe) != 0)
++#else
++ if(_pclose(pipe) != 0)
++#endif
+ throw runtime_error("Command failed");
+
+ // Trim newlines and whitespace at end
+diff --git a/libproxy/url.cpp b/libproxy/url.cpp
+index b61a9bc..021763e 100644
+--- a/libproxy/url.cpp
++++ b/libproxy/url.cpp
+@@ -33,7 +33,9 @@
+ #include <cstdlib> // For atoi()
+ #include <sys/stat.h> // For stat()
+ #include <algorithm> // For transform()
++#if !defined(WIN32)
+ #include <unistd.h> // For read() close()
++#endif
+
+ #ifdef WIN32
+ #include <io.h>