aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodor Prokopov <koprok@users.noreply.github.com>2019-01-27 02:28:29 +0200
committerCodiferous <44823842+Codiferous@users.noreply.github.com>2019-01-26 16:28:29 -0800
commitebb2d1a44fa74f4928bfb1e229e343bd4a721472 (patch)
treedb6f9f4e44f353d3a8a8ad6bd4d10ef54eea6047
parentbbb8efe794ca72f9102c976343b3dcca87056e96 (diff)
downloadvcpkg-ebb2d1a44fa74f4928bfb1e229e343bd4a721472.tar.gz
vcpkg-ebb2d1a44fa74f4928bfb1e229e343bd4a721472.zip
[amqpcpp] Add new port (#5201)
* [amqpcpp] Add new port * Force static linkage for amqpcpp The documentation for this library says that shared linkage on Windows is unsupported. Furthermore, the build currently errors out on Windows because shared DLLs are not placed correctly. vcpkg only supports static linkage on Linux and macOS, so I'm categorically making amqpcpp build with static linkage on all platforms. This unifies the platforms and gives consistent behavior
-rw-r--r--ports/amqpcpp/CONTROL4
-rw-r--r--ports/amqpcpp/find-openssl.patch16
-rw-r--r--ports/amqpcpp/portfile.cmake34
3 files changed, 54 insertions, 0 deletions
diff --git a/ports/amqpcpp/CONTROL b/ports/amqpcpp/CONTROL
new file mode 100644
index 000000000..3cf199118
--- /dev/null
+++ b/ports/amqpcpp/CONTROL
@@ -0,0 +1,4 @@
+Source: amqpcpp
+Version: 4.1.2
+Description: AMQP-CPP is a C++ library for communicating with a RabbitMQ message broker
+Build-Depends: openssl (linux)
diff --git a/ports/amqpcpp/find-openssl.patch b/ports/amqpcpp/find-openssl.patch
new file mode 100644
index 000000000..ad841edd3
--- /dev/null
+++ b/ports/amqpcpp/find-openssl.patch
@@ -0,0 +1,16 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 645bb32..3ef5c4b 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -89,6 +89,11 @@ else()
+ add_library(${PROJECT_NAME} STATIC ${src_MAIN} ${src_LINUX_TCP})
+ endif()
+
++if(AMQP-CPP_LINUX_TCP)
++ find_path(OPENSSL_INCLUDE_DIR openssl/ssl.h)
++ include_directories(${OPENSSL_INCLUDE_DIR})
++endif()
++
+ # install rules
+ # ------------------------------------------------------------------------------------------------------
+
diff --git a/ports/amqpcpp/portfile.cmake b/ports/amqpcpp/portfile.cmake
new file mode 100644
index 000000000..64b02f686
--- /dev/null
+++ b/ports/amqpcpp/portfile.cmake
@@ -0,0 +1,34 @@
+include(vcpkg_common_functions)
+
+vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
+
+vcpkg_from_github(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO CopernicaMarketingSoftware/AMQP-CPP
+ REF v4.1.2
+ SHA512 e2015d3958d434532591f9a304c625bdebb9bb075af1e2b684c9b8b061df8a2fd6a407200c802ad7b88ee954bcdad854f44a43512f76adf225addf145fc0fb44
+ HEAD_REF master
+ PATCHES
+ find-openssl.patch
+)
+
+if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux")
+ set(LINUX_TCP ON)
+else()
+ set(LINUX_TCP OFF)
+endif()
+
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS
+ -DAMQP-CPP_BUILD_SHARED=OFF
+ -DAMQP-CPP_LINUX_TCP=${LINUX_TCP}
+)
+
+vcpkg_install_cmake()
+vcpkg_fixup_cmake_targets(CONFIG_PATH cmake)
+
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/amqpcpp RENAME copyright)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
+file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share)