aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-09-11 03:18:35 +0000
committerPo-Chuan Hsieh <sunpoet@FreeBSD.org>2023-09-11 03:22:47 +0000
commit5dff756fbe4ed7037a37789040b48553c851001b (patch)
treed033c1b6baf4247c0683b68092979004e27922b2
parentcd1837f2e351891c3ee678e91a589e51836bff1e (diff)
downloadports-5dff756fbe4ed7037a37789040b48553c851001b.tar.gz
ports-5dff756fbe4ed7037a37789040b48553c851001b.zip
math/py-or-tools: Fix build with abseil 20230125.0+ and re2 20230601+
-rw-r--r--math/py-or-tools/Makefile1
-rw-r--r--math/py-or-tools/files/patch-abseil20
2 files changed, 21 insertions, 0 deletions
diff --git a/math/py-or-tools/Makefile b/math/py-or-tools/Makefile
index 00e501d5c5e5..13cf22a54c45 100644
--- a/math/py-or-tools/Makefile
+++ b/math/py-or-tools/Makefile
@@ -51,6 +51,7 @@ CMAKE_OFF= BUILD_DEPS BUILD_pybind11 INSTALL_BUILD_DEPS BUILD_TESTING BUILD_EXAM
CMAKE_ON= BUILD_PYTHON
CMAKE_ARGS= -DSWIG_EXECUTABLE=${LOCALBASE}/bin/swig -DFREEBSD_PYTHON_VER=${PYTHON_VER}
CONFIGURE_ENV= UNIX_CBC_DIR=${LOCALBASE} UNIX_CLP_DIR=${LOCALBASE}
+CXXFLAGS+= -DABSL_LEGACY_THREAD_ANNOTATIONS
BUILD_ENV= UNIX_CBC_DIR=${LOCALBASE} UNIX_CLP_DIR=${LOCALBASE}
TEST_ENV= ${MAKE_ENV} PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
diff --git a/math/py-or-tools/files/patch-abseil b/math/py-or-tools/files/patch-abseil
new file mode 100644
index 000000000000..eccc97345062
--- /dev/null
+++ b/math/py-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)));
+ }
+ }
+