aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThierry Thomas <thierry@FreeBSD.org>2022-11-26 18:54:41 +0000
committerThierry Thomas <thierry@FreeBSD.org>2022-11-27 11:09:57 +0000
commit20b1cb36dae15be1adeb92f297b5815151999029 (patch)
tree56b736a4f40d4b43508f22dfaef7cb03e167414d
parent8f2142d0c95689e682c14d6b2d100c2df9c659c2 (diff)
downloadports-20b1cb36dae15be1adeb92f297b5815151999029.tar.gz
ports-20b1cb36dae15be1adeb92f297b5815151999029.zip
math/ceres-solver: chase the upgrade of SuiteSparse
-rw-r--r--math/ceres-solver/Makefile1
-rw-r--r--math/ceres-solver/files/patch-cmake_FindSuiteSparse.cmake52
2 files changed, 53 insertions, 0 deletions
diff --git a/math/ceres-solver/Makefile b/math/ceres-solver/Makefile
index 1eda7ad4680f..0a1cad198ccc 100644
--- a/math/ceres-solver/Makefile
+++ b/math/ceres-solver/Makefile
@@ -1,5 +1,6 @@
PORTNAME= ceres-solver
DISTVERSION= 2.1.0
+PORTREVISION= 1
CATEGORIES= math
MAINTAINER= yuri@FreeBSD.org
diff --git a/math/ceres-solver/files/patch-cmake_FindSuiteSparse.cmake b/math/ceres-solver/files/patch-cmake_FindSuiteSparse.cmake
new file mode 100644
index 000000000000..a5a9781b6f6b
--- /dev/null
+++ b/math/ceres-solver/files/patch-cmake_FindSuiteSparse.cmake
@@ -0,0 +1,52 @@
+--- cmake/FindSuiteSparse.cmake.orig 2022-03-28 14:02:35 UTC
++++ cmake/FindSuiteSparse.cmake
+@@ -394,26 +394,36 @@ if (TARGET SuiteSparse::Config)
+ else (NOT EXISTS ${SuiteSparse_VERSION_FILE})
+ file(READ ${SuiteSparse_VERSION_FILE} Config_CONTENTS)
+
+- string(REGEX MATCH "#define SUITESPARSE_MAIN_VERSION [0-9]+"
+- SuiteSparse_VERSION_MAJOR "${Config_CONTENTS}")
+- string(REGEX REPLACE "#define SUITESPARSE_MAIN_VERSION ([0-9]+)" "\\1"
+- SuiteSparse_VERSION_MAJOR "${SuiteSparse_VERSION_MAJOR}")
++ string(REGEX MATCH "#define SUITESPARSE_MAIN_VERSION[ \t]+([0-9]+)"
++ SuiteSparse_VERSION_LINE "${Config_CONTENTS}")
++ set (SuiteSparse_VERSION_MAJOR ${CMAKE_MATCH_1})
+
+- string(REGEX MATCH "#define SUITESPARSE_SUB_VERSION [0-9]+"
+- SuiteSparse_VERSION_MINOR "${Config_CONTENTS}")
+- string(REGEX REPLACE "#define SUITESPARSE_SUB_VERSION ([0-9]+)" "\\1"
+- SuiteSparse_VERSION_MINOR "${SuiteSparse_VERSION_MINOR}")
++ string(REGEX MATCH "#define SUITESPARSE_SUB_VERSION[ \t]+([0-9]+)"
++ SuiteSparse_VERSION_LINE "${Config_CONTENTS}")
++ set (SuiteSparse_VERSION_MINOR ${CMAKE_MATCH_1})
+
+- string(REGEX MATCH "#define SUITESPARSE_SUBSUB_VERSION [0-9]+"
+- SuiteSparse_VERSION_PATCH "${Config_CONTENTS}")
+- string(REGEX REPLACE "#define SUITESPARSE_SUBSUB_VERSION ([0-9]+)" "\\1"
+- SuiteSparse_VERSION_PATCH "${SuiteSparse_VERSION_PATCH}")
++ string(REGEX MATCH "#define SUITESPARSE_SUBSUB_VERSION[ \t]+([0-9]+)"
++ SuiteSparse_VERSION_LINE "${Config_CONTENTS}")
++ set (SuiteSparse_VERSION_PATCH ${CMAKE_MATCH_1})
+
++ unset (SuiteSparse_VERSION_LINE)
++
+ # This is on a single line s/t CMake does not interpret it as a list of
+ # elements and insert ';' separators which would result in 4.;2.;1 nonsense.
+ set(SuiteSparse_VERSION
+ "${SuiteSparse_VERSION_MAJOR}.${SuiteSparse_VERSION_MINOR}.${SuiteSparse_VERSION_PATCH}")
+- set(SuiteSparse_VERSION_COMPONENTS 3)
++
++ if (SuiteSparse_VERSION MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
++ set(SuiteSparse_VERSION_COMPONENTS 3)
++ else (SuiteSparse_VERSION MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
++ message (WARNING "Could not parse SuiteSparse_config.h: SuiteSparse "
++ "version will not be available")
++
++ unset (SuiteSparse_VERSION)
++ unset (SuiteSparse_VERSION_MAJOR)
++ unset (SuiteSparse_VERSION_MINOR)
++ unset (SuiteSparse_VERSION_PATCH)
++ endif (SuiteSparse_VERSION MATCHES "[0-9]+\\.[0-9]+\\.[0-9]+")
+ endif (NOT EXISTS ${SuiteSparse_VERSION_FILE})
+ endif (TARGET SuiteSparse::Config)
+