aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Offel <mio@mflour.com>2017-06-20 01:59:25 +0200
committerMichael Offel <mio@mflour.com>2017-06-20 01:59:25 +0200
commit5ff2ec20327d1e8177a28db9df7876047293b5d1 (patch)
tree18a498763423063fe9f63713e80c3929ef2d515b
parent8d955c83b53d42983ebd9a046a0a0a5ade08537f (diff)
downloadvcpkg-5ff2ec20327d1e8177a28db9df7876047293b5d1.tar.gz
vcpkg-5ff2ec20327d1e8177a28db9df7876047293b5d1.zip
add c++ requests 1.3.0 port
-rw-r--r--ports/cpr/CONTROL4
-rw-r--r--ports/cpr/force_static_library.patch13
-rw-r--r--ports/cpr/portfile.cmake45
3 files changed, 62 insertions, 0 deletions
diff --git a/ports/cpr/CONTROL b/ports/cpr/CONTROL
new file mode 100644
index 000000000..417850b75
--- /dev/null
+++ b/ports/cpr/CONTROL
@@ -0,0 +1,4 @@
+Source: cpr
+Version: 1.3.0
+Description: C++ Requests is a simple wrapper around libcurl inspired by the excellent Python Requests project.
+Build-Depends: curl
diff --git a/ports/cpr/force_static_library.patch b/ports/cpr/force_static_library.patch
new file mode 100644
index 000000000..4571f21ac
--- /dev/null
+++ b/ports/cpr/force_static_library.patch
@@ -0,0 +1,13 @@
+diff --git a/cpr/CMakeLists.txt b/cpr/CMakeLists.txt
+index a6db5bd..9df92a6 100644
+--- a/cpr/CMakeLists.txt
++++ b/cpr/CMakeLists.txt
+@@ -3,7 +3,7 @@ include_directories(
+ ${CPR_INCLUDE_DIRS}
+ ${CURL_INCLUDE_DIRS})
+
+-add_library(${CPR_LIBRARIES}
++add_library(${CPR_LIBRARIES} STATIC
+
+ # Source files
+ auth.cpp
diff --git a/ports/cpr/portfile.cmake b/ports/cpr/portfile.cmake
new file mode 100644
index 000000000..ddcbc4cb7
--- /dev/null
+++ b/ports/cpr/portfile.cmake
@@ -0,0 +1,45 @@
+# Common Ambient Variables:
+# CURRENT_BUILDTREES_DIR = ${VCPKG_ROOT_DIR}\buildtrees\${PORT}
+# CURRENT_PACKAGES_DIR = ${VCPKG_ROOT_DIR}\packages\${PORT}_${TARGET_TRIPLET}
+# CURRENT_PORT_DIR = ${VCPKG_ROOT_DIR}\ports\${PORT}
+# PORT = current port name (zlib, etc)
+# TARGET_TRIPLET = current triplet (x86-windows, x64-windows-static, etc)
+# VCPKG_CRT_LINKAGE = C runtime linkage type (static, dynamic)
+# VCPKG_LIBRARY_LINKAGE = target library linkage type (static, dynamic)
+# VCPKG_ROOT_DIR = <C:\path\to\current\vcpkg>
+# VCPKG_TARGET_ARCHITECTURE = target architecture (x64, x86, arm)
+#
+
+include(vcpkg_common_functions)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO whoshuu/cpr
+ REF 1.3.0
+ SHA512 fd08f8a592a5e1fb8dc93158a4850b81575983c08527fb415f65bd9284f93c804c8680d16c548744583cd26b9353a7d4838269cfc59ccb6003da8941f620c273
+)
+
+vcpkg_apply_patches(
+ SOURCE_PATH ${SOURCE_PATH}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/force_static_library.patch
+)
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA # Disable this option if project cannot be built with Ninja
+ OPTIONS
+ -DBUILD_CPR_TESTS=OFF
+ -DUSE_SYSTEM_CURL=ON
+)
+
+vcpkg_build_cmake()
+
+file(INSTALL ${SOURCE_PATH}/include DESTINATION ${CURRENT_PACKAGES_DIR})
+file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/lib/cpr.lib DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
+file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-rel/cpr/CMakeFiles/cpr.dir/cpr.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/lib)
+file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/lib/cpr.lib DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
+file(INSTALL ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-dbg/cpr/CMakeFiles/cpr.dir/cpr.pdb DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib)
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/cpr)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/cpr/LICENSE ${CURRENT_PACKAGES_DIR}/share/cpr/copyright)