git: cd1837f2e351 - main - math/or-tools: Fix build with abseil 20230125.0+ and re2 20230601+

From: Po-Chuan Hsieh <sunpoet_at_FreeBSD.org>
Date: Mon, 11 Sep 2023 03:23:26 UTC
The branch main has been updated by sunpoet:

URL: https://cgit.FreeBSD.org/ports/commit/?id=cd1837f2e351891c3ee678e91a589e51836bff1e

commit cd1837f2e351891c3ee678e91a589e51836bff1e
Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
AuthorDate: 2023-09-11 03:18:32 +0000
Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
CommitDate: 2023-09-11 03:22:47 +0000

    math/or-tools: Fix build with abseil 20230125.0+ and re2 20230601+
    
    Reference:      https://github.com/google/or-tools/issues/3655
---
 math/or-tools/Makefile           |  1 +
 math/or-tools/files/patch-abseil | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/math/or-tools/Makefile b/math/or-tools/Makefile
index fc1aa696407f..f6ae57e6c979 100644
--- a/math/or-tools/Makefile
+++ b/math/or-tools/Makefile
@@ -35,6 +35,7 @@ USE_LDCONFIG=	yes
 CMAKE_OFF=	BUILD_PYTHON BUILD_DEPS INSTALL_BUILD_DEPS BUILD_EXAMPLES BUILD_SAMPLES
 CMAKE_ON=	BUILD_CXX
 CMAKE_TESTING_ON=	BUILD_EXAMPLES BUILD_CXX_EXAMPLES
+CXXFLAGS+=	-DABSL_LEGACY_THREAD_ANNOTATIONS
 
 CONFIGURE_ENV=	UNIX_CBC_DIR=${LOCALBASE} UNIX_CLP_DIR=${LOCALBASE}
 
diff --git a/math/or-tools/files/patch-abseil b/math/or-tools/files/patch-abseil
new file mode 100644
index 000000000000..eccc97345062
--- /dev/null
+++ b/math/or-tools/files/patch-abseil
@@ -0,0 +1,20 @@
+--- ortools/lp_data/lp_parser.cc.orig	2022-11-25 09:21:54 UTC
++++ ortools/lp_data/lp_parser.cc
+@@ -185,7 +185,7 @@ bool LPParser::ParseIntegerVariablesList(StringPiece l
+ 
+ bool LPParser::ParseConstraint(StringPiece constraint) {
+   const StatusOr<ParsedConstraint> parsed_constraint_or_status =
+-      ::operations_research::glop::ParseConstraint(constraint.as_string());
++      ::operations_research::glop::ParseConstraint(std::string(constraint));
+   if (!parsed_constraint_or_status.ok()) return false;
+   const ParsedConstraint& parsed_constraint =
+       parsed_constraint_or_status.value();
+@@ -414,7 +414,7 @@ StatusOr<ParsedConstraint> ParseConstraint(absl::strin
+     if (ConsumeToken(&constraint, &consumed_name, &consumed_coeff) !=
+         TokenType::END) {
+       return absl::InvalidArgumentError(absl::StrCat(
+-          "End of input was expected, found: ", constraint.as_string()));
++          "End of input was expected, found: ", std::string(constraint)));
+     }
+   }
+