diff --git a/ports/abseil/0001-revert-integer-to-string-conversion-optimizations.patch b/ports/abseil/0001-revert-integer-to-string-conversion-optimizations.patch new file mode 100644 index 00000000000000..e8d324f827b36f --- /dev/null +++ b/ports/abseil/0001-revert-integer-to-string-conversion-optimizations.patch @@ -0,0 +1,1313 @@ +From fe447768b741e6f4a1cb529f93174e6dc6f86bec Mon Sep 17 00:00:00 2001 +From: Abseil Team <absl-team@google.com> +Date: Tue, 26 Mar 2024 11:41:28 -0700 +Subject: [PATCH] Revert integer-to-string conversion optimizations pending + more thorough analysis + +PiperOrigin-RevId: 619261152 +Change-Id: Id3409b326c52ace0fda42537e0b91dbb2d6a2287 +--- + absl/base/macros.h | 48 ++++ + absl/strings/numbers.cc | 440 +++++++++-------------------------- + absl/strings/numbers.h | 163 +------------ + absl/strings/numbers_test.cc | 7 - + absl/strings/str_cat.cc | 146 +----------- + absl/strings/str_cat.h | 150 ++++++------ + absl/strings/str_cat_test.cc | 46 ---- + 7 files changed, 245 insertions(+), 755 deletions(-) + +diff --git a/absl/base/macros.h b/absl/base/macros.h +index f33cd192..b318f116 100644 +--- a/absl/base/macros.h ++++ b/absl/base/macros.h +@@ -138,4 +138,52 @@ ABSL_NAMESPACE_END + #define ABSL_INTERNAL_RETHROW do {} while (false) + #endif // ABSL_HAVE_EXCEPTIONS + ++// ABSL_DEPRECATE_AND_INLINE() ++// ++// Marks a function or type alias as deprecated and tags it to be picked up for ++// automated refactoring by go/cpp-inliner. It can added to inline function ++// definitions or type aliases. It should only be used within a header file. It ++// differs from `ABSL_DEPRECATED` in the following ways: ++// ++// 1. New uses of the function or type will be discouraged via Tricorder ++// warnings. ++// 2. If enabled via `METADATA`, automated changes will be sent out inlining the ++// functions's body or replacing the type where it is used. ++// ++// For example: ++// ++// ABSL_DEPRECATE_AND_INLINE() inline int OldFunc(int x) { ++// return NewFunc(x, 0); ++// } ++// ++// will mark `OldFunc` as deprecated, and the go/cpp-inliner service will ++// replace calls to `OldFunc(x)` with calls to `NewFunc(x, 0)`. Once all calls ++// to `OldFunc` have been replaced, `OldFunc` can be deleted. ++// ++// See go/cpp-inliner for more information. ++// ++// Note: go/cpp-inliner is Google-internal service for automated refactoring. ++// While open-source users do not have access to this service, the macro is ++// provided for compatibility, and so that users receive deprecation warnings. ++#if ABSL_HAVE_CPP_ATTRIBUTE(deprecated) && \ ++ ABSL_HAVE_CPP_ATTRIBUTE(clang::annotate) ++#define ABSL_DEPRECATE_AND_INLINE() [[deprecated, clang::annotate("inline-me")]] ++#elif ABSL_HAVE_CPP_ATTRIBUTE(deprecated) ++#define ABSL_DEPRECATE_AND_INLINE() [[deprecated]] ++#else ++#define ABSL_DEPRECATE_AND_INLINE() ++#endif ++ ++// Requires the compiler to prove that the size of the given object is at least ++// the expected amount. ++#if ABSL_HAVE_ATTRIBUTE(diagnose_if) && ABSL_HAVE_BUILTIN(__builtin_object_size) ++#define ABSL_INTERNAL_NEED_MIN_SIZE(Obj, N) \ ++ __attribute__((diagnose_if(__builtin_object_size(Obj, 0) < N, \ ++ "object size provably too small " \ ++ "(this would corrupt memory)", \ ++ "error"))) ++#else ++#define ABSL_INTERNAL_NEED_MIN_SIZE(Obj, N) ++#endif ++ + #endif // ABSL_BASE_MACROS_H_ +diff --git a/absl/strings/numbers.cc b/absl/strings/numbers.cc +index 882c3a8b..b57d9e82 100644 +--- a/absl/strings/numbers.cc ++++ b/absl/strings/numbers.cc +@@ -20,9 +20,7 @@ + #include <algorithm> + #include <cassert> + #include <cfloat> // for DBL_DIG and FLT_DIG +-#include <climits> + #include <cmath> // for HUGE_VAL +-#include <cstddef> + #include <cstdint> + #include <cstdio> + #include <cstdlib> +@@ -30,7 +28,6 @@ + #include <iterator> + #include <limits> + #include <system_error> // NOLINT(build/c++11) +-#include <type_traits> + #include <utility> + + #include "absl/base/attributes.h" +@@ -159,71 +156,28 @@ constexpr uint32_t kTwoZeroBytes = 0x0101 * '0'; + constexpr uint64_t kFourZeroBytes = 0x01010101 * '0'; + constexpr uint64_t kEightZeroBytes = 0x0101010101010101ull * '0'; + +-template <typename T> +-constexpr T Pow(T base, uint32_t n) { +- // Exponentiation by squaring +- return static_cast<T>((n > 1 ? Pow(base * base, n >> 1) : static_cast<T>(1)) * +- ((n & 1) ? base : static_cast<T>(1))); +-} +- +-// Given n, calculates C where the following holds for all 0 <= x < Pow(100, n): +-// x / Pow(10, n) == x * C / Pow(2, n * 10) +-// In other words, it allows us to divide by a power of 10 via a single +-// multiplication and bit shifts, assuming the input will be smaller than the +-// square of that power of 10. +-template <typename T> +-constexpr T ComputePowerOf100DivisionCoefficient(uint32_t n) { +- if (n > 4) { +- // This doesn't work for large powers of 100, due to overflow +- abort(); +- } +- T denom = 16 - 1; +- T num = (denom + 1) - 10; +- T gcd = 3; // Greatest common divisor of numerator and denominator +- denom = Pow(denom / gcd, n); +- num = Pow(num / gcd, 9 * n); +- T quotient = num / denom; +- if (num % denom >= denom / 2) { +- // Round up, since the remainder is more than half the denominator +- ++quotient; +- } +- return quotient; +-} +- +-// * kDivisionBy10Mul / kDivisionBy10Div is a division by 10 for values from 0 +-// to 99. It's also a division of a structure [k takes 2 bytes][m takes 2 +-// bytes], then * kDivisionBy10Mul / kDivisionBy10Div will be [k / 10][m / 10]. +-// It allows parallel division. +-constexpr uint64_t kDivisionBy10Mul = +- ComputePowerOf100DivisionCoefficient<uint64_t>(1); +-static_assert(kDivisionBy10Mul == 103, +- "division coefficient for 10 is incorrect"); ++// * 103 / 1024 is a division by 10 for values from 0 to 99. It's also a ++// division of a structure [k takes 2 bytes][m takes 2 bytes], then * 103 / 1024 ++// will be [k / 10][m / 10]. It allows parallel division. ++constexpr uint64_t kDivisionBy10Mul = 103u; + constexpr uint64_t kDivisionBy10Div = 1 << 10; + +-// * kDivisionBy100Mul / kDivisionBy100Div is a division by 100 for values from +-// 0 to 9999. +-constexpr uint64_t kDivisionBy100Mul = +- ComputePowerOf100DivisionCoefficient<uint64_t>(2); +-static_assert(kDivisionBy100Mul == 10486, +- "division coefficient for 100 is incorrect"); ++// * 10486 / 1048576 is a division by 100 for values from 0 to 9999. ++constexpr uint64_t kDivisionBy100Mul = 10486u; + constexpr uint64_t kDivisionBy100Div = 1 << 20; + +-static_assert(ComputePowerOf100DivisionCoefficient<uint64_t>(3) == 1073742, +- "division coefficient for 1000 is incorrect"); +- +-// Same as `PrepareEightDigits`, but produces 2 digits for integers < 100. +-inline uint32_t PrepareTwoDigitsImpl(uint32_t i, bool reversed) { +- assert(i < 100); +- uint32_t div10 = (i * kDivisionBy10Mul) / kDivisionBy10Div; +- uint32_t mod10 = i - 10u * div10; +- return (div10 << (reversed ? 8 : 0)) + (mod10 << (reversed ? 0 : 8)); +-} +-inline uint32_t PrepareTwoDigits(uint32_t i) { +- return PrepareTwoDigitsImpl(i, false); ++// Encode functions write the ASCII output of input `n` to `out_str`. ++inline char* EncodeHundred(uint32_t n, absl::Nonnull<char*> out_str) { ++ int num_digits = static_cast<int>(n - 10) >> 8; ++ uint32_t div10 = (n * kDivisionBy10Mul) / kDivisionBy10Div; ++ uint32_t mod10 = n - 10u * div10; ++ uint32_t base = kTwoZeroBytes + div10 + (mod10 << 8); ++ base >>= num_digits & 8; ++ little_endian::Store16(out_str, static_cast<uint16_t>(base)); ++ return out_str + 2 + num_digits; + } + +-// Same as `PrepareEightDigits`, but produces 4 digits for integers < 10000. +-inline uint32_t PrepareFourDigitsImpl(uint32_t n, bool reversed) { ++inline char* EncodeTenThousand(uint32_t n, absl::Nonnull<char*> out_str) { + // We split lower 2 digits and upper 2 digits of n into 2 byte consecutive + // blocks. 123 -> [\0\1][\0\23]. We divide by 10 both blocks + // (it's 1 division + zeroing upper bits), and compute modulo 10 as well "in +@@ -231,19 +185,22 @@ inline uint32_t PrepareFourDigitsImpl(uint32_t n, bool reversed) { + // strip trailing zeros, add ASCII '0000' and return. + uint32_t div100 = (n * kDivisionBy100Mul) / kDivisionBy100Div; + uint32_t mod100 = n - 100ull * div100; +- uint32_t hundreds = +- (mod100 << (reversed ? 0 : 16)) + (div100 << (reversed ? 16 : 0)); ++ uint32_t hundreds = (mod100 << 16) + div100; + uint32_t tens = (hundreds * kDivisionBy10Mul) / kDivisionBy10Div; + tens &= (0xFull << 16) | 0xFull; +- tens = (tens << (reversed ? 8 : 0)) + +- static_cast<uint32_t>((hundreds - 10ull * tens) << (reversed ? 0 : 8)); +- return tens; +-} +-inline uint32_t PrepareFourDigits(uint32_t n) { +- return PrepareFourDigitsImpl(n, false); +-} +-inline uint32_t PrepareFourDigitsReversed(uint32_t n) { +- return PrepareFourDigitsImpl(n, true); ++ tens += (hundreds - 10ull * tens) << 8; ++ ABSL_ASSUME(tens != 0); ++ // The result can contain trailing zero bits, we need to strip them to a first ++ // significant byte in a final representation. For example, for n = 123, we ++ // have tens to have representation \0\1\2\3. We do `& -8` to round ++ // to a multiple to 8 to strip zero bytes, not all zero bits. ++ // countr_zero to help. ++ // 0 minus 8 to make MSVC happy. ++ uint32_t zeroes = static_cast<uint32_t>(absl::countr_zero(tens)) & (0 - 8u); ++ tens += kFourZeroBytes; ++ tens >>= zeroes; ++ little_endian::Store32(out_str, tens); ++ return out_str + sizeof(tens) - zeroes / 8; + } + + // Helper function to produce an ASCII representation of `i`. +@@ -259,309 +216,126 @@ inline uint32_t PrepareFourDigitsReversed(uint32_t n) { + // // Note two leading zeros: + // EXPECT_EQ(absl::string_view(ascii, 8), "00102030"); + // +-// If `Reversed` is set to true, the result becomes reversed to "03020100". +-// + // Pre-condition: `i` must be less than 100000000. +-inline uint64_t PrepareEightDigitsImpl(uint32_t i, bool reversed) { ++inline uint64_t PrepareEightDigits(uint32_t i) { + ABSL_ASSUME(i < 10000'0000); + // Prepare 2 blocks of 4 digits "in parallel". + uint32_t hi = i / 10000; + uint32_t lo = i % 10000; +- uint64_t merged = (uint64_t{hi} << (reversed ? 32 : 0)) | +- (uint64_t{lo} << (reversed ? 0 : 32)); ++ uint64_t merged = hi | (uint64_t{lo} << 32); + uint64_t div100 = ((merged * kDivisionBy100Mul) / kDivisionBy100Div) & + ((0x7Full << 32) | 0x7Full); + uint64_t mod100 = merged - 100ull * div100; +- uint64_t hundreds = +- (mod100 << (reversed ? 0 : 16)) + (div100 << (reversed ? 16 : 0)); ++ uint64_t hundreds = (mod100 << 16) + div100; + uint64_t tens = (hundreds * kDivisionBy10Mul) / kDivisionBy10Div; + tens &= (0xFull << 48) | (0xFull << 32) | (0xFull << 16) | 0xFull; +- tens = (tens << (reversed ? 8 : 0)) + +- ((hundreds - 10ull * tens) << (reversed ? 0 : 8)); ++ tens += (hundreds - 10ull * tens) << 8; + return tens; + } +-inline uint64_t PrepareEightDigits(uint32_t i) { +- return PrepareEightDigitsImpl(i, false); +-} +-inline uint64_t PrepareEightDigitsReversed(uint32_t i) { +- return PrepareEightDigitsImpl(i, true); +-} + +-template <typename T, typename BackwardIt> +-class FastUIntToStringConverter { +- static_assert( +- std::is_same<T, decltype(+std::declval<T>())>::value, +- "to avoid code bloat, only instantiate this for int and larger types"); +- static_assert(std::is_unsigned<T>::value, +- "this class is only for unsigned types"); +- +- public: +- // Outputs the given number backward (like with std::copy_backward), +- // starting from the end of the string. +- // The number of digits in the number must have been already measured and +- // passed *exactly*, otherwise the behavior is undefined. +- // (This is an optimization, as calculating the number of digits again would +- // slow down the hot path.) +- // Returns an iterator to the start of the suffix that was appended. +- static BackwardIt FastIntToBufferBackward(T v, BackwardIt end) { +- // THIS IS A HOT FUNCTION with a very deliberate structure to exploit branch +- // prediction and shorten the critical path for smaller numbers. +- // Do not move around the if/else blocks or attempt to simplify it +- // without benchmarking any changes. +- +- if (v < 10) { +- goto AT_LEAST_1 /* NOTE: mandatory for the 0 case */; +- } +- if (v < 1000) { +- goto AT_LEAST_10; +- } +- if (v < 10000000) { +- goto AT_LEAST_1000; +- } +- +- if (v >= 100000000 / 10) { +- if (v >= 10000000000000000 / 10) { +- DoFastIntToBufferBackward<8>(v, end); +- } +- DoFastIntToBufferBackward<8>(v, end); +- } +- +- if (v >= 10000 / 10) { +- AT_LEAST_1000: +- DoFastIntToBufferBackward<4>(v, end); +- } +- +- if (v >= 100 / 10) { +- AT_LEAST_10: +- DoFastIntToBufferBackward<2>(v, end); +- } +- +- if (v >= 10 / 10) { +- AT_LEAST_1: +- end = DoFastIntToBufferBackward(v, end, std::integral_constant<int, 1>()); +- } +- return end; ++inline ABSL_ATTRIBUTE_ALWAYS_INLINE absl::Nonnull<char*> EncodeFullU32( ++ uint32_t n, absl::Nonnull<char*> out_str) { ++ if (n < 10) { ++ *out_str = static_cast<char>('0' + n); ++ return out_str + 1; + } +- +- private: +- // Only assume pointers are contiguous for now. String and vector iterators +- // could be special-cased as well, but there's no need for them here. +- // With C++20 we can probably switch to std::contiguous_iterator_tag. +- static constexpr bool kIsContiguousIterator = +- std::is_pointer<BackwardIt>::value; +- +- template <int Exponent> +- static void DoFastIntToBufferBackward(T& v, BackwardIt& end) { +- constexpr T kModulus = Pow<T>(10, Exponent); +- T remainder = static_cast<T>(v % kModulus); +- v = static_cast<T>(v / kModulus); +- end = DoFastIntToBufferBackward(remainder, end, +- std::integral_constant<int, Exponent>()); +- } +- +- static BackwardIt DoFastIntToBufferBackward(const T&, BackwardIt end, +- std::integral_constant<int, 0>) { +- return end; +- } +- +- static BackwardIt DoFastIntToBufferBackward(T v, BackwardIt end, +- std::integral_constant<int, 1>) { +- *--end = static_cast<char>('0' + v); +- return DoFastIntToBufferBackward(v, end, std::integral_constant<int, 0>()); +- } +- +- static BackwardIt DoFastIntToBufferBackward(T v, BackwardIt end, +- std::integral_constant<int, 4>) { +- if (kIsContiguousIterator) { +- const uint32_t digits = +- PrepareFourDigits(static_cast<uint32_t>(v)) + kFourZeroBytes; +- end -= sizeof(digits); +- little_endian::Store32(&*end, digits); +- } else { +- uint32_t digits = +- PrepareFourDigitsReversed(static_cast<uint32_t>(v)) + kFourZeroBytes; +- for (size_t i = 0; i < sizeof(digits); ++i) { +- *--end = static_cast<char>(digits); +- digits >>= CHAR_BIT; +- } +- } +- return end; ++ if (n < 100'000'000) { ++ uint64_t bottom = PrepareEightDigits(n); ++ ABSL_ASSUME(bottom != 0); ++ // 0 minus 8 to make MSVC happy. ++ uint32_t zeroes = ++ static_cast<uint32_t>(absl::countr_zero(bottom)) & (0 - 8u); ++ little_endian::Store64(out_str, (bottom + kEightZeroBytes) >> zeroes); ++ return out_str + sizeof(bottom) - zeroes / 8; + } +- +- static BackwardIt DoFastIntToBufferBackward(T v, BackwardIt end, +- std::integral_constant<int, 8>) { +- if (kIsContiguousIterator) { +- const uint64_t digits = +- PrepareEightDigits(static_cast<uint32_t>(v)) + kEightZeroBytes; +- end -= sizeof(digits); +- little_endian::Store64(&*end, digits); +- } else { +- uint64_t digits = PrepareEightDigitsReversed(static_cast<uint32_t>(v)) + +- kEightZeroBytes; +- for (size_t i = 0; i < sizeof(digits); ++i) { +- *--end = static_cast<char>(digits); +- digits >>= CHAR_BIT; +- } +- } +- return end; +- } +- +- template <int Digits> +- static BackwardIt DoFastIntToBufferBackward( +- T v, BackwardIt end, std::integral_constant<int, Digits>) { +- constexpr int kLogModulus = Digits - Digits / 2; +- constexpr T kModulus = Pow(static_cast<T>(10), kLogModulus); +- bool is_safe_to_use_division_trick = Digits <= 8; +- T quotient, remainder; +- if (is_safe_to_use_division_trick) { +- constexpr uint64_t kCoefficient = +- ComputePowerOf100DivisionCoefficient<uint64_t>(kLogModulus); +- quotient = (v * kCoefficient) >> (10 * kLogModulus); +- remainder = v - quotient * kModulus; +- } else { +- quotient = v / kModulus; +- remainder = v % kModulus; +- } +- end = DoFastIntToBufferBackward(remainder, end, +- std::integral_constant<int, kLogModulus>()); +- return DoFastIntToBufferBackward( +- quotient, end, std::integral_constant<int, Digits - kLogModulus>()); +- } +-}; +- +-// Returns an iterator to the start of the suffix that was appended +-template <typename T, typename BackwardIt> +-std::enable_if_t<std::is_unsigned<T>::value, BackwardIt> +-DoFastIntToBufferBackward(T v, BackwardIt end, uint32_t digits) { +- using PromotedT = std::decay_t<decltype(+v)>; +- using Converter = FastUIntToStringConverter<PromotedT, BackwardIt>; +- (void)digits; +- return Converter().FastIntToBufferBackward(v, end); ++ uint32_t div08 = n / 100'000'000; ++ uint32_t mod08 = n % 100'000'000; ++ uint64_t bottom = PrepareEightDigits(mod08) + kEightZeroBytes; ++ out_str = EncodeHundred(div08, out_str); ++ little_endian::Store64(out_str, bottom); ++ return out_str + sizeof(bottom); + } + +-template <typename T, typename BackwardIt> +-std::enable_if_t<std::is_signed<T>::value, BackwardIt> +-DoFastIntToBufferBackward(T v, BackwardIt end, uint32_t digits) { +- if (absl::numbers_internal::IsNegative(v)) { +- // Store the minus sign *before* we produce the number itself, not after. +- // This gets us a tail call. +- end[-static_cast<ptrdiff_t>(digits) - 1] = '-'; ++inline ABSL_ATTRIBUTE_ALWAYS_INLINE char* EncodeFullU64(uint64_t i, ++ char* buffer) { ++ if (i <= std::numeric_limits<uint32_t>::max()) { ++ return EncodeFullU32(static_cast<uint32_t>(i), buffer); + } +- return DoFastIntToBufferBackward( +- absl::numbers_internal::UnsignedAbsoluteValue(v), end, digits); +-} +- +-template <class T> +-std::enable_if_t<std::is_integral<T>::value, int> +-GetNumDigitsOrNegativeIfNegativeImpl(T v) { +- const auto /* either bool or std::false_type */ is_negative = +- absl::numbers_internal::IsNegative(v); +- const int digits = static_cast<int>(absl::numbers_internal::Base10Digits( +- absl::numbers_internal::UnsignedAbsoluteValue(v))); +- return is_negative ? ~digits : digits; ++ uint32_t mod08; ++ if (i < 1'0000'0000'0000'0000ull) { ++ uint32_t div08 = static_cast<uint32_t>(i / 100'000'000ull); ++ mod08 = static_cast<uint32_t>(i % 100'000'000ull); ++ buffer = EncodeFullU32(div08, buffer); ++ } else { ++ uint64_t div08 = i / 100'000'000ull; ++ mod08 = static_cast<uint32_t>(i % 100'000'000ull); ++ uint32_t div016 = static_cast<uint32_t>(div08 / 100'000'000ull); ++ uint32_t div08mod08 = static_cast<uint32_t>(div08 % 100'000'000ull); ++ uint64_t mid_result = PrepareEightDigits(div08mod08) + kEightZeroBytes; ++ buffer = EncodeTenThousand(div016, buffer); ++ little_endian::Store64(buffer, mid_result); ++ buffer += sizeof(mid_result); ++ } ++ uint64_t mod_result = PrepareEightDigits(mod08) + kEightZeroBytes; ++ little_endian::Store64(buffer, mod_result); ++ return buffer + sizeof(mod_result); + } + + } // namespace + + void numbers_internal::PutTwoDigits(uint32_t i, absl::Nonnull<char*> buf) { +- little_endian::Store16( +- buf, static_cast<uint16_t>(PrepareTwoDigits(i) + kTwoZeroBytes)); ++ assert(i < 100); ++ uint32_t base = kTwoZeroBytes; ++ uint32_t div10 = (i * kDivisionBy10Mul) / kDivisionBy10Div; ++ uint32_t mod10 = i - 10u * div10; ++ base += div10 + (mod10 << 8); ++ little_endian::Store16(buf, static_cast<uint16_t>(base)); + } + + absl::Nonnull<char*> numbers_internal::FastIntToBuffer( +- uint32_t i, absl::Nonnull<char*> buffer) { +- const uint32_t digits = absl::numbers_internal::Base10Digits(i); +- buffer += digits; +- *buffer = '\0'; // We're going backward, so store this first +- FastIntToBufferBackward(i, buffer, digits); +- return buffer; ++ uint32_t n, absl::Nonnull<char*> out_str) { ++ out_str = EncodeFullU32(n, out_str); ++ *out_str = '\0'; ++ return out_str; + } + + absl::Nonnull<char*> numbers_internal::FastIntToBuffer( + int32_t i, absl::Nonnull<char*> buffer) { +- buffer += static_cast<int>(i < 0); +- uint32_t digits = absl::numbers_internal::Base10Digits( +- absl::numbers_internal::UnsignedAbsoluteValue(i)); +- buffer += digits; +- *buffer = '\0'; // We're going backward, so store this first +- FastIntToBufferBackward(i, buffer, digits); ++ uint32_t u = static_cast<uint32_t>(i); ++ if (i < 0) { ++ *buffer++ = '-'; ++ // We need to do the negation in modular (i.e., "unsigned") ++ // arithmetic; MSVC++ apparently warns for plain "-u", so ++ // we write the equivalent expression "0 - u" instead. ++ u = 0 - u; ++ } ++ buffer = EncodeFullU32(u, buffer); ++ *buffer = '\0'; + return buffer; + } + + absl::Nonnull<char*> numbers_internal::FastIntToBuffer( + uint64_t i, absl::Nonnull<char*> buffer) { +- uint32_t digits = absl::numbers_internal::Base10Digits(i); +- buffer += digits; +- *buffer = '\0'; // We're going backward, so store this first +- FastIntToBufferBackward(i, buffer, digits); ++ buffer = EncodeFullU64(i, buffer); ++ *buffer = '\0'; + return buffer; + } + + absl::Nonnull<char*> numbers_internal::FastIntToBuffer( + int64_t i, absl::Nonnull<char*> buffer) { +- buffer += static_cast<int>(i < 0); +- uint32_t digits = absl::numbers_internal::Base10Digits( +- absl::numbers_internal::UnsignedAbsoluteValue(i)); +- buffer += digits; +- *buffer = '\0'; // We're going backward, so store this first +- FastIntToBufferBackward(i, buffer, digits); ++ uint64_t u = static_cast<uint64_t>(i); ++ if (i < 0) { ++ *buffer++ = '-'; ++ // We need to do the negation in modular (i.e., "unsigned") ++ // arithmetic; MSVC++ apparently warns for plain "-u", so ++ // we write the equivalent expression "0 - u" instead. ++ u = 0 - u; ++ } ++ buffer = EncodeFullU64(u, buffer); ++ *buffer = '\0'; + return buffer; + } + +-absl::Nonnull<char*> numbers_internal::FastIntToBufferBackward( +- uint32_t i, absl::Nonnull<char*> buffer_end, uint32_t exact_digit_count) { +- return DoFastIntToBufferBackward(i, buffer_end, exact_digit_count); +-} +- +-absl::Nonnull<char*> numbers_internal::FastIntToBufferBackward( +- int32_t i, absl::Nonnull<char*> buffer_end, uint32_t exact_digit_count) { +- return DoFastIntToBufferBackward(i, buffer_end, exact_digit_count); +-} +- +-absl::Nonnull<char*> numbers_internal::FastIntToBufferBackward( +- uint64_t i, absl::Nonnull<char*> buffer_end, uint32_t exact_digit_count) { +- return DoFastIntToBufferBackward(i, buffer_end, exact_digit_count); +-} +- +-absl::Nonnull<char*> numbers_internal::FastIntToBufferBackward( +- int64_t i, absl::Nonnull<char*> buffer_end, uint32_t exact_digit_count) { +- return DoFastIntToBufferBackward(i, buffer_end, exact_digit_count); +-} +- +-int numbers_internal::GetNumDigitsOrNegativeIfNegative(signed char v) { +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +-int numbers_internal::GetNumDigitsOrNegativeIfNegative(unsigned char v) { +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +-int numbers_internal::GetNumDigitsOrNegativeIfNegative(short v) { // NOLINT +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +-int numbers_internal::GetNumDigitsOrNegativeIfNegative( +- unsigned short v) { // NOLINT +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +-int numbers_internal::GetNumDigitsOrNegativeIfNegative(int v) { +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +-int numbers_internal::GetNumDigitsOrNegativeIfNegative(unsigned int v) { +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +-int numbers_internal::GetNumDigitsOrNegativeIfNegative(long v) { // NOLINT +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +-int numbers_internal::GetNumDigitsOrNegativeIfNegative( +- unsigned long v) { // NOLINT +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +-int numbers_internal::GetNumDigitsOrNegativeIfNegative(long long v) { // NOLINT +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +-int numbers_internal::GetNumDigitsOrNegativeIfNegative( +- unsigned long long v) { // NOLINT +- return GetNumDigitsOrNegativeIfNegativeImpl(v); +-} +- + // Given a 128-bit number expressed as a pair of uint64_t, high half first, + // return that number multiplied by the given 32-bit value. If the result is + // too large to fit in a 128-bit number, divide it by 2 until it fits. +diff --git a/absl/strings/numbers.h b/absl/strings/numbers.h +index ad4e66b6..739dbb28 100644 +--- a/absl/strings/numbers.h ++++ b/absl/strings/numbers.h +@@ -32,7 +32,6 @@ + #endif + + #include <cstddef> +-#include <cstdint> + #include <cstdlib> + #include <cstring> + #include <ctime> +@@ -40,12 +39,10 @@ + #include <string> + #include <type_traits> + +-#include "absl/base/attributes.h" + #include "absl/base/config.h" + #include "absl/base/internal/endian.h" + #include "absl/base/macros.h" + #include "absl/base/nullability.h" +-#include "absl/base/optimization.h" + #include "absl/base/port.h" + #include "absl/numeric/bits.h" + #include "absl/numeric/int128.h" +@@ -161,96 +158,6 @@ bool safe_strtou128_base(absl::string_view text, + static const int kFastToBufferSize = 32; + static const int kSixDigitsToBufferSize = 16; + +-template <class T> +-std::enable_if_t<!std::is_unsigned<T>::value, bool> IsNegative(const T& v) { +- return v < T(); +-} +- +-template <class T> +-std::enable_if_t<std::is_unsigned<T>::value, std::false_type> IsNegative( +- const T&) { +- // The integer is unsigned, so return a compile-time constant. +- // This can help the optimizer avoid having to prove bool to be false later. +- return std::false_type(); +-} +- +-template <class T> +-std::enable_if_t<std::is_unsigned<std::decay_t<T>>::value, T&&> +-UnsignedAbsoluteValue(T&& v ABSL_ATTRIBUTE_LIFETIME_BOUND) { +- // The value is unsigned; just return the original. +- return std::forward<T>(v); +-} +- +-template <class T> +-ABSL_ATTRIBUTE_CONST_FUNCTION +- std::enable_if_t<!std::is_unsigned<T>::value, std::make_unsigned_t<T>> +- UnsignedAbsoluteValue(T v) { +- using U = std::make_unsigned_t<T>; +- return IsNegative(v) ? U() - static_cast<U>(v) : static_cast<U>(v); +-} +- +-// Returns the number of base-10 digits in the given number. +-// Note that this strictly counts digits. It does not count the sign. +-// The `initial_digits` parameter is the starting point, which is normally equal +-// to 1 because the number of digits in 0 is 1 (a special case). +-// However, callers may e.g. wish to change it to 2 to account for the sign. +-template <typename T> +-std::enable_if_t<std::is_unsigned<T>::value, uint32_t> Base10Digits( +- T v, const uint32_t initial_digits = 1) { +- uint32_t r = initial_digits; +- // If code size becomes an issue, the 'if' stage can be removed for a minor +- // performance loss. +- for (;;) { +- if (ABSL_PREDICT_TRUE(v < 10 * 10)) { +- r += (v >= 10); +- break; +- } +- if (ABSL_PREDICT_TRUE(v < 1000 * 10)) { +- r += (v >= 1000) + 2; +- break; +- } +- if (ABSL_PREDICT_TRUE(v < 100000 * 10)) { +- r += (v >= 100000) + 4; +- break; +- } +- r += 6; +- v = static_cast<T>(v / 1000000); +- } +- return r; +-} +- +-template <typename T> +-std::enable_if_t<std::is_signed<T>::value, uint32_t> Base10Digits( +- T v, uint32_t r = 1) { +- // Branchlessly add 1 to account for a minus sign. +- r += static_cast<uint32_t>(IsNegative(v)); +- return Base10Digits(UnsignedAbsoluteValue(v), r); +-} +- +-// These functions return the number of base-10 digits, but multiplied by -1 if +-// the input itself is negative. This is handy and efficient for later usage, +-// since the bitwise complement of the result becomes equal to the number of +-// characters required. +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( +- signed char v); +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( +- unsigned char v); +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( +- short v); // NOLINT +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( +- unsigned short v); // NOLINT +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative(int v); +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( +- unsigned int v); +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( +- long v); // NOLINT +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( +- unsigned long v); // NOLINT +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( +- long long v); // NOLINT +-ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( +- unsigned long long v); // NOLINT +- + // Helper function for fast formatting of floating-point values. + // The result is the same as printf's "%g", a.k.a. "%.6g"; that is, six + // significant digits are returned, trailing zeros are removed, and numbers +@@ -259,18 +166,24 @@ ABSL_ATTRIBUTE_CONST_FUNCTION int GetNumDigitsOrNegativeIfNegative( + // Required buffer size is `kSixDigitsToBufferSize`. + size_t SixDigitsToBuffer(double d, absl::Nonnull<char*> buffer); + +-// All of these functions take an output buffer ++// WARNING: These functions may write more characters than necessary, because ++// they are intended for speed. All functions take an output buffer + // as an argument and return a pointer to the last byte they wrote, which is the + // terminating '\0'. At most `kFastToBufferSize` bytes are written. +-absl::Nonnull<char*> FastIntToBuffer(int32_t i, absl::Nonnull<char*> buffer); +-absl::Nonnull<char*> FastIntToBuffer(uint32_t i, absl::Nonnull<char*> buffer); +-absl::Nonnull<char*> FastIntToBuffer(int64_t i, absl::Nonnull<char*> buffer); +-absl::Nonnull<char*> FastIntToBuffer(uint64_t i, absl::Nonnull<char*> buffer); ++absl::Nonnull<char*> FastIntToBuffer(int32_t i, absl::Nonnull<char*> buffer) ++ ABSL_INTERNAL_NEED_MIN_SIZE(buffer, kFastToBufferSize); ++absl::Nonnull<char*> FastIntToBuffer(uint32_t n, absl::Nonnull<char*> out_str) ++ ABSL_INTERNAL_NEED_MIN_SIZE(out_str, kFastToBufferSize); ++absl::Nonnull<char*> FastIntToBuffer(int64_t i, absl::Nonnull<char*> buffer) ++ ABSL_INTERNAL_NEED_MIN_SIZE(buffer, kFastToBufferSize); ++absl::Nonnull<char*> FastIntToBuffer(uint64_t i, absl::Nonnull<char*> buffer) ++ ABSL_INTERNAL_NEED_MIN_SIZE(buffer, kFastToBufferSize); + + // For enums and integer types that are not an exact match for the types above, + // use templates to call the appropriate one of the four overloads above. + template <typename int_type> +-absl::Nonnull<char*> FastIntToBuffer(int_type i, absl::Nonnull<char*> buffer) { ++absl::Nonnull<char*> FastIntToBuffer(int_type i, absl::Nonnull<char*> buffer) ++ ABSL_INTERNAL_NEED_MIN_SIZE(buffer, kFastToBufferSize) { + static_assert(sizeof(i) <= 64 / 8, + "FastIntToBuffer works only with 64-bit-or-less integers."); + // TODO(jorg): This signed-ness check is used because it works correctly +@@ -294,58 +207,6 @@ absl::Nonnull<char*> FastIntToBuffer(int_type i, absl::Nonnull<char*> buffer) { + } + } + +-// These functions do NOT add any null-terminator. +-// They return a pointer to the beginning of the written string. +-// The digit counts provided must *exactly* match the number of base-10 digits +-// in the number, or the behavior is undefined. +-// (i.e. do NOT count the minus sign, or over- or under-count the digits.) +-absl::Nonnull<char*> FastIntToBufferBackward(int32_t i, +- absl::Nonnull<char*> buffer_end, +- uint32_t exact_digit_count); +-absl::Nonnull<char*> FastIntToBufferBackward(uint32_t i, +- absl::Nonnull<char*> buffer_end, +- uint32_t exact_digit_count); +-absl::Nonnull<char*> FastIntToBufferBackward(int64_t i, +- absl::Nonnull<char*> buffer_end, +- uint32_t exact_digit_count); +-absl::Nonnull<char*> FastIntToBufferBackward(uint64_t i, +- absl::Nonnull<char*> buffer_end, +- uint32_t exact_digit_count); +- +-// For enums and integer types that are not an exact match for the types above, +-// use templates to call the appropriate one of the four overloads above. +-template <typename int_type> +-absl::Nonnull<char*> FastIntToBufferBackward(int_type i, +- absl::Nonnull<char*> buffer_end, +- uint32_t exact_digit_count) { +- static_assert( +- sizeof(i) <= 64 / 8, +- "FastIntToBufferBackward works only with 64-bit-or-less integers."); +- // This signed-ness check is used because it works correctly +- // with enums, and it also serves to check that int_type is not a pointer. +- // If one day something like std::is_signed<enum E> works, switch to it. +- // These conditions are constexpr bools to suppress MSVC warning C4127. +- constexpr bool kIsSigned = static_cast<int_type>(1) - 2 < 0; +- constexpr bool kUse64Bit = sizeof(i) > 32 / 8; +- if (kIsSigned) { +- if (kUse64Bit) { +- return FastIntToBufferBackward(static_cast<int64_t>(i), buffer_end, +- exact_digit_count); +- } else { +- return FastIntToBufferBackward(static_cast<int32_t>(i), buffer_end, +- exact_digit_count); +- } +- } else { +- if (kUse64Bit) { +- return FastIntToBufferBackward(static_cast<uint64_t>(i), buffer_end, +- exact_digit_count); +- } else { +- return FastIntToBufferBackward(static_cast<uint32_t>(i), buffer_end, +- exact_digit_count); +- } +- } +-} +- + // Implementation of SimpleAtoi, generalized to support arbitrary base (used + // with base different from 10 elsewhere in Abseil implementation). + template <typename int_type> +diff --git a/absl/strings/numbers_test.cc b/absl/strings/numbers_test.cc +index 1ceff70f..75c2dcf2 100644 +--- a/absl/strings/numbers_test.cc ++++ b/absl/strings/numbers_test.cc +@@ -231,15 +231,10 @@ TEST(Numbers, TestFastPrints) { + CheckInt32(INT_MIN); + CheckInt32(INT_MAX); + CheckInt64(LONG_MIN); +- CheckInt64(uint64_t{10000000}); +- CheckInt64(uint64_t{100000000}); + CheckInt64(uint64_t{1000000000}); + CheckInt64(uint64_t{9999999999}); + CheckInt64(uint64_t{100000000000000}); + CheckInt64(uint64_t{999999999999999}); +- CheckInt64(uint64_t{1000000000000000}); +- CheckInt64(uint64_t{10000000000000000}); +- CheckInt64(uint64_t{100000000000000000}); + CheckInt64(uint64_t{1000000000000000000}); + CheckInt64(uint64_t{1199999999999999999}); + CheckInt64(int64_t{-700000000000000000}); +@@ -251,8 +246,6 @@ TEST(Numbers, TestFastPrints) { + CheckUInt64(uint64_t{999999999999999}); + CheckUInt64(uint64_t{1000000000000000000}); + CheckUInt64(uint64_t{1199999999999999999}); +- CheckUInt64(uint64_t{10000000000000000000u}); +- CheckUInt64(uint64_t{10200300040000500006u}); + CheckUInt64(std::numeric_limits<uint64_t>::max()); + + for (int i = 0; i < 10000; i++) { +diff --git a/absl/strings/str_cat.cc b/absl/strings/str_cat.cc +index 098ab183..e7f7052a 100644 +--- a/absl/strings/str_cat.cc ++++ b/absl/strings/str_cat.cc +@@ -21,12 +21,10 @@ + #include <cstring> + #include <initializer_list> + #include <string> +-#include <type_traits> + + #include "absl/base/config.h" + #include "absl/base/nullability.h" + #include "absl/strings/internal/resize_uninitialized.h" +-#include "absl/strings/numbers.h" + #include "absl/strings/string_view.h" + + namespace absl { +@@ -43,7 +41,8 @@ ABSL_NAMESPACE_BEGIN + namespace { + // Append is merely a version of memcpy that returns the address of the byte + // after the area just overwritten. +-absl::Nonnull<char*> Append(absl::Nonnull<char*> out, const AlphaNum& x) { ++inline absl::Nonnull<char*> Append(absl::Nonnull<char*> out, ++ const AlphaNum& x) { + // memcpy is allowed to overwrite arbitrary memory, so doing this after the + // call would force an extra fetch of x.size(). + char* after = out + x.size(); +@@ -53,6 +52,11 @@ absl::Nonnull<char*> Append(absl::Nonnull<char*> out, const AlphaNum& x) { + return after; + } + ++inline void STLStringAppendUninitializedAmortized(std::string* dest, ++ size_t to_append) { ++ strings_internal::AppendUninitializedTraits<std::string>::Append(dest, ++ to_append); ++} + } // namespace + + std::string StrCat(const AlphaNum& a, const AlphaNum& b) { +@@ -98,130 +102,6 @@ std::string StrCat(const AlphaNum& a, const AlphaNum& b, const AlphaNum& c, + namespace strings_internal { + + // Do not call directly - these are not part of the public API. +-void STLStringAppendUninitializedAmortized(std::string* dest, +- size_t to_append) { +- strings_internal::AppendUninitializedTraits<std::string>::Append(dest, +- to_append); +-} +- +-template <typename Integer> +-std::enable_if_t<std::is_integral<Integer>::value, std::string> IntegerToString( +- Integer i) { +- std::string str; +- const auto /* either bool or std::false_type */ is_negative = +- absl::numbers_internal::IsNegative(i); +- const uint32_t digits = absl::numbers_internal::Base10Digits( +- absl::numbers_internal::UnsignedAbsoluteValue(i)); +- absl::strings_internal::STLStringResizeUninitialized( +- &str, digits + static_cast<uint32_t>(is_negative)); +- absl::numbers_internal::FastIntToBufferBackward(i, &str[str.size()], digits); +- return str; +-} +- +-template <> +-std::string IntegerToString(long i) { // NOLINT +- if (sizeof(i) <= sizeof(int)) { +- return IntegerToString(static_cast<int>(i)); +- } else { +- return IntegerToString(static_cast<long long>(i)); // NOLINT +- } +-} +- +-template <> +-std::string IntegerToString(unsigned long i) { // NOLINT +- if (sizeof(i) <= sizeof(unsigned int)) { +- return IntegerToString(static_cast<unsigned int>(i)); +- } else { +- return IntegerToString(static_cast<unsigned long long>(i)); // NOLINT +- } +-} +- +-template <typename Float> +-std::enable_if_t<std::is_floating_point<Float>::value, std::string> +-FloatToString(Float f) { +- std::string result; +- strings_internal::STLStringResizeUninitialized( +- &result, numbers_internal::kSixDigitsToBufferSize); +- char* start = &result[0]; +- result.erase(numbers_internal::SixDigitsToBuffer(f, start)); +- return result; +-} +- +-std::string SingleArgStrCat(int x) { return IntegerToString(x); } +-std::string SingleArgStrCat(unsigned int x) { return IntegerToString(x); } +-// NOLINTNEXTLINE +-std::string SingleArgStrCat(long x) { return IntegerToString(x); } +-// NOLINTNEXTLINE +-std::string SingleArgStrCat(unsigned long x) { return IntegerToString(x); } +-// NOLINTNEXTLINE +-std::string SingleArgStrCat(long long x) { return IntegerToString(x); } +-// NOLINTNEXTLINE +-std::string SingleArgStrCat(unsigned long long x) { return IntegerToString(x); } +-std::string SingleArgStrCat(float x) { return FloatToString(x); } +-std::string SingleArgStrCat(double x) { return FloatToString(x); } +- +-template <class Integer> +-std::enable_if_t<std::is_integral<Integer>::value, void> AppendIntegerToString( +- std::string& str, Integer i) { +- const auto /* either bool or std::false_type */ is_negative = +- absl::numbers_internal::IsNegative(i); +- const uint32_t digits = absl::numbers_internal::Base10Digits( +- absl::numbers_internal::UnsignedAbsoluteValue(i)); +- absl::strings_internal::STLStringAppendUninitializedAmortized( +- &str, digits + static_cast<uint32_t>(is_negative)); +- absl::numbers_internal::FastIntToBufferBackward(i, &str[str.size()], digits); +-} +- +-template <> +-void AppendIntegerToString(std::string& str, long i) { // NOLINT +- if (sizeof(i) <= sizeof(int)) { +- return AppendIntegerToString(str, static_cast<int>(i)); +- } else { +- return AppendIntegerToString(str, static_cast<long long>(i)); // NOLINT +- } +-} +- +-template <> +-void AppendIntegerToString(std::string& str, +- unsigned long i) { // NOLINT +- if (sizeof(i) <= sizeof(unsigned int)) { +- return AppendIntegerToString(str, static_cast<unsigned int>(i)); +- } else { +- return AppendIntegerToString(str, +- static_cast<unsigned long long>(i)); // NOLINT +- } +-} +- +-// `SingleArgStrAppend` overloads are defined here for the same reasons as with +-// `SingleArgStrCat` above. +-void SingleArgStrAppend(std::string& str, int x) { +- return AppendIntegerToString(str, x); +-} +- +-void SingleArgStrAppend(std::string& str, unsigned int x) { +- return AppendIntegerToString(str, x); +-} +- +-// NOLINTNEXTLINE +-void SingleArgStrAppend(std::string& str, long x) { +- return AppendIntegerToString(str, x); +-} +- +-// NOLINTNEXTLINE +-void SingleArgStrAppend(std::string& str, unsigned long x) { +- return AppendIntegerToString(str, x); +-} +- +-// NOLINTNEXTLINE +-void SingleArgStrAppend(std::string& str, long long x) { +- return AppendIntegerToString(str, x); +-} +- +-// NOLINTNEXTLINE +-void SingleArgStrAppend(std::string& str, unsigned long long x) { +- return AppendIntegerToString(str, x); +-} +- + std::string CatPieces(std::initializer_list<absl::string_view> pieces) { + std::string result; + size_t total_size = 0; +@@ -258,7 +138,7 @@ void AppendPieces(absl::Nonnull<std::string*> dest, + ASSERT_NO_OVERLAP(*dest, piece); + to_append += piece.size(); + } +- strings_internal::STLStringAppendUninitializedAmortized(dest, to_append); ++ STLStringAppendUninitializedAmortized(dest, to_append); + + char* const begin = &(*dest)[0]; + char* out = begin + old_size; +@@ -277,7 +157,7 @@ void AppendPieces(absl::Nonnull<std::string*> dest, + void StrAppend(absl::Nonnull<std::string*> dest, const AlphaNum& a) { + ASSERT_NO_OVERLAP(*dest, a); + std::string::size_type old_size = dest->size(); +- strings_internal::STLStringAppendUninitializedAmortized(dest, a.size()); ++ STLStringAppendUninitializedAmortized(dest, a.size()); + char* const begin = &(*dest)[0]; + char* out = begin + old_size; + out = Append(out, a); +@@ -289,8 +169,7 @@ void StrAppend(absl::Nonnull<std::string*> dest, const AlphaNum& a, + ASSERT_NO_OVERLAP(*dest, a); + ASSERT_NO_OVERLAP(*dest, b); + std::string::size_type old_size = dest->size(); +- strings_internal::STLStringAppendUninitializedAmortized(dest, +- a.size() + b.size()); ++ STLStringAppendUninitializedAmortized(dest, a.size() + b.size()); + char* const begin = &(*dest)[0]; + char* out = begin + old_size; + out = Append(out, a); +@@ -304,8 +183,7 @@ void StrAppend(absl::Nonnull<std::string*> dest, const AlphaNum& a, + ASSERT_NO_OVERLAP(*dest, b); + ASSERT_NO_OVERLAP(*dest, c); + std::string::size_type old_size = dest->size(); +- strings_internal::STLStringAppendUninitializedAmortized( +- dest, a.size() + b.size() + c.size()); ++ STLStringAppendUninitializedAmortized(dest, a.size() + b.size() + c.size()); + char* const begin = &(*dest)[0]; + char* out = begin + old_size; + out = Append(out, a); +@@ -321,7 +199,7 @@ void StrAppend(absl::Nonnull<std::string*> dest, const AlphaNum& a, + ASSERT_NO_OVERLAP(*dest, c); + ASSERT_NO_OVERLAP(*dest, d); + std::string::size_type old_size = dest->size(); +- strings_internal::STLStringAppendUninitializedAmortized( ++ STLStringAppendUninitializedAmortized( + dest, a.size() + b.size() + c.size() + d.size()); + char* const begin = &(*dest)[0]; + char* out = begin + old_size; +diff --git a/absl/strings/str_cat.h b/absl/strings/str_cat.h +index 1b52a36f..f224942f 100644 +--- a/absl/strings/str_cat.h ++++ b/absl/strings/str_cat.h +@@ -93,6 +93,8 @@ + #include <cstddef> + #include <cstdint> + #include <cstring> ++#include <initializer_list> ++#include <limits> + #include <string> + #include <type_traits> + #include <utility> +@@ -448,36 +450,77 @@ std::string CatPieces(std::initializer_list<absl::string_view> pieces); + void AppendPieces(absl::Nonnull<std::string*> dest, + std::initializer_list<absl::string_view> pieces); + +-void STLStringAppendUninitializedAmortized(std::string* dest, size_t to_append); ++template <typename Integer> ++std::string IntegerToString(Integer i) { ++ // Any integer (signed/unsigned) up to 64 bits can be formatted into a buffer ++ // with 22 bytes (including NULL at the end). ++ constexpr size_t kMaxDigits10 = 22; ++ std::string result; ++ strings_internal::STLStringResizeUninitialized(&result, kMaxDigits10); ++ char* start = &result[0]; ++ // note: this can be optimized to not write last zero. ++ char* end = numbers_internal::FastIntToBuffer(i, start); ++ auto size = static_cast<size_t>(end - start); ++ assert((size < result.size()) && ++ "StrCat(Integer) does not fit into kMaxDigits10"); ++ result.erase(size); ++ return result; ++} ++template <typename Float> ++std::string FloatToString(Float f) { ++ std::string result; ++ strings_internal::STLStringResizeUninitialized( ++ &result, numbers_internal::kSixDigitsToBufferSize); ++ char* start = &result[0]; ++ result.erase(numbers_internal::SixDigitsToBuffer(f, start)); ++ return result; ++} + + // `SingleArgStrCat` overloads take built-in `int`, `long` and `long long` types + // (signed / unsigned) to avoid ambiguity on the call side. If we used int32_t + // and int64_t, then at least one of the three (`int` / `long` / `long long`) + // would have been ambiguous when passed to `SingleArgStrCat`. +-std::string SingleArgStrCat(int x); +-std::string SingleArgStrCat(unsigned int x); +-std::string SingleArgStrCat(long x); // NOLINT +-std::string SingleArgStrCat(unsigned long x); // NOLINT +-std::string SingleArgStrCat(long long x); // NOLINT +-std::string SingleArgStrCat(unsigned long long x); // NOLINT +-std::string SingleArgStrCat(float x); +-std::string SingleArgStrCat(double x); +- +-// `SingleArgStrAppend` overloads are defined here for the same reasons as with +-// `SingleArgStrCat` above. +-void SingleArgStrAppend(std::string& str, int x); +-void SingleArgStrAppend(std::string& str, unsigned int x); +-void SingleArgStrAppend(std::string& str, long x); // NOLINT +-void SingleArgStrAppend(std::string& str, unsigned long x); // NOLINT +-void SingleArgStrAppend(std::string& str, long long x); // NOLINT +-void SingleArgStrAppend(std::string& str, unsigned long long x); // NOLINT +- +-template <typename T, +- typename = std::enable_if_t<std::is_arithmetic<T>::value && +- !std::is_same<T, char>::value && +- !std::is_same<T, bool>::value>> ++inline std::string SingleArgStrCat(int x) { return IntegerToString(x); } ++inline std::string SingleArgStrCat(unsigned int x) { ++ return IntegerToString(x); ++} ++// NOLINTNEXTLINE ++inline std::string SingleArgStrCat(long x) { return IntegerToString(x); } ++// NOLINTNEXTLINE ++inline std::string SingleArgStrCat(unsigned long x) { ++ return IntegerToString(x); ++} ++// NOLINTNEXTLINE ++inline std::string SingleArgStrCat(long long x) { return IntegerToString(x); } ++// NOLINTNEXTLINE ++inline std::string SingleArgStrCat(unsigned long long x) { ++ return IntegerToString(x); ++} ++inline std::string SingleArgStrCat(float x) { return FloatToString(x); } ++inline std::string SingleArgStrCat(double x) { return FloatToString(x); } ++ ++// As of September 2023, the SingleArgStrCat() optimization is only enabled for ++// libc++. The reasons for this are: ++// 1) The SSO size for libc++ is 23, while libstdc++ and MSSTL have an SSO size ++// of 15. Since IntegerToString unconditionally resizes the string to 22 bytes, ++// this causes both libstdc++ and MSSTL to allocate. ++// 2) strings_internal::STLStringResizeUninitialized() only has an ++// implementation that avoids initialization when using libc++. This isn't as ++// relevant as (1), and the cost should be benchmarked if (1) ever changes on ++// libstc++ or MSSTL. ++#ifdef _LIBCPP_VERSION ++#define ABSL_INTERNAL_STRCAT_ENABLE_FAST_CASE true ++#else ++#define ABSL_INTERNAL_STRCAT_ENABLE_FAST_CASE false ++#endif ++ ++template <typename T, typename = std::enable_if_t< ++ ABSL_INTERNAL_STRCAT_ENABLE_FAST_CASE && ++ std::is_arithmetic<T>{} && !std::is_same<T, char>{}>> + using EnableIfFastCase = T; + ++#undef ABSL_INTERNAL_STRCAT_ENABLE_FAST_CASE ++ + } // namespace strings_internal + + ABSL_MUST_USE_RESULT inline std::string StrCat() { return std::string(); } +@@ -553,67 +596,6 @@ inline void StrAppend(absl::Nonnull<std::string*> dest, const AlphaNum& a, + static_cast<const AlphaNum&>(args).Piece()...}); + } + +-template <class String, class T> +-std::enable_if_t< +- std::is_integral<absl::strings_internal::EnableIfFastCase<T>>::value, void> +-StrAppend(absl::Nonnull<String*> result, T i) { +- return absl::strings_internal::SingleArgStrAppend(*result, i); +-} +- +-// This overload is only selected if all the parameters are numbers that can be +-// handled quickly. +-// Later we can look into how we can extend this to more general argument +-// mixtures without bloating codegen too much, or copying unnecessarily. +-template <typename String, typename... T> +-std::enable_if_t< +- (sizeof...(T) > 1), +- std::common_type_t<std::conditional_t< +- true, void, absl::strings_internal::EnableIfFastCase<T>>...>> +-StrAppend(absl::Nonnull<String*> str, T... args) { +- // Do not add unnecessary variables, logic, or even "free" lambdas here. +- // They can add overhead for the compiler and/or at run time. +- // Furthermore, assume this function will be inlined. +- // This function is carefully tailored to be able to be largely optimized away +- // so that it becomes near-equivalent to the caller handling each argument +- // individually while minimizing register pressure, so that the compiler +- // can inline it with minimal overhead. +- +- // First, calculate the total length, so we can perform just a single resize. +- // Save all the lengths for later. +- size_t total_length = 0; +- const ptrdiff_t lengths[] = { +- absl::numbers_internal::GetNumDigitsOrNegativeIfNegative(args)...}; +- for (const ptrdiff_t possibly_negative_length : lengths) { +- // Lengths are negative for negative numbers. Keep them for later use, but +- // take their absolute values for calculating total lengths; +- total_length += possibly_negative_length < 0 +- ? static_cast<size_t>(-possibly_negative_length) +- : static_cast<size_t>(possibly_negative_length); +- } +- +- // Now reserve space for all the arguments. +- const size_t old_size = str->size(); +- absl::strings_internal::STLStringAppendUninitializedAmortized(str, +- total_length); +- +- // Finally, output each argument one-by-one, from left to right. +- size_t i = 0; // The current argument we're processing +- ptrdiff_t n; // The length of the current argument +- typename String::pointer pos = &(*str)[old_size]; +- using SomeTrivialEmptyType = std::false_type; +- const SomeTrivialEmptyType dummy; +- // Ugly code due to the lack of C++17 fold expressions +- const SomeTrivialEmptyType dummies[] = { +- (/* Comma expressions are poor man's C++17 fold expression for C++14 */ +- (void)(n = lengths[i]), +- (void)(n < 0 ? (void)(*pos++ = '-'), (n = ~n) : 0), +- (void)absl::numbers_internal::FastIntToBufferBackward( +- absl::numbers_internal::UnsignedAbsoluteValue(std::move(args)), +- pos += n, static_cast<uint32_t>(n)), +- (void)++i, dummy)...}; +- (void)dummies; // Remove & migrate to fold expressions in C++17 +-} +- + // Helper function for the future StrCat default floating-point format, %.6g + // This is fast. + inline strings_internal::AlphaNumBuffer< +diff --git a/absl/strings/str_cat_test.cc b/absl/strings/str_cat_test.cc +index b30a86fe..66eddf0d 100644 +--- a/absl/strings/str_cat_test.cc ++++ b/absl/strings/str_cat_test.cc +@@ -39,24 +39,6 @@ + + namespace { + +-template <typename Integer> +-void VerifyInteger(Integer value) { +- const std::string expected = std::to_string(value); +- +- EXPECT_EQ(absl::StrCat(value), expected); +- +- const char* short_prefix = "x"; +- const char* long_prefix = "2;k.msabxiuow2[09i;o3k21-93-9=29]"; +- +- std::string short_str = short_prefix; +- absl::StrAppend(&short_str, value); +- EXPECT_EQ(short_str, short_prefix + expected); +- +- std::string long_str = long_prefix; +- absl::StrAppend(&long_str, value); +- EXPECT_EQ(long_str, long_prefix + expected); +-} +- + // Test absl::StrCat of ints and longs of various sizes and signdedness. + TEST(StrCat, Ints) { + const short s = -1; // NOLINT(runtime/int) +@@ -86,34 +68,6 @@ TEST(StrCat, Ints) { + EXPECT_EQ(answer, "-9-12"); + answer = absl::StrCat(uintptr, 0); + EXPECT_EQ(answer, "130"); +- +- for (const uint32_t base : {2u, 10u}) { +- for (const int extra_shift : {0, 12}) { +- for (uint64_t i = 0; i < (1 << 8); ++i) { +- uint64_t j = i; +- while (true) { +- uint64_t v = j ^ (extra_shift != 0 ? (j << extra_shift) * base : 0); +- VerifyInteger(static_cast<bool>(v)); +- VerifyInteger(static_cast<wchar_t>(v)); +- VerifyInteger(static_cast<signed char>(v)); +- VerifyInteger(static_cast<unsigned char>(v)); +- VerifyInteger(static_cast<short>(v)); // NOLINT +- VerifyInteger(static_cast<unsigned short>(v)); // NOLINT +- VerifyInteger(static_cast<int>(v)); // NOLINT +- VerifyInteger(static_cast<unsigned int>(v)); // NOLINT +- VerifyInteger(static_cast<long>(v)); // NOLINT +- VerifyInteger(static_cast<unsigned long>(v)); // NOLINT +- VerifyInteger(static_cast<long long>(v)); // NOLINT +- VerifyInteger(static_cast<unsigned long long>(v)); // NOLINT +- const uint64_t next = j == 0 ? 1 : j * base; +- if (next <= j) { +- break; +- } +- j = next; +- } +- } +- } +- } + } + + TEST(StrCat, Enums) { +-- +2.34.1 + diff --git a/ports/abseil/portfile.cmake b/ports/abseil/portfile.cmake index 3e0a84747a3fee..a1389b078d003f 100644 --- a/ports/abseil/portfile.cmake +++ b/ports/abseil/portfile.cmake @@ -8,6 +8,8 @@ vcpkg_from_github( REF "${VERSION}" SHA512 5062e731ee8c9a757e6d75fc1c558652deb4dd1daab4d6143f7ad52a139501c61365f89acbf82480be0f9a4911a58286560068d8b1a8b6774e6afad51739766e HEAD_REF master + PATCHES + 0001-revert-integer-to-string-conversion-optimizations.patch # Fix openvino MSVC compile error ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS diff --git a/ports/abseil/vcpkg.json b/ports/abseil/vcpkg.json index 9c41ed17cd53bb..25816c972fcc6d 100644 --- a/ports/abseil/vcpkg.json +++ b/ports/abseil/vcpkg.json @@ -1,6 +1,7 @@ { "name": "abseil", "version": "20240116.2", + "port-version": 1, "description": [ "Abseil is an open-source collection of C++ library code designed to augment the C++ standard library. The Abseil library code is collected from Google's own C++ code base, has been extensively tested and used in production, and is the same code we depend on in our daily coding lives.", "In some cases, Abseil provides pieces missing from the C++ standard; in others, Abseil provides alternatives to the standard for special needs we've found through usage in the Google code base. We denote those cases clearly within the library code we provide you.", diff --git a/ports/arcus/0002-protobuf-version.patch b/ports/arcus/0002-protobuf-version.patch new file mode 100644 index 00000000000000..1dea39346dc61d --- /dev/null +++ b/ports/arcus/0002-protobuf-version.patch @@ -0,0 +1,37 @@ +diff --git a/ArcusConfig.cmake.in b/ArcusConfig.cmake.in +index 3208a69..fb4a968 100644 +--- a/ArcusConfig.cmake.in ++++ b/ArcusConfig.cmake.in +@@ -4,7 +4,7 @@ + # However, if ProtobufConfig is used instead, there is a CMake option that controls + # this, which defaults to OFF. We need to force this option to ON instead. + set(protobuf_MODULE_COMPATIBLE ON CACHE "" INTERNAL FORCE) +-find_package(Protobuf 3.0.0 REQUIRED) ++find_package(Protobuf REQUIRED) + + get_filename_component(SELF_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) + include(${SELF_DIR}/Arcus-targets.cmake) +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 1d736ba..66d6c13 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -17,7 +17,7 @@ endif() + # However, if ProtobufConfig is used instead, there is a CMake option that controls + # this, which defaults to OFF. We need to force this option to ON instead. + set(protobuf_MODULE_COMPATIBLE ON CACHE INTERNAL "" FORCE) +-find_package(Protobuf 3.0.0 REQUIRED) ++find_package(Protobuf REQUIRED) + + set(CMAKE_POSITION_INDEPENDENT_CODE ON) #Required if a patch to libArcus needs to be made via templates. + +@@ -103,9 +103,8 @@ endif() + target_include_directories(Arcus PUBLIC + $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src> + $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}> +- ${PROTOBUF_INCLUDE_DIR} + ) +-target_link_libraries(Arcus PUBLIC ${PROTOBUF_LIBRARIES}) ++target_link_libraries(Arcus PUBLIC protobuf::libprotobuf) + + if(WIN32) + add_definitions(-D_WIN32_WINNT=0x0600) # Declare we require Vista or higher, this allows us to use IPv6 functions. diff --git a/ports/arcus/portfile.cmake b/ports/arcus/portfile.cmake index c85b0f73f90800..da0dcc4cf053bf 100644 --- a/ports/arcus/portfile.cmake +++ b/ports/arcus/portfile.cmake @@ -1,11 +1,12 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Ultimaker/libArcus - REF 617f6f71572090f73cb44592b12f49567b539e5b #v4.10.0 - SHA512 cf0954d8b10d9f94165aa5c086d0e58c2925464f9fbe4252535c36d7e6bb12b767d89efb816c9e642f9cd7f0ec0d66d61ca21c5121a05340499d38d5d851f73b - HEAD_REF master + REF ${VERSION} + SHA512 452c541360d74a8f58ab1b20df59efd36756812a9ecd09804ba16877956fb240d367bd968271a9c010496598ef0b459f62aa287553d4ba3fdb4cd2742c25553f + HEAD_REF main PATCHES 0001-fix-protobuf-deprecated.patch + 0002-protobuf-version.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" ENABLE_STATIC) @@ -26,4 +27,4 @@ vcpkg_cmake_config_fixup(PACKAGE_NAME Arcus CONFIG_PATH lib/cmake/Arcus) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -configure_file("${SOURCE_PATH}/LICENSE" "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" COPYONLY) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/arcus/vcpkg.json b/ports/arcus/vcpkg.json index 356415b524ca12..91080aeb69f017 100644 --- a/ports/arcus/vcpkg.json +++ b/ports/arcus/vcpkg.json @@ -1,7 +1,7 @@ { "name": "arcus", "version-semver": "4.10.0", - "port-version": 2, + "port-version": 3, "description": "This library contains C++ bindings for creating a socket in a thread and using this socket to send and receive messages based on the Protocol Buffers library.", "homepage": "https://github.com/Ultimaker/libArcus", "supports": "!uwp", diff --git a/ports/braft/export-target.patch b/ports/braft/export-target.patch index b5779e1aecd4cf..98b04e90129a5d 100644 --- a/ports/braft/export-target.patch +++ b/ports/braft/export-target.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index a851c00..d18ecd0 100644 +index 3d75dd5..090a02e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -105,7 +105,7 @@ if(BRPC_WITH_GLOG) +@@ -99,7 +99,7 @@ if(BRPC_WITH_GLOG) ${OPENSSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY} dl @@ -11,7 +11,7 @@ index a851c00..d18ecd0 100644 ) else() set(DYNAMIC_LIB -@@ -117,7 +117,7 @@ else() +@@ -111,7 +111,7 @@ else() ${OPENSSL_LIBRARIES} ${OPENSSL_CRYPTO_LIBRARY} dl @@ -21,7 +21,7 @@ index a851c00..d18ecd0 100644 endif() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 78adc56..0ab4dce 100644 +index 78adc56..50cffc6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,8 +19,10 @@ add_library(braft-static STATIC $<TARGET_OBJECTS:OBJ_LIB>) @@ -35,7 +35,7 @@ index 78adc56..0ab4dce 100644 target_link_libraries(braft-static PUBLIC ${DYNAMIC_LIB}) endif() -@@ -31,15 +33,31 @@ SET_TARGET_PROPERTIES(braft-shared PROPERTIES OUTPUT_NAME braft CLEAN_DIRECT_OUT +@@ -31,15 +33,32 @@ SET_TARGET_PROPERTIES(braft-shared PROPERTIES OUTPUT_NAME braft CLEAN_DIRECT_OUT endif() if (NOT BUILD_SHARED_LIBS) @@ -58,6 +58,7 @@ index 78adc56..0ab4dce 100644 +[[include(CMakeFindDependencyMacro) +find_dependency(ZLIB) +find_dependency(gflags CONFIG) ++find_dependency(Protobuf CONFIG) +file(GLOB TARGET_FILES "${CMAKE_CURRENT_LIST_DIR}/unofficial-braftTargets.cmake") +foreach (TARGET_FILE ${TARGET_FILES}) + include("${TARGET_FILE}") diff --git a/ports/braft/fix-glog.patch b/ports/braft/fix-glog.patch index ea6a54b512e907..a2783e5c0c57e9 100644 --- a/ports/braft/fix-glog.patch +++ b/ports/braft/fix-glog.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index c88b0a2..bd3b74f 100644 +index 090a02e..fbe0ac3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,12 +55,8 @@ if ((NOT GFLAGS_INCLUDE_PATH) OR (NOT GFLAGS_LIB)) @@ -18,30 +18,22 @@ index c88b0a2..bd3b74f 100644 if(LEVELDB_WITH_SNAPPY) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index ff435a2..4e7591b 100644 +index 70d73df..a3d3046 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -10,6 +10,9 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) - include_directories(${CMAKE_SOURCE_DIR}/src) +@@ -11,6 +11,7 @@ include_directories(${CMAKE_SOURCE_DIR}/src) add_library(OBJ_LIB OBJECT ${SOURCES}) -+target_include_directories(OBJ_LIB PUBLIC $<INSTALL_INTERFACE:include>) -+target_link_libraries(OBJ_LIB PUBLIC ${DYNAMIC_LIB}) -+ ++target_link_libraries(OBJ_LIB PUBLIC ${DYNAMIC_LIB}) set_property(TARGET ${OBJ_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1) if (BUILD_SHARED_LIBS) -@@ -18,13 +21,6 @@ else() - add_library(braft-static STATIC $<TARGET_OBJECTS:OBJ_LIB>) - endif() - --if (BUILD_SHARED_LIBS) --target_include_directories(braft-shared PUBLIC $<INSTALL_INTERFACE:include>) --target_link_libraries(braft-shared PUBLIC ${DYNAMIC_LIB}) --else() --target_include_directories(braft-static PUBLIC $<INSTALL_INTERFACE:include>) --target_link_libraries(braft-static PUBLIC ${DYNAMIC_LIB}) --endif() - - if (NOT BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(braft-static PROPERTIES OUTPUT_NAME braft CLEAN_DIRECT_OUTPUT 1) + add_library(braft-shared SHARED $<TARGET_OBJECTS:OBJ_LIB>) +@@ -50,6 +51,7 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/unofficial-braft-config.cmake" + [[include(CMakeFindDependencyMacro) + find_dependency(ZLIB) + find_dependency(gflags CONFIG) ++find_dependency(glog CONFIG) + find_dependency(Protobuf CONFIG) + file(GLOB TARGET_FILES "${CMAKE_CURRENT_LIST_DIR}/unofficial-braftTargets.cmake") + foreach (TARGET_FILE ${TARGET_FILES}) diff --git a/ports/braft/portfile.cmake b/ports/braft/portfile.cmake index 81f4184f49afa5..8811e4f9b3c6ad 100644 --- a/ports/braft/portfile.cmake +++ b/ports/braft/portfile.cmake @@ -17,6 +17,7 @@ vcpkg_from_github( export-target.patch "${GCC_11_PATCH}" fix-glog.patch + protobuf.patch ) vcpkg_cmake_configure( diff --git a/ports/braft/protobuf.patch b/ports/braft/protobuf.patch new file mode 100644 index 00000000000000..7ba2bed6eb2d23 --- /dev/null +++ b/ports/braft/protobuf.patch @@ -0,0 +1,23 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 28c1026..65af3ae 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -22,7 +22,7 @@ endif() + set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) + + include(FindThreads) +-include(FindProtobuf) ++find_package(Protobuf CONFIG REQUIRED) + + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + # require at least gcc 4.8 +@@ -69,7 +69,8 @@ if ((NOT BRPC_INCLUDE_PATH) OR (NOT BRPC_LIB)) + message(FATAL_ERROR "Fail to find brpc") + endif() + +-if (NOT PROTOBUF_PROTOC_EXECUTABLE) ++set(PROTOBUF_LIBRARY protobuf::libprotobuf) ++if (0) + get_filename_component(PROTO_LIB_DIR ${PROTOBUF_LIBRARY} DIRECTORY) + set (PROTOBUF_PROTOC_EXECUTABLE "${PROTO_LIB_DIR}/../bin/protoc") + endif() diff --git a/ports/braft/vcpkg.json b/ports/braft/vcpkg.json index e5f30236393298..2083b4d5cecbd9 100644 --- a/ports/braft/vcpkg.json +++ b/ports/braft/vcpkg.json @@ -1,7 +1,7 @@ { "name": "braft", "version-date": "2021-26-04", - "port-version": 4, + "port-version": 5, "description": "Consensus algorithm library", "homepage": "https://github.com/baidu/braft", "license": "Apache-2.0", diff --git a/ports/brpc/fix-build.patch b/ports/brpc/fix-build.patch index fa57f6e14e1cc8..e48139fc5c5d6d 100644 --- a/ports/brpc/fix-build.patch +++ b/ports/brpc/fix-build.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index b14fe17..ecce87c 100644 +index b14fe178..9e9a776a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,7 +68,8 @@ endif() @@ -12,12 +12,10 @@ index b14fe17..ecce87c 100644 if (NOT THRIFT_LIB) message(FATAL_ERROR "Fail to find Thrift") endif() -@@ -153,7 +154,9 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - endif() +@@ -154,6 +155,8 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") endif() --find_package(Protobuf REQUIRED) -+find_package(protobuf CONFIG REQUIRED) + find_package(Protobuf REQUIRED) +get_target_property(PROTOBUF_INCLUDE_DIR protobuf::libprotobuf INTERFACE_INCLUDE_DIRECTORIES) +set(PROTOBUF_LIBRARIES protobuf::libprotobuf) if(Protobuf_VERSION GREATER 4.21) @@ -78,8 +76,17 @@ index b14fe17..ecce87c 100644 if(WITH_BORINGSSL) list(APPEND DYNAMIC_LIB ${BORINGSSL_SSL_LIBRARY}) +@@ -520,7 +527,7 @@ compile_proto(PROTO_HDRS PROTO_SRCS ${PROJECT_BINARY_DIR} + ${PROJECT_SOURCE_DIR}/src + "${PROTO_FILES}") + add_library(PROTO_LIB OBJECT ${PROTO_SRCS} ${PROTO_HDRS}) +- ++target_link_libraries(PROTO_LIB PUBLIC ${DYNAMIC_LIB}) + set(SOURCES + ${BVAR_SOURCES} + ${BTHREAD_SOURCES} diff --git a/cmake/FindGFLAGS.cmake b/cmake/FindGFLAGS.cmake -index dfad5fd..8423d55 100644 +index dfad5fd8..8423d55a 100644 --- a/cmake/FindGFLAGS.cmake +++ b/cmake/FindGFLAGS.cmake @@ -24,7 +24,9 @@ if (GFLAGS_STATIC) @@ -94,10 +101,19 @@ index dfad5fd..8423d55 100644 set(GFLAGS_FOUND TRUE) endif(GFLAGS_INCLUDE_PATH AND GFLAGS_LIBRARY) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 1b4b233..8e836a4 100644 +index 1b4b2332..638ec070 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt -@@ -31,6 +31,7 @@ add_dependencies(SOURCES_LIB PROTO_LIB) +@@ -24,13 +24,16 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR}) + include_directories(${PROJECT_SOURCE_DIR}/src) + + add_library(BUTIL_LIB OBJECT ${BUTIL_SOURCES}) ++target_link_libraries(BUTIL_LIB PUBLIC ${DYNAMIC_LIB}) + add_library(SOURCES_LIB OBJECT ${SOURCES}) ++target_link_libraries(SOURCES_LIB PUBLIC ${DYNAMIC_LIB}) + add_dependencies(SOURCES_LIB PROTO_LIB) + + # shared library needs POSITION_INDEPENDENT_CODE set_property(TARGET ${SOURCES_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1) set_property(TARGET ${BUTIL_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1) @@ -105,7 +121,7 @@ index 1b4b233..8e836a4 100644 add_library(brpc-static STATIC $<TARGET_OBJECTS:BUTIL_LIB> $<TARGET_OBJECTS:SOURCES_LIB> $<TARGET_OBJECTS:PROTO_LIB>) -@@ -60,12 +61,19 @@ endfunction() +@@ -60,12 +63,19 @@ endfunction() if(WITH_THRIFT) @@ -127,7 +143,7 @@ index 1b4b233..8e836a4 100644 # for protoc-gen-mcpack set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/output/bin) -@@ -74,36 +82,64 @@ set(protoc_gen_mcpack_SOURCES +@@ -74,36 +84,63 @@ set(protoc_gen_mcpack_SOURCES ) add_executable(protoc-gen-mcpack ${protoc_gen_mcpack_SOURCES}) @@ -151,7 +167,6 @@ index 1b4b233..8e836a4 100644 endif() SET_TARGET_PROPERTIES(brpc-shared PROPERTIES OUTPUT_NAME brpc CLEAN_DIRECT_OUTPUT 1) - -+ + if(0) target_link_libraries(protoc-gen-mcpack brpc-shared ${DYNAMIC_LIB} pthread) + endif() diff --git a/ports/brpc/fix-glog.patch b/ports/brpc/fix-glog.patch deleted file mode 100644 index d4e4c656c6ad24..00000000000000 --- a/ports/brpc/fix-glog.patch +++ /dev/null @@ -1,97 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ecce87c..3d938d3 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -86,8 +86,10 @@ configure_file(${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_SOURCE_DIR}/src/butil - - set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) - --find_package(GFLAGS REQUIRED) -- -+set(GFLAGS_USE_TARGET_NAMESPACE ON) -+find_package(gflags CONFIG REQUIRED) -+set(GFLAGS_LIBRARY gflags::gflags) -+if(0) - execute_process( - COMMAND bash -c "grep \"namespace [_A-Za-z0-9]\\+ {\" ${GFLAGS_INCLUDE_PATH}/gflags/gflags_declare.h | head -1 | awk '{print $2}' | tr -d '\n'" - OUTPUT_VARIABLE GFLAGS_NS -@@ -98,6 +100,8 @@ if(${GFLAGS_NS} STREQUAL "GFLAGS_NAMESPACE") - OUTPUT_VARIABLE GFLAGS_NS - ) - endif() -+endif() -+set(GFLAGS_NS "google") - - include_directories( - ${PROJECT_SOURCE_DIR}/src -@@ -127,19 +131,19 @@ set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} ${DEBUG_SYMBOL} ${THRIFT_CPP_FLAG}") - set(CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer") - set(CMAKE_C_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-unused-parameter -fno-omit-frame-pointer") - --macro(use_cxx11) -+macro(use_cxx14) - if(CMAKE_VERSION VERSION_LESS "3.1.3") - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") - endif() - if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") -- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") -+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") - endif() - else() -- set(CMAKE_CXX_STANDARD 11) -+ set(CMAKE_CXX_STANDARD 14) - set(CMAKE_CXX_STANDARD_REQUIRED ON) - endif() --endmacro(use_cxx11) -+endmacro(use_cxx14) - - if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - #required by butil/crc32.cc to boost performance for 10x -@@ -199,7 +203,7 @@ if(Protobuf_VERSION GREATER 4.21) - absl::variant - ) - else() -- use_cxx11() -+ use_cxx14() - endif() - find_package(Threads REQUIRED) - find_package(ZLIB REQUIRED) -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt -index 8e836a4..c1b1f36 100644 ---- a/src/CMakeLists.txt -+++ b/src/CMakeLists.txt -@@ -30,6 +30,10 @@ add_dependencies(SOURCES_LIB PROTO_LIB) - # shared library needs POSITION_INDEPENDENT_CODE - set_property(TARGET ${SOURCES_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1) - set_property(TARGET ${BUTIL_LIB} PROPERTY POSITION_INDEPENDENT_CODE 1) -+if(BRPC_WITH_GLOG) -+ target_link_libraries(BUTIL_LIB PUBLIC ${GLOG_LIB}) -+ target_link_libraries(SOURCES_LIB PUBLIC ${GLOG_LIB}) -+endif() - - if(NOT BUILD_SHARED_LIBS) - add_library(brpc-static STATIC $<TARGET_OBJECTS:BUTIL_LIB> -@@ -65,9 +69,7 @@ if(WITH_THRIFT) - endif() - - target_link_libraries(brpc-static PUBLIC ${DYNAMIC_LIB}) --if(BRPC_WITH_GLOG) -- target_link_libraries(brpc-static PUBLIC ${GLOG_LIB}) --endif() -+ - target_include_directories(brpc-static PUBLIC $<INSTALL_INTERFACE:include>) - - SET_TARGET_PROPERTIES(brpc-static PROPERTIES OUTPUT_NAME brpc CLEAN_DIRECT_OUTPUT 1) -@@ -90,9 +92,7 @@ if(BUILD_SHARED_LIBS) - $<TARGET_OBJECTS:PROTO_LIB>) - target_link_libraries(brpc-shared PUBLIC ${DYNAMIC_LIB}) - target_include_directories(brpc-shared PUBLIC $<INSTALL_INTERFACE:include>) -- if(WITH_GLOG) -- target_link_libraries(brpc-shared PUBLIC ${GLOG_LIB}) -- endif() -+ - if(WITH_THRIFT) - target_link_libraries(brpc-shared PUBLIC ${THRIFT_LIB}) - endif() diff --git a/ports/brpc/fix-warnings.patch b/ports/brpc/fix-warnings.patch new file mode 100644 index 00000000000000..72755d163e995a --- /dev/null +++ b/ports/brpc/fix-warnings.patch @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 9e9a776a..a8c4c1ea 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -124,8 +124,8 @@ if(WITH_MESALINK) + endif() + set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} -DBTHREAD_USE_FAST_PTHREAD_MUTEX -D__const__=__unused__ -D_GNU_SOURCE -DUSE_SYMBOLIZE -DNO_TCMALLOC -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -DBRPC_REVISION=\\\"${BRPC_REVISION}\\\" -D__STRICT_ANSI__") + set(CMAKE_CPP_FLAGS "${CMAKE_CPP_FLAGS} ${DEBUG_SYMBOL} ${THRIFT_CPP_FLAG}") +-set(CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer") +-set(CMAKE_C_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -Wall -W -fPIC -fstrict-aliasing -Wno-unused-parameter -fno-omit-frame-pointer") ++set(CMAKE_CXX_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -w -fPIC -fstrict-aliasing -Wno-invalid-offsetof -Wno-unused-parameter -fno-omit-frame-pointer") ++set(CMAKE_C_FLAGS "${CMAKE_CPP_FLAGS} -O2 -pipe -w -fPIC -fstrict-aliasing -Wno-unused-parameter -fno-omit-frame-pointer") + + macro(use_cxx11) + if(CMAKE_VERSION VERSION_LESS "3.1.3") diff --git a/ports/brpc/portfile.cmake b/ports/brpc/portfile.cmake index 83cafa4fe486a7..953d82ff92f199 100644 --- a/ports/brpc/portfile.cmake +++ b/ports/brpc/portfile.cmake @@ -6,7 +6,8 @@ vcpkg_from_github( HEAD_REF master PATCHES fix-build.patch - fix-glog.patch + fix-warnings.patch + protobuf.patch ) vcpkg_cmake_configure( diff --git a/ports/brpc/protobuf.patch b/ports/brpc/protobuf.patch new file mode 100644 index 00000000000000..f8069bbd719bc4 --- /dev/null +++ b/ports/brpc/protobuf.patch @@ -0,0 +1,25 @@ +diff --git a/src/brpc/thrift_message.cpp b/src/brpc/thrift_message.cpp +index ed3d7557..7b9d210a 100644 +--- a/src/brpc/thrift_message.cpp ++++ b/src/brpc/thrift_message.cpp +@@ -22,7 +22,6 @@ + #include <algorithm> + #include "butil/logging.h" + +-#include <google/protobuf/stubs/once.h> + #include <google/protobuf/io/coded_stream.h> + #include <google/protobuf/descriptor.h> + #include <google/protobuf/reflection_ops.h> +diff --git a/src/brpc/thrift_message.h b/src/brpc/thrift_message.h +index 53041c85..471bafb5 100644 +--- a/src/brpc/thrift_message.h ++++ b/src/brpc/thrift_message.h +@@ -101,7 +101,7 @@ public: + void SerializeWithCachedSizes( + ::google::protobuf::io::CodedOutputStream* output) const PB_310_OVERRIDE; + ::google::protobuf::uint8* SerializeWithCachedSizesToArray(::google::protobuf::uint8* output) const PB_310_OVERRIDE; +- int GetCachedSize() const override { return ByteSize(); } ++ int GetCachedSize() const { return ByteSize(); } + + protected: + ::google::protobuf::Metadata GetMetadata() const override; diff --git a/ports/brpc/vcpkg.json b/ports/brpc/vcpkg.json index fb5da5be92593d..c7cd86324b9bd3 100644 --- a/ports/brpc/vcpkg.json +++ b/ports/brpc/vcpkg.json @@ -1,6 +1,7 @@ { "name": "brpc", "version": "1.9.0", + "port-version": 1, "description": "Industrial-grade RPC framework used throughout Baidu, with 1,000,000+ instances and thousands kinds of services, called \"baidu-rpc\" inside Baidu.", "homepage": "https://github.com/apache/brpc", "license": "Apache-2.0", diff --git a/ports/cartographer/fix-find-packages.patch b/ports/cartographer/fix-find-packages.patch index 59e433c5fff55b..a1336c8840e621 100644 --- a/ports/cartographer/fix-find-packages.patch +++ b/ports/cartographer/fix-find-packages.patch @@ -1,5 +1,5 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 2e3a686..f36f15a 100644 +index 2e3a686..ed161e4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,27 +25,33 @@ option(BUILD_GRPC "build Cartographer gRPC support" false) @@ -15,8 +15,9 @@ index 2e3a686..f36f15a 100644 find_package(Ceres REQUIRED COMPONENTS SuiteSparse) find_package(Eigen3 REQUIRED) -find_package(LuaGoogle REQUIRED) +-find_package(Protobuf 3.0.0 REQUIRED) +find_package(Lua REQUIRED) - find_package(Protobuf 3.0.0 REQUIRED) ++find_package(Protobuf REQUIRED) +find_package(glog REQUIRED) +find_package(gflags REQUIRED) @@ -80,7 +81,7 @@ index 2e3a686..f36f15a 100644 if(${BUILD_GRPC}) google_binary(cartographer_grpc_server -@@ -213,8 +219,9 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC +@@ -213,18 +219,16 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC target_link_libraries(${PROJECT_NAME} PUBLIC ${Boost_LIBRARIES}) # We expect find_package(Ceres) to have located these for us. @@ -90,45 +91,38 @@ index 2e3a686..f36f15a 100644 +#target_link_libraries(${PROJECT_NAME} PUBLIC gflags) +#target_link_libraries(${PROJECT_NAME} PUBLIC ${CAIRO_LIBRARY}) - target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC - "${CAIRO_INCLUDE_DIRS}") -@@ -224,7 +231,8 @@ target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC - ${PROTOBUF_INCLUDE_DIR}) +-target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC +- "${CAIRO_INCLUDE_DIRS}") + target_link_libraries(${PROJECT_NAME} PUBLIC ${CAIRO_LIBRARIES}) + +-target_include_directories(${PROJECT_NAME} SYSTEM PUBLIC +- ${PROTOBUF_INCLUDE_DIR}) # TODO(hrapp): This should not explicitly list pthread and use # PROTOBUF_LIBRARIES, but that failed on first try. -target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} pthread) +#target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY} pthread) -+target_link_libraries(${PROJECT_NAME} PUBLIC ${PROTOBUF_LIBRARY}) ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) if(${BUILD_GRPC}) target_link_libraries(${PROJECT_NAME} PUBLIC grpc++) target_link_libraries(${PROJECT_NAME} PUBLIC async_grpc) -@@ -234,7 +242,7 @@ if(${BUILD_PROMETHEUS}) - target_compile_definitions(${PROJECT_NAME} PUBLIC USE_PROMETHEUS=1) - endif() - --set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") -+set(TARGET_COMPILE_FLAGS "-D_DISABLE_EXTENDED_ALIGNED_STORAGE ${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") +@@ -237,7 +241,7 @@ endif() + set(TARGET_COMPILE_FLAGS "${TARGET_COMPILE_FLAGS} ${GOOG_CXX_FLAGS}") set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS ${TARGET_COMPILE_FLAGS}) - -@@ -255,7 +263,7 @@ foreach(ABS_FIL ${ALL_TESTS}) - get_filename_component(FIL_WE ${REL_FIL} NAME_WE) - # Replace slashes as required for CMP0037. - string(REPLACE "/" "." TEST_TARGET_NAME "${DIR}/${FIL_WE}") -- google_test("${TEST_TARGET_NAME}" ${ABS_FIL}) -+ #google_test("${TEST_TARGET_NAME}" ${ABS_FIL}) - if(${BUILD_GRPC}) - target_link_libraries("${TEST_TARGET_NAME}" PUBLIC grpc++) - target_link_libraries("${TEST_TARGET_NAME}" PUBLIC async_grpc) -@@ -263,7 +271,7 @@ foreach(ABS_FIL ${ALL_TESTS}) - if(${BUILD_PROMETHEUS}) - target_link_libraries("${TEST_TARGET_NAME}" PUBLIC prometheus-cpp) +- ++if(0) + set(TEST_LIB + cartographer_test_library + ) +@@ -265,7 +269,7 @@ foreach(ABS_FIL ${ALL_TESTS}) endif() -- target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${TEST_LIB}) -+ #target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${TEST_LIB}) + target_link_libraries("${TEST_TARGET_NAME}" PUBLIC ${TEST_LIB}) endforeach() - +- ++endif() # Add the binary directory first, so that port.h is included after it has + # been generated. + target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/cartographer/common/math.h b/cartographer/common/math.h index c4a77ef..0248f66 100644 --- a/cartographer/common/math.h diff --git a/ports/cartographer/portfile.cmake b/ports/cartographer/portfile.cmake index baff80a7da0aec..50cab69d0a98da 100644 --- a/ports/cartographer/portfile.cmake +++ b/ports/cartographer/portfile.cmake @@ -3,7 +3,7 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO googlecartographer/cartographer - REF 1.0.0 + REF ${VERSION} SHA512 4e3b38ee40d9758cbd51f087578b82efb7d1199b4b7696d31f45938ac06250caaea2b4d85ccb0a848c958ba187a0101ee95c87323ca236c613995b23b215041c HEAD_REF master PATCHES @@ -14,11 +14,6 @@ vcpkg_from_github( vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" - OPTIONS - -DGFLAGS_PREFER_EXPORTED_GFLAGS_CMAKE_CONFIGURATION=OFF - -DGLOG_PREFER_EXPORTED_GLOG_CMAKE_CONFIGURATION=OFF - -Dgtest_disable_pthreads=ON - -DCMAKE_USE_PTHREADS_INIT=OFF OPTIONS_DEBUG -DFORCE_DEBUG_BUILD=True ) @@ -32,5 +27,4 @@ vcpkg_copy_pdbs() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -# Handle copyright of cartographer -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/cartographer/vcpkg.json b/ports/cartographer/vcpkg.json index 9cc51693b099f8..bfd1ce508cc22f 100644 --- a/ports/cartographer/vcpkg.json +++ b/ports/cartographer/vcpkg.json @@ -1,7 +1,7 @@ { "name": "cartographer", "version": "1.0.0", - "port-version": 5, + "port-version": 6, "description": "Google 2D & 3D SLAM package", "homepage": "https://github.com/googlecartographer/cartographer", "dependencies": [ diff --git a/ports/ecal/0008-protobuf-linkage.patch b/ports/ecal/0008-protobuf-linkage.patch new file mode 100644 index 00000000000000..26e77e7173506a --- /dev/null +++ b/ports/ecal/0008-protobuf-linkage.patch @@ -0,0 +1,26 @@ +diff --git a/app/app_pb/CMakeLists.txt b/app/app_pb/CMakeLists.txt +index edd036188..1aae43a81 100644 +--- a/app/app_pb/CMakeLists.txt ++++ b/app/app_pb/CMakeLists.txt +@@ -68,7 +68,7 @@ target_compile_options(${PROJECT_NAME} + + set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) + +-target_link_libraries(${PROJECT_NAME} protobuf::libprotobuf) ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) + + ecal_install_library(${PROJECT_NAME}) +diff --git a/ecal/core_pb/CMakeLists.txt b/ecal/core_pb/CMakeLists.txt +index e8f0704c7..502a92c11 100644 +--- a/ecal/core_pb/CMakeLists.txt ++++ b/ecal/core_pb/CMakeLists.txt +@@ -63,7 +63,7 @@ target_compile_options(${PROJECT_NAME} + + set_property(TARGET ${PROJECT_NAME} PROPERTY POSITION_INDEPENDENT_CODE ON) + +-target_link_libraries(${PROJECT_NAME} protobuf::libprotobuf) ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) + target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_14) + + ecal_install_library(${PROJECT_NAME}) diff --git a/ports/ecal/portfile.cmake b/ports/ecal/portfile.cmake index c8600cdac36d1f..f4b1c0d862c1b1 100644 --- a/ports/ecal/portfile.cmake +++ b/ports/ecal/portfile.cmake @@ -16,6 +16,7 @@ vcpkg_from_github( 0005-remove-install-prefix-macro-value.patch 0006-use-find_dependency-in-cmake-config.patch 0007-allow-static-build-of-core.patch + 0008-protobuf-linkage.patch ) vcpkg_cmake_configure( diff --git a/ports/ecal/vcpkg.json b/ports/ecal/vcpkg.json index 35c836188aa49a..a4b25c494cb2f0 100644 --- a/ports/ecal/vcpkg.json +++ b/ports/ecal/vcpkg.json @@ -1,6 +1,7 @@ { "name": "ecal", "version-semver": "5.12.0", + "port-version": 1, "description": "eCAL - enhanced Communication Abstraction Layer", "homepage": "https://eclipse-ecal.github.io/ecal/", "license": "Apache-2.0", diff --git a/ports/grpc/00001-fix-uwp.patch b/ports/grpc/00001-fix-uwp.patch index 2aea0afd765e2d..e33079b34c68a7 100644 --- a/ports/grpc/00001-fix-uwp.patch +++ b/ports/grpc/00001-fix-uwp.patch @@ -1,8 +1,8 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 25990a5d8a..4bec4e1e72 100644 +index ec370e9..4f7d770 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -219,6 +219,9 @@ if(UNIX) +@@ -237,6 +237,9 @@ if(UNIX) endif() if(WIN32) set(_gRPC_PLATFORM_WINDOWS ON) @@ -11,8 +11,8 @@ index 25990a5d8a..4bec4e1e72 100644 + endif() endif() - # Use C11 standard -@@ -263,6 +266,9 @@ if(MSVC) + if (APPLE AND NOT DEFINED CMAKE_CXX_STANDARD) +@@ -267,6 +270,9 @@ if(MSVC) set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4267") # TODO(jtattermusch): needed to build boringssl with VS2017, revisit later set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4987 /wd4774 /wd4819 /wd4996 /wd4619") @@ -22,7 +22,7 @@ index 25990a5d8a..4bec4e1e72 100644 # Silences thousands of trucation warnings set(_gRPC_C_CXX_FLAGS "${_gRPC_C_CXX_FLAGS} /wd4503") # Tell MSVC to build grpc using utf-8 -@@ -430,6 +436,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR}) +@@ -439,6 +445,10 @@ file(MAKE_DIRECTORY ${_gRPC_PROTO_GENS_DIR}) # ``.proto`` files # function(protobuf_generate_grpc_cpp) @@ -33,7 +33,7 @@ index 25990a5d8a..4bec4e1e72 100644 if(NOT ARGN) message(SEND_ERROR "Error: PROTOBUF_GENERATE_GRPC_CPP() called without any proto files") return() -@@ -552,6 +562,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN) +@@ -561,6 +571,7 @@ if (gRPC_BUILD_GRPC_RUBY_PLUGIN) list(APPEND _gRPC_PLUGIN_LIST grpc_ruby_plugin) endif () @@ -41,7 +41,7 @@ index 25990a5d8a..4bec4e1e72 100644 add_custom_target(plugins DEPENDS ${_gRPC_PLUGIN_LIST} ) -@@ -567,6 +578,7 @@ add_custom_target(tools_cxx +@@ -575,6 +586,7 @@ add_custom_target(tools_cxx add_custom_target(tools DEPENDS tools_c tools_cxx) @@ -50,18 +50,18 @@ index 25990a5d8a..4bec4e1e72 100644 protobuf_generate_grpc_cpp_with_import_path_correction( src/proto/grpc/channelz/channelz.proto src/proto/grpc/channelz/channelz.proto diff --git a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc -index 5d2bdc14de..e9870c2656 100644 +index b034cca..5dbdfe3 100644 --- a/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc +++ b/src/core/lib/security/credentials/alts/check_gcp_environment_windows.cc -@@ -39,6 +39,7 @@ bool check_bios_data(const char*) { return false; } +@@ -40,6 +40,7 @@ bool check_bios_data(const char*) { return false; } bool check_windows_registry_product_name(HKEY root_key, const char* reg_key_path, const char* reg_key_name) { -+#if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP ++ #if !defined(WINAPI_FAMILY) || WINAPI_FAMILY == WINAPI_FAMILY_DESKTOP_APP const size_t kProductNameBufferSize = 256; char const expected_substr[] = "Google"; -@@ -71,6 +72,9 @@ bool check_windows_registry_product_name(HKEY root_key, +@@ -72,6 +73,9 @@ bool check_windows_registry_product_name(HKEY root_key, } return strstr(buffer, expected_substr) != nullptr; diff --git a/ports/grpc/00004-link-gdi32-on-windows.patch b/ports/grpc/00004-link-gdi32-on-windows.patch index 54b55c60b89d65..a3af55facce2ac 100644 --- a/ports/grpc/00004-link-gdi32-on-windows.patch +++ b/ports/grpc/00004-link-gdi32-on-windows.patch @@ -1,13 +1,13 @@ diff --git a/CMakeLists.txt b/CMakeLists.txt -index 25990a5d8a..8a632d2289 100644 +index fce68b9..220f251 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -404,7 +404,7 @@ if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/xds) +@@ -432,7 +432,7 @@ if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/xds) endif() if(WIN32) -- set(_gRPC_BASELIB_LIBRARIES ws2_32 crypt32) -+ set(_gRPC_BASELIB_LIBRARIES wsock32 ws2_32 crypt32 gdi32) +- set(_gRPC_ALLTARGETS_LIBRARIES ${_gRPC_ALLTARGETS_LIBRARIES} ws2_32 crypt32) ++ set(_gRPC_ALLTARGETS_LIBRARIES ${_gRPC_ALLTARGETS_LIBRARIES} wsock32 ws2_32 crypt32 gdi32) + set(_gRPC_STATIC_WIN32 STATIC) endif() - # Create directory for proto source files diff --git a/ports/grpc/00005-fix-uwp-error.patch b/ports/grpc/00005-fix-uwp-error.patch index 23f885d48e485e..69a3e7d646aaaf 100644 --- a/ports/grpc/00005-fix-uwp-error.patch +++ b/ports/grpc/00005-fix-uwp-error.patch @@ -1,10 +1,10 @@ diff --git a/src/core/ext/transport/chttp2/transport/hpack_parser.cc b/src/core/ext/transport/chttp2/transport/hpack_parser.cc -index b0d3a6465b..5c48f1aa30 100644 +index 31bf464..d1007e4 100644 --- a/src/core/ext/transport/chttp2/transport/hpack_parser.cc +++ b/src/core/ext/transport/chttp2/transport/hpack_parser.cc -@@ -1037,7 +1037,7 @@ class HPackParser::Parser { +@@ -689,7 +689,7 @@ class HPackParser::Parser { + } - private: void GPR_ATTRIBUTE_NOINLINE LogHeader(const HPackTable::Memento& memento) { - const char* type; + const char* type = nullptr; @@ -12,7 +12,7 @@ index b0d3a6465b..5c48f1aa30 100644 case LogInfo::kHeaders: type = "HDR"; diff --git a/src/core/lib/slice/slice.cc b/src/core/lib/slice/slice.cc -index 898a62823c..6b31cdc082 100644 +index 6180ef1..a8e8110 100644 --- a/src/core/lib/slice/slice.cc +++ b/src/core/lib/slice/slice.cc @@ -188,6 +188,7 @@ grpc_slice grpc_slice_from_moved_buffer(grpc_core::UniquePtr<char> p, @@ -33,10 +33,10 @@ index 898a62823c..6b31cdc082 100644 slice.refcount = nullptr; slice.data.inlined.length = str.size(); diff --git a/src/core/lib/surface/server.cc b/src/core/lib/surface/server.cc -index 141b16e345..89d9d6dafd 100644 +index 3dda49d..202caa5 100644 --- a/src/core/lib/surface/server.cc +++ b/src/core/lib/surface/server.cc -@@ -902,7 +902,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) { +@@ -1057,7 +1057,7 @@ grpc_call_error Server::QueueRequestedCall(size_t cq_idx, RequestedCall* rc) { FailCall(cq_idx, rc, GRPC_ERROR_CREATE("Server Shutdown")); return GRPC_CALL_OK; } diff --git a/ports/grpc/00009-use-system-upb.patch b/ports/grpc/00009-use-system-upb.patch index 8bafe8452b2eb8..c85a9bd50337e6 100644 --- a/ports/grpc/00009-use-system-upb.patch +++ b/ports/grpc/00009-use-system-upb.patch @@ -1,91 +1,106 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 23098aa578..a8e8bc274b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -85,6 +85,9 @@ set_property(CACHE gRPC_SSL_PROVIDER PROPERTY STRINGS "module" "package") - set(gRPC_PROTOBUF_PROVIDER "module" CACHE STRING "Provider of protobuf library") - set_property(CACHE gRPC_PROTOBUF_PROVIDER PROPERTY STRINGS "module" "package") - -+set(gRPC_UPB_PROVIDER "module" CACHE STRING "Provider of upb library") -+set_property(CACHE gRPC_UPB_PROVIDER PROPERTY STRINGS "module" "package") -+ - set(gRPC_PROTOBUF_PACKAGE_TYPE "" CACHE STRING "Algorithm for searching protobuf package") - set_property(CACHE gRPC_PROTOBUF_PACKAGE_TYPE PROPERTY STRINGS "CONFIG" "MODULE") - -@@ -1631,6 +1634,7 @@ target_link_libraries(gpr - absl::time - absl::optional - absl::variant -+ ${_gRPC_UPB_LIBRARIES} - ) - if(_gRPC_PLATFORM_ANDROID) - target_link_libraries(gpr -@@ -2435,7 +2439,6 @@ target_link_libraries(grpc - gpr - ${_gRPC_SSL_LIBRARIES} - address_sorting -- upb - ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc "-framework CoreFoundation") -@@ -2979,7 +2982,6 @@ target_link_libraries(grpc_unsecure - absl::utility - gpr - address_sorting -- upb - ) - if(_gRPC_PLATFORM_IOS OR _gRPC_PLATFORM_MAC) - target_link_libraries(grpc_unsecure "-framework CoreFoundation") -@@ -4251,6 +4253,7 @@ endif() - - endif() - -+if (gRPC_UPB_PROVIDER STREQUAL "module") - add_library(upb - third_party/upb/third_party/utf8_range/naive.c - third_party/upb/third_party/utf8_range/range2-neon.c -@@ -4319,7 +4322,7 @@ if(gRPC_INSTALL) - ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} - ) - endif() -- -+endif() - - if(gRPC_BUILD_TESTS) - -diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in -index 3623f4aa5e..df6ced560e 100644 ---- a/cmake/gRPCConfig.cmake.in -+++ b/cmake/gRPCConfig.cmake.in -@@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) - @_gRPC_FIND_CARES@ - @_gRPC_FIND_ABSL@ - @_gRPC_FIND_RE2@ -+@_gRPC_FIND_UPB@ - - # Targets - include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) -diff --git a/cmake/upb.cmake b/cmake/upb.cmake -index f2a0e508c3..09751f5ef0 100644 ---- a/cmake/upb.cmake -+++ b/cmake/upb.cmake -@@ -12,9 +12,19 @@ - # See the License for the specific language governing permissions and - # limitations under the License. - -+set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated") -+if (gRPC_UPB_PROVIDER STREQUAL "module") -+ - set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb) - - set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}") - set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-generated" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-generated") - - set(_gRPC_UPB_LIBRARIES upb) -+ -+elseif(gRPC_UPB_PROVIDER STREQUAL "package") -+ find_package(upb CONFIG REQUIRED) -+ set(_gRPC_UPB_LIBRARIES upb::fastdecode upb::json upb::upb upb::utf8_range upb::textformat upb::reflection upb::descriptor_upb_proto) -+ set(_gRPC_UPB_INCLUDE_DIR) -+ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()") -+endif() +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a3b39a1637..8c1dc7223d 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -3455,7 +3455,7 @@ target_link_libraries(gtest + + endif() + +- ++if (0) + add_library(upb ${_gRPC_STATIC_WIN32} + third_party/upb/upb/base/status.c + third_party/upb/upb/mem/alloc.c +@@ -3818,6 +3818,7 @@ if(gRPC_INSTALL) + ARCHIVE DESTINATION ${gRPC_INSTALL_LIBDIR} + ) + endif() ++endif() + + if(gRPC_BUILD_TESTS) + +@@ -30412,9 +30413,9 @@ generate_pkgconfig( + "high performance general RPC framework" + "${gRPC_CORE_VERSION}" + "absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr" +- "libcares openssl re2 zlib" ++ "libcares openssl re2 zlib utf8_range" + "-lgrpc" +- "-laddress_sorting -lupb -lupb_textformat_lib -lupb_json_lib -lutf8_range_lib -lupb_collections_lib" ++ "-laddress_sorting -lupb" + "grpc.pc") + + # grpc_unsecure .pc file +@@ -30423,9 +30424,9 @@ generate_pkgconfig( + "high performance general RPC framework without SSL" + "${gRPC_CORE_VERSION}" + "absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr" +- "libcares zlib" ++ "libcares zlib utf8_range" + "-lgrpc_unsecure" +- "-laddress_sorting -lutf8_range_lib -lupb -lupb_collections_lib" ++ "-laddress_sorting -lupb" + "grpc_unsecure.pc") + + # grpc++ .pc file +@@ -30434,9 +30435,9 @@ generate_pkgconfig( + "C++ wrapper for gRPC" + "${gRPC_CPP_VERSION}" + "absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc" +- "libcares openssl re2 zlib" ++ "libcares openssl re2 zlib utf8_range" + "-lgrpc++" +- "-laddress_sorting -lupb -lupb_textformat_lib -lupb_json_lib -lutf8_range_lib -lupb_collections_lib" ++ "-laddress_sorting -lupb" + "grpc++.pc") + + # grpc++_unsecure .pc file +@@ -30445,7 +30446,7 @@ generate_pkgconfig( + "C++ wrapper for gRPC without SSL" + "${gRPC_CPP_VERSION}" + "absl_algorithm_container absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flags absl_flags_marshalling absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_bit_gen_ref absl_random_distributions absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant gpr grpc_unsecure" +- "libcares zlib" ++ "libcares zlib utf8_range" + "-lgrpc++_unsecure" +- "-laddress_sorting -lutf8_range_lib -lupb -lupb_collections_lib" ++ "-laddress_sorting -lupb" + "grpc++_unsecure.pc") +diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in +index 98d8c6d8b9..7cad2abca1 100644 +--- a/cmake/gRPCConfig.cmake.in ++++ b/cmake/gRPCConfig.cmake.in +@@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) + @_gRPC_FIND_CARES@ + @_gRPC_FIND_ABSL@ + @_gRPC_FIND_RE2@ ++@_gRPC_FIND_UPB@ + + # Targets + include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) +diff --git a/cmake/upb.cmake b/cmake/upb.cmake +index 9156e5f48f..6ff5125938 100644 +--- a/cmake/upb.cmake ++++ b/cmake/upb.cmake +@@ -12,9 +12,21 @@ + # See the License for the specific language governing permissions and + # limitations under the License. + ++set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-gen" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-gen") ++if (0) + set(UPB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/upb) + + set(_gRPC_UPB_INCLUDE_DIR "${UPB_ROOT_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range") + set(_gRPC_UPB_GRPC_GENERATED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upb-gen" "${CMAKE_CURRENT_SOURCE_DIR}/src/core/ext/upbdefs-gen") + + set(_gRPC_UPB_LIBRARIES upb) ++else() ++ find_package(upb CONFIG REQUIRED) ++ set(_gRPC_UPB_INCLUDE_DIR) ++ set(_gRPC_FIND_UPB "if(NOT upb_FOUND)\n find_package(upb CONFIG REQUIRED)\nendif()") ++ add_library(upb_collections_lib ALIAS upb::upb) ++ add_library(upb_json_lib ALIAS upb::upb) ++ add_library(upb_textformat_lib ALIAS upb::upb) ++ add_library(upb ALIAS upb::upb) ++ add_library(utf8_range_lib ALIAS utf8_range::utf8_range) ++endif() +\ No newline at end of file diff --git a/ports/grpc/00012-fix-use-cxx17.patch b/ports/grpc/00012-fix-use-cxx17.patch deleted file mode 100644 index 56bc4367608e2c..00000000000000 --- a/ports/grpc/00012-fix-use-cxx17.patch +++ /dev/null @@ -1,16 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 25990a5d8a..ba8df92858 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -326,6 +326,11 @@ include(cmake/xxhash.cmake) - include(cmake/zlib.cmake) - include(cmake/download_archive.cmake) - -+if (ABSL_USE_CXX17) -+ message(STATUS "Found absl uses CXX17, enable CXX17 feature.") -+ set(CMAKE_CXX_STANDARD 17) -+endif() -+ - # Setup external proto library at third_party/envoy-api with 2 download URLs - if (NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/third_party/envoy-api) - # Download the archive via HTTP, validate the checksum, and extract to third_party/envoy-api. diff --git a/ports/grpc/00014-pkgconfig-upbdefs.patch b/ports/grpc/00014-pkgconfig-upbdefs.patch deleted file mode 100644 index 1c2bda5b1b942f..00000000000000 --- a/ports/grpc/00014-pkgconfig-upbdefs.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 48019cce95..1eda700ae8 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -23186,7 +23186,7 @@ generate_pkgconfig( - "high performance general RPC framework" - "${gRPC_CORE_VERSION}" - "gpr openssl absl_any_invocable absl_base absl_bind_front absl_cleanup absl_cord absl_core_headers absl_flat_hash_map absl_flat_hash_set absl_function_ref absl_hash absl_inlined_vector absl_memory absl_optional absl_random_random absl_span absl_status absl_statusor absl_str_format absl_strings absl_synchronization absl_time absl_type_traits absl_utility absl_variant" -- "-lgrpc -laddress_sorting -lre2 -lupb -lcares -lz" -+ "-lgrpc -laddress_sorting -lre2 -lupb_textformat -lupb_mini_table -lupb -lupb_collections -lupb_reflection -lupb_extension_registry -lupb_json -lupb_fastdecode -lupb_utf8_range -ldescriptor_upb_proto -lcares -lz" - "" - "grpc.pc") - diff --git a/ports/grpc/00015-disable-download-archive.patch b/ports/grpc/00015-disable-download-archive.patch index b28bc72a7c9103..675c2519dcf4a0 100644 --- a/ports/grpc/00015-disable-download-archive.patch +++ b/ports/grpc/00015-disable-download-archive.patch @@ -1,5 +1,5 @@ diff --git a/cmake/download_archive.cmake b/cmake/download_archive.cmake -index 820aafafb7..a59b785c7e 100644 +index 820aafa..a59b785 100644 --- a/cmake/download_archive.cmake +++ b/cmake/download_archive.cmake @@ -19,6 +19,7 @@ file(MAKE_DIRECTORY ${_download_archive_TEMPORARY_DIR}) diff --git a/ports/grpc/00016-fix-plugin-targets.patch b/ports/grpc/00016-fix-plugin-targets.patch new file mode 100644 index 00000000000000..ce7924ceb1e17b --- /dev/null +++ b/ports/grpc/00016-fix-plugin-targets.patch @@ -0,0 +1,12 @@ +diff --git a/cmake/gRPCConfig.cmake.in b/cmake/gRPCConfig.cmake.in +index 7cad2abca1..c287f3b413 100644 +--- a/cmake/gRPCConfig.cmake.in ++++ b/cmake/gRPCConfig.cmake.in +@@ -12,6 +12,6 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/modules) + + # Targets + include(${CMAKE_CURRENT_LIST_DIR}/gRPCTargets.cmake) +-if(NOT CMAKE_CROSSCOMPILING) ++if(@gRPC_BUILD_CODEGEN@) + include(${CMAKE_CURRENT_LIST_DIR}/gRPCPluginTargets.cmake) + endif() diff --git a/ports/grpc/00016_add_header.patch b/ports/grpc/00016_add_header.patch deleted file mode 100644 index ba166a5ee36bc7..00000000000000 --- a/ports/grpc/00016_add_header.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/core/lib/iomgr/tcp_posix.cc b/src/core/lib/iomgr/tcp_posix.cc -index 72e1b66..8dc1fd1 100644 ---- a/src/core/lib/iomgr/tcp_posix.cc -+++ b/src/core/lib/iomgr/tcp_posix.cc -@@ -47,6 +47,7 @@ - #include <grpc/support/string_util.h> - #include <grpc/support/sync.h> - #include <grpc/support/time.h> -+#include <absl/strings/str_cat.h> - - #include "src/core/lib/address_utils/sockaddr_utils.h" - #include "src/core/lib/debug/event_log.h" diff --git a/ports/grpc/00017-abseil.patch b/ports/grpc/00017-abseil.patch new file mode 100644 index 00000000000000..4fd424cd912173 --- /dev/null +++ b/ports/grpc/00017-abseil.patch @@ -0,0 +1,36 @@ +diff --git a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +index dde7570ede..43e06d7a69 100644 +--- a/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc ++++ b/src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc +@@ -32,6 +32,7 @@ + #include "absl/strings/string_view.h" + #include "absl/strings/strip.h" + #include "absl/types/optional.h" ++#include "absl/strings/str_cat.h" + + #include <grpc/impl/channel_arg_names.h> + #include <grpc/support/alloc.h> +diff --git a/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc b/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +index 74f7392af9..656cdc427b 100644 +--- a/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc ++++ b/src/core/lib/event_engine/cf_engine/cfstream_endpoint.cc +@@ -21,6 +21,7 @@ + #include "src/core/lib/event_engine/cf_engine/cfstream_endpoint.h" + #include "src/core/lib/event_engine/trace.h" + #include "src/core/lib/gprpp/strerror.h" ++#include "absl/strings/str_cat.h" + + namespace grpc_event_engine { + namespace experimental { +diff --git a/src/core/lib/gprpp/windows/directory_reader.cc b/src/core/lib/gprpp/windows/directory_reader.cc +index 790e213e78..103d68a5a3 100644 +--- a/src/core/lib/gprpp/windows/directory_reader.cc ++++ b/src/core/lib/gprpp/windows/directory_reader.cc +@@ -28,6 +28,7 @@ + + #include "absl/status/statusor.h" + #include "absl/strings/string_view.h" ++#include "absl/strings/str_cat.h" + + #include <grpc/support/log.h> + diff --git a/ports/grpc/portfile.cmake b/ports/grpc/portfile.cmake index 9653bb09561060..402905a53c5dcf 100644 --- a/ports/grpc/portfile.cmake +++ b/ports/grpc/portfile.cmake @@ -5,8 +5,8 @@ endif() vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO grpc/grpc - REF v1.51.1 - SHA512 1bc8e7a5a15b2dca88527d111cde398b0dc1921bbc945c6df8225b4225b8ac0b43155bcf743230ce7b5962d1ab948e9363229c98a879b1befc7a939a290fb888 + REF "v${VERSION}" + SHA512 91c2406ed4198509ac0d5360b3da6898fa4f40f459eb6fff541faa44cc238eed98fd7489e7ef7a80a6f4a318bc5b9130eaa0ba1beaa358d1c074fc82825648ff HEAD_REF master PATCHES 00001-fix-uwp.patch @@ -15,11 +15,9 @@ vcpkg_from_github( 00004-link-gdi32-on-windows.patch 00005-fix-uwp-error.patch 00009-use-system-upb.patch - snprintf.patch - 00012-fix-use-cxx17.patch - 00014-pkgconfig-upbdefs.patch 00015-disable-download-archive.patch - 00016_add_header.patch + 00016-fix-plugin-targets.patch + 00017-abseil.patch ) if(NOT TARGET_TRIPLET STREQUAL HOST_TRIPLET) @@ -52,9 +50,7 @@ vcpkg_cmake_configure( -DgRPC_SSL_PROVIDER=package -DgRPC_PROTOBUF_PROVIDER=package -DgRPC_ABSL_PROVIDER=package - -DgRPC_UPB_PROVIDER=package -DgRPC_RE2_PROVIDER=package - -DgRPC_PROTOBUF_PACKAGE_TYPE=CONFIG -DgRPC_CARES_PROVIDER=${cares_CARES_PROVIDER} -DgRPC_BENCHMARK_PROVIDER=none -DgRPC_INSTALL_BINDIR:STRING=bin @@ -96,4 +92,4 @@ else() vcpkg_fixup_pkgconfig() endif() -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/grpc/snprintf.patch b/ports/grpc/snprintf.patch deleted file mode 100644 index b5012ad2dba8bf..00000000000000 --- a/ports/grpc/snprintf.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff --git a/src/core/tsi/alts/crypt/aes_gcm.cc b/src/core/tsi/alts/crypt/aes_gcm.cc -index b761224..88a3d6b 100644 ---- a/src/core/tsi/alts/crypt/aes_gcm.cc -+++ b/src/core/tsi/alts/crypt/aes_gcm.cc -@@ -19,6 +19,7 @@ - #include <grpc/support/port_platform.h> - - #include <string.h> -+#include <cstdio> - - #include <openssl/bio.h> - #include <openssl/buffer.h> diff --git a/ports/grpc/vcpkg.json b/ports/grpc/vcpkg.json index 8647b3fb298e59..7192d0ae2e5ef6 100644 --- a/ports/grpc/vcpkg.json +++ b/ports/grpc/vcpkg.json @@ -1,7 +1,6 @@ { "name": "grpc", - "version-semver": "1.51.1", - "port-version": 3, + "version-semver": "1.60.0", "description": "gRPC is a modern, open source, high-performance remote procedure call (RPC) framework that can run anywhere. gRPC enables client and server applications to communicate transparently, and simplifies the building of connected systems.", "homepage": "https://github.com/grpc/grpc", "license": "Apache-2.0", diff --git a/ports/gz-transport12/portfile.cmake b/ports/gz-transport12/portfile.cmake index 0cc1e635bf639f..0a9c99f0726cc6 100644 --- a/ports/gz-transport12/portfile.cmake +++ b/ports/gz-transport12/portfile.cmake @@ -4,7 +4,7 @@ ignition_modular_library( NAME ${PACKAGE_NAME} REF ${PORT}_${VERSION} VERSION ${VERSION} - SHA512 8f0c02b76579679d40b16bd19796e8ac84eaace6c70889fc703d4c234970be130ca1dd18f047c0b40acd46e8f9291f199b8558329a75a33fc61c235dfcb79f4d + SHA512 734d4c2eccf42a3a5a665611c44ccb450bf290763bcf8dc169b16c0c5c5c7d7be6b3cb69c69a5ef64a502b411fdb1461f036c660d8d9188146e61cf8f4beead8 OPTIONS PATCHES uuid-osx.patch diff --git a/ports/gz-transport12/vcpkg.json b/ports/gz-transport12/vcpkg.json index 43e3a8e708c1cb..639e493fe76a5b 100644 --- a/ports/gz-transport12/vcpkg.json +++ b/ports/gz-transport12/vcpkg.json @@ -1,6 +1,6 @@ { "name": "gz-transport12", - "version": "12.2.0", + "version": "12.2.1", "description": "Transport middleware for robotics", "license": null, "dependencies": [ diff --git a/ports/ignition-msgs1/fix-protobuf-version.patch b/ports/ignition-msgs1/fix-protobuf-version.patch new file mode 100644 index 00000000000000..e902d1ea09f08f --- /dev/null +++ b/ports/ignition-msgs1/fix-protobuf-version.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2eeb011..e8ffcc9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,7 +39,6 @@ else() + set(PROTOBUF_PURPOSE) + endif() + ign_find_package(IgnProtobuf +- VERSION ${REQ_PROTOBUF_VER} + PKGCONFIG protobuf + PKGCONFIG_VER_COMPARISON >= + REQUIRED diff --git a/ports/ignition-msgs1/portfile.cmake b/ports/ignition-msgs1/portfile.cmake index 058c5996cad425..d1cecc700c150e 100644 --- a/ports/ignition-msgs1/portfile.cmake +++ b/ports/ignition-msgs1/portfile.cmake @@ -20,4 +20,5 @@ ignition_modular_library(NAME msgs # Fix linking order of protobuf libraries (backport of https://bitbucket.org/ignitionrobotics/ign-msgs/pull-requests/151) PATCHES fix-protobuf-static-link-order.patch - fix-Add_std_string.patch) + fix-Add_std_string.patch + fix-protobuf-version.patch) diff --git a/ports/ignition-msgs1/vcpkg.json b/ports/ignition-msgs1/vcpkg.json index 903b1fcebe8633..7a507a65df2a24 100644 --- a/ports/ignition-msgs1/vcpkg.json +++ b/ports/ignition-msgs1/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ignition-msgs1", "version": "1.0.0", - "port-version": 6, + "port-version": 7, "description": "Middleware protobuf messages for robotics", "license": "Apache-2.0", "dependencies": [ diff --git a/ports/ignition-msgs5/03-protobuf-version.patch b/ports/ignition-msgs5/03-protobuf-version.patch new file mode 100644 index 00000000000000..41b61abc8e466f --- /dev/null +++ b/ports/ignition-msgs5/03-protobuf-version.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 62b56b1..5765fd6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -31,7 +31,6 @@ message(STATUS "\n\n-- ====== Finding Dependencies ======") + # Find Protobuf + set(REQ_PROTOBUF_VER 3) + ign_find_package(IgnProtobuf +- VERSION ${REQ_PROTOBUF_VER} + REQUIRED + COMPONENTS all + PRETTY Protobuf) diff --git a/ports/ignition-msgs5/portfile.cmake b/ports/ignition-msgs5/portfile.cmake index 494a71795f2ee4..eef76b8161c93b 100644 --- a/ports/ignition-msgs5/portfile.cmake +++ b/ports/ignition-msgs5/portfile.cmake @@ -6,4 +6,5 @@ ignition_modular_library(NAME msgs SHA512 645ae5317fb4c3c1b452e98c3581363fc939b5b963dae8a2097bcee97584819bd80357397d88728c5917142dd4ac9beecc335862df44fc06a46d8aa62c54e389 PATCHES "01-protobuf.patch" - "02-Add_std_string.patch") + "02-Add_std_string.patch" + "03-protobuf-version.patch") diff --git a/ports/ignition-msgs5/vcpkg.json b/ports/ignition-msgs5/vcpkg.json index d5cb928c7729a7..36714db45e1adb 100644 --- a/ports/ignition-msgs5/vcpkg.json +++ b/ports/ignition-msgs5/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ignition-msgs5", "version": "5.3.0", - "port-version": 6, + "port-version": 7, "description": "Middleware protobuf messages for robotics", "license": "Apache-2.0", "supports": "!(arm | uwp)", diff --git a/ports/ignition-msgs6/02-protobuf-version.patch b/ports/ignition-msgs6/02-protobuf-version.patch new file mode 100644 index 00000000000000..32d92c50de42d2 --- /dev/null +++ b/ports/ignition-msgs6/02-protobuf-version.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 27f747a..a02d312 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,7 +58,6 @@ message(STATUS "\n\n-- ====== Finding Dependencies ======") + # Find Protobuf + set(REQ_PROTOBUF_VER 3) + ign_find_package(IgnProtobuf +- VERSION ${REQ_PROTOBUF_VER} + REQUIRED + COMPONENTS all + PRETTY Protobuf) diff --git a/ports/ignition-msgs6/portfile.cmake b/ports/ignition-msgs6/portfile.cmake index 7b2e50932a2b01..4d340a19b458c0 100644 --- a/ports/ignition-msgs6/portfile.cmake +++ b/ports/ignition-msgs6/portfile.cmake @@ -4,4 +4,4 @@ ignition_modular_library(NAME msgs VERSION "6.0.0" SHA512 d7b76b61d37bc4bb2fd1319e2e2d8313fbcc52f51253b7c487bcdb7dabffcf50653fc5c709eb356d8b6ae20500c1fd32ffabc1fcfb28dd14346a10030fb6cd46 - PATCHES 01-Add_std_string.patch) + PATCHES 01-Add_std_string.patch 02-protobuf-version.patch) diff --git a/ports/ignition-msgs6/vcpkg.json b/ports/ignition-msgs6/vcpkg.json index 715b1ad12ce961..c0814ef5b4f9f6 100644 --- a/ports/ignition-msgs6/vcpkg.json +++ b/ports/ignition-msgs6/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ignition-msgs6", "version": "6.0.0", - "port-version": 5, + "port-version": 6, "description": "Middleware protobuf messages for robotics", "license": "Apache-2.0", "supports": "!(arm | uwp)", diff --git a/ports/ignition-transport4/fix-protobuf.patch b/ports/ignition-transport4/fix-protobuf.patch new file mode 100644 index 00000000000000..6db3a459cae707 --- /dev/null +++ b/ports/ignition-transport4/fix-protobuf.patch @@ -0,0 +1,62 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 5453cd07..c00e7329 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -39,7 +39,6 @@ else() + set(PROTOBUF_PURPOSE) + endif() + ign_find_package(IgnProtobuf +- VERSION ${REQ_PROTOBUF_VER} + REQUIRED + PRETTY Protobuf + PURPOSE ${PROTOBUF_PURPOSE}) +diff --git a/include/ignition/transport/RepHandler.hh b/include/ignition/transport/RepHandler.hh +index 1163c3eb..e2cb5ca0 100644 +--- a/include/ignition/transport/RepHandler.hh ++++ b/include/ignition/transport/RepHandler.hh +@@ -26,7 +26,7 @@ + #pragma warning(pop) + #endif + +-#if GOOGLE_PROTOBUF_VERSION > 2999999 ++#if GOOGLE_PROTOBUF_VERSION > 2999999 && GOOGLE_PROTOBUF_VERSION < 4022000 + #include <google/protobuf/stubs/casts.h> + #endif + +@@ -127,7 +127,11 @@ namespace ignition + return false; + } + +-#if GOOGLE_PROTOBUF_VERSION > 2999999 ++#if GOOGLE_PROTOBUF_VERSION >= 4022000 ++ auto msgReq = ++ google::protobuf::internal::DownCast<const Req*>(&_msgReq); ++ auto msgRep = google::protobuf::internal::DownCast<Rep*>(&_msgRep); ++#elif GOOGLE_PROTOBUF_VERSION > 2999999 + auto msgReq = google::protobuf::down_cast<const Req*>(&_msgReq); + auto msgRep = google::protobuf::down_cast<Rep*>(&_msgRep); + #else +diff --git a/include/ignition/transport/SubscriptionHandler.hh b/include/ignition/transport/SubscriptionHandler.hh +index d9fbd224..22486730 100644 +--- a/include/ignition/transport/SubscriptionHandler.hh ++++ b/include/ignition/transport/SubscriptionHandler.hh +@@ -28,7 +28,7 @@ + + #include <google/protobuf/stubs/common.h> + +-#if GOOGLE_PROTOBUF_VERSION >= 3000000 ++#if GOOGLE_PROTOBUF_VERSION >= 3000000 && GOOGLE_PROTOBUF_VERSION < 4022000 + #include <google/protobuf/stubs/casts.h> + #endif + +@@ -198,7 +198,9 @@ namespace ignition + if (!this->UpdateThrottling()) + return true; + +-#if GOOGLE_PROTOBUF_VERSION >= 3000000 ++#if GOOGLE_PROTOBUF_VERSION >= 4022000 ++ auto msgPtr = google::protobuf::internal::DownCast<const T*>(&_msg); ++#elif GOOGLE_PROTOBUF_VERSION >= 3000000 + auto msgPtr = google::protobuf::down_cast<const T*>(&_msg); + #else + auto msgPtr = google::protobuf::internal::down_cast<const T*>(&_msg); diff --git a/ports/ignition-transport4/portfile.cmake b/ports/ignition-transport4/portfile.cmake index 0f70168c9e1e8e..bb951537a3ea53 100644 --- a/ports/ignition-transport4/portfile.cmake +++ b/ports/ignition-transport4/portfile.cmake @@ -5,4 +5,5 @@ ignition_modular_library(NAME transport DISABLE_PKGCONFIG_INSTALL PATCHES uuid-osx.patch + fix-protobuf.patch ) diff --git a/ports/ignition-transport4/vcpkg.json b/ports/ignition-transport4/vcpkg.json index 2658f13ee1b744..a9a2cb21cd4411 100644 --- a/ports/ignition-transport4/vcpkg.json +++ b/ports/ignition-transport4/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ignition-transport4", "version": "4.0.0", - "port-version": 6, + "port-version": 7, "description": "Transport middleware for robotics", "license": null, "dependencies": [ diff --git a/ports/ignition-transport8/fix-protobuf.patch b/ports/ignition-transport8/fix-protobuf.patch new file mode 100644 index 00000000000000..4c82c33084fcf8 --- /dev/null +++ b/ports/ignition-transport8/fix-protobuf.patch @@ -0,0 +1,62 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cbf24cba..f2ba7ae6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -38,7 +38,6 @@ message(STATUS "\n\n-- ====== Finding Dependencies ======") + # Find Protobuf + set(REQ_PROTOBUF_VER 3) + ign_find_package(IgnProtobuf +- VERSION ${REQ_PROTOBUF_VER} + REQUIRED + PRETTY Protobuf) + +diff --git a/include/ignition/transport/RepHandler.hh b/include/ignition/transport/RepHandler.hh +index e826fd6b..4719aa4b 100644 +--- a/include/ignition/transport/RepHandler.hh ++++ b/include/ignition/transport/RepHandler.hh +@@ -26,7 +26,7 @@ + #pragma warning(pop) + #endif + +-#if GOOGLE_PROTOBUF_VERSION > 2999999 ++#if GOOGLE_PROTOBUF_VERSION > 2999999 && GOOGLE_PROTOBUF_VERSION < 4022000 + #include <google/protobuf/stubs/casts.h> + #endif + +@@ -140,7 +140,11 @@ namespace ignition + return false; + } + +-#if GOOGLE_PROTOBUF_VERSION > 2999999 ++#if GOOGLE_PROTOBUF_VERSION >= 4022000 ++ auto msgReq = ++ google::protobuf::internal::DownCast<const Req*>(&_msgReq); ++ auto msgRep = google::protobuf::internal::DownCast<Rep*>(&_msgRep); ++#elif GOOGLE_PROTOBUF_VERSION > 2999999 + auto msgReq = google::protobuf::down_cast<const Req*>(&_msgReq); + auto msgRep = google::protobuf::down_cast<Rep*>(&_msgRep); + #else +diff --git a/include/ignition/transport/SubscriptionHandler.hh b/include/ignition/transport/SubscriptionHandler.hh +index 96811afe..a8d7ebcd 100644 +--- a/include/ignition/transport/SubscriptionHandler.hh ++++ b/include/ignition/transport/SubscriptionHandler.hh +@@ -28,7 +28,7 @@ + + #include <google/protobuf/stubs/common.h> + +-#if GOOGLE_PROTOBUF_VERSION >= 3000000 ++#if GOOGLE_PROTOBUF_VERSION >= 3000000 && GOOGLE_PROTOBUF_VERSION < 4022000 + #include <google/protobuf/stubs/casts.h> + #endif + +@@ -211,7 +211,9 @@ namespace ignition + if (!this->UpdateThrottling()) + return true; + +-#if GOOGLE_PROTOBUF_VERSION >= 3000000 ++#if GOOGLE_PROTOBUF_VERSION >= 4022000 ++ auto msgPtr = google::protobuf::internal::DownCast<const T*>(&_msg); ++#elif GOOGLE_PROTOBUF_VERSION >= 3000000 + auto msgPtr = google::protobuf::down_cast<const T*>(&_msg); + #else + auto msgPtr = google::protobuf::internal::down_cast<const T*>(&_msg); diff --git a/ports/ignition-transport8/portfile.cmake b/ports/ignition-transport8/portfile.cmake index 7ca8513e7cb022..f0a71a2ce0cc46 100644 --- a/ports/ignition-transport8/portfile.cmake +++ b/ports/ignition-transport8/portfile.cmake @@ -1,3 +1,6 @@ ignition_modular_library(NAME transport VERSION "8.1.0" - SHA512 04b4cd954453505398da35b284e7db4b4691d9a705924c41e0082fd20e94176a3eaeae7329fd9992aaa50f90b2d8973c71daf763ccff58aa30d06be1da15189a) + SHA512 04b4cd954453505398da35b284e7db4b4691d9a705924c41e0082fd20e94176a3eaeae7329fd9992aaa50f90b2d8973c71daf763ccff58aa30d06be1da15189a + PATCHES + fix-protobuf.patch + ) diff --git a/ports/ignition-transport8/vcpkg.json b/ports/ignition-transport8/vcpkg.json index 52bcedab152044..d123372d9fa932 100644 --- a/ports/ignition-transport8/vcpkg.json +++ b/ports/ignition-transport8/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ignition-transport8", "version": "8.1.0", - "port-version": 4, + "port-version": 5, "description": "Transport middleware for robotics", "license": null, "dependencies": [ diff --git a/ports/ignition-transport9/fix-protobuf.patch b/ports/ignition-transport9/fix-protobuf.patch new file mode 100644 index 00000000000000..13d49c3ea7540a --- /dev/null +++ b/ports/ignition-transport9/fix-protobuf.patch @@ -0,0 +1,62 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 084b6daf..a5501b5b 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -38,7 +38,6 @@ message(STATUS "\n\n-- ====== Finding Dependencies ======") + # Find Protobuf + set(REQ_PROTOBUF_VER 3) + ign_find_package(IgnProtobuf +- VERSION ${REQ_PROTOBUF_VER} + REQUIRED + PRETTY Protobuf) + +diff --git a/include/ignition/transport/RepHandler.hh b/include/ignition/transport/RepHandler.hh +index e826fd6b..4719aa4b 100644 +--- a/include/ignition/transport/RepHandler.hh ++++ b/include/ignition/transport/RepHandler.hh +@@ -26,7 +26,7 @@ + #pragma warning(pop) + #endif + +-#if GOOGLE_PROTOBUF_VERSION > 2999999 ++#if GOOGLE_PROTOBUF_VERSION > 2999999 && GOOGLE_PROTOBUF_VERSION < 4022000 + #include <google/protobuf/stubs/casts.h> + #endif + +@@ -140,7 +140,11 @@ namespace ignition + return false; + } + +-#if GOOGLE_PROTOBUF_VERSION > 2999999 ++#if GOOGLE_PROTOBUF_VERSION >= 4022000 ++ auto msgReq = ++ google::protobuf::internal::DownCast<const Req*>(&_msgReq); ++ auto msgRep = google::protobuf::internal::DownCast<Rep*>(&_msgRep); ++#elif GOOGLE_PROTOBUF_VERSION > 2999999 + auto msgReq = google::protobuf::down_cast<const Req*>(&_msgReq); + auto msgRep = google::protobuf::down_cast<Rep*>(&_msgRep); + #else +diff --git a/include/ignition/transport/SubscriptionHandler.hh b/include/ignition/transport/SubscriptionHandler.hh +index 96811afe..a8d7ebcd 100644 +--- a/include/ignition/transport/SubscriptionHandler.hh ++++ b/include/ignition/transport/SubscriptionHandler.hh +@@ -28,7 +28,7 @@ + + #include <google/protobuf/stubs/common.h> + +-#if GOOGLE_PROTOBUF_VERSION >= 3000000 ++#if GOOGLE_PROTOBUF_VERSION >= 3000000 && GOOGLE_PROTOBUF_VERSION < 4022000 + #include <google/protobuf/stubs/casts.h> + #endif + +@@ -211,7 +211,9 @@ namespace ignition + if (!this->UpdateThrottling()) + return true; + +-#if GOOGLE_PROTOBUF_VERSION >= 3000000 ++#if GOOGLE_PROTOBUF_VERSION >= 4022000 ++ auto msgPtr = google::protobuf::internal::DownCast<const T*>(&_msg); ++#elif GOOGLE_PROTOBUF_VERSION >= 3000000 + auto msgPtr = google::protobuf::down_cast<const T*>(&_msg); + #else + auto msgPtr = google::protobuf::internal::down_cast<const T*>(&_msg); diff --git a/ports/ignition-transport9/portfile.cmake b/ports/ignition-transport9/portfile.cmake index 0396815664ae87..4eb81e5035f378 100644 --- a/ports/ignition-transport9/portfile.cmake +++ b/ports/ignition-transport9/portfile.cmake @@ -5,4 +5,5 @@ ignition_modular_library(NAME transport DISABLE_PKGCONFIG_INSTALL PATCHES uuid-osx.patch + fix-protobuf.patch ) diff --git a/ports/ignition-transport9/vcpkg.json b/ports/ignition-transport9/vcpkg.json index 59e5483f49522f..42bcdcc477c748 100644 --- a/ports/ignition-transport9/vcpkg.json +++ b/ports/ignition-transport9/vcpkg.json @@ -1,7 +1,7 @@ { "name": "ignition-transport9", "version": "9.0.0", - "port-version": 4, + "port-version": 5, "description": "Transport middleware for robotics", "license": null, "dependencies": [ diff --git a/ports/libosmscout/portfile.cmake b/ports/libosmscout/portfile.cmake index b10ac9d37ad10e..4cb246225bcecf 100644 --- a/ports/libosmscout/portfile.cmake +++ b/ports/libosmscout/portfile.cmake @@ -4,6 +4,7 @@ vcpkg_from_github( REF c81e1d9a0f69cc5b93588dbe330b2af587162c5f SHA512 d6ddbc49dd40b1f938ae2cd1ea9342cab0a52db46bf7ed6716111a91d0a38acba12ff2e273d457db51fc240d578a5b849af77b53e600482cf52c3b22306f8c45 HEAD_REF master + PATCHES protobuf-linkage.patch ) vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES diff --git a/ports/libosmscout/protobuf-linkage.patch b/ports/libosmscout/protobuf-linkage.patch new file mode 100644 index 00000000000000..f80afd83e31c0f --- /dev/null +++ b/ports/libosmscout/protobuf-linkage.patch @@ -0,0 +1,15 @@ +diff --git a/libosmscout-import/CMakeLists.txt b/libosmscout-import/CMakeLists.txt +index 36fa3585c..404f61aff 100644 +--- a/libosmscout-import/CMakeLists.txt ++++ b/libosmscout-import/CMakeLists.txt +@@ -146,8 +146,8 @@ endif() + + if (PROTOBUF_FOUND) + target_include_directories(OSMScoutImport PRIVATE ${Protobuf_INCLUDE_DIRS} ${CMAKE_CURRENT_BINARY_DIR}) +- target_link_libraries(OSMScoutImport ${Protobuf_LIBRARIES}) +- if(WIN32) ++ target_link_libraries(OSMScoutImport protobuf::libprotobuf) ++ if(0) + target_compile_definitions(OSMScoutImport PRIVATE -DPROTOBUF_USE_DLLS) + endif() + target_compile_definitions(OSMScoutImport PRIVATE -DOSMSCOUT_IMPORT_CMAKE_BUILD) diff --git a/ports/libosmscout/vcpkg.json b/ports/libosmscout/vcpkg.json index e49ed461e32754..fca91e195fbfa5 100644 --- a/ports/libosmscout/vcpkg.json +++ b/ports/libosmscout/vcpkg.json @@ -1,7 +1,7 @@ { "name": "libosmscout", "version": "1.1.1", - "port-version": 4, + "port-version": 5, "description": "libosmscout offers applications simple, high-level interfaces for offline location and POI lokup, rendering and routing functionalities based on OpenStreetMap (OSM) data.", "homepage": "http://libosmscout.sourceforge.net/", "documentation": "http://libosmscout.sourceforge.net/documentation/", diff --git a/ports/libprotobuf-mutator/portfile.cmake b/ports/libprotobuf-mutator/portfile.cmake index 4f79efcd729424..2582e04e820a9e 100644 --- a/ports/libprotobuf-mutator/portfile.cmake +++ b/ports/libprotobuf-mutator/portfile.cmake @@ -6,8 +6,10 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO google/libprotobuf-mutator REF "v${VERSION}" - SHA512 cafc59c6c1e26a3e4873ec47f12db290739e98f229a17352c740aa17ac41f1435268eb0c45518b07e5c33280c18da1c4e363a31200569ffe636250e7c904b55e + SHA512 9c752cf2bdbf9228ba5a7c1e7a552ea7e12bda226ad8268e4cb9f135a79aee9c3ff0c1f2dfebe5d011282835a63d3b9cf3b3f642f02a3e00bb0b5eee9580a3dd HEAD_REF master + PATCHES + protobuf-cmake.patch ) string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" STATIC_RUNTIME) @@ -17,6 +19,8 @@ vcpkg_cmake_configure( -DLIB_PROTO_MUTATOR_TESTING=OFF -DLIB_PROTO_MUTATOR_MSVC_STATIC_RUNTIME=${STATIC_RUNTIME} -DPKG_CONFIG_PATH=lib/pkgconfig + MAYBE_UNUSED_VARIABLES + LIB_PROTO_MUTATOR_MSVC_STATIC_RUNTIME ) vcpkg_cmake_install() @@ -25,4 +29,4 @@ vcpkg_fixup_pkgconfig() vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/${PORT}) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/libprotobuf-mutator/protobuf-cmake.patch b/ports/libprotobuf-mutator/protobuf-cmake.patch new file mode 100644 index 00000000000000..8b775ce9a9ede6 --- /dev/null +++ b/ports/libprotobuf-mutator/protobuf-cmake.patch @@ -0,0 +1,27 @@ +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 321874c..2b4b492 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -20,7 +20,7 @@ add_library(protobuf-mutator + text_format.cc + utf8_fix.cc) + target_link_libraries(protobuf-mutator +- ${Protobuf_LIBRARIES}) ++ PUBLIC protobuf::libprotobuf) + set_target_properties(protobuf-mutator PROPERTIES + COMPILE_FLAGS "${NO_FUZZING_FLAGS}" + SOVERSION 0) +diff --git a/src/libfuzzer/CMakeLists.txt b/src/libfuzzer/CMakeLists.txt +index 7100ef1..9863138 100644 +--- a/src/libfuzzer/CMakeLists.txt ++++ b/src/libfuzzer/CMakeLists.txt +@@ -16,8 +16,7 @@ add_library(protobuf-mutator-libfuzzer + libfuzzer_mutator.cc + libfuzzer_macro.cc) + target_link_libraries(protobuf-mutator-libfuzzer +- protobuf-mutator +- ${Protobuf_LIBRARIES}) ++ PUBLIC protobuf-mutator) + set_target_properties(protobuf-mutator-libfuzzer PROPERTIES + COMPILE_FLAGS "${NO_FUZZING_FLAGS}" + SOVERSION 0) diff --git a/ports/libprotobuf-mutator/vcpkg.json b/ports/libprotobuf-mutator/vcpkg.json index 8e7a1ad80d6549..a244d5e652781c 100644 --- a/ports/libprotobuf-mutator/vcpkg.json +++ b/ports/libprotobuf-mutator/vcpkg.json @@ -1,6 +1,6 @@ { "name": "libprotobuf-mutator", - "version": "1.1", + "version": "1.3", "description": "Library for structured fuzzing with protobuffers.", "dependencies": [ "liblzma", diff --git a/ports/marble/cpack.patch b/ports/marble/cpack.patch new file mode 100644 index 00000000000000..e3f7baa63a282a --- /dev/null +++ b/ports/marble/cpack.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 307735839..bfdb50d2f 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -356,7 +356,6 @@ add_subdirectory(doc) + add_subdirectory(src) + add_subdirectory(data) + +-include(DistTarget) + + add_subdirectory(tests) + diff --git a/ports/marble/portfile.cmake b/ports/marble/portfile.cmake index 2a8f946599c214..7624abd994579c 100644 --- a/ports/marble/portfile.cmake +++ b/ports/marble/portfile.cmake @@ -7,6 +7,8 @@ vcpkg_from_github( HEAD_REF master PATCHES qtfix.patch + protobuf.patch + cpack.patch ) vcpkg_cmake_configure( diff --git a/ports/marble/protobuf.patch b/ports/marble/protobuf.patch new file mode 100644 index 00000000000000..0df882a7a073f7 --- /dev/null +++ b/ports/marble/protobuf.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a8f024c2a..307735839 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -109,6 +109,7 @@ endif() + # Find Qt dependencies + + find_package(Protobuf) ++set(Protobuf_FOUND 0) + set_package_properties(Protobuf PROPERTIES TYPE OPTIONAL PURPOSE "Parsing of OSM PBF files.") + + if(ANDROID) diff --git a/ports/marble/vcpkg.json b/ports/marble/vcpkg.json index 2497389ea59dcd..aa21033dc54af1 100644 --- a/ports/marble/vcpkg.json +++ b/ports/marble/vcpkg.json @@ -1,6 +1,7 @@ { "name": "marble", "version-string": "24.02.0", + "port-version": 1, "description": "Marble KDE library", "homepage": "https://marble.kde.org", "license": "LGPL-2.1-or-later", diff --git a/ports/mysql-connector-cpp/dependencies.patch b/ports/mysql-connector-cpp/dependencies.patch index 8f4a38f651b84a..9cfb03d2fa1f37 100644 --- a/ports/mysql-connector-cpp/dependencies.patch +++ b/ports/mysql-connector-cpp/dependencies.patch @@ -1,154 +1,154 @@ -diff --git a/cdk/cmake/DepFindCompression.cmake b/cdk/cmake/DepFindCompression.cmake -index f9fe519f..0f893da8 100644 ---- a/cdk/cmake/DepFindCompression.cmake -+++ b/cdk/cmake/DepFindCompression.cmake -@@ -48,7 +48,12 @@ message(STATUS "Setting up compression libraries.") - ####### - # ZLIB - # --add_ext(zlib zlib.h z ext_zlib) -+if (WIN32) -+ set(ZLIB_NAME zlib) -+else() -+ set(ZLIB_NAME z) -+endif() -+add_ext(zlib zlib.h ${ZLIB_NAME} ext_zlib) - if(NOT ZLIB_FOUND) - message(FATAL_ERROR "Can't build without zlib support") - endif() -diff --git a/cdk/cmake/dependency.cmake b/cdk/cmake/dependency.cmake -index e928e711..30d34fef 100644 ---- a/cdk/cmake/dependency.cmake -+++ b/cdk/cmake/dependency.cmake -@@ -286,10 +286,18 @@ endif() - function(add_ext_lib EXT target name) - # Search for the library - if(DEFINED ${EXT}_ROOT_DIR) -- set(suffix PATHS ${${EXT}_ROOT_DIR} -- PATH_SUFFIXES lib lib64 dll -- NO_DEFAULT_PATH -- ) -+ if(CMAKE_BUILD_TYPE STREQUAL "Debug") -+ set(name "${name}d;${name}") -+ set(suffix PATHS "${${EXT}_ROOT_DIR}/debug" -+ PATH_SUFFIXES lib lib64 dll -+ NO_DEFAULT_PATH -+ ) -+ else() -+ set(suffix PATHS ${${EXT}_ROOT_DIR} -+ PATH_SUFFIXES lib lib64 dll -+ NO_DEFAULT_PATH -+ ) -+ endif() - elseif(DEFINED ${EXT}_LIB_DIR) - set(suffix - PATHS ${${EXT}_LIB_DIR} -@@ -326,9 +334,10 @@ endfunction(add_ext_lib) - # - function(add_ext_exec EXT target name) - # Search for the library -+ string(TOLOWER ${EXT} EXT_LOWER) - if(DEFINED ${EXT}_ROOT_DIR) - set(suffix PATHS ${${EXT}_ROOT_DIR} -- PATH_SUFFIXES bin -+ PATH_SUFFIXES tools/${EXT_LOWER} - NO_DEFAULT_PATH - ) - -diff --git a/cdk/protocol/mysqlx/CMakeLists.txt b/cdk/protocol/mysqlx/CMakeLists.txt -index 97a4b005..cfc81daf 100644 ---- a/cdk/protocol/mysqlx/CMakeLists.txt -+++ b/cdk/protocol/mysqlx/CMakeLists.txt -@@ -135,8 +135,13 @@ else() - target_link_libraries(cdk_proto_mysqlx PRIVATE ext::protobuf-lite) - endif() - -+if (WIN32) -+ set(EXT_ZLIB_NAME ext::zlib) -+else() -+ set(EXT_ZLIB_NAME ext::z) -+endif() - target_link_libraries(cdk_proto_mysqlx -- PRIVATE cdk_foundation ext::z ext::lz4 ext::zstd -+ PRIVATE cdk_foundation ${EXT_ZLIB_NAME} ext::lz4 ext::zstd - ) - - ADD_COVERAGE(cdk_proto_mysqlx) -diff --git a/jdbc/cmake/DepFindMySQL.cmake b/jdbc/cmake/DepFindMySQL.cmake -index 7977381a..d7f4e58b 100644 ---- a/jdbc/cmake/DepFindMySQL.cmake -+++ b/jdbc/cmake/DepFindMySQL.cmake -@@ -167,13 +167,13 @@ function(main) - - find_library(MYSQL_LIB - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient${CMAKE_STATIC_LIBRARY_SUFFIX} -- PATHS ${MYSQL_LIB_DIR} -+ PATHS "${MYSQL_LIB_DIR}/lib" - NO_DEFAULT_PATH - ) - - find_library(MYSQL_LIB_DEBUG - NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient${CMAKE_STATIC_LIBRARY_SUFFIX} -- PATHS "${MYSQL_LIB_DIR}/debug" -+ PATHS "${MYSQL_LIB_DIR}/debug/lib" - NO_DEFAULT_PATH - ) - -@@ -181,39 +181,39 @@ function(main) - - find_library(MYSQL_DLL - NAMES ${CMAKE_DYNAMIC_LIBRARY_PREFIX}mysqlclient${CMAKE_DYNAMIC_LIBRARY_SUFFIX} -- PATHS ${MYSQL_LIB_DIR} -+ PATHS "${MYSQL_LIB_DIR}/lib" - NO_DEFAULT_PATH - ) - - find_library(MYSQL_DLL_DEBUG - NAMES ${CMAKE_DYNAMIC_LIBRARY_PREFIX}mysqlclient${CMAKE_DYNAMIC_LIBRARY_SUFFIX} -- PATHS "${MYSQL_LIB_DIR}/debug" -+ PATHS "${MYSQL_LIB_DIR}/debug/lib" - NO_DEFAULT_PATH - ) - - else() #WIN32 - -- find_library(MYSQL_DLL -- NAMES libmysql -- PATHS ${MYSQL_LIB_DIR} -+ find_file(MYSQL_DLL -+ NAMES libmysql.dll -+ PATHS "${MYSQL_LIB_DIR}/bin" - NO_DEFAULT_PATH - ) - -- find_library(MYSQL_DLL_DEBUG -- NAMES libmysql -- PATHS "${MYSQL_LIB_DIR}/debug" -+ find_file(MYSQL_DLL_DEBUG -+ NAMES libmysql.dll -+ PATHS "${MYSQL_LIB_DIR}/debug/bin" - NO_DEFAULT_PATH - ) - - find_library(MYSQL_DLL_IMP - NAMES libmysql.lib -- PATHS ${MYSQL_LIB_DIR} -+ PATHS "${MYSQL_LIB_DIR}/lib" - NO_DEFAULT_PATH - ) - - find_library(MYSQL_DLL_IMP_DEBUG - NAMES libmysql.lib -- PATHS "${MYSQL_LIB_DIR}/debug" -+ PATHS "${MYSQL_LIB_DIR}/debug/lib" - NO_DEFAULT_PATH - ) - endif() -@@ -383,6 +383,7 @@ function(main) - # external dependencies. - # - -+ find_package(OpenSSL) - target_link_libraries(MySQL::client-static INTERFACE ${MYSQL_EXTERNAL_DEPENDENCIES}) - - endif() +diff --git a/cdk/cmake/DepFindCompression.cmake b/cdk/cmake/DepFindCompression.cmake +index f9fe519f..0f893da8 100644 +--- a/cdk/cmake/DepFindCompression.cmake ++++ b/cdk/cmake/DepFindCompression.cmake +@@ -48,7 +48,12 @@ message(STATUS "Setting up compression libraries.") + ####### + # ZLIB + # +-add_ext(zlib zlib.h z ext_zlib) ++if (WIN32) ++ set(ZLIB_NAME zlib) ++else() ++ set(ZLIB_NAME z) ++endif() ++add_ext(zlib zlib.h ${ZLIB_NAME} ext_zlib) + if(NOT ZLIB_FOUND) + message(FATAL_ERROR "Can't build without zlib support") + endif() +diff --git a/cdk/cmake/dependency.cmake b/cdk/cmake/dependency.cmake +index e928e711..30d34fef 100644 +--- a/cdk/cmake/dependency.cmake ++++ b/cdk/cmake/dependency.cmake +@@ -286,10 +286,18 @@ endif() + function(add_ext_lib EXT target name) + # Search for the library + if(DEFINED ${EXT}_ROOT_DIR) +- set(suffix PATHS ${${EXT}_ROOT_DIR} +- PATH_SUFFIXES lib lib64 dll +- NO_DEFAULT_PATH +- ) ++ if(CMAKE_BUILD_TYPE STREQUAL "Debug") ++ set(name "${name}d;${name}") ++ set(suffix PATHS "${${EXT}_ROOT_DIR}/debug" ++ PATH_SUFFIXES lib lib64 dll ++ NO_DEFAULT_PATH ++ ) ++ else() ++ set(suffix PATHS ${${EXT}_ROOT_DIR} ++ PATH_SUFFIXES lib lib64 dll ++ NO_DEFAULT_PATH ++ ) ++ endif() + elseif(DEFINED ${EXT}_LIB_DIR) + set(suffix + PATHS ${${EXT}_LIB_DIR} +@@ -326,9 +334,10 @@ endfunction(add_ext_lib) + # + function(add_ext_exec EXT target name) + # Search for the library ++ string(TOLOWER ${EXT} EXT_LOWER) + if(DEFINED ${EXT}_ROOT_DIR) + set(suffix PATHS ${${EXT}_ROOT_DIR} +- PATH_SUFFIXES bin ++ PATH_SUFFIXES tools/${EXT_LOWER} + NO_DEFAULT_PATH + ) + +diff --git a/cdk/protocol/mysqlx/CMakeLists.txt b/cdk/protocol/mysqlx/CMakeLists.txt +index 97a4b005..cfc81daf 100644 +--- a/cdk/protocol/mysqlx/CMakeLists.txt ++++ b/cdk/protocol/mysqlx/CMakeLists.txt +@@ -135,8 +135,13 @@ else() + target_link_libraries(cdk_proto_mysqlx PRIVATE ext::protobuf-lite) + endif() + ++if (WIN32) ++ set(EXT_ZLIB_NAME ext::zlib) ++else() ++ set(EXT_ZLIB_NAME ext::z) ++endif() + target_link_libraries(cdk_proto_mysqlx +- PRIVATE cdk_foundation ext::z ext::lz4 ext::zstd ++ PRIVATE cdk_foundation ${EXT_ZLIB_NAME} ext::lz4 ext::zstd + ) + + ADD_COVERAGE(cdk_proto_mysqlx) +diff --git a/jdbc/cmake/DepFindMySQL.cmake b/jdbc/cmake/DepFindMySQL.cmake +index 7977381a..d7f4e58b 100644 +--- a/jdbc/cmake/DepFindMySQL.cmake ++++ b/jdbc/cmake/DepFindMySQL.cmake +@@ -167,13 +167,13 @@ function(main) + + find_library(MYSQL_LIB + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient${CMAKE_STATIC_LIBRARY_SUFFIX} +- PATHS ${MYSQL_LIB_DIR} ++ PATHS "${MYSQL_LIB_DIR}/lib" + NO_DEFAULT_PATH + ) + + find_library(MYSQL_LIB_DEBUG + NAMES ${CMAKE_STATIC_LIBRARY_PREFIX}mysqlclient${CMAKE_STATIC_LIBRARY_SUFFIX} +- PATHS "${MYSQL_LIB_DIR}/debug" ++ PATHS "${MYSQL_LIB_DIR}/debug/lib" + NO_DEFAULT_PATH + ) + +@@ -181,39 +181,39 @@ function(main) + + find_library(MYSQL_DLL + NAMES ${CMAKE_DYNAMIC_LIBRARY_PREFIX}mysqlclient${CMAKE_DYNAMIC_LIBRARY_SUFFIX} +- PATHS ${MYSQL_LIB_DIR} ++ PATHS "${MYSQL_LIB_DIR}/lib" + NO_DEFAULT_PATH + ) + + find_library(MYSQL_DLL_DEBUG + NAMES ${CMAKE_DYNAMIC_LIBRARY_PREFIX}mysqlclient${CMAKE_DYNAMIC_LIBRARY_SUFFIX} +- PATHS "${MYSQL_LIB_DIR}/debug" ++ PATHS "${MYSQL_LIB_DIR}/debug/lib" + NO_DEFAULT_PATH + ) + + else() #WIN32 + +- find_library(MYSQL_DLL +- NAMES libmysql +- PATHS ${MYSQL_LIB_DIR} ++ find_file(MYSQL_DLL ++ NAMES libmysql.dll ++ PATHS "${MYSQL_LIB_DIR}/bin" + NO_DEFAULT_PATH + ) + +- find_library(MYSQL_DLL_DEBUG +- NAMES libmysql +- PATHS "${MYSQL_LIB_DIR}/debug" ++ find_file(MYSQL_DLL_DEBUG ++ NAMES libmysql.dll ++ PATHS "${MYSQL_LIB_DIR}/debug/bin" + NO_DEFAULT_PATH + ) + + find_library(MYSQL_DLL_IMP + NAMES libmysql.lib +- PATHS ${MYSQL_LIB_DIR} ++ PATHS "${MYSQL_LIB_DIR}/lib" + NO_DEFAULT_PATH + ) + + find_library(MYSQL_DLL_IMP_DEBUG + NAMES libmysql.lib +- PATHS "${MYSQL_LIB_DIR}/debug" ++ PATHS "${MYSQL_LIB_DIR}/debug/lib" + NO_DEFAULT_PATH + ) + endif() +@@ -383,6 +383,7 @@ function(main) + # external dependencies. + # + ++ find_package(OpenSSL) + target_link_libraries(MySQL::client-static INTERFACE ${MYSQL_EXTERNAL_DEPENDENCIES}) + + endif() diff --git a/ports/mysql-connector-cpp/mysql-connector-cpp-config.cmake.in b/ports/mysql-connector-cpp/mysql-connector-cpp-config.cmake.in index 5d2e07e750ce71..5eb80ed42c41a3 100644 --- a/ports/mysql-connector-cpp/mysql-connector-cpp-config.cmake.in +++ b/ports/mysql-connector-cpp/mysql-connector-cpp-config.cmake.in @@ -3,6 +3,7 @@ include(CMakeFindDependencyMacro) find_dependency(OpenSSL) +find_dependency(Protobuf CONFIG) include("${CMAKE_CURRENT_LIST_DIR}/unofficial-mysql-connector-cpp-targets.cmake") check_required_components(mysql-connector-cpp) diff --git a/ports/mysql-connector-cpp/portfile.cmake b/ports/mysql-connector-cpp/portfile.cmake index 7b2a2b8ff6293f..ce4b9365192b1b 100644 --- a/ports/mysql-connector-cpp/portfile.cmake +++ b/ports/mysql-connector-cpp/portfile.cmake @@ -8,6 +8,8 @@ vcpkg_from_github( fix-static-build8.patch export-targets.patch dependencies.patch + protobuf-cmake.patch + protobuf-source.patch ) vcpkg_check_features( @@ -29,9 +31,12 @@ vcpkg_cmake_configure( OPTIONS "-DWITH_SSL=${CURRENT_INSTALLED_DIR}" "-DWITH_LZ4=${CURRENT_INSTALLED_DIR}" - "-DWITH_ZLIB=${CURRENT_INSTALLED_DIR}" "-DWITH_ZSTD=${CURRENT_INSTALLED_DIR}" - "-DWITH_PROTOBUF=${CURRENT_INSTALLED_DIR}" + "-DWITH_ZLIB=${CURRENT_INSTALLED_DIR}" + "-DProtobuf_DIR=${CURRENT_INSTALLED_DIR}/share/protobuf" # Without these Windows is unable to find protobuf + "-Dabsl_DIR=${CURRENT_INSTALLED_DIR}/share/absl" + "-Dutf8_range_DIR=${CURRENT_INSTALLED_DIR}/share/utf8_range" + "-DProtobuf_PROTOC_EXECUTABLE=${CURRENT_INSTALLED_DIR}/tools/protobuf/protoc" -DBUILD_STATIC=${BUILD_STATIC} -DSTATIC_MSVCRT=${STATIC_MSVCRT} -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS} @@ -57,5 +62,4 @@ file(REMOVE ) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -# Handle copyright -file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/ports/mysql-connector-cpp/protobuf-cmake.patch b/ports/mysql-connector-cpp/protobuf-cmake.patch new file mode 100644 index 00000000000000..ddda94dabfd260 --- /dev/null +++ b/ports/mysql-connector-cpp/protobuf-cmake.patch @@ -0,0 +1,76 @@ +diff --git a/cdk/cmake/DepFindProtobuf.cmake b/cdk/cmake/DepFindProtobuf.cmake +index 730389de..7c3fd78b 100644 +--- a/cdk/cmake/DepFindProtobuf.cmake ++++ b/cdk/cmake/DepFindProtobuf.cmake +@@ -44,6 +44,7 @@ + # + # + ++if(0) + if(TARGET ext::protobuf) + return() + endif() +@@ -64,7 +65,7 @@ add_ext_targets(protobuf + LIBRARY protobuf pb_libprotobuf + EXECUTABLE protoc pb_protoc + ) +- ++endif() + + # Standard PROTOBUF_GENERATE_CPP modified to our usage + function(mysqlx_protobuf_generate_cpp SRCS HDRS) +@@ -90,7 +91,7 @@ function(mysqlx_protobuf_generate_cpp SRCS HDRS) + "${CMAKE_CURRENT_BINARY_DIR}/protobuf/${FIL_WE}.pb.h" + COMMAND ${CMAKE_COMMAND} + -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/protobuf" +- COMMAND ext::protoc ++ COMMAND protobuf::protoc + ARGS --cpp_out "${CMAKE_CURRENT_BINARY_DIR}/protobuf" + -I ${ABS_PATH} ${ABS_FIL} + +diff --git a/cdk/core/CMakeLists.txt b/cdk/core/CMakeLists.txt +index 30f7baf1..2a4a9434 100644 +--- a/cdk/core/CMakeLists.txt ++++ b/cdk/core/CMakeLists.txt +@@ -33,6 +33,7 @@ cmake_minimum_required(VERSION 2.8) + + #ADD_SUBDIRECTORY(tests) + ++find_package(Protobuf CONFIG REQUIRED) + + SET(cdk_sources + session.cc +@@ -45,7 +46,7 @@ add_library(cdk STATIC ${cdk_sources} ${HEADERS}) + + target_link_libraries(cdk + PUBLIC cdk_mysqlx cdk_parser +- PRIVATE ext::protobuf-lite # required by codecc.cc ++ PRIVATE protobuf::libprotobuf-lite # required by codecc.cc + ) + + add_coverage(cdk) +diff --git a/cdk/protocol/mysqlx/CMakeLists.txt b/cdk/protocol/mysqlx/CMakeLists.txt +index cfc81daf..6c484575 100644 +--- a/cdk/protocol/mysqlx/CMakeLists.txt ++++ b/cdk/protocol/mysqlx/CMakeLists.txt +@@ -26,8 +26,9 @@ + # along with this program; if not, write to the Free Software Foundation, Inc., + # 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +-find_dependency(Protobuf) +-find_dependency(Compression) ++include(DepFindCompression) ++find_package(Protobuf CONFIG REQUIRED) ++include(DepFindProtobuf) + + include(CheckIncludeFile) + +@@ -132,7 +133,7 @@ target_include_directories(cdk_proto_mysqlx PRIVATE + if(use_full_protobuf) + target_link_libraries(cdk_proto_mysqlx PRIVATE ext::protobuf) + else() +- target_link_libraries(cdk_proto_mysqlx PRIVATE ext::protobuf-lite) ++ target_link_libraries(cdk_proto_mysqlx PRIVATE protobuf::libprotobuf-lite) + endif() + + if (WIN32) diff --git a/ports/mysql-connector-cpp/protobuf-source.patch b/ports/mysql-connector-cpp/protobuf-source.patch new file mode 100644 index 00000000000000..4412dec7e1ae7a --- /dev/null +++ b/ports/mysql-connector-cpp/protobuf-source.patch @@ -0,0 +1,61 @@ +diff --git a/cdk/protocol/mysqlx/protocol.cc b/cdk/protocol/mysqlx/protocol.cc +index d4589c27..c61deca4 100644 +--- a/cdk/protocol/mysqlx/protocol.cc ++++ b/cdk/protocol/mysqlx/protocol.cc +@@ -117,18 +117,15 @@ namespace mysqlx { + Protobuf log handler initialization. + */ + +-static void log_handler(LogLevel level, const char* filename, int line, const std::string& message); + + #ifdef _WIN32 + BOOL CALLBACK log_handler_init(PINIT_ONCE, PVOID, PVOID*) + { +- SetLogHandler(&log_handler); + return TRUE; + } + #else + static void log_handler_init() + { +- SetLogHandler(log_handler); + } + #endif + +@@ -289,37 +286,6 @@ Message* mk_message(Protocol_side side, msg_type_t msg_type) + situation occurs in Protobuf (such as parsing error etc). + */ + +-static void log_handler( +- LogLevel level, const char* /*filename*/, int /*line*/, +- const std::string& message +-) +-{ +- switch(level) +- { +- case LOGLEVEL_FATAL: +- case LOGLEVEL_ERROR: +- /* +- With this code the error description is: +- +- MMM: Protobuf error (cdk:NNN) +- +- where MMM is the message and NNN is the protbuf error code. +- +- TODO: Change description to: +- +- Protobuf error: MMM (cdk:NNN) +- */ +- throw_error(cdkerrc::protobuf_error, message); +- +- case LOGLEVEL_WARNING: +- case LOGLEVEL_INFO: +- default: +- { +- // just ignore for now +- // TODO: this could be used for logging in the future +- } +- } +-} + + /* + Implementation of protobuf's ZeroCopyOutputStream which stores diff --git a/ports/mysql-connector-cpp/vcpkg.json b/ports/mysql-connector-cpp/vcpkg.json index c52ad5b5b210eb..ff26e043e96f80 100644 --- a/ports/mysql-connector-cpp/vcpkg.json +++ b/ports/mysql-connector-cpp/vcpkg.json @@ -1,7 +1,7 @@ { "name": "mysql-connector-cpp", "version": "8.0.32", - "port-version": 1, + "port-version": 2, "description": "This is a release of MySQL Connector/C++, the C++ interface for communicating with MySQL servers.", "homepage": "https://github.com/mysql/mysql-connector-cpp", "license": null, diff --git a/ports/osgearth/portfile.cmake b/ports/osgearth/portfile.cmake index f38385cd4b1143..375330d6ef7418 100644 --- a/ports/osgearth/portfile.cmake +++ b/ports/osgearth/portfile.cmake @@ -10,6 +10,7 @@ vcpkg_from_github( remove-tool-debug-suffix.patch remove-lerc-gltf.patch export-plugins.patch + protobuf.patch ) if("tools" IN_LIST FEATURES) @@ -54,7 +55,6 @@ vcpkg_cmake_configure( OPTIONS ${FEATURE_OPTIONS} -DLIB_POSTFIX= - -DCMAKE_CXX_STANDARD=11 -DOSGEARTH_BUILD_SHARED_LIBS=${BUILD_SHARED} -DOSGEARTH_BUILD_EXAMPLES=OFF -DOSGEARTH_BUILD_TESTS=OFF @@ -66,6 +66,8 @@ vcpkg_cmake_configure( -DCMAKE_JOB_POOL_LINK=console # Serialize linking to avoid OOM OPTIONS_DEBUG -DOSGEARTH_BUILD_TOOLS=OFF + MAYBE_UNUSED_VARIABLES + LIB_POSTFIX ) vcpkg_cmake_install() @@ -95,5 +97,4 @@ endif() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -# Handle copyright -file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") diff --git a/ports/osgearth/protobuf.patch b/ports/osgearth/protobuf.patch new file mode 100644 index 00000000000000..b05c2f873cd741 --- /dev/null +++ b/ports/osgearth/protobuf.patch @@ -0,0 +1,74 @@ +diff --git a/CMakeModules/OsgEarthMacroUtils.cmake b/CMakeModules/OsgEarthMacroUtils.cmake +index ccf209f6a..e961531f8 100644 +--- a/CMakeModules/OsgEarthMacroUtils.cmake ++++ b/CMakeModules/OsgEarthMacroUtils.cmake +@@ -94,28 +94,28 @@ MACRO(LINK_WITH_VARIABLES TRGTNAME) + FOREACH(varname ${ARGN}) + string(REPLACE "_LIBRARY" "_LIBRARIES" lwv_libraries "${varname}") + if(DEFINED ${lwv_libraries}) +- TARGET_LINK_LIBRARIES(${TRGTNAME} ${${lwv_libraries}}) ++ TARGET_LINK_LIBRARIES(${TRGTNAME} PUBLIC ${${lwv_libraries}}) + continue() + endif() + IF(${varname}_DEBUG) + IF(${varname}_RELEASE) +- TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}_RELEASE}" debug "${${varname}_DEBUG}") ++ TARGET_LINK_LIBRARIES(${TRGTNAME} PUBLIC optimized "${${varname}_RELEASE}" debug "${${varname}_DEBUG}") + ELSE(${varname}_RELEASE) +- TARGET_LINK_LIBRARIES(${TRGTNAME} optimized "${${varname}}" debug "${${varname}_DEBUG}") ++ TARGET_LINK_LIBRARIES(${TRGTNAME} PUBLIC optimized "${${varname}}" debug "${${varname}_DEBUG}") + ENDIF(${varname}_RELEASE) + ELSE(${varname}_DEBUG) +- TARGET_LINK_LIBRARIES(${TRGTNAME} ${${varname}} ) ++ TARGET_LINK_LIBRARIES(${TRGTNAME} PUBLIC ${${varname}} ) + ENDIF(${varname}_DEBUG) + ENDFOREACH(varname) + ENDMACRO(LINK_WITH_VARIABLES TRGTNAME) + + MACRO(LINK_INTERNAL TRGTNAME) +- TARGET_LINK_LIBRARIES(${TRGTNAME} ${ARGN}) ++ TARGET_LINK_LIBRARIES(${TRGTNAME} PUBLIC ${ARGN}) + ENDMACRO(LINK_INTERNAL TRGTNAME) + + MACRO(LINK_EXTERNAL TRGTNAME) + FOREACH(LINKLIB ${ARGN}) +- TARGET_LINK_LIBRARIES(${TRGTNAME} "${LINKLIB}" ) ++ TARGET_LINK_LIBRARIES(${TRGTNAME} PUBLIC "${LINKLIB}" ) + ENDFOREACH(LINKLIB) + ENDMACRO(LINK_EXTERNAL TRGTNAME) + +@@ -179,7 +179,7 @@ MACRO(SETUP_LINK_LIBRARIES) + ENDIF(TARGET_LIBRARIES_VARS) + + FOREACH(LINKLIB ${TARGET_EXTERNAL_LIBRARIES}) +- TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} ${LINKLIB}) ++ TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} PUBLIC ${LINKLIB}) + ENDFOREACH(LINKLIB) + ENDMACRO(SETUP_LINK_LIBRARIES) + +diff --git a/src/applications/osgearth_viewerIOS/CMakeLists.txt b/src/applications/osgearth_viewerIOS/CMakeLists.txt +index e66fd25c7..9db76784e 100644 +--- a/src/applications/osgearth_viewerIOS/CMakeLists.txt ++++ b/src/applications/osgearth_viewerIOS/CMakeLists.txt +@@ -1,7 +1,7 @@ + MACRO(LINK_OSG_STATIC_PLUGINS) + FOREACH(LINKLIB ${OSG_STATIC_PLUGINS}) + SET(OSG_PLUGINS_PATH "${OSG_DIR}/lib") +- TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} optimized "${OSG_PLUGINS_PATH}/lib${LINKLIB}.a" debug "${OSG_PLUGINS_PATH}/lib${LINKLIB}${CMAKE_DEBUG_POSTFIX}.a") ++ TARGET_LINK_LIBRARIES(${TARGET_TARGETNAME} PUBLIC optimized "${OSG_PLUGINS_PATH}/lib${LINKLIB}.a" debug "${OSG_PLUGINS_PATH}/lib${LINKLIB}${CMAKE_DEBUG_POSTFIX}.a") + ENDFOREACH(LINKLIB) + ENDMACRO(LINK_OSG_STATIC_PLUGINS) + +diff --git a/src/osgEarth/CMakeLists.txt b/src/osgEarth/CMakeLists.txt +index e320eb340..cd711a927 100644 +--- a/src/osgEarth/CMakeLists.txt ++++ b/src/osgEarth/CMakeLists.txt +@@ -943,7 +943,7 @@ IF(Protobuf_FOUND AND Protobuf_PROTOC_EXECUTABLE) + ADD_DEFINITIONS(-DPROTOBUF_USE_DLLS) + ENDIF() + +- LINK_WITH_VARIABLES(${LIB_NAME} Protobuf_LIBRARIES) ++ TARGET_LINK_LIBRARIES(${LIB_NAME} PUBLIC protobuf::libprotobuf) + ENDIF() + + # ESRI FileGeodatabase? diff --git a/ports/osgearth/vcpkg.json b/ports/osgearth/vcpkg.json index 1459fde3f078e4..b5056322e3ee00 100644 --- a/ports/osgearth/vcpkg.json +++ b/ports/osgearth/vcpkg.json @@ -1,7 +1,7 @@ { "name": "osgearth", "version": "3.4", - "port-version": 1, + "port-version": 2, "description": "osgEarth - Dynamic map generation toolkit for OpenSceneGraph Copyright 2021 Pelican Mapping.", "homepage": "https://github.com/gwaldron/osgearth", "license": "LGPL-3.0-or-later", diff --git a/ports/paraview/portfile.cmake b/ports/paraview/portfile.cmake index aa65e549ff44a1..8456baa943dbb5 100644 --- a/ports/paraview/portfile.cmake +++ b/ports/paraview/portfile.cmake @@ -59,6 +59,7 @@ vcpkg_from_github( add-tools-option.patch fix-build.patch fix-configure.patch + protobuf-version.patch ) if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") diff --git a/ports/paraview/protobuf-version.patch b/ports/paraview/protobuf-version.patch new file mode 100644 index 00000000000000..975f72fb213550 --- /dev/null +++ b/ports/paraview/protobuf-version.patch @@ -0,0 +1,13 @@ +diff --git a/ThirdParty/protobuf/CMakeLists.txt b/ThirdParty/protobuf/CMakeLists.txt +index 811dc3721b..02f26ae757 100644 +--- a/ThirdParty/protobuf/CMakeLists.txt ++++ b/ThirdParty/protobuf/CMakeLists.txt +@@ -40,7 +40,7 @@ vtk_module_third_party( + STANDARD_INCLUDE_DIRS + EXTERNAL + PACKAGE Protobuf +- VERSION "3.4" ++ CONFIG_MODE + TARGETS protobuf::libprotobuf + STANDARD_INCLUDE_DIRS) + diff --git a/ports/paraview/vcpkg.json b/ports/paraview/vcpkg.json index d102d8353a6dce..610ba1e5adb664 100644 --- a/ports/paraview/vcpkg.json +++ b/ports/paraview/vcpkg.json @@ -1,7 +1,7 @@ { "name": "paraview", "version": "5.12.1", - "port-version": 1, + "port-version": 2, "description": "VTK-based Data Analysis and Visualization Application", "homepage": "https://www.paraview.org/", "license": "BSD-3-Clause", diff --git a/ports/protobuf/compile_options.patch b/ports/protobuf/compile_options.patch deleted file mode 100644 index 8cf5417740f27e..00000000000000 --- a/ports/protobuf/compile_options.patch +++ /dev/null @@ -1,48 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 04cb3303a..608c580be 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -242,12 +242,12 @@ endif (protobuf_BUILD_SHARED_LIBS) - if (MSVC) - if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") - # Build with multiple processes -- add_definitions(/MP) -+ add_compile_options(/MP) - endif() - # Set source file and execution character sets to UTF-8 -- add_definitions(/utf-8) -+ add_compile_options(/utf-8) - # MSVC warning suppressions -- add_definitions( -+ add_compile_options( - /wd4065 # switch statement contains 'default' but no 'case' labels - /wd4244 # 'conversion' conversion from 'type1' to 'type2', possible loss of data - /wd4251 # 'identifier' : class 'type' needs to have dll-interface to be used by clients of class 'type2' -@@ -262,23 +262,17 @@ if (MSVC) - /wd4996 # The compiler encountered a deprecated declaration. - ) - # Allow big object -- add_definitions(/bigobj) -+ add_compile_options(/bigobj) - string(REPLACE "/" "\\" PROTOBUF_SOURCE_WIN32_PATH ${protobuf_SOURCE_DIR}) - string(REPLACE "/" "\\" PROTOBUF_BINARY_WIN32_PATH ${protobuf_BINARY_DIR}) - string(REPLACE "." "," protobuf_RC_FILEVERSION "${protobuf_VERSION}") - configure_file(${protobuf_SOURCE_DIR}/cmake/extract_includes.bat.in extract_includes.bat) - - # Suppress linker warnings about files with no symbols defined. -- set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221") -+ string(APPEND CMAKE_STATIC_LINKER_FLAGS " /ignore:4221") - -- if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") -- # Configure Resource Compiler -- enable_language(RC) -- # use English language (0x409) in resource compiler -- set(rc_flags "/l0x409") -- # fix rc.exe invocations because of usage of add_definitions() -- set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> ${rc_flags} <DEFINES> /fo<OBJECT> <SOURCE>") -- endif() -+ # use English language (0x409) in resource compiler -+ string(APPEND CMAKE_RC_FLAGS " -l0x409") - - # Generate the version.rc file used elsewhere. - configure_file(${protobuf_SOURCE_DIR}/cmake/version.rc.in ${CMAKE_CURRENT_BINARY_DIR}/version.rc @ONLY) diff --git a/ports/protobuf/fix-default-proto-file-path.patch b/ports/protobuf/fix-default-proto-file-path.patch index 1c850b1dec2b97..c30abeb9ba88b4 100644 --- a/ports/protobuf/fix-default-proto-file-path.patch +++ b/ports/protobuf/fix-default-proto-file-path.patch @@ -1,9 +1,9 @@ diff --git a/src/google/protobuf/compiler/command_line_interface.cc b/src/google/protobuf/compiler/command_line_interface.cc -index 5e9a2c4..8eaa6e0 100644 +index f9e9666..d453a4c 100644 --- a/src/google/protobuf/compiler/command_line_interface.cc +++ b/src/google/protobuf/compiler/command_line_interface.cc -@@ -261,12 +261,15 @@ void AddDefaultProtoPaths( - std::pair<std::string, std::string>("", path + "/include")); +@@ -280,12 +280,15 @@ void AddDefaultProtoPaths( + paths->emplace_back("", std::move(include_path)); return; } - // Check if the upper level directory has an "include" subdirectory. @@ -16,6 +16,6 @@ index 5e9a2c4..8eaa6e0 100644 } path = path.substr(0, pos); + } - if (IsInstalledProtoPath(path + "/include")) { - paths->push_back( - std::pair<std::string, std::string>("", path + "/include")); + include_path = absl::StrCat(path, "/include"); + if (IsInstalledProtoPath(include_path)) { + paths->emplace_back("", std::move(include_path)); diff --git a/ports/protobuf/fix-static-build.patch b/ports/protobuf/fix-static-build.patch index 496c6c4d50524b..e0ea7fd09531d2 100644 --- a/ports/protobuf/fix-static-build.patch +++ b/ports/protobuf/fix-static-build.patch @@ -1,8 +1,8 @@ diff --git a/cmake/install.cmake b/cmake/install.cmake -index 825cb25..4f453d6 100644 +index 998c2e31a..233f9e400 100644 --- a/cmake/install.cmake +++ b/cmake/install.cmake -@@ -32,7 +32,7 @@ if (protobuf_BUILD_PROTOC_BINARIES) +@@ -49,7 +49,7 @@ if (protobuf_BUILD_PROTOC_BINARIES) install(TARGETS protoc EXPORT protobuf-targets RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc BUNDLE DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT protoc) @@ -11,3 +11,11 @@ index 825cb25..4f453d6 100644 set_property(TARGET protoc PROPERTY INSTALL_RPATH "$ORIGIN/../${CMAKE_INSTALL_LIBDIR}") elseif (APPLE) +@@ -68,7 +68,6 @@ set(protobuf_HEADERS + ${cpp_features_proto_proto_srcs} + ${descriptor_proto_proto_srcs} + ${plugin_proto_proto_srcs} +- ${java_features_proto_proto_srcs} + ) + foreach(_header ${protobuf_HEADERS}) + string(FIND ${_header} "${protobuf_SOURCE_DIR}/src" _find_src) diff --git a/ports/protobuf/fix-utf8-range.patch b/ports/protobuf/fix-utf8-range.patch new file mode 100644 index 00000000000000..90cd0468d1fcc2 --- /dev/null +++ b/ports/protobuf/fix-utf8-range.patch @@ -0,0 +1,48 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 4137ce2e9..f1289e08a 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -294,6 +294,7 @@ endif (protobuf_BUILD_TESTS) + include(${protobuf_SOURCE_DIR}/cmake/abseil-cpp.cmake) + + if (protobuf_BUILD_PROTOBUF_BINARIES) ++ find_package(utf8_range CONFIG REQUIRED) + include(${protobuf_SOURCE_DIR}/cmake/utf8_range.cmake) + include(${protobuf_SOURCE_DIR}/cmake/libprotobuf-lite.cmake) + if (NOT DEFINED protobuf_LIB_PROTOBUF_LITE) +diff --git a/cmake/libprotobuf-lite.cmake b/cmake/libprotobuf-lite.cmake +index f343458cf..f4b1e0faa 100644 +--- a/cmake/libprotobuf-lite.cmake ++++ b/cmake/libprotobuf-lite.cmake +@@ -42,4 +42,4 @@ set_target_properties(libprotobuf-lite PROPERTIES + ) + add_library(protobuf::libprotobuf-lite ALIAS libprotobuf-lite) + +-target_link_libraries(libprotobuf-lite PRIVATE utf8_validity) ++target_link_libraries(libprotobuf-lite PRIVATE utf8_range::utf8_validity) +diff --git a/cmake/libprotobuf.cmake b/cmake/libprotobuf.cmake +index 422754a1a..fa9956685 100644 +--- a/cmake/libprotobuf.cmake ++++ b/cmake/libprotobuf.cmake +@@ -45,4 +45,4 @@ set_target_properties(libprotobuf PROPERTIES + ) + add_library(protobuf::libprotobuf ALIAS libprotobuf) + +-target_link_libraries(libprotobuf PRIVATE utf8_validity) ++target_link_libraries(libprotobuf PRIVATE utf8_range::utf8_validity) +diff --git a/cmake/utf8_range.cmake b/cmake/utf8_range.cmake +index f411a8c5b..21bf8235b 100644 +--- a/cmake/utf8_range.cmake ++++ b/cmake/utf8_range.cmake +@@ -1,4 +1,4 @@ +-if (NOT TARGET utf8_range) ++if (0) + set(utf8_range_ENABLE_TESTS OFF CACHE BOOL "Disable utf8_range tests") + + if (NOT EXISTS "${protobuf_SOURCE_DIR}/third_party/utf8_range/CMakeLists.txt") +@@ -12,4 +12,4 @@ if (NOT TARGET utf8_range) + include_directories(${CMAKE_CURRENT_SOURCE_DIR}/third_party/utf8_range) + endif () + +-set(_protobuf_FIND_UTF8_RANGE "if(NOT TARGET utf8_range)\n find_package(utf8_range CONFIG)\nendif()") ++set(_protobuf_FIND_UTF8_RANGE "if(NOT TARGET utf8_range::utf8_range)\n find_package(utf8_range CONFIG)\nendif()") diff --git a/ports/protobuf/portfile.cmake b/ports/protobuf/portfile.cmake index a448bdf2e88735..33261850e96f6a 100644 --- a/ports/protobuf/portfile.cmake +++ b/ports/protobuf/portfile.cmake @@ -1,15 +1,13 @@ -vcpkg_minimum_required(VERSION 2022-10-12) # for ${VERSION} - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO protocolbuffers/protobuf - REF v3.21.12 - SHA512 152f8441c325e808b942153c15e82fdb533d5273b50c25c28916ec568ada880f79242bb61ee332ac5fb0d20f21239ed6f8de02ef6256cc574b1fc354d002c6b0 + REF "v${VERSION}" + SHA512 ce81add9d978a6b63d4205715eac5084e81a6753da1f6c6bad6493e60253215901bffc4a60d704a873333f2b9f94fd86cb7eb5b293035f2268c12692bd808bac HEAD_REF master PATCHES fix-static-build.patch fix-default-proto-file-path.patch - compile_options.patch + fix-utf8-range.patch ) string(COMPARE EQUAL "${TARGET_TRIPLET}" "${HOST_TRIPLET}" protobuf_BUILD_PROTOC_BINARIES) @@ -38,10 +36,12 @@ endif() file(REMOVE_RECURSE "${SOURCE_PATH}/csharp" "${SOURCE_PATH}/java" + "${SOURCE_PATH}/lua" "${SOURCE_PATH}/objectivec" "${SOURCE_PATH}/php" "${SOURCE_PATH}/python" "${SOURCE_PATH}/ruby" + "${SOURCE_PATH}/rust" ) vcpkg_cmake_configure( @@ -53,46 +53,20 @@ vcpkg_cmake_configure( -DCMAKE_INSTALL_CMAKEDIR:STRING=share/protobuf -Dprotobuf_BUILD_PROTOC_BINARIES=${protobuf_BUILD_PROTOC_BINARIES} -Dprotobuf_BUILD_LIBPROTOC=${protobuf_BUILD_LIBPROTOC} + -Dprotobuf_ABSL_PROVIDER=package ${FEATURE_OPTIONS} ) vcpkg_cmake_install() -# It appears that at this point the build hasn't actually finished. There is probably -# a process spawned by the build, therefore we need to wait a bit. - -function(protobuf_try_remove_recurse_wait PATH_TO_REMOVE) - file(REMOVE_RECURSE ${PATH_TO_REMOVE}) - if (EXISTS "${PATH_TO_REMOVE}") - execute_process(COMMAND ${CMAKE_COMMAND} -E sleep 5) - file(REMOVE_RECURSE ${PATH_TO_REMOVE}) - endif() -endfunction() - -protobuf_try_remove_recurse_wait("${CURRENT_PACKAGES_DIR}/debug/include") - -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-release.cmake" - "\${_IMPORT_PREFIX}/bin/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}" - "\${_IMPORT_PREFIX}/tools/protobuf/protoc${VCPKG_HOST_EXECUTABLE_SUFFIX}" - IGNORE_UNCHANGED - ) -endif() - -if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug") - file(READ "${CURRENT_PACKAGES_DIR}/debug/share/protobuf/protobuf-targets-debug.cmake" DEBUG_MODULE) - string(REPLACE "\${_IMPORT_PREFIX}" "\${_IMPORT_PREFIX}/debug" DEBUG_MODULE "${DEBUG_MODULE}") - string(REPLACE "\${_IMPORT_PREFIX}/debug/bin/protoc${EXECUTABLE_SUFFIX}" "\${_IMPORT_PREFIX}/tools/protobuf/protoc${EXECUTABLE_SUFFIX}" DEBUG_MODULE "${DEBUG_MODULE}") - file(WRITE "${CURRENT_PACKAGES_DIR}/share/protobuf/protobuf-targets-debug.cmake" "${DEBUG_MODULE}") -endif() - -protobuf_try_remove_recurse_wait("${CURRENT_PACKAGES_DIR}/debug/share") - if(protobuf_BUILD_PROTOC_BINARIES) if(VCPKG_TARGET_IS_WINDOWS) vcpkg_copy_tools(TOOL_NAMES protoc AUTO_CLEAN) else() - vcpkg_copy_tools(TOOL_NAMES protoc protoc-${VERSION}.0 AUTO_CLEAN) + string(REPLACE "." ";" VERSION_LIST ${VERSION}) + list(GET VERSION_LIST 1 VERSION_MINOR) + list(GET VERSION_LIST 2 VERSION_PATCH) + vcpkg_copy_tools(TOOL_NAMES protoc protoc-${VERSION_MINOR}.${VERSION_PATCH}.0 AUTO_CLEAN) endif() else() file(COPY "${CURRENT_HOST_INSTALLED_DIR}/tools/${PORT}" DESTINATION "${CURRENT_PACKAGES_DIR}/tools") @@ -100,7 +74,7 @@ endif() vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/protobuf-config.cmake" "if(protobuf_MODULE_COMPATIBLE)" - "if(ON)" + "if(1)" ) if(NOT protobuf_BUILD_LIBPROTOC) vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/share/${PORT}/protobuf-module.cmake" @@ -109,15 +83,12 @@ if(NOT protobuf_BUILD_LIBPROTOC) ) endif() -if(VCPKG_LIBRARY_LINKAGE STREQUAL "static") - protobuf_try_remove_recurse_wait("${CURRENT_PACKAGES_DIR}/bin") - protobuf_try_remove_recurse_wait("${CURRENT_PACKAGES_DIR}/debug/bin") -endif() +vcpkg_cmake_config_fixup() if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic") - vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/google/protobuf/stubs/platform_macros.h" - "\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" - "\#ifndef PROTOBUF_USE_DLLS\n\#define PROTOBUF_USE_DLLS\n\#endif // PROTOBUF_USE_DLLS\n\n\#endif // GOOGLE_PROTOBUF_PLATFORM_MACROS_H_" + vcpkg_replace_string("${CURRENT_PACKAGES_DIR}/include/google/protobuf/port_def.inc" + "\#ifdef PROTOBUF_PORT_" + "\#ifndef PROTOBUF_USE_DLLS\n\#define PROTOBUF_USE_DLLS\n\#endif // PROTOBUF_USE_DLLS\n\n\#ifdef PROTOBUF_PORT_" ) endif() @@ -128,23 +99,25 @@ function(replace_package_string package) set(release_file "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${package}.pc") if(EXISTS "${release_file}") + vcpkg_replace_string("${release_file}" "absl_abseil_dll" "abseil_dll" IGNORE_UNCHANGED) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - vcpkg_replace_string(${release_file} "-l${package}" "-llib${package}") + vcpkg_replace_string("${release_file}" "-l${package}" "-llib${package}" IGNORE_UNCHANGED) endif() endif() if(EXISTS "${debug_file}") + vcpkg_replace_string("${debug_file}" "absl_abseil_dll" "abseil_dll" IGNORE_UNCHANGED) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) - vcpkg_replace_string(${debug_file} "-l${package}" "-llib${package}d") + vcpkg_replace_string("${debug_file}" "-l${package}" "-llib${package}d" IGNORE_UNCHANGED) else() - vcpkg_replace_string(${debug_file} "-l${package}" "-l${package}d") + vcpkg_replace_string("${debug_file}" "-l${package}" "-l${package}d" IGNORE_UNCHANGED) endif() endif() endfunction() set(packages protobuf protobuf-lite) foreach(package IN LISTS packages) - replace_package_string(${package}) + replace_package_string("${package}") endforeach() @@ -155,4 +128,7 @@ if(NOT protobuf_BUILD_PROTOC_BINARIES) endif() configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY) -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) + +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include") + +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/protobuf/vcpkg-cmake-wrapper.cmake b/ports/protobuf/vcpkg-cmake-wrapper.cmake index 542a16c2b8a300..17d787370b03bb 100644 --- a/ports/protobuf/vcpkg-cmake-wrapper.cmake +++ b/ports/protobuf/vcpkg-cmake-wrapper.cmake @@ -1,16 +1,3 @@ -if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.3) - cmake_policy(PUSH) - cmake_policy(SET CMP0057 NEW) - if(NOT "CONFIG" IN_LIST ARGS AND NOT "NO_MODULE" IN_LIST ARGS) - if("@VCPKG_LIBRARY_LINKAGE@" STREQUAL "static") - set(Protobuf_USE_STATIC_LIBS ON) - else() - set(Protobuf_USE_STATIC_LIBS OFF) - endif() - endif() - cmake_policy(POP) -endif() - find_program(Protobuf_PROTOC_EXECUTABLE NAMES protoc PATHS "${CMAKE_CURRENT_LIST_DIR}/../../../@HOST_TRIPLET@/tools/protobuf" NO_DEFAULT_PATH) -_find_package(${ARGS}) +_find_package(${ARGS} CONFIG) diff --git a/ports/protobuf/vcpkg.json b/ports/protobuf/vcpkg.json index d922e4bb03b42a..797a89b2f022fd 100644 --- a/ports/protobuf/vcpkg.json +++ b/ports/protobuf/vcpkg.json @@ -1,15 +1,16 @@ { "name": "protobuf", - "version": "3.21.12", - "port-version": 4, + "version": "4.25.1", "description": "Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data.", "homepage": "https://github.com/protocolbuffers/protobuf", "license": "BSD-3-Clause", "dependencies": [ + "abseil", { "name": "protobuf", "host": true }, + "utf8-range", { "name": "vcpkg-cmake", "host": true diff --git a/ports/pulsar-client-cpp/disable-warnings.patch b/ports/pulsar-client-cpp/disable-warnings.patch new file mode 100644 index 00000000000000..644015e9d0d3f4 --- /dev/null +++ b/ports/pulsar-client-cpp/disable-warnings.patch @@ -0,0 +1,12 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index b004653..4b7abd9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -88,7 +88,6 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Intel") + # ?? Don't have this to test with + else() # GCC or Clang are mostly compatible: + # Turn on warnings and enable warnings-as-errors: +- add_compile_options(-Wall -Wformat-security -Wvla -Werror) + # Turn off certain warnings that are too much pain for too little gain: + add_compile_options(-Wno-sign-compare -Wno-deprecated-declarations -Wno-error=cpp) + if (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR APPLE) diff --git a/ports/pulsar-client-cpp/portfile.cmake b/ports/pulsar-client-cpp/portfile.cmake index 37474a8408bcb2..b5e42390e14c84 100644 --- a/ports/pulsar-client-cpp/portfile.cmake +++ b/ports/pulsar-client-cpp/portfile.cmake @@ -4,6 +4,8 @@ vcpkg_from_github( REF "v${VERSION}" SHA512 9ee1b8d057298079c58c10226dbb07676eb94a11e7aa7b725dd9e0dd4e61e0af7127cda93c8651921fbbf00b91b89e28a88fb9edf3270360886319e94f672e12 HEAD_REF main + PATCHES + disable-warnings.patch ) string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" BUILD_STATIC_LIB) diff --git a/ports/pulsar-client-cpp/vcpkg.json b/ports/pulsar-client-cpp/vcpkg.json index f65a1c5820190b..40e0e046042cbf 100644 --- a/ports/pulsar-client-cpp/vcpkg.json +++ b/ports/pulsar-client-cpp/vcpkg.json @@ -1,6 +1,7 @@ { "name": "pulsar-client-cpp", "version": "3.5.1", + "port-version": 1, "description": "The Apache Pulsar C++ library", "homepage": "https://github.com/apache/pulsar-client-cpp", "license": "Apache-2.0", diff --git a/ports/shogun/cmake-config.in.patch b/ports/shogun/cmake-config.in.patch deleted file mode 100644 index 8ee2a13430e73e..00000000000000 --- a/ports/shogun/cmake-config.in.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff --git a/cmake/ShogunConfig.cmake.in b/cmake/ShogunConfig.cmake.in -index e8e8035..a5097cb 100644 ---- a/cmake/ShogunConfig.cmake.in -+++ b/cmake/ShogunConfig.cmake.in -@@ -2,5 +2,5 @@ - - set_and_check(shogun_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@") - --include("@PACKAGE_CONFIG_PACKAGE_DIR@/ShogunTargets.cmake") -+include("@PACKAGE_CONFIG_PACKAGE_DIR@/../../../share/shogun/ShogunTargets.cmake") - check_required_components(shogun) diff --git a/ports/shogun/cmake.patch b/ports/shogun/cmake.patch index 16f1c3ad45640e..77eb04c954c5fd 100644 --- a/ports/shogun/cmake.patch +++ b/ports/shogun/cmake.patch @@ -1,73 +1,93 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 6c48bed..6f97c8b 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -60,8 +60,8 @@ SET(SYSTEM_C_FLAGS "${CMAKE_C_FLAGS}") - SET(SYSTEM_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - STRING(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UC) - IF(NOT ("${BUILD_TYPE_UC}" STREQUAL "DISTRIBUTION")) -- SET(CMAKE_C_FLAGS "") -- SET(CMAKE_CXX_FLAGS "") -+# SET(CMAKE_C_FLAGS "") -+# SET(CMAKE_CXX_FLAGS "") - ENDIF(NOT ("${BUILD_TYPE_UC}" STREQUAL "DISTRIBUTION")) - - # CCACHE -@@ -184,12 +184,12 @@ SET(SWIG_CXX_COMPILER_FLAGS "-O0 -g") - SET(CMAKE_C_FLAGS "${COMPILER_WARNINGS} ${CMAKE_C_FLAGS}") - SET(CMAKE_CXX_FLAGS "${COMPILER_WARNINGS} ${CMAKE_CXX_FLAGS}") - IF(MSVC) -- SET(CMAKE_C_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}") -- SET(CMAKE_CXX_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}") -- SET(CMAKE_C_FLAGS_DISTRIBUTION "/Ot") -- SET(CMAKE_CXX_FLAGS_DISTRIBUTION "/Ot") -- SET(CMAKE_C_FLAGS_DEBUG "/DEBUG /Od /Zi") -- SET(CMAKE_CXX_FLAGS_DEBUG "/DEBUG /Od /Zi") -+ # SET(CMAKE_C_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}") -+ # SET(CMAKE_CXX_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}") -+ # SET(CMAKE_C_FLAGS_DISTRIBUTION "/Ot") -+ # SET(CMAKE_CXX_FLAGS_DISTRIBUTION "/Ot") -+ # SET(CMAKE_C_FLAGS_DEBUG "/DEBUG /Od /Zi") -+ # SET(CMAKE_CXX_FLAGS_DEBUG "/DEBUG /Od /Zi") - add_compile_options("/bigobj") - ELSE() - SET(CMAKE_C_FLAGS_RELEASE "-O3 ${RELEASE_COMPILER_FLAGS}") -diff --git a/cmake/version.cmake b/cmake/version.cmake -index fbca111..f6847f7 100644 ---- a/cmake/version.cmake -+++ b/cmake/version.cmake -@@ -5,7 +5,7 @@ SET(MAINVERSION ${VERSION}) - - SET(EXTRA "") - --IF(EXISTS "${ROOT_DIR}/.git/") -+IF(EXISTS "${ROOT_DIR}/.git/" AND FALSE) - FIND_PACKAGE(Git QUIET) - IF (NOT GIT_FOUND) - MESSAGE(FATAL_ERROR "The source is checked out from a git repository, but cannot find git executable!") -diff --git a/src/shogun/CMakeLists.txt b/src/shogun/CMakeLists.txt -index 9e79786..fd76961 100644 ---- a/src/shogun/CMakeLists.txt -+++ b/src/shogun/CMakeLists.txt -@@ -145,7 +145,7 @@ endif() - # add target for static library if enabled - if (LIBSHOGUN_BUILD_STATIC) - add_library(shogun-static STATIC $<TARGET_OBJECTS:libshogun> ${CMAKE_CURRENT_BINARY_DIR}/lib/config.h) -- set_property(TARGET shogun-static PROPERTY OUTPUT_NAME shogun) -+ set_property(TARGET shogun-static PROPERTY OUTPUT_NAME libshogun) - target_include_directories(shogun-static PUBLIC - $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> - $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src> -@@ -492,10 +492,12 @@ ELSE() - ENDIF() - - # set the desidered targets to be installed -+if(NOT INSTALL_TARGETS) - set(INSTALL_TARGETS shogun) - if (LIBSHOGUN_BUILD_STATIC) - LIST(APPEND INSTALL_TARGETS shogun-static) - endif() -+endif() - - INSTALL( - TARGETS ${INSTALL_TARGETS} +diff --git a/CMakeLists.txt b/CMakeLists.txt +index cb06e0cd3..e207fd5ef 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -113,8 +113,6 @@ SET(SYSTEM_C_FLAGS "${CMAKE_C_FLAGS}") + SET(SYSTEM_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + STRING(TOUPPER "${CMAKE_BUILD_TYPE}" BUILD_TYPE_UC) + IF(NOT ("${BUILD_TYPE_UC}" STREQUAL "DISTRIBUTION")) +- SET(CMAKE_C_FLAGS "") +- SET(CMAKE_CXX_FLAGS "") + ENDIF(NOT ("${BUILD_TYPE_UC}" STREQUAL "DISTRIBUTION")) + + # compilation cache +@@ -250,12 +248,6 @@ ELSEIF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang") + SET(RELEASE_COMPILER_FLAGS "-funroll-loops") + ENDIF() + IF(MSVC) +- SET(CMAKE_C_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}") +- SET(CMAKE_CXX_FLAGS_RELEASE "/O2 ${RELEASE_COMPILER_FLAGS}") +- SET(CMAKE_C_FLAGS_DISTRIBUTION "/Ot") +- SET(CMAKE_CXX_FLAGS_DISTRIBUTION "/Ot") +- SET(CMAKE_C_FLAGS_DEBUG "/DEBUG /Od /Zi") +- SET(CMAKE_CXX_FLAGS_DEBUG "/DEBUG /Od /Zi") + add_compile_options("/bigobj") + SET(SWIG_CXX_COMPILER_FLAGS "/DEBUG /Od /Zi") + ELSE() +diff --git a/cmake/version.cmake b/cmake/version.cmake +index f588caef3..204bc0c27 100644 +--- a/cmake/version.cmake ++++ b/cmake/version.cmake +@@ -5,7 +5,7 @@ SET(MAINVERSION ${VERSION}) + + SET(EXTRA "") + +-IF(EXISTS "${ROOT_DIR}/.git/") ++IF(0) + FIND_PACKAGE(Git QUIET) + IF (NOT GIT_FOUND) + MESSAGE(FATAL_ERROR "The source is checked out from a git repository, but cannot find git executable!") +diff --git a/src/shogun/CMakeLists.txt b/src/shogun/CMakeLists.txt +index 20c4b4fa6..8fcbd87ed 100644 +--- a/src/shogun/CMakeLists.txt ++++ b/src/shogun/CMakeLists.txt +@@ -42,7 +42,6 @@ ELSE() + ENDIF() + set(INCLUDE_INSTALL_DIR include) + set(THIRD_PARTY_INCLUDE_DIR ${CMAKE_CURRENT_BINARY_DIR}/third_party) +-set(SHOGUN_CLING_LIBRARY_DIR "\"${CMAKE_INSTALL_PREFIX}/${SHOGUN_LIB_INSTALL}\"") + + if (MSVC OR BUILD_BENCHMARKS) + SET(LIBSHOGUN_BUILD_STATIC ON +@@ -159,7 +158,7 @@ ENDIF() + # add target for static library if enabled + if (LIBSHOGUN_BUILD_STATIC) + add_library(shogun-static STATIC $<TARGET_OBJECTS:libshogun> ${CMAKE_CURRENT_BINARY_DIR}/lib/config.h) +- set_property(TARGET shogun-static PROPERTY OUTPUT_NAME shogun) ++ set_property(TARGET shogun-static PROPERTY OUTPUT_NAME libshogun) + target_include_directories(shogun-static PUBLIC + $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src> + $<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src> +@@ -441,7 +440,7 @@ if (NOT RapidJSON_FOUND) + endif() + SHOGUN_INCLUDE_DIRS(SCOPE PRIVATE ${RAPIDJSON_INCLUDE_DIRS}) + +-include(external/bitsery) ++find_package(bitsery) + SHOGUN_INCLUDE_DIRS(SCOPE PRIVATE ${BITSERY_INCLUDE_DIR}) + + if (NOT WIN32) +@@ -631,10 +630,6 @@ INSTALL( + PATTERN ".settings" EXCLUDE) + + # set the desidered targets to be installed +-set(INSTALL_TARGETS shogun) +-if (LIBSHOGUN_BUILD_STATIC) +- LIST(APPEND INSTALL_TARGETS shogun-static) +-endif() + + INSTALL( + TARGETS ${INSTALL_TARGETS} +@@ -645,10 +640,10 @@ INSTALL( + INCLUDES DESTINATION ${INCLUDE_INSTALL_DIR} + ) + +-file(TO_CMAKE_PATH ${SHOGUN_LIB_INSTALL}/cmake/shogun CONFIG_PACKAGE_DIR) ++file(TO_CMAKE_PATH share/shogun CONFIG_PACKAGE_DIR) + configure_package_config_file( + ${CMAKE_SOURCE_DIR}/cmake/ShogunConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/ShogunConfig.cmake +- INSTALL_DESTINATION ${SHOGUN_LIB_INSTALL}/cmake/shogun ++ INSTALL_DESTINATION share/shogun + PATH_VARS INCLUDE_INSTALL_DIR CONFIG_PACKAGE_DIR) + + write_basic_package_version_file( diff --git a/ports/shogun/eigen-3.4.patch b/ports/shogun/eigen-3.4.patch index c6cd369b12b939..727cbe44b5217c 100644 --- a/ports/shogun/eigen-3.4.patch +++ b/ports/shogun/eigen-3.4.patch @@ -1,37 +1,57 @@ +diff --git a/src/shogun/CMakeLists.txt b/src/shogun/CMakeLists.txt +index 31a0d2c7b..e700bd7c7 100644 +--- a/src/shogun/CMakeLists.txt ++++ b/src/shogun/CMakeLists.txt +@@ -307,7 +307,7 @@ IF(NOT EIGEN3_FOUND) + ) + ELSE() + # https://github.com/shogun-toolbox/shogun/issues/4870 +- IF(${EIGEN3_VERSION_STRING} VERSION_GREATER 3.3.9) ++ IF(0) + MESSAGE(FATAL_ERROR "The system Eigen3 version ${EIGEN3_VERSION_STRING} isn't supported!") + ENDIF() + SHOGUN_INCLUDE_DIRS(SCOPE PUBLIC SYSTEM ${EIGEN3_INCLUDE_DIR}) +diff --git a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp +index a1677177e..0c9ca8f78 100644 --- a/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp +++ b/src/shogun/machine/gp/MultiLaplaceInferenceMethod.cpp -@@ -84,9 +84,9 @@ class CMultiPsiLine : public func_base +@@ -87,10 +87,10 @@ public: float64_t result=0; for(index_t bl=0; bl<C; bl++) { -- eigen_f.block(bl*n,0,n,1)=K*alpha->block(bl*n,0,n,1)*CMath::exp(log_scale*2.0); +- eigen_f.block(bl * n, 0, n, 1) = +- K * alpha->block(bl * n, 0, n, 1) * std::exp(log_scale * 2.0); - result+=alpha->block(bl*n,0,n,1).dot(eigen_f.block(bl*n,0,n,1))/2.0; - eigen_f.block(bl*n,0,n,1)+=eigen_m; -+ eigen_f.segment(bl*n,n)=K*alpha->segment(bl*n,n)*CMath::exp(log_scale*2.0); ++ eigen_f.segment(bl * n, n) = ++ K * alpha->segment(bl * n, n) * std::exp(log_scale * 2.0); + result+=alpha->segment(bl*n,n).dot(eigen_f.segment(bl*n,n))/2.0; + eigen_f.segment(bl*n,n)+=eigen_m; } // get first and second derivatives of log likelihood -@@ -272,7 +272,7 @@ void CMultiLaplaceInferenceMethod::update_alpha() +@@ -278,9 +278,9 @@ void MultiLaplaceInferenceMethod::update_alpha() { Map<VectorXd> alpha(m_alpha.vector, m_alpha.vlen); for(index_t bl=0; bl<C; bl++) -- eigen_mu.block(bl*n,0,n,1)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.block(bl*n,0,n,1); -+ eigen_mu.segment(bl*n,n)=eigen_ktrtr*CMath::exp(m_log_scale*2.0)*alpha.segment(bl*n,n); +- eigen_mu.block(bl * n, 0, n, 1) = eigen_ktrtr * ++ eigen_mu.segment(bl * n, n) = eigen_ktrtr * + std::exp(m_log_scale * 2.0) * +- alpha.block(bl * n, 0, n, 1); ++ alpha.segment(bl * n, n); //alpha'*(f-m)/2.0 Psi_New=alpha.dot(eigen_mu)/2.0; -@@ -316,7 +316,7 @@ void CMultiLaplaceInferenceMethod::update_alpha() +@@ -324,7 +324,7 @@ void MultiLaplaceInferenceMethod::update_alpha() for(index_t bl=0; bl<C; bl++) { - VectorXd eigen_sD=eigen_dpi.block(bl*n,0,n,1).cwiseSqrt(); + VectorXd eigen_sD=eigen_dpi.segment(bl*n,n).cwiseSqrt(); - LLT<MatrixXd> chol_tmp((eigen_sD*eigen_sD.transpose()).cwiseProduct(eigen_ktrtr*CMath::exp(m_log_scale*2.0))+ - MatrixXd::Identity(m_ktrtr.num_rows, m_ktrtr.num_cols)); - MatrixXd eigen_L_tmp=chol_tmp.matrixU(); -@@ -341,11 +341,11 @@ void CMultiLaplaceInferenceMethod::update_alpha() + LLT<MatrixXd> chol_tmp( + (eigen_sD * eigen_sD.transpose()) + .cwiseProduct(eigen_ktrtr * std::exp(m_log_scale * 2.0)) + +@@ -351,14 +351,14 @@ void MultiLaplaceInferenceMethod::update_alpha() VectorXd tmp2=m_tmp.array().rowwise().sum(); for(index_t bl=0; bl<C; bl++) @@ -40,12 +60,16 @@ Map<VectorXd> &eigen_c=eigen_W; for(index_t bl=0; bl<C; bl++) -- eigen_c.block(bl*n,0,n,1)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.block(bl*n,0,n,1)); -+ eigen_c.segment(bl*n,n)=eigen_E.block(0,bl*n,n,n)*(eigen_ktrtr*CMath::exp(m_log_scale*2.0)*eigen_b.segment(bl*n,n)); +- eigen_c.block(bl * n, 0, n, 1) = ++ eigen_c.segment(bl * n, n) = + eigen_E.block(0, bl * n, n, n) * + (eigen_ktrtr * std::exp(m_log_scale * 2.0) * +- eigen_b.block(bl * n, 0, n, 1)); ++ eigen_b.segment(bl * n, n)); Map<MatrixXd> c_tmp(eigen_c.data(),n,C); -@@ -409,7 +409,7 @@ float64_t CMultiLaplaceInferenceMethod::get_derivative_helper(SGMatrix<float64_t +@@ -422,7 +422,7 @@ float64_t MultiLaplaceInferenceMethod::get_derivative_helper(SGMatrix<float64_t> { result+=((eigen_E.block(0,bl*n,n,n)-eigen_U.block(0,bl*n,n,n).transpose()*eigen_U.block(0,bl*n,n,n)).array() *eigen_dK.array()).sum(); @@ -54,7 +78,7 @@ } return result/2.0; -@@ -489,7 +489,7 @@ SGVector<float64_t> CMultiLaplaceInferenceMethod::get_derivative_wrt_mean( +@@ -504,7 +504,7 @@ SGVector<float64_t> MultiLaplaceInferenceMethod::get_derivative_wrt_mean( result[i]=0; //currently only compute the explicit term for(index_t bl=0; bl<C; bl++) diff --git a/ports/shogun/fix-ASSERT-not-found.patch b/ports/shogun/fix-ASSERT-not-found.patch index ae8889caaae4a7..ea656437e98302 100644 --- a/ports/shogun/fix-ASSERT-not-found.patch +++ b/ports/shogun/fix-ASSERT-not-found.patch @@ -1,12 +1,12 @@ -diff --git a/src/shogun/base/Parallel.cpp b/src/shogun/base/Parallel.cpp -index 78ba319..53ac6c0 100644 ---- a/src/shogun/base/Parallel.cpp -+++ b/src/shogun/base/Parallel.cpp -@@ -12,6 +12,7 @@ - #include <shogun/lib/RefCount.h> - #include <shogun/lib/config.h> - #include <shogun/lib/memory.h> -+#include <shogun/io/SGIO.h> - - #ifdef HAVE_CXX11 - #include <thread> +diff --git a/src/shogun/base/Parallel.cpp b/src/shogun/base/Parallel.cpp +index ad12280fa..a34a24706 100644 +--- a/src/shogun/base/Parallel.cpp ++++ b/src/shogun/base/Parallel.cpp +@@ -9,6 +9,7 @@ + #include <shogun/lib/RefCount.h> + #include <shogun/lib/config.h> + #include <shogun/lib/memory.h> ++#include <shogun/io/SGIO.h> + + #include <thread> + diff --git a/ports/shogun/fix-dirent.patch b/ports/shogun/fix-dirent.patch deleted file mode 100644 index f45102356d00c0..00000000000000 --- a/ports/shogun/fix-dirent.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/src/shogun/CMakeLists.txt b/src/shogun/CMakeLists.txt -index fd76961..396251c 100644 ---- a/src/shogun/CMakeLists.txt -+++ b/src/shogun/CMakeLists.txt -@@ -170,10 +170,10 @@ IF(MSVC) - ENDIF() - - # bundle dirent -- include(external/MSDirent) -+ find_path(MSDIRENT_INCLUDE_DIR NAMES dirent.h) - SHOGUN_INCLUDE_DIRS(SCOPE PUBLIC - $<BUILD_INTERFACE:${MSDIRENT_INCLUDE_DIR}> -- $<INSTALL_INTERFACE:include/shogun/lib/external/MSDirent> -+ $<INSTALL_INTERFACE:include> - ) - - target_link_libraries(shogun PUBLIC winmm) diff --git a/ports/shogun/fix_accelerate_detection.patch b/ports/shogun/fix_accelerate_detection.patch deleted file mode 100644 index 90bbe9b578a893..00000000000000 --- a/ports/shogun/fix_accelerate_detection.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/cmake/ShogunFindLAPACK.cmake b/cmake/ShogunFindLAPACK.cmake -index fe3d6db9c2..882a1f4218 100644 ---- a/cmake/ShogunFindLAPACK.cmake -+++ b/cmake/ShogunFindLAPACK.cmake -@@ -6,7 +6,8 @@ IF (LAPACK_FOUND) - SET(HAVE_LAPACK 1) - - # find out the type of Lapack/BLAS implementation we are dealing with -- IF("${LAPACK_LIBRARIES}" MATCHES ".*/Accelerate.framework$") -+ message(STATUS "LAPACK_LIBRARIES:${LAPACK_LIBRARIES}") -+ IF("${LAPACK_LIBRARIES}" MATCHES ".*/Accelerate.framework(;|$)") - # Accelerate.framework we found for LaPack/BLAS - SET(HAVE_MVEC 1) - SET(HAVE_CATLAS 1) diff --git a/ports/shogun/fmt.patch b/ports/shogun/fmt.patch new file mode 100644 index 00000000000000..281b1bacaa4da6 --- /dev/null +++ b/ports/shogun/fmt.patch @@ -0,0 +1,216 @@ +diff --git a/src/shogun/classifier/mkl/MKL.cpp b/src/shogun/classifier/mkl/MKL.cpp +index 2622df919..1a36aa513 100644 +--- a/src/shogun/classifier/mkl/MKL.cpp ++++ b/src/shogun/classifier/mkl/MKL.cpp +@@ -369,7 +369,7 @@ bool MKL::train_machine(std::shared_ptr<Features> data) + io::info("mkl_epsilon = %1.1e", mkl_epsilon); + io::info("C_mkl = %1.1e", C_mkl); + io::info("mkl_norm = %1.3e", mkl_norm); +- io::info("solver = {}", get_solver_type()); ++ io::info("solver = {}", (int)get_solver_type()); + io::info("ent_lambda = {}", ent_lambda); + io::info("mkl_block_norm = {}", mkl_block_norm); + +diff --git a/src/shogun/classifier/mkl/MKLMulticlass.cpp b/src/shogun/classifier/mkl/MKLMulticlass.cpp +index b50876f14..dc0f80e8a 100644 +--- a/src/shogun/classifier/mkl/MKLMulticlass.cpp ++++ b/src/shogun/classifier/mkl/MKLMulticlass.cpp +@@ -104,7 +104,7 @@ void MKLMulticlass::initlpsolver() + { + error("MKLMulticlass::initlpsolver(): given kernel is not of type" + " K_COMBINED {} required by Multiclass Mkl \n", +- m_kernel->get_kernel_type()); ++ (int)m_kernel->get_kernel_type()); + } + + int numker=std::dynamic_pointer_cast<CombinedKernel>(m_kernel)->get_num_subkernels(); +diff --git a/src/shogun/evaluation/ROCEvaluation.cpp b/src/shogun/evaluation/ROCEvaluation.cpp +index 482f06528..58595c844 100644 +--- a/src/shogun/evaluation/ROCEvaluation.cpp ++++ b/src/shogun/evaluation/ROCEvaluation.cpp +@@ -30,11 +30,11 @@ float64_t ROCEvaluation::evaluate(std::shared_ptr<Labels> predicted, std::shared + require( + predicted->get_label_type() == LT_BINARY, + "Given predicted labels ({}) must be binary ({}).", +- predicted->get_label_type(), LT_BINARY); ++ (int)predicted->get_label_type(), (int)LT_BINARY); + require( + ground_truth->get_label_type() == LT_BINARY, + "Given ground truth labels ({}) must be binary ({}).", +- ground_truth->get_label_type(), LT_BINARY); ++ (int)ground_truth->get_label_type(), (int)LT_BINARY); + + return evaluate_roc(binary_labels(predicted),binary_labels(ground_truth)); + } +diff --git a/src/shogun/io/SGIO.h b/src/shogun/io/SGIO.h +index 336e35b03..0ba7b2c0b 100644 +--- a/src/shogun/io/SGIO.h ++++ b/src/shogun/io/SGIO.h +@@ -307,7 +307,7 @@ namespace shogun + if (should_log(prio)) + { + fmt::memory_buffer msg; +- fmt::format_to(msg, format, std::forward<Args>(args)...); ++ fmt::format_to(std::back_inserter(msg), format, std::forward<Args>(args)...); + message_(prio, loc, fmt::string_view(msg.data(), msg.size())); + } + } +@@ -357,7 +357,7 @@ namespace shogun + "ExceptionType must be nothrow copy constructible"); + + fmt::memory_buffer msg; +- fmt::format_to(msg, format, std::forward<Args>(args)...); ++ fmt::format_to(std::back_inserter(msg), format, std::forward<Args>(args)...); + msg.push_back('\0'); + env()->io()->message(io::MSG_ERROR, loc, msg.data()); + throw ExceptionType(msg.data()); +diff --git a/src/shogun/io/serialization/JsonDeserializer.cpp b/src/shogun/io/serialization/JsonDeserializer.cpp +index 24fd30edd..7667e34d3 100644 +--- a/src/shogun/io/serialization/JsonDeserializer.cpp ++++ b/src/shogun/io/serialization/JsonDeserializer.cpp +@@ -49,7 +49,7 @@ public: + void on(std::vector<bool>::reference* v) override + { + *v = next_element<bool>(&ValueType::GetBool); +- SG_DEBUG("read bool with value {}", *v); ++ SG_DEBUG("read bool with value {}", (bool)*v); + } + void on(char* v) override + { +diff --git a/src/shogun/io/serialization/JsonSerializer.cpp b/src/shogun/io/serialization/JsonSerializer.cpp +index 22c99ec5c..530a14525 100644 +--- a/src/shogun/io/serialization/JsonSerializer.cpp ++++ b/src/shogun/io/serialization/JsonSerializer.cpp +@@ -62,7 +62,7 @@ public: + } + void on(std::vector<bool>::reference* v) override + { +- SG_DEBUG("writing bool with value {}", *v); ++ SG_DEBUG("writing bool with value {}", (bool)*v); + m_json_writer.Bool(*v); + close_container(); + } +diff --git a/src/shogun/kernel/CustomKernel.cpp b/src/shogun/kernel/CustomKernel.cpp +index 06a7e7abd..78be0ef6f 100644 +--- a/src/shogun/kernel/CustomKernel.cpp ++++ b/src/shogun/kernel/CustomKernel.cpp +@@ -112,10 +112,10 @@ bool CustomKernel::init(std::shared_ptr<Features> l, std::shared_ptr<Features> r + /* Make sure l and r have the same type of CFeatures */ + require(l->get_feature_class()==r->get_feature_class(), + "Different FeatureClass: l is {}, r is {}", +- l->get_feature_class(),r->get_feature_class()); ++ (int)l->get_feature_class(),(int)r->get_feature_class()); + require(l->get_feature_type()==r->get_feature_type(), + "Different FeatureType: l is {}, r is {}", +- l->get_feature_type(),r->get_feature_type()); ++ (int)l->get_feature_type(),(int)r->get_feature_type()); + + /* If l and r are the type of IndexFeatures, + * the init function adds a subset to kernel matrix. +diff --git a/src/shogun/preprocessor/DensePreprocessor.cpp b/src/shogun/preprocessor/DensePreprocessor.cpp +index 56de8a9e6..05cd9a32e 100644 +--- a/src/shogun/preprocessor/DensePreprocessor.cpp ++++ b/src/shogun/preprocessor/DensePreprocessor.cpp +@@ -90,7 +90,7 @@ std::shared_ptr<Features> DensePreprocessor<ST>::transform(std::shared_ptr<Featu + { + require(features->get_feature_class()==C_DENSE, "Provided features ({}) " + "has to be of C_DENSE ({}) class!", +- features->get_feature_class(), C_DENSE); ++ (int)features->get_feature_class(), (int)C_DENSE); + + auto matrix = features->as<DenseFeatures<ST>>()->get_feature_matrix(); + if (!inplace) +@@ -107,7 +107,7 @@ DensePreprocessor<ST>::inverse_transform(std::shared_ptr<Features> features, boo + features->get_feature_class() == C_DENSE, + "Provided features ({}) " + "has to be of C_DENSE ({}) class!", +- features->get_feature_class(), C_DENSE); ++ (int)features->get_feature_class(), (int)C_DENSE); + + auto matrix = features->as<DenseFeatures<ST>>()->get_feature_matrix(); + if (!inplace) +diff --git a/src/shogun/preprocessor/KernelPCA.cpp b/src/shogun/preprocessor/KernelPCA.cpp +index 6709f67cd..0707f3db9 100644 +--- a/src/shogun/preprocessor/KernelPCA.cpp ++++ b/src/shogun/preprocessor/KernelPCA.cpp +@@ -125,7 +125,7 @@ std::shared_ptr<Features> KernelPCA::transform(std::shared_ptr<Features> feature + return apply_to_string_features(features); + } + +- error("Feature type {} not supported", features->get_feature_type()); ++ error("Feature type {} not supported", (int)features->get_feature_type()); + return NULL; + } + +diff --git a/src/shogun/preprocessor/StringPreprocessor.cpp b/src/shogun/preprocessor/StringPreprocessor.cpp +index c0c342b82..87629b5cb 100644 +--- a/src/shogun/preprocessor/StringPreprocessor.cpp ++++ b/src/shogun/preprocessor/StringPreprocessor.cpp +@@ -95,7 +95,7 @@ namespace shogun + features->get_feature_class() == C_STRING, + "Provided features ({}) " + "has to be of C_STRING ({}) class!", +- features->get_feature_class(), C_STRING); ++ (int)features->get_feature_class(), (int)C_STRING); + + + +diff --git a/src/shogun/structure/BeliefPropagation.cpp b/src/shogun/structure/BeliefPropagation.cpp +index e54228917..96b90c458 100644 +--- a/src/shogun/structure/BeliefPropagation.cpp ++++ b/src/shogun/structure/BeliefPropagation.cpp +@@ -248,7 +248,7 @@ void TreeMaxProduct::bottom_up_pass() + for (uint32_t mi = 0; mi < m_msg_order.size(); ++mi) + { + SG_DEBUG("mi = {}, mtype: {} {} -> {}", mi, +- m_msg_order[mi]->mtype, m_msg_order[mi]->child, m_msg_order[mi]->parent); ++ (int)m_msg_order[mi]->mtype, m_msg_order[mi]->child, m_msg_order[mi]->parent); + + if (m_msg_order[mi]->mtype == VAR_TO_FAC) // var -> factor + { +@@ -392,7 +392,7 @@ void TreeMaxProduct::top_down_pass() + for (int32_t mi = (int32_t)(m_msg_order.size()-1); mi >= 0; --mi) + { + SG_DEBUG("mi = {}, mtype: {} {} <- {}", mi, +- m_msg_order[mi]->mtype, m_msg_order[mi]->child, m_msg_order[mi]->parent); ++ (int)m_msg_order[mi]->mtype, m_msg_order[mi]->child, m_msg_order[mi]->parent); + + if (m_msg_order[mi]->mtype == FAC_TO_VAR) // factor <- var + { +diff --git a/src/shogun/structure/CCSOSVM.cpp b/src/shogun/structure/CCSOSVM.cpp +index 8dd920ad8..8267a402c 100644 +--- a/src/shogun/structure/CCSOSVM.cpp ++++ b/src/shogun/structure/CCSOSVM.cpp +@@ -321,7 +321,7 @@ bool CCSOSVM::train_machine(std::shared_ptr<Features> data) + proximal_rhs[i] = (1+rho)*delta[i] - rho*gammaG0[i]; + break; + default: +- error("Invalid QPType: {}", m_qp_type); ++ error("Invalid QPType: {}", (int)m_qp_type); + } + } + +@@ -351,7 +351,7 @@ bool CCSOSVM::train_machine(std::shared_ptr<Features> data) + */ + break; + default: +- error("Invalid QPType: {}", m_qp_type); ++ error("Invalid QPType: {}", (int)m_qp_type); + } + + /* DEBUG */ +@@ -697,12 +697,12 @@ void CCSOSVM::init() + + /* check return code */ + if (r != MSK_RES_OK) +- error("Error while creating mosek env: {}", r); ++ error("Error while creating mosek env: {}", (int)r); + + /* initialize the environment */ + r = MSK_initenv(m_msk_env); + if (r != MSK_RES_OK) +- error("Error while initializing mosek env: {}", r); ++ error("Error while initializing mosek env: {}", (int)r); + #endif + + SG_ADD(&m_C, "m_C", "C"); diff --git a/ports/shogun/portfile.cmake b/ports/shogun/portfile.cmake index 86375b9085d4f4..9fff2511aaa13e 100644 --- a/ports/shogun/portfile.cmake +++ b/ports/shogun/portfile.cmake @@ -3,17 +3,16 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO shogun-toolbox/shogun - REF ab274e7ab6bf24dd598c1daf1e626cb686d6e1cc - SHA512 fb90e5bf802c6fd59bf35ab7bbde5e8cfcdc5d46c69c52097140b30c6b29e28b8341dd1ece7f8a1f9d9123f4bc06d44d288584ce7dfddccf3d33fe05106884ae + REF 8f01b2b9e4de46a38bf70cdb603db75ebfd4b58b + SHA512 24bd0e3e2a599e81432f59bd6ebc514729453cfe808541f6842dc57e2eff329e52a3e3575580bf84b2d4768209fa2624295e4e9cdcdc656dd48a8ab66bc6dbc6 HEAD_REF master PATCHES cmake.patch - cmake-config.in.patch eigen-3.4.patch - fix-dirent.patch fix-ASSERT-not-found.patch - remove_cmake_flags.patch - fix_accelerate_detection.patch + fmt.patch + syntax.patch + remove-bitsery.patch ) vcpkg_find_acquire_program(PYTHON3) @@ -46,7 +45,6 @@ vcpkg_cmake_configure( -DENABLE_TESTING=OFF -DLICENSE_GPL_SHOGUN=OFF -DLIBSHOGUN_BUILD_STATIC=ON - -DCMAKE_DISABLE_FIND_PACKAGE_JSON=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_ViennaCL=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_TFLogger=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_GLPK=TRUE @@ -56,17 +54,18 @@ vcpkg_cmake_configure( -DCMAKE_DISABLE_FIND_PACKAGE_LpSolve=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_ColPack=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_ARPREC=TRUE - -DCMAKE_DISABLE_FIND_PACKAGE_Ctags=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_CCache=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_CURL=TRUE -DCMAKE_DISABLE_FIND_PACKAGE_OpenMP=TRUE + -DCMAKE_DISABLE_FIND_PACKAGE_bitsery=TRUE -DINSTALL_TARGETS=shogun-static ${extra_opts} + -DCMAKE_CXX_STANDARD=14 # protobuf ) vcpkg_cmake_install() -vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/shogun) +vcpkg_cmake_config_fixup() file(REMOVE_RECURSE # This directory is empty given the settings above @@ -76,4 +75,4 @@ file(REMOVE_RECURSE ) # Handle copyright -file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/shogun/remove-bitsery.patch b/ports/shogun/remove-bitsery.patch new file mode 100644 index 00000000000000..9bcb92d24db812 --- /dev/null +++ b/ports/shogun/remove-bitsery.patch @@ -0,0 +1,51 @@ +diff --git a/src/interfaces/swig/SGBase.i b/src/interfaces/swig/SGBase.i +index 543a8ff00..4b4df8604 100644 +--- a/src/interfaces/swig/SGBase.i ++++ b/src/interfaces/swig/SGBase.i +@@ -504,10 +504,7 @@ namespace shogun + PyObject* __getstate__() + { + std::shared_ptr<io::Serializer> serializer = nullptr; +- if (pickle_ascii) + serializer = std::make_shared<io::JsonSerializer>(); +- else +- serializer = std::make_shared<io::BitserySerializer>(); + auto byte_stream = std::make_shared<io::ByteArrayOutputStream>(); + serializer->attach(byte_stream); + serializer->write(std::shared_ptr<SGObject>($self)); +@@ -537,10 +534,7 @@ namespace shogun + PyString_AsStringAndSize(py_str, &str, &len); + #endif + std::shared_ptr<io::Deserializer> deser = nullptr; +- if (pickle_ascii) + deser = std::make_shared<io::JsonDeserializer>(); +- else +- deser = std::make_shared<io::BitseryDeserializer>(); + + auto byte_input_stream = std::make_shared<io::ByteArrayInputStream>(str, len); + deser->attach(byte_input_stream); +diff --git a/src/shogun/CMakeLists.txt b/src/shogun/CMakeLists.txt +index 20c4b4fa6..fa4be96f6 100644 +--- a/src/shogun/CMakeLists.txt ++++ b/src/shogun/CMakeLists.txt +@@ -12,6 +12,7 @@ include(CheckCXXSourceCompiles) + include(CMakePackageConfigHelpers) + + FILE(GLOB_RECURSE LIBSHOGUN_SRC *.${EXT_SRC_CPP} *.${EXT_SRC_C}) ++list(FILTER LIBSHOGUN_SRC EXCLUDE REGEX ".*(BitserySerializer\.cpp|BitseryDeserializer\.cpp)$") + FILE(GLOB_RECURSE LIBSHOGUN_HEADERS *.${EXT_SRC_HEADER}) + FILE(GLOB_RECURSE LIBSHOGUN_SRC_TMP *.${EXT_CPP_TMP}) + +diff --git a/src/shogun/base/class_list.cpp.py b/src/shogun/base/class_list.cpp.py +index 854d5dd1e..92c4379c1 100644 +--- a/src/shogun/base/class_list.cpp.py ++++ b/src/shogun/base/class_list.cpp.py +@@ -69,7 +69,7 @@ class_blacklist = ["SGVector", "SGMatrix", "SGSparseVector", "SGSparseMatrix", + "NumericalVGLikelihood", "SingleFITCInference", "VariationalGaussianLikelihood", + "RationalApproximation", "FirstOrderStochasticMinimizer", "IndependenceTest", + "TwoDistributionTest", "TwoSampleTest", "RealDistance", "BinaryClassEvaluation", +- "MomentumCorrection", "OneDistributionTest", "DependenceMaximization"] ++ "MomentumCorrection", "OneDistributionTest", "DependenceMaximization", "BitserySerializer", "BitseryDeserializer"] + + SHOGUN_TEMPLATE_CLASS = "SHOGUN_TEMPLATE_CLASS" + SHOGUN_BASIC_CLASS = "SHOGUN_BASIC_CLASS" diff --git a/ports/shogun/remove_cmake_flags.patch b/ports/shogun/remove_cmake_flags.patch deleted file mode 100644 index f9adeb22ed19bb..00000000000000 --- a/ports/shogun/remove_cmake_flags.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/CMakeLists.txt b/CMakeLists.txt -index 94c8389f96..d4d533301a 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -192,12 +192,12 @@ IF(MSVC) - # SET(CMAKE_CXX_FLAGS_DEBUG "/DEBUG /Od /Zi") - add_compile_options("/bigobj") - ELSE() -- SET(CMAKE_C_FLAGS_RELEASE "-O3 ${RELEASE_COMPILER_FLAGS}") -- SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${RELEASE_COMPILER_FLAGS}") -- SET(CMAKE_C_FLAGS_DISTRIBUTION "-O2") -- SET(CMAKE_CXX_FLAGS_DISTRIBUTION "-O2") -- SET(CMAKE_C_FLAGS_DEBUG "-g") -- SET(CMAKE_CXX_FLAGS_DEBUG "-g") -+ #SET(CMAKE_C_FLAGS_RELEASE "-O3 ${RELEASE_COMPILER_FLAGS}") -+ #SET(CMAKE_CXX_FLAGS_RELEASE "-O3 ${RELEASE_COMPILER_FLAGS}") -+ #SET(CMAKE_C_FLAGS_DISTRIBUTION "-O2") -+ #SET(CMAKE_CXX_FLAGS_DISTRIBUTION "-O2") -+ #SET(CMAKE_C_FLAGS_DEBUG "-g") -+ #SET(CMAKE_CXX_FLAGS_DEBUG "-g") - ENDIF() - - OPTION(ENABLE_COVERAGE "Enable code coverage" OFF) diff --git a/ports/shogun/syntax.patch b/ports/shogun/syntax.patch new file mode 100644 index 00000000000000..fc3d22aa2d7df8 --- /dev/null +++ b/ports/shogun/syntax.patch @@ -0,0 +1,24 @@ +diff --git a/src/shogun/io/ShogunErrc.h b/src/shogun/io/ShogunErrc.h +index 6cb5619c5..98b08b494 100644 +--- a/src/shogun/io/ShogunErrc.h ++++ b/src/shogun/io/ShogunErrc.h +@@ -8,6 +8,7 @@ + #define SHOGUN_ERRORS_H__ + + #include <system_error> ++#include <cstdint> + + #include <shogun/lib/common.h> + +diff --git a/src/shogun/mathematics/linalg/LinalgNamespace.h b/src/shogun/mathematics/linalg/LinalgNamespace.h +index 40888e00c..c4293e378 100644 +--- a/src/shogun/mathematics/linalg/LinalgNamespace.h ++++ b/src/shogun/mathematics/linalg/LinalgNamespace.h +@@ -1825,7 +1825,6 @@ namespace shogun + auto max_it = std::max_element(a_copy.begin(), a_copy.begin() + n); + result = (a_copy[n] + *max_it) / 2; + } +- } + + return result; + } diff --git a/ports/shogun/vcpkg.json b/ports/shogun/vcpkg.json index b6b62a8c0b463b..be26036d6f857b 100644 --- a/ports/shogun/vcpkg.json +++ b/ports/shogun/vcpkg.json @@ -1,14 +1,12 @@ { "name": "shogun", - "version": "6.1.4", - "port-version": 10, + "version-date": "2023-12-19", "description": "Unified and efficient Machine Learning", "homepage": "https://github.com/shogun-toolbox/shogun", "dependencies": [ "blas", "bzip2", "curl", - "dirent", "eigen3", { "name": "hdf5", @@ -21,8 +19,10 @@ "lzo", "nlopt", "protobuf", + "rapidjson", "rxcpp", "snappy", + "spdlog", { "name": "vcpkg-cmake", "host": true diff --git a/ports/srpc/portfile.cmake b/ports/srpc/portfile.cmake index 5b5dbc81a8eb5d..3e3b4f3a636647 100644 --- a/ports/srpc/portfile.cmake +++ b/ports/srpc/portfile.cmake @@ -1,14 +1,23 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO sogou/srpc - REF v0.9.3 - SHA512 e64cfec279f833ad24b1942ef2b572fc4bd3bfc5f9d623cd5d25b3c869d2ff9b35250cc814e8aaeb919ebed0929c44407eb9abb2e6793cfdc967708210f5f7e3 + REF v${VERSION} + SHA512 12816755ba94d1d006d5bbbbba14b0589258f6a79b3fef16b722e7a9f5375a6f69a513f203b27eef305358ec28d07a0553a40b1aaebf467326f14e4b6bfc4a01 HEAD_REF master + PATCHES + protobuf.patch ) +string(COMPARE EQUAL "${VCPKG_CRT_LINKAGE}" "static" SRPC_BUILD_STATIC_RUNTIME) + vcpkg_cmake_configure( SOURCE_PATH ${SOURCE_PATH} DISABLE_PARALLEL_CONFIGURE + OPTIONS + -DSRPC_BUILD_STATIC_RUNTIME=${SRPC_BUILD_STATIC_RUNTIME} + -DCMAKE_CXX_STANDARD=11 + MAYBE_UNUSED_VARIABLES + SRPC_BUILD_STATIC_RUNTIME ) vcpkg_cmake_install() @@ -19,6 +28,5 @@ vcpkg_copy_tools( AUTO_CLEAN ) -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/srpc/protobuf.patch b/ports/srpc/protobuf.patch new file mode 100644 index 00000000000000..5dc40bda25a2d0 --- /dev/null +++ b/ports/srpc/protobuf.patch @@ -0,0 +1,148 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6c1aafc..97854a6 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -58,11 +58,10 @@ else () + endif () + + check_include_file_cxx("workflow/Workflow.h" WORKFLOW_INSTALLED) +-if (NOT WORKFLOW_INSTALLED) ++if (0) + if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/workflow/workflow-config.cmake.in") + message( FATAL_ERROR "\nWorkflow" ${THIRD_PARTY_FATAL_MESSAGE} ) + endif () +-else () + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/workflow/workflow-config.cmake.in") + message("Workflow third_party FOUND. Use for source code dependencies.") + set(WORKFLOW_INSTALLED 0) +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt +index 3b47ee6..15c8009 100644 +--- a/src/CMakeLists.txt ++++ b/src/CMakeLists.txt +@@ -16,7 +16,7 @@ set(protobuf_MODULE_COMPATIBLE ON CACHE BOOL "") + if (WIN32) + find_package(Protobuf REQUIRED CONFIG) + else () +- find_package(Protobuf 3.5.0 REQUIRED) ++ find_package(Protobuf CONFIG REQUIRED) + endif () + + if (WIN32) +@@ -59,8 +59,8 @@ if (WIN32) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP /wd4200") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /wd4200 /Zc:__cplusplus /std:c++14") + else () +- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIC -pipe -std=gnu90") +- set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -pipe -std=c++11 -fno-exceptions") ++ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIC -pipe") ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC -pipe -fno-exceptions") + endif () + + add_subdirectory(generator) +@@ -100,6 +100,7 @@ if (WIN32) + ) + + add_dependencies(${PROJECT_NAME} LINK_HEADERS) ++ target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) + + target_compile_definitions( + ${PROJECT_NAME} PRIVATE +@@ -118,7 +119,6 @@ if (WIN32) + else () + set(STATIC_LIB_NAME ${PROJECT_NAME}-static) + set(SHARED_LIB_NAME ${PROJECT_NAME}-shared) +- get_filename_component(Protobuf_LIB_DIR ${Protobuf_LIBRARY} DIRECTORY) + link_directories(${OPENSSL_LINK_DIR} ${WORKFLOW_LIB_DIR} ${Protobuf_LIB_DIR}) + + add_library( +@@ -143,8 +143,10 @@ else () + $<TARGET_OBJECTS:http> + ) + ++ target_link_libraries(${SHARED_LIB_NAME} PUBLIC protobuf::libprotobuf) ++ target_link_libraries(${STATIC_LIB_NAME} PUBLIC protobuf::libprotobuf) + if (APPLE) +- target_link_libraries(${SHARED_LIB_NAME} ++ target_link_libraries(${SHARED_LIB_NAME} PUBLIC + OpenSSL::SSL + OpenSSL::Crypto + pthread +diff --git a/src/compress/CMakeLists.txt b/src/compress/CMakeLists.txt +index 818b505..c0d1dde 100644 +--- a/src/compress/CMakeLists.txt ++++ b/src/compress/CMakeLists.txt +@@ -51,3 +51,4 @@ else () + ) + endif() + ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) +diff --git a/src/generator/CMakeLists.txt b/src/generator/CMakeLists.txt +index c2d72d7..674c5d0 100644 +--- a/src/generator/CMakeLists.txt ++++ b/src/generator/CMakeLists.txt +@@ -8,6 +8,7 @@ set(SRC + ) + + add_executable(${PROJECT_NAME} ${SRC}) ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) + if (WIN32) + target_compile_definitions( + ${PROJECT_NAME} PRIVATE +diff --git a/src/http/CMakeLists.txt b/src/http/CMakeLists.txt +index 64c0377..1cf1dfc 100644 +--- a/src/http/CMakeLists.txt ++++ b/src/http/CMakeLists.txt +@@ -11,6 +11,7 @@ set(SRC + ) + + add_library(${PROJECT_NAME} OBJECT ${SRC}) ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) + if (WIN32) + target_compile_definitions( + ${PROJECT_NAME} PRIVATE +diff --git a/src/message/CMakeLists.txt b/src/message/CMakeLists.txt +index 952607f..f947540 100644 +--- a/src/message/CMakeLists.txt ++++ b/src/message/CMakeLists.txt +@@ -15,6 +15,7 @@ set(SRC + ) + + add_library(${PROJECT_NAME} OBJECT ${SRC}) ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) + if (WIN32) + target_compile_definitions( + ${PROJECT_NAME} PRIVATE +diff --git a/src/module/CMakeLists.txt b/src/module/CMakeLists.txt +index f0041a4..a9d9a65 100644 +--- a/src/module/CMakeLists.txt ++++ b/src/module/CMakeLists.txt +@@ -22,6 +22,7 @@ set(SRC + ) + + add_library(${PROJECT_NAME} OBJECT ${SRC}) ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) + + if (WIN32) + target_compile_definitions( +diff --git a/src/thrift/CMakeLists.txt b/src/thrift/CMakeLists.txt +index 1d1d61c..dc66723 100644 +--- a/src/thrift/CMakeLists.txt ++++ b/src/thrift/CMakeLists.txt +@@ -7,4 +7,4 @@ set(SRC + ) + + add_library(${PROJECT_NAME} OBJECT ${SRC}) +- ++target_link_libraries(${PROJECT_NAME} PUBLIC protobuf::libprotobuf) +diff --git a/srpc-config.cmake.in b/srpc-config.cmake.in +index 54b4323..1cdb97f 100644 +--- a/srpc-config.cmake.in ++++ b/srpc-config.cmake.in +@@ -3,7 +3,6 @@ + set(SRPC_VERSION "@srpc_VERSION@") + set_and_check(SRPC_INCLUDE_DIR "@PACKAGE_CONFIG_INC_DIR@") + set_and_check(SRPC_LIB_DIR "@PACKAGE_CONFIG_LIB_DIR@") +-set_and_check(SRPC_BIN_DIR "@PACKAGE_CONFIG_BIN_DIR@") + + if (EXISTS "${CMAKE_CURRENT_LIST_DIR}/srpc-targets.cmake") + include ("${CMAKE_CURRENT_LIST_DIR}/srpc-targets.cmake") diff --git a/ports/srpc/vcpkg.json b/ports/srpc/vcpkg.json index 3b95d8da00f2f8..8b2b963464d706 100644 --- a/ports/srpc/vcpkg.json +++ b/ports/srpc/vcpkg.json @@ -1,6 +1,6 @@ { "name": "srpc", - "version-semver": "0.9.3", + "version-semver": "0.10.1", "description": "RPC based on Sogou C++ Workflow", "homepage": "https://github.com/sogou/srpc", "dependencies": [ diff --git a/ports/upb/0001-make-cmakelists-py.patch b/ports/upb/0001-make-cmakelists-py.patch deleted file mode 100644 index 15f333efe55f21..00000000000000 --- a/ports/upb/0001-make-cmakelists-py.patch +++ /dev/null @@ -1,141 +0,0 @@ -diff --git a/cmake/make_cmakelists.py b/cmake/make_cmakelists.py -index d64c14f6..ad3597c3 100755 ---- a/cmake/make_cmakelists.py -+++ b/cmake/make_cmakelists.py -@@ -316,10 +316,136 @@ class Converter(object): - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--build-id") - endif() - -+ if (MSVC) -+ add_compile_options(/wd4146 /wd4703 -D_CRT_SECURE_NO_WARNINGS) -+ endif() -+ - enable_testing() - -+ set(CMAKE_CXX_STANDARD 11) -+ -+ if (VCPKG_UPB_BUILD_CODEGEN) -+ find_package(absl CONFIG REQUIRED) -+ find_package(protobuf CONFIG REQUIRED) -+ -+ if (ABSL_USE_CXX17) -+ message(STATUS "Found absl uses CXX17, enable CXX17 feature.") -+ set(CMAKE_CXX_STANDARD 17) -+ endif() -+ endif() -+ -+ add_library(descriptor_upb_proto) -+ -+ add_library(utf8_range -+ ../third_party/utf8_range/naive.c -+ ../third_party/utf8_range/range2-neon.c -+ ../third_party/utf8_range/range2-sse.c -+ ../third_party/utf8_range/utf8_range.h -+ ) -+ - %(toplevel)s - -+ set(UPB_DESCRIPTOR_PROTO "${VCPKG_UPB_HOST_INCLUDE_DIR}/google/protobuf/descriptor.proto") -+ if (VCPKG_UPB_BUILD_CODEGEN) -+ set(UPB_CODEGEN_TARGETS protoc-gen-upb protoc-gen-upbdefs) -+ -+ add_executable(protoc-gen-upbdefs -+ ../upbc/common.h -+ ../upbc/common.cc -+ ../upbc/protoc-gen-upbdefs.cc -+ ) -+ target_link_libraries(protoc-gen-upbdefs PRIVATE -+ absl::flat_hash_map -+ absl::strings -+ protobuf::libprotobuf -+ protobuf::libprotoc -+ ) -+ -+ add_executable(protoc-gen-upb -+ ../upbc/common.h -+ ../upbc/common.cc -+ ../upbc/protoc-gen-upb.cc -+ ) -+ target_link_libraries(protoc-gen-upb PRIVATE -+ mini_table -+ port -+ upb -+ absl::flat_hash_map -+ absl::flat_hash_set -+ absl::strings -+ protobuf::libprotobuf -+ protobuf::libprotoc -+ ) -+ -+ set(PROTOC_PROGRAM "\$<TARGET_FILE:protobuf::protoc>") -+ set(PROTOC_GEN_UPB_PROGRAM "\$<TARGET_FILE:protoc-gen-upb>") -+ set(PROTOC_GEN_UPBDEFS_PROGRAM "\$<TARGET_FILE:protoc-gen-upbdefs>") -+ else() -+ find_program(PROTOC_PROGRAM protoc) -+ find_program(PROTOC_GEN_UPB_PROGRAM protoc-gen-upb) -+ find_program(PROTOC_GEN_UPBDEFS_PROGRAM protoc-gen-upbdefs) -+ endif() -+ -+ set(UPB_DESCRIPTOR_SOURCES -+ "${CMAKE_CURRENT_BINARY_DIR}/google/protobuf/descriptor.upb.h" -+ "${CMAKE_CURRENT_BINARY_DIR}/google/protobuf/descriptor.upb.c" -+ "${CMAKE_CURRENT_BINARY_DIR}/google/protobuf/descriptor.upbdefs.h" -+ "${CMAKE_CURRENT_BINARY_DIR}/google/protobuf/descriptor.upbdefs.c" -+ ) -+ -+ add_custom_command( -+ OUTPUT ${UPB_DESCRIPTOR_SOURCES} -+ DEPENDS "${UPB_DESCRIPTOR_PROTO}" -+ COMMAND -+ "${PROTOC_PROGRAM}" -+ "-I${VCPKG_UPB_HOST_INCLUDE_DIR}" -+ "--plugin=protoc-gen-upb=${PROTOC_GEN_UPB_PROGRAM}" -+ "--plugin=protoc-gen-upbdefs=${PROTOC_GEN_UPBDEFS_PROGRAM}" -+ "--upb_out=${CMAKE_CURRENT_BINARY_DIR}" -+ "--upbdefs_out=${CMAKE_CURRENT_BINARY_DIR}" -+ "${UPB_DESCRIPTOR_PROTO}" -+ ) -+ -+ target_sources(descriptor_upb_proto PRIVATE ${UPB_DESCRIPTOR_SOURCES}) -+ -+ set_target_properties(reflection PROPERTIES OUTPUT_NAME upb_reflection) -+ set_target_properties(fastdecode PROPERTIES OUTPUT_NAME upb_fastdecode) -+ set_target_properties(textformat PROPERTIES OUTPUT_NAME upb_textformat) -+ set_target_properties(json PROPERTIES OUTPUT_NAME upb_json) -+ set_target_properties(utf8_range PROPERTIES OUTPUT_NAME upb_utf8_range) -+ set_target_properties(mini_table PROPERTIES OUTPUT_NAME upb_mini_table) -+ set_target_properties(extension_registry PROPERTIES OUTPUT_NAME upb_extension_registry) -+ set_target_properties(collections PROPERTIES OUTPUT_NAME upb_collections) -+ -+ install( -+ DIRECTORY ../upb -+ DESTINATION include -+ FILES_MATCHING -+ PATTERN "*.h" -+ PATTERN "*.hpp" -+ PATTERN "*.inc" -+ PATTERN "*.int.h" -+ ) -+ target_include_directories(upb PUBLIC $<INSTALL_INTERFACE:include>) -+ install(TARGETS -+ upb -+ utf8_range -+ fastdecode -+ json -+ port -+ table -+ descriptor_upb_proto -+ reflection -+ textformat -+ mini_table_internal -+ mini_table -+ extension_registry -+ collections -+ ${UPB_CODEGEN_TARGETS} -+ EXPORT upb-config -+ ) -+ install(EXPORT upb-config NAMESPACE upb:: DESTINATION share/upb) -+ - """) - - data = {} diff --git a/ports/upb/0002-fix-uwp.patch b/ports/upb/0002-fix-uwp.patch deleted file mode 100644 index 0b0b712dd1de96..00000000000000 --- a/ports/upb/0002-fix-uwp.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/upb/json_decode.c b/upb/json_decode.c -index c4698f0..20226f5 100644 ---- a/upb/json_decode.c -+++ b/upb/json_decode.c -@@ -1217,7 +1217,7 @@ static void jsondec_struct(jsondec* d, upb_Message* msg, - static void jsondec_wellknownvalue(jsondec* d, upb_Message* msg, - const upb_MessageDef* m) { - upb_MessageValue val; -- const upb_FieldDef* f; -+ const upb_FieldDef* f = 0; - upb_Message* submsg; - - switch (jsondec_peek(d)) { diff --git a/ports/upb/fix-cmake.patch b/ports/upb/fix-cmake.patch new file mode 100644 index 00000000000000..45c145555f677a --- /dev/null +++ b/ports/upb/fix-cmake.patch @@ -0,0 +1,151 @@ +diff --git a/upb/cmake/CMakeLists.txt b/upb/cmake/CMakeLists.txt +index 3ebe25780..67a70cf81 100644 +--- a/upb/cmake/CMakeLists.txt ++++ b/upb/cmake/CMakeLists.txt +@@ -4,6 +4,7 @@ cmake_minimum_required(VERSION 3.10...3.24) + + project(upb) + set(CMAKE_C_STANDARD 99) ++set(CMAKE_CXX_STANDARD 11) + + # Prevent CMake from setting -rdynamic on Linux (!!). + SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") +@@ -39,7 +40,8 @@ if(UPB_ENABLE_UBSAN) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address") + endif() + +-if(NOT TARGET utf8_range) ++find_package(utf8_range REQUIRED CONFIG) ++if(0) + if(EXISTS ../../external/utf8_range) + # utf8_range is already installed + include_directories(../external/utf8_range) +@@ -60,6 +62,11 @@ if(NOT TARGET utf8_range) + endif() + endif() + ++if (VCPKG_UPB_BUILD_CODEGEN) ++ find_package(absl CONFIG REQUIRED) ++ find_package(protobuf CONFIG REQUIRED) ++endif() ++ + if(APPLE) + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -undefined dynamic_lookup -flat_namespace") + elseif(UNIX) +@@ -69,17 +76,14 @@ endif() + enable_testing() + + +-add_library(upb INTERFACE ++add_library(upb + + ) +-target_include_directories(upb INTERFACE +- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/..> +- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../cmake> +- $<BUILD_INTERFACE:${CMAKE_CURRENT_BINRARY_DIR}> ++target_include_directories(upb PUBLIC ++ $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../..> + ) + target_link_libraries(upb INTERFACE +- base +- mem) ++ ) + + add_library(generated_code_support__only_for_generated_code_do_not_use__i_give_permission_to_break_me INTERFACE + +@@ -123,4 +127,94 @@ target_link_libraries(generated_reflection_support__only_for_generated_code_do_n + mini_descriptor + reflection_internal) + ++file(GLOB_RECURSE source_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/../" "${CMAKE_CURRENT_SOURCE_DIR}/../*.c") ++list(FILTER source_files EXCLUDE REGEX ".*(_test|upb_so|util|cmake|conformance).*") ++list(TRANSFORM source_files PREPEND "${CMAKE_CURRENT_SOURCE_DIR}/../") ++target_sources(upb PRIVATE ${source_files}) ++ ++target_include_directories(upb PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../reflection/stage0>) ++target_link_libraries(upb PRIVATE utf8_range::utf8_range) ++ ++if (VCPKG_UPB_BUILD_CODEGEN) ++ add_library(common OBJECT ++ ../util/def_to_proto.c ++ ../../upb_generator/common.cc ++ ../../upb_generator/file_layout.cc ++ ../../upb_generator/names.cc ++ ../../upb_generator/stage0/google/protobuf/compiler/plugin.upb.c ++ ) ++ target_link_libraries(common PUBLIC ++ upb ++ absl::flat_hash_map ++ ) ++ target_include_directories(common PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../upb_generator/stage0>) ++ ++ add_executable(protoc-gen-upbdefs ++ ../../upb_generator/protoc-gen-upbdefs.cc ++ ) ++ target_link_libraries(protoc-gen-upbdefs PRIVATE ++ common ++ absl::absl_log ++ absl::strings ++ protobuf::libprotobuf ++ protobuf::libprotoc ++ ) ++ ++ add_executable(protoc-gen-upb ++ ../../upb_generator/protoc-gen-upb.cc ++ ) ++ target_link_libraries(protoc-gen-upb PRIVATE ++ common ++ absl::absl_log ++ absl::strings ++ protobuf::libprotobuf ++ protobuf::libprotoc ++ ) ++ ++ add_executable(protoc-gen-upb_minitable ++ ../../upb_generator/protoc-gen-upb_minitable.cc ++ ) ++ target_link_libraries(protoc-gen-upb_minitable PRIVATE ++ common ++ absl::absl_log ++ absl::strings ++ protobuf::libprotobuf ++ protobuf::libprotoc ++ ) ++ ++ list(APPEND _upb_codegen_targets protoc-gen-upbdefs protoc-gen-upb protoc-gen-upb_minitable) ++endif() + ++include(GNUInstallDirs) ++ ++target_include_directories(upb PUBLIC $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}/reflection/stage0>) ++ ++install(EXPORT ${PROJECT_NAME}-targets ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}" ++ NAMESPACE ${PROJECT_NAME}:: ++) ++file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" ++ "include(CMakeFindDependencyMacro)\nfind_dependency(utf8_range)\ninclude(\"\${CMAKE_CURRENT_LIST_DIR}/${PROJECT_NAME}-targets.cmake\")") ++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/${PROJECT_NAME}") ++ ++install(TARGETS upb ${_upb_codegen_targets} EXPORT ${PROJECT_NAME}-targets ++ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ++ LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ++ INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ++) ++ ++install(FILES ++ ../upb.hpp ++ ../generated_code_support.h ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}" ++) ++foreach(_dir base collections hash io json lex mem message mini_descriptor mini_table port reflection text wire) ++ install(DIRECTORY "../${_dir}" ++ DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/${PROJECT_NAME}" ++ FILES_MATCHING ++ PATTERN "*.hpp" ++ PATTERN "*.h" ++ PATTERN "*.inc" ++ ) ++endforeach() diff --git a/ports/upb/portfile.cmake b/ports/upb/portfile.cmake index 374b8e4eac2e39..4408295c23cc41 100644 --- a/ports/upb/portfile.cmake +++ b/ports/upb/portfile.cmake @@ -2,24 +2,14 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH - REPO protocolbuffers/upb - REF e4635f223e7d36dfbea3b722a4ca4807a7e882e2 # 2022-06-21 - SHA512 c5d48b1d87be7db65ad1f04f5ab43d694958d0e6892fd79c29993e564a402891fcd24ee9d34a9ca642ad20b80c02d3157675885edb6bd3bbc8cf5f29cc3be32c - HEAD_REF master + REPO protocolbuffers/protobuf + REF "v${VERSION}" + SHA512 ce81add9d978a6b63d4205715eac5084e81a6753da1f6c6bad6493e60253215901bffc4a60d704a873333f2b9f94fd86cb7eb5b293035f2268c12692bd808bac + HEAD_REF main PATCHES - 0001-make-cmakelists-py.patch - 0002-fix-uwp.patch + fix-cmake.patch ) -vcpkg_find_acquire_program(PYTHON3) - -vcpkg_execute_required_process( - COMMAND "${PYTHON3}" "${SOURCE_PATH}/cmake/make_cmakelists.py" "cmake/CMakeLists.txt" - WORKING_DIRECTORY "${SOURCE_PATH}" - LOGNAME make_cmakelists) - -vcpkg_replace_string("${SOURCE_PATH}/cmake/CMakeLists.txt" "/third_party/utf8_range)" "utf8_range)") - vcpkg_check_features( OUT_FEATURE_OPTIONS FEATURE_OPTIONS FEATURES @@ -31,9 +21,8 @@ if(NOT VCPKG_UPB_BUILD_CODEGEN) endif() vcpkg_cmake_configure( - SOURCE_PATH "${SOURCE_PATH}/cmake" + SOURCE_PATH "${SOURCE_PATH}/upb/cmake" OPTIONS ${FEATURE_OPTIONS} - "-DVCPKG_UPB_HOST_INCLUDE_DIR=${CURRENT_HOST_INSTALLED_DIR}/include" ) vcpkg_cmake_install(ADD_BIN_TO_PATH) @@ -45,13 +34,14 @@ if (VCPKG_UPB_BUILD_CODEGEN) TOOL_NAMES protoc-gen-upbdefs protoc-gen-upb + protoc-gen-upb_minitable ) else() configure_file("${CMAKE_CURRENT_LIST_DIR}/upb-config-vcpkg-tools.cmake" "${CURRENT_PACKAGES_DIR}/share/upb/upb-config-vcpkg-tools.cmake" @ONLY) endif() -file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/include/upb/fuzz" "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include") +file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" "${CURRENT_PACKAGES_DIR}/debug/include") vcpkg_copy_pdbs() -file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE") diff --git a/ports/upb/vcpkg.json b/ports/upb/vcpkg.json index 7a99b8597c78ed..4061b4ca196129 100644 --- a/ports/upb/vcpkg.json +++ b/ports/upb/vcpkg.json @@ -1,18 +1,11 @@ { "name": "upb", - "version-date": "2022-06-21", - "port-version": 1, + "version": "4.25.1", "description": "μpb (often written 'upb') is a small protobuf implementation written in C.", - "homepage": "https://github.com/protocolbuffers/upb/", + "homepage": "https://github.com/protocolbuffers/protobuf", "license": "BSD-2-Clause", "dependencies": [ - { - "name": "upb", - "host": true, - "features": [ - "codegen" - ] - }, + "utf8-range", { "name": "vcpkg-cmake", "host": true diff --git a/ports/utf8-range/portfile.cmake b/ports/utf8-range/portfile.cmake index c54d38aef9c1a9..11665cdcb442ee 100644 --- a/ports/utf8-range/portfile.cmake +++ b/ports/utf8-range/portfile.cmake @@ -3,8 +3,8 @@ vcpkg_check_linkage(ONLY_STATIC_LIBRARY) vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO protocolbuffers/protobuf - REF d30e326ca1f511ab537d9b2f73ce69b2f8f0c865 - SHA512 5f22493cfb6536d3a8a7bd752505baccacb85b0eade53b35763c3a30fab9197a8ff04bc9d4b6c2f66dc295b77c09a1b670d242f509f8705c0d699767d222eb38 + REF "v${VERSION}" + SHA512 ce81add9d978a6b63d4205715eac5084e81a6753da1f6c6bad6493e60253215901bffc4a60d704a873333f2b9f94fd86cb7eb5b293035f2268c12692bd808bac HEAD_REF main PATCHES fix-cmake.patch diff --git a/ports/utf8-range/vcpkg.json b/ports/utf8-range/vcpkg.json index 13f9c3ea38ae7e..92d5d73eb7aa9b 100644 --- a/ports/utf8-range/vcpkg.json +++ b/ports/utf8-range/vcpkg.json @@ -1,6 +1,6 @@ { "name": "utf8-range", - "version-date": "2023-11-09", + "version": "4.25.1", "description": "Fast UTF-8 validation with Range algorithm (NEON+SSE4+AVX2)", "homepage": "https://github.com/protocolbuffers/protobuf", "license": "MIT", diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt index a318cab6b24c1a..2f1d24bc0dfc3c 100644 --- a/scripts/ci.baseline.txt +++ b/scripts/ci.baseline.txt @@ -1076,6 +1076,7 @@ shader-slang:x64-windows-static=fail shogun:arm64-windows = skip shogun:arm64-uwp = skip shogun:x64-osx = skip +shogun:arm64-osx = skip shogun:x64-uwp = skip shogun:x64-windows = skip shogun:x64-windows-static = skip diff --git a/versions/a-/abseil.json b/versions/a-/abseil.json index eced844436ad63..f5c77ae31afe10 100644 --- a/versions/a-/abseil.json +++ b/versions/a-/abseil.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "de728ac31037e511da4996c815903e6ac71e8fb9", + "version": "20240116.2", + "port-version": 1 + }, { "git-tree": "9af16c8547b0a3d6c5886384b9b18934353c9d6d", "version": "20240116.2", diff --git a/versions/a-/arcus.json b/versions/a-/arcus.json index c7981fe70dd6fa..708bef66a72cb5 100644 --- a/versions/a-/arcus.json +++ b/versions/a-/arcus.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "cbf79963e156283eae951185abaafc86d2679262", + "version-semver": "4.10.0", + "port-version": 3 + }, { "git-tree": "1edcde9d0c4a64d780c6692b017cd30137a9ab19", "version-semver": "4.10.0", diff --git a/versions/b-/braft.json b/versions/b-/braft.json index f2ed00ebd24e45..d97b2daab64cf5 100644 --- a/versions/b-/braft.json +++ b/versions/b-/braft.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "72682af00e63de8f23eb8242e17212a0777deb25", + "version-date": "2021-26-04", + "port-version": 5 + }, { "git-tree": "b376168dcf6ec1336dd980ae419f8dcd626bc41b", "version-date": "2021-26-04", diff --git a/versions/b-/brpc.json b/versions/b-/brpc.json index b73ff58972f38e..5bf23bbe52a44f 100644 --- a/versions/b-/brpc.json +++ b/versions/b-/brpc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "e3c927bb9bf156c75d26d06f1c0c250afd50df69", + "version": "1.9.0", + "port-version": 1 + }, { "git-tree": "5c492561a044534b4177cf14d9296c8a68431755", "version": "1.9.0", diff --git a/versions/baseline.json b/versions/baseline.json index 7015c5b86ae116..4b9de2eb601957 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -18,7 +18,7 @@ }, "abseil": { "baseline": "20240116.2", - "port-version": 0 + "port-version": 1 }, "absent": { "baseline": "0.3.1", @@ -186,7 +186,7 @@ }, "arcus": { "baseline": "4.10.0", - "port-version": 2 + "port-version": 3 }, "arg-router": { "baseline": "1.4.0", @@ -1358,7 +1358,7 @@ }, "braft": { "baseline": "2021-26-04", - "port-version": 4 + "port-version": 5 }, "breakpad": { "baseline": "2023-06-01", @@ -1374,7 +1374,7 @@ }, "brpc": { "baseline": "1.9.0", - "port-version": 0 + "port-version": 1 }, "brunocodutra-metal": { "baseline": "2.1.4", @@ -1494,7 +1494,7 @@ }, "cartographer": { "baseline": "1.0.0", - "port-version": 5 + "port-version": 6 }, "casclib": { "baseline": "2024-06-05", @@ -2446,7 +2446,7 @@ }, "ecal": { "baseline": "5.12.0", - "port-version": 0 + "port-version": 1 }, "ecm": { "baseline": "5.98.0", @@ -3205,8 +3205,8 @@ "port-version": 0 }, "grpc": { - "baseline": "1.51.1", - "port-version": 3 + "baseline": "1.60.0", + "port-version": 0 }, "grppi": { "baseline": "0.4.0", @@ -3325,7 +3325,7 @@ "port-version": 1 }, "gz-transport12": { - "baseline": "12.2.0", + "baseline": "12.2.1", "port-version": 0 }, "gz-utils2": { @@ -3542,15 +3542,15 @@ }, "ignition-msgs1": { "baseline": "1.0.0", - "port-version": 6 + "port-version": 7 }, "ignition-msgs5": { "baseline": "5.3.0", - "port-version": 6 + "port-version": 7 }, "ignition-msgs6": { "baseline": "6.0.0", - "port-version": 5 + "port-version": 6 }, "ignition-plugin1": { "baseline": "1.4.0", @@ -3562,15 +3562,15 @@ }, "ignition-transport4": { "baseline": "4.0.0", - "port-version": 6 + "port-version": 7 }, "ignition-transport8": { "baseline": "8.1.0", - "port-version": 4 + "port-version": 5 }, "ignition-transport9": { "baseline": "9.0.0", - "port-version": 4 + "port-version": 5 }, "ignition-utils1": { "baseline": "1.5.1", @@ -4802,7 +4802,7 @@ }, "libosmscout": { "baseline": "1.1.1", - "port-version": 4 + "port-version": 5 }, "libp7-baical": { "baseline": "replaced", @@ -4849,7 +4849,7 @@ "port-version": 0 }, "libprotobuf-mutator": { - "baseline": "1.1", + "baseline": "1.3", "port-version": 0 }, "libproxy": { @@ -5618,7 +5618,7 @@ }, "marble": { "baseline": "24.02.0", - "port-version": 0 + "port-version": 1 }, "marisa-trie": { "baseline": "0.2.6+20200926", @@ -6018,7 +6018,7 @@ }, "mysql-connector-cpp": { "baseline": "8.0.32", - "port-version": 1 + "port-version": 2 }, "nameof": { "baseline": "0.10.4", @@ -6634,7 +6634,7 @@ }, "osgearth": { "baseline": "3.4", - "port-version": 1 + "port-version": 2 }, "osmanip": { "baseline": "4.6.1", @@ -6694,7 +6694,7 @@ }, "paraview": { "baseline": "5.12.1", - "port-version": 1 + "port-version": 2 }, "parmetis": { "baseline": "2022-07-27", @@ -7013,8 +7013,8 @@ "port-version": 0 }, "protobuf": { - "baseline": "3.21.12", - "port-version": 4 + "baseline": "4.25.1", + "port-version": 0 }, "protobuf-c": { "baseline": "1.4.1", @@ -7078,7 +7078,7 @@ }, "pulsar-client-cpp": { "baseline": "3.5.1", - "port-version": 0 + "port-version": 1 }, "pulseaudio": { "baseline": "17.0", @@ -8125,8 +8125,8 @@ "port-version": 7 }, "shogun": { - "baseline": "6.1.4", - "port-version": 10 + "baseline": "2023-12-19", + "port-version": 0 }, "si": { "baseline": "2.5.1", @@ -8445,7 +8445,7 @@ "port-version": 0 }, "srpc": { - "baseline": "0.9.3", + "baseline": "0.10.1", "port-version": 0 }, "sse2neon": { @@ -8981,8 +8981,8 @@ "port-version": 0 }, "upb": { - "baseline": "2022-06-21", - "port-version": 1 + "baseline": "4.25.1", + "port-version": 0 }, "urdfdom": { "baseline": "3.1.1", @@ -9021,7 +9021,7 @@ "port-version": 3 }, "utf8-range": { - "baseline": "2023-11-09", + "baseline": "4.25.1", "port-version": 0 }, "utf8h": { diff --git a/versions/c-/cartographer.json b/versions/c-/cartographer.json index 6694174e7c8680..4f60b8c9abf8a6 100644 --- a/versions/c-/cartographer.json +++ b/versions/c-/cartographer.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "917d4ac19da5414db7ad690f8f315821b94a40ba", + "version": "1.0.0", + "port-version": 6 + }, { "git-tree": "b0e352bf9c678b6425f767a21470b2c8ef3f79b9", "version": "1.0.0", diff --git a/versions/e-/ecal.json b/versions/e-/ecal.json index da14ddb895ddd1..c866e93e2ecd78 100644 --- a/versions/e-/ecal.json +++ b/versions/e-/ecal.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "26c1e5fbf33ce903aa80a25fb031ce66f0921f1f", + "version-semver": "5.12.0", + "port-version": 1 + }, { "git-tree": "cfba9f382140cce351a69ed174cc1b93d0c97483", "version-semver": "5.12.0", diff --git a/versions/g-/grpc.json b/versions/g-/grpc.json index 8db26076d666c5..ed5a35eeb06fee 100644 --- a/versions/g-/grpc.json +++ b/versions/g-/grpc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "0f654950a7b38b7023e12c8579a09cf854097331", + "version-semver": "1.60.0", + "port-version": 0 + }, { "git-tree": "a78d7b20a22ebe842a2e78624254d1462ca49415", "version-semver": "1.51.1", diff --git a/versions/g-/gz-transport12.json b/versions/g-/gz-transport12.json index 64d23ddc669dd5..6fad3f1601a925 100644 --- a/versions/g-/gz-transport12.json +++ b/versions/g-/gz-transport12.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "9737ff0b7ff8d0b842f485bb01e6842c2e0ac077", + "version": "12.2.1", + "port-version": 0 + }, { "git-tree": "0cff2b97b9f6d2e46b5fea0158431fb2c3a92fba", "version": "12.2.0", diff --git a/versions/i-/ignition-msgs1.json b/versions/i-/ignition-msgs1.json index 89799ae235d135..b6e71688bf51f7 100644 --- a/versions/i-/ignition-msgs1.json +++ b/versions/i-/ignition-msgs1.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "5839a2117b54d52d370d0636281809b410067b5e", + "version": "1.0.0", + "port-version": 7 + }, { "git-tree": "61644519b91178792399cda9a6f03cb8d7651eaf", "version": "1.0.0", diff --git a/versions/i-/ignition-msgs5.json b/versions/i-/ignition-msgs5.json index 8276981c24fcf9..8719b7145ad408 100644 --- a/versions/i-/ignition-msgs5.json +++ b/versions/i-/ignition-msgs5.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "f72a4cea42ae227af5630276f9b58f5a2b5ed231", + "version": "5.3.0", + "port-version": 7 + }, { "git-tree": "a7de105c1d93f5c86e6ee624d65fe1bd8d9a2beb", "version": "5.3.0", diff --git a/versions/i-/ignition-msgs6.json b/versions/i-/ignition-msgs6.json index 2b167f3bdcc060..8e6c527ff0b89f 100644 --- a/versions/i-/ignition-msgs6.json +++ b/versions/i-/ignition-msgs6.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b604b707d0bbf94878a17e1cd0d53c3e97f8e055", + "version": "6.0.0", + "port-version": 6 + }, { "git-tree": "809e114122aec8103638b9c376b883f59376b1a1", "version": "6.0.0", diff --git a/versions/i-/ignition-transport4.json b/versions/i-/ignition-transport4.json index 2911cc0792e02c..4e8f8024c96313 100644 --- a/versions/i-/ignition-transport4.json +++ b/versions/i-/ignition-transport4.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "52ab4e86f4b09e0256c16de68f418f3aac2d89b8", + "version": "4.0.0", + "port-version": 7 + }, { "git-tree": "485717373dc99ab0f6f3a6b0ad8fec42bf8e9a9b", "version": "4.0.0", diff --git a/versions/i-/ignition-transport8.json b/versions/i-/ignition-transport8.json index 06f92d704bcfb1..40d04a32995c34 100644 --- a/versions/i-/ignition-transport8.json +++ b/versions/i-/ignition-transport8.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "4582fd73daabc8fd7f5ce3344144bf5a6e08c042", + "version": "8.1.0", + "port-version": 5 + }, { "git-tree": "967c8839fce7bd85b58ed1d4a5506a2be278a8ef", "version": "8.1.0", diff --git a/versions/i-/ignition-transport9.json b/versions/i-/ignition-transport9.json index 712a03c8121311..ce4f2a7033fe71 100644 --- a/versions/i-/ignition-transport9.json +++ b/versions/i-/ignition-transport9.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "aed3bea9851408f8b978260edd9e2af7eae24c68", + "version": "9.0.0", + "port-version": 5 + }, { "git-tree": "918e7d23ff4ca98405b40bbdf55f9302b6cb0ed0", "version": "9.0.0", diff --git a/versions/l-/libosmscout.json b/versions/l-/libosmscout.json index 95ed7b0a8454a4..f1e72ae2432f2d 100644 --- a/versions/l-/libosmscout.json +++ b/versions/l-/libosmscout.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3289b39536694fa953bbc20bf4a25653e39fab9b", + "version": "1.1.1", + "port-version": 5 + }, { "git-tree": "55b989b709d0c12649e6b2a522249bbf3d0788c7", "version": "1.1.1", diff --git a/versions/l-/libprotobuf-mutator.json b/versions/l-/libprotobuf-mutator.json index 52281f5d216a48..ef9097ca14acd3 100644 --- a/versions/l-/libprotobuf-mutator.json +++ b/versions/l-/libprotobuf-mutator.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "65fd72758c5a494660dc7633ecc5c69ead65cb04", + "version": "1.3", + "port-version": 0 + }, { "git-tree": "711a63d6cbb8a9556e4d5df54aa17383780a46b1", "version": "1.1", diff --git a/versions/m-/marble.json b/versions/m-/marble.json index 5711dbec72422d..dce6614cfc51dd 100644 --- a/versions/m-/marble.json +++ b/versions/m-/marble.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "582ef4bc67baebe0e34ce75cbbe5ba3cc1e8b953", + "version-string": "24.02.0", + "port-version": 1 + }, { "git-tree": "a8ee922e29c82515ad220efa52068a80b45978d0", "version-string": "24.02.0", diff --git a/versions/m-/mysql-connector-cpp.json b/versions/m-/mysql-connector-cpp.json index c5b154f2226c42..0ea94f557fb522 100644 --- a/versions/m-/mysql-connector-cpp.json +++ b/versions/m-/mysql-connector-cpp.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "ce8505dc2ea60882163204b35ccb2e37ce204c5c", + "version": "8.0.32", + "port-version": 2 + }, { "git-tree": "89b1c4d68211753ab836de3dde9664a3d611b78e", "version": "8.0.32", diff --git a/versions/o-/osgearth.json b/versions/o-/osgearth.json index 6e98d6cbbd2257..e844d639ace20a 100644 --- a/versions/o-/osgearth.json +++ b/versions/o-/osgearth.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3412700e8699006bff1c2d4947500da9b180a0c5", + "version": "3.4", + "port-version": 2 + }, { "git-tree": "4c7eac5ebac0fb2f82b730a863d50278a83955a9", "version": "3.4", diff --git a/versions/p-/paraview.json b/versions/p-/paraview.json index 23df3baf121936..cbcc7a8a4cf39a 100644 --- a/versions/p-/paraview.json +++ b/versions/p-/paraview.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "44f6c15c7d9d433dd86de5546560c598e7922ec8", + "version": "5.12.1", + "port-version": 2 + }, { "git-tree": "1995d873358ccb876209e5ece80dc8d8dba04f2c", "version": "5.12.1", diff --git a/versions/p-/protobuf.json b/versions/p-/protobuf.json index 37b47e961a8580..cce729658cf430 100644 --- a/versions/p-/protobuf.json +++ b/versions/p-/protobuf.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "278ba5370a8c59bbb60650d6ad91ae1eab0fadad", + "version": "4.25.1", + "port-version": 0 + }, { "git-tree": "7a874adf6e222ee14c665bd62a2b04a0d65ea1b1", "version": "3.21.12", diff --git a/versions/p-/pulsar-client-cpp.json b/versions/p-/pulsar-client-cpp.json index 9cb0ee10108720..c6c275b90548f2 100644 --- a/versions/p-/pulsar-client-cpp.json +++ b/versions/p-/pulsar-client-cpp.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "632560bc0bda253fffea18938af7bfc141c892e1", + "version": "3.5.1", + "port-version": 1 + }, { "git-tree": "ca72d75215e3ffcdf2f19b130f190dea2dcf55b5", "version": "3.5.1", diff --git a/versions/s-/shogun.json b/versions/s-/shogun.json index 956ba87e79d48b..9808405efb5662 100644 --- a/versions/s-/shogun.json +++ b/versions/s-/shogun.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "005b5791f492c914205e14ecf3985f1f9da7a707", + "version-date": "2023-12-19", + "port-version": 0 + }, { "git-tree": "1492ad59069309d6872f7cf6df5640dcd1d8e4b4", "version": "6.1.4", diff --git a/versions/s-/srpc.json b/versions/s-/srpc.json index 01f29288d85606..a1700e756146b5 100644 --- a/versions/s-/srpc.json +++ b/versions/s-/srpc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "cab44b93cf32daf3a535c14426eb9b5c780e94ea", + "version-semver": "0.10.1", + "port-version": 0 + }, { "git-tree": "7f8e905bb42ba10b9076c4fca512933f4e3171e5", "version-semver": "0.9.3", diff --git a/versions/u-/upb.json b/versions/u-/upb.json index 6e515219183f26..8391e3f65a2415 100644 --- a/versions/u-/upb.json +++ b/versions/u-/upb.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3edd5c1f37803c69faaf1b0884791e8c1d8ff48f", + "version": "4.25.1", + "port-version": 0 + }, { "git-tree": "1d7a6a503d8e111f919697470e47030cba1172b3", "version-date": "2022-06-21", diff --git a/versions/u-/utf8-range.json b/versions/u-/utf8-range.json index 37bf59624fd0de..967f7ee2a86995 100644 --- a/versions/u-/utf8-range.json +++ b/versions/u-/utf8-range.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "b4f93db62704293a100326ad0561ab1c5aa2d856", + "version": "4.25.1", + "port-version": 0 + }, { "git-tree": "dd54a8c4b774935b2c164d0902185fa56a8694bb", "version-date": "2023-11-09",