summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c5c289546f434e918559b00d30cea5112eaa07f0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Maintainer: kino <cybao292261@163.com>
# Contributor: dtag <dtag00@gmail.com>

pkgname=ceres-solver-legacy
pkgver=1.14.0
pkgrel=6
pkgdesc="Solver for nonlinear least squares problems. Legacy version needed for google cartographer"
arch=('i686' 'x86_64')
url="http://ceres-solver.org/"
license=('LGPL')
makedepends=('cmake' 'eigen>=3.3.0')
depends=('google-glog>=0.3.4' 'suitesparse>=4.4.5')
optdepends=('openmp')
provides=(ceres-solver)
conflicts=(ceres-solver)

source=("http://ceres-solver.org/ceres-solver-${pkgver}.tar.gz"
        "ceres-solver-fix-cmake-findtbb.patch"
        "ceres-solver-fix-suitesparse-7.2.patch")
sha256sums=('4744005fc3b902fed886ea418df70690caa8e2ff6b5a90f3dd88a3d291ef8e8e'
            '6166866bf678ac26acaf0c95279c02a039652856f924b2782dff4d46bb39402b'
            '30020a2a3d6827e269ab3ec4c14397c3ce2ab2b19afc85e61ae268dd301dec7b')
options=('staticlibs')

_cmakeopts=('-D CMAKE_BUILD_TYPE=Release'
            '-D CMAKE_INSTALL_PREFIX=/usr'
            '-D EIGENSPARSE=ON'
            '-D CXX11=ON'
            '-D BUILD_SHARED_LIBS=ON'
            '-D BUILD_TESTING=OFF'
            '-D BUILD_EXAMPLES=OFF')

prepare() {
  cd $srcdir/ceres-solver-$pkgver
  patch -p1 -i "$srcdir"/ceres-solver-fix-cmake-findtbb.patch
  patch -p1 -i "$srcdir"/ceres-solver-fix-suitesparse-7.2.patch
}

build() {
  cd $srcdir/ceres-solver-$pkgver

  mkdir -p ./build
  cd ./build
  cmake ${_cmakeopts[@]} ../ -DLIB_SUFFIX=""
  make
}

package() {
  cd $srcdir/ceres-solver-$pkgver/build/
  make DESTDIR=$pkgdir install
  install -Dm644 ../LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}