diff options
author | Frank Neuhaus | 2022-11-17 10:10:09 +0100 |
---|---|---|
committer | Frank Neuhaus | 2022-11-17 10:10:09 +0100 |
commit | cb56dae6f6baa593c44ef954066c7c0d0f3f18c4 (patch) | |
tree | a58f860333d3bcfcf567b96d07c6e8d32d79ba55 | |
parent | 7c9496cf545a4e847d404f5391b3d11b18d2b36e (diff) | |
download | aur-ceres-solver.tar.gz |
fix for suitesparse > 6.0.0 (adapted from https://ceres-solver-review.googlesource.com/c/ceres-solver/+/23460 )
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | 0001-fix-for-suitesparse-6.0.0.patch | 54 | ||||
-rw-r--r-- | PKGBUILD | 9 |
3 files changed, 63 insertions, 4 deletions
@@ -1,7 +1,7 @@ pkgbase = ceres-solver pkgdesc = Solver for nonlinear least squares problems pkgver = 2.1.0 - pkgrel = 1 + pkgrel = 2 url = http://ceres-solver.org/ arch = i686 arch = x86_64 @@ -13,6 +13,8 @@ pkgbase = ceres-solver optdepends = openmp options = staticlibs source = http://ceres-solver.org/ceres-solver-2.1.0.tar.gz + source = 0001-fix-for-suitesparse-6.0.0.patch sha256sums = f7d74eecde0aed75bfc51ec48c91d01fe16a6bf16bce1987a7073286701e2fc6 + sha256sums = 0eb45170ec3e87839a688b78ce2d2cffe562a7aa3d10619043729252d3a56d79 pkgname = ceres-solver diff --git a/0001-fix-for-suitesparse-6.0.0.patch b/0001-fix-for-suitesparse-6.0.0.patch new file mode 100644 index 000000000000..76ce6ed1537e --- /dev/null +++ b/0001-fix-for-suitesparse-6.0.0.patch @@ -0,0 +1,54 @@ +diff --git a/cmake/FindSuiteSparse.cmake b/cmake/FindSuiteSparse.cmake +index 4e05930..0e3a10b 100644 +--- a/cmake/FindSuiteSparse.cmake ++++ b/cmake/FindSuiteSparse.cmake +@@ -404,26 +404,36 @@ + 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) + @@ -2,7 +2,7 @@ pkgname=ceres-solver pkgver=2.1.0 -pkgrel=1 +pkgrel=2 pkgdesc="Solver for nonlinear least squares problems" arch=('i686' 'x86_64') url="http://ceres-solver.org/" @@ -11,8 +11,8 @@ makedepends=('cmake') depends=('google-glog>=0.3.5' 'eigen>=3.3.0' 'suitesparse>=4.4.5') optdepends=('openmp') -source=("http://ceres-solver.org/ceres-solver-2.1.0.tar.gz") -sha256sums=('f7d74eecde0aed75bfc51ec48c91d01fe16a6bf16bce1987a7073286701e2fc6') +source=("http://ceres-solver.org/ceres-solver-2.1.0.tar.gz" "0001-fix-for-suitesparse-6.0.0.patch") +sha256sums=('f7d74eecde0aed75bfc51ec48c91d01fe16a6bf16bce1987a7073286701e2fc6' '0eb45170ec3e87839a688b78ce2d2cffe562a7aa3d10619043729252d3a56d79') options=('staticlibs') _cmakeopts=('-D CMAKE_BUILD_TYPE=Release' @@ -25,6 +25,9 @@ _cmakeopts=('-D CMAKE_BUILD_TYPE=Release' build() { cd $srcdir/$pkgname-$pkgver + for p in "$srcdir"/*.patch; do + patch -p1 < "$p" + done mkdir -p ./build cd ./build cmake ${_cmakeopts[@]} ../ |