diff options
| author | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
|---|---|---|
| committer | Ethan Morgan <ethan@gweithio.com> | 2026-02-14 16:44:06 +0000 |
| commit | 54409423f767d8b1cf30cb7d0efca6b4ca138823 (patch) | |
| tree | d915ac7828703ce4b963efdd9728a1777ba18c1e /vcpkg/ports/amqpcpp | |
Diffstat (limited to 'vcpkg/ports/amqpcpp')
| -rw-r--r-- | vcpkg/ports/amqpcpp/fix-max_min_macros.patch | 31 | ||||
| -rw-r--r-- | vcpkg/ports/amqpcpp/portfile.cmake | 34 | ||||
| -rw-r--r-- | vcpkg/ports/amqpcpp/vcpkg.json | 18 |
3 files changed, 83 insertions, 0 deletions
diff --git a/vcpkg/ports/amqpcpp/fix-max_min_macros.patch b/vcpkg/ports/amqpcpp/fix-max_min_macros.patch new file mode 100644 index 0000000..4d1e2ae --- /dev/null +++ b/vcpkg/ports/amqpcpp/fix-max_min_macros.patch @@ -0,0 +1,31 @@ +diff --git a/include/amqpcpp/message.h b/include/amqpcpp/message.h
+index 0a35838..96b43e1 100644
+--- a/include/amqpcpp/message.h
++++ b/include/amqpcpp/message.h
+@@ -80,7 +80,7 @@ protected:
+ // safety-check: on 32-bit platforms size_t is obviously also a 32-bit dword
+ // in which case casting the uint64_t to a size_t could result in truncation
+ // here we check whether the given size fits inside a size_t
+- if (std::numeric_limits<size_t>::max() < size) throw std::runtime_error("message is too big for this system");
++ if ((std::numeric_limits<size_t>::max)() < size) throw std::runtime_error("message is too big for this system");
+
+ // store the new size
+ _bodySize = size;
+@@ -98,7 +98,7 @@ protected:
+ if (_mutableBody)
+ {
+ // prevent overflow
+- size = std::min(size, _bodySize - _filled);
++ size = (std::min)(size, _bodySize - _filled);
+
+ // append more data
+ memcpy(_mutableBody + _filled, buffer, (size_t)size);
+@@ -121,7 +121,7 @@ protected:
+ _body = _mutableBody;
+
+ // store the initial data
+- _filled = std::min((size_t)size, (size_t)_bodySize);
++ _filled = (std::min)((size_t)size, (size_t)_bodySize);
+ memcpy(_mutableBody, buffer, _filled);
+ }
+
diff --git a/vcpkg/ports/amqpcpp/portfile.cmake b/vcpkg/ports/amqpcpp/portfile.cmake new file mode 100644 index 0000000..a46546a --- /dev/null +++ b/vcpkg/ports/amqpcpp/portfile.cmake @@ -0,0 +1,34 @@ +vcpkg_check_linkage(ONLY_STATIC_LIBRARY) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO CopernicaMarketingSoftware/AMQP-CPP + REF "v${VERSION}" + SHA512 310e0d1bc1780d54bd1f9a99d114003aee7bdfe8930be198b3006f2ca174c32718844f88d72fd75259d6ce20d35a9dc77a61aea4c364e4af17ba8c87cae43259 + HEAD_REF master + PATCHES + fix-max_min_macros.patch +) + +if(VCPKG_TARGET_IS_LINUX) + set(LINUX_TCP ON) +else() + set(LINUX_TCP OFF) +endif() + +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + -DAMQP-CPP_BUILD_SHARED=OFF + -DAMQP-CPP_LINUX_TCP=${LINUX_TCP} +) + +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH cmake) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") + +vcpkg_fixup_pkgconfig() + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/vcpkg/ports/amqpcpp/vcpkg.json b/vcpkg/ports/amqpcpp/vcpkg.json new file mode 100644 index 0000000..d5ae71d --- /dev/null +++ b/vcpkg/ports/amqpcpp/vcpkg.json @@ -0,0 +1,18 @@ +{ + "name": "amqpcpp", + "version": "4.3.27", + "description": "AMQP-CPP is a C++ library for communicating with a RabbitMQ message broker", + "homepage": "https://github.com/CopernicaMarketingSoftware/AMQP-CPP", + "license": "Apache-2.0", + "dependencies": [ + "openssl", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] +} |