From e9267ac7c40d990c8368861189031bcd5eb77189 Mon Sep 17 00:00:00 2001 From: Yuval Gross <52262536+yuvalg-MSFT@users.noreply.github.com> Date: Tue, 3 Dec 2019 11:18:49 -0800 Subject: [proxywrapper] Add new port (#8916) * adding proxywrapper package * resolving review comments * restrict Linux only * [proxywrapper] Only static library * [libmodman] Move building of tests to a non-default feature * [libproxy] Move tests to a non-default feature * [libproxy] Add features for language bindings * [proxywrapper] Require C++ 11 standard --- ports/proxywrapper/CONTROL | 5 +++++ ports/proxywrapper/fix-find-libproxy.patch | 20 ++++++++++++++++++++ ports/proxywrapper/fix-macos-build.patch | 15 +++++++++++++++ ports/proxywrapper/portfile.cmake | 23 +++++++++++++++++++++++ 4 files changed, 63 insertions(+) create mode 100644 ports/proxywrapper/CONTROL create mode 100644 ports/proxywrapper/fix-find-libproxy.patch create mode 100644 ports/proxywrapper/fix-macos-build.patch create mode 100644 ports/proxywrapper/portfile.cmake (limited to 'ports/proxywrapper') diff --git a/ports/proxywrapper/CONTROL b/ports/proxywrapper/CONTROL new file mode 100644 index 000000000..c982b2c5b --- /dev/null +++ b/ports/proxywrapper/CONTROL @@ -0,0 +1,5 @@ +Source: proxywrapper +Version: 1.0.0 +Description: Provides a standalone wrapper around the libproxy library. +Homepage: https://github.com/microsoft/proxy-wrapper +Build-Depends: libproxy diff --git a/ports/proxywrapper/fix-find-libproxy.patch b/ports/proxywrapper/fix-find-libproxy.patch new file mode 100644 index 000000000..aeb45b98d --- /dev/null +++ b/ports/proxywrapper/fix-find-libproxy.patch @@ -0,0 +1,20 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5a867a4..3ba85fa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -5,11 +5,12 @@ project(proxywrapper) + + include(GNUInstallDirs) + +-find_library(proxy REQUIRED) ++find_package(libproxy REQUIRED) + +-add_library(proxywrapper SHARED ProxyWrapper.cpp) ++add_library(proxywrapper ProxyWrapper.cpp) + +-target_link_libraries(proxywrapper proxy) ++target_link_libraries(proxywrapper PRIVATE ${LIBPROXY_LIBRARIES}) ++target_include_directories(proxywrapper PRIVATE ${LIBPROXY_INCLUDE_DIR}) + + install(TARGETS proxywrapper EXPORT proxywrapper DESTINATION ${CMAKE_INSTALL_LIBDIR}) + diff --git a/ports/proxywrapper/fix-macos-build.patch b/ports/proxywrapper/fix-macos-build.patch new file mode 100644 index 000000000..8bdaeac56 --- /dev/null +++ b/ports/proxywrapper/fix-macos-build.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 3ba85fa..f18fd1e 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -1,7 +1,9 @@ + + cmake_minimum_required(VERSION 3.8) + +-project(proxywrapper) ++project(proxywrapper C CXX) ++ ++set(CMAKE_CXX_STANDARD 11) + + include(GNUInstallDirs) + diff --git a/ports/proxywrapper/portfile.cmake b/ports/proxywrapper/portfile.cmake new file mode 100644 index 000000000..048a9f995 --- /dev/null +++ b/ports/proxywrapper/portfile.cmake @@ -0,0 +1,23 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO microsoft/proxy-wrapper + REF b113aa0a284508ce0c2878febf9073d1f03b59dc + SHA512 9793ec8b9cc0467c88d850ea51a96a0fdc3c3027cc5b7fd9f5d0362d7fd559e909f19a4eaca6554a9316d6e3a86bb5f541034ca9ce2fb8797fb2e5bdff42b0de + HEAD_REF master + PATCHES + fix-find-libproxy.patch + fix-macos-build.patch +) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA +) + +vcpkg_install_cmake() + +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) +file(INSTALL ${SOURCE_PATH}/license.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) + -- cgit v1.2.3