From 6171b912f9f33789be2439be85d2a142001e4ebb Mon Sep 17 00:00:00 2001 From: Falko Axmann Date: Tue, 3 Sep 2019 22:47:48 +0200 Subject: [PATCH] [anyrpc] Add new port (#7438) * Add port anyrpc * Add port anyrpc Added missing `vcpkg_install_cmake()` * Add port anyrpc Added patch to detect endianness on ARM. * Add port anyrpc further tweaks to endianness detection. --- ports/anyrpc/CONTROL | 4 ++++ ports/anyrpc/arm_endian_detection.patch | 16 ++++++++++++++ ports/anyrpc/portfile.cmake | 29 +++++++++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 ports/anyrpc/CONTROL create mode 100644 ports/anyrpc/arm_endian_detection.patch create mode 100644 ports/anyrpc/portfile.cmake diff --git a/ports/anyrpc/CONTROL b/ports/anyrpc/CONTROL new file mode 100644 index 000000000..a6ddb6890 --- /dev/null +++ b/ports/anyrpc/CONTROL @@ -0,0 +1,4 @@ +Source: anyrpc +Version: 2017-12-01 +Homepage: https://github.com/sgieseking/anyrpc +Description: A multiprotocol remote procedure call system for C++. diff --git a/ports/anyrpc/arm_endian_detection.patch b/ports/anyrpc/arm_endian_detection.patch new file mode 100644 index 000000000..5dfa340b0 --- /dev/null +++ b/ports/anyrpc/arm_endian_detection.patch @@ -0,0 +1,16 @@ +diff --git a/include/anyrpc/api.h b/include/anyrpc/api.h +index a67fa32..e7d74ad 100644 +--- a/include/anyrpc/api.h ++++ b/include/anyrpc/api.h +@@ -158,9 +158,9 @@ typedef int socklen_t; + # elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) + # define ANYRPC_ENDIAN ANYRPC_BIGENDIAN + // Detect with architecture macros +-# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) ++# elif defined(__sparc) || defined(__sparc__) || defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || defined(__hpux) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) || defined(__s390__) || defined(__ARMEB__) || defined(__THUMBEB__) || defined(__AARCH64EB__) + # define ANYRPC_ENDIAN ANYRPC_BIGENDIAN +-# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) ++# elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) || defined(_M_IX86) || defined(_M_IA64) || defined(_M_ALPHA) || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || defined(__bfin__) || defined(__ARMEL__) || defined(__THUMBEL__) || defined(__AARCH64EL__) || defined(_M_ARM64) || defined(_M_ARM) + # define ANYRPC_ENDIAN ANYRPC_LITTLEENDIAN + # elif defined(ANYRPC_DOXYGEN_RUNNING) + # define ANYRPC_ENDIAN diff --git a/ports/anyrpc/portfile.cmake b/ports/anyrpc/portfile.cmake new file mode 100644 index 000000000..34102a24d --- /dev/null +++ b/ports/anyrpc/portfile.cmake @@ -0,0 +1,29 @@ +include(vcpkg_common_functions) + +vcpkg_from_github( + OUT_SOURCE_PATH SOURCE_PATH + REPO sgieseking/anyrpc + REF bfd50aa6dd620066ed308258599127cd46be818b + SHA512 604e92a2a2936fb95e74e05dd1ac578e67e2877357443d83f8fac319ab244a27d1fac2ebd8bcd9ac8108e7a198752776974027b8f020643bb039b5f84406049b + HEAD_REF master + PATCHES "arm_endian_detection.patch" +) + +string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ANYRPC_LIB_BUILD_SHARED) + +vcpkg_configure_cmake( + SOURCE_PATH ${SOURCE_PATH} + PREFER_NINJA + OPTIONS + -DBUILD_EXAMPLES=OFF + -DBUILD_TESTS=OFF + -DBUILD_WITH_LOG4CPLUS=OFF + -DANYRPC_LIB_BUILD_SHARED=${ANYRPC_LIB_BUILD_SHARED} +) + +vcpkg_install_cmake() + +file(INSTALL ${SOURCE_PATH}/license DESTINATION ${CURRENT_PACKAGES_DIR}/share/anyrpc RENAME copyright) +file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) + +vcpkg_copy_pdbs()