summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: f4974b0327ea71d6325bdfdbe594391417e5c717 (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
53
54
55
56
57
58
59
60
61
# Maintainer: Benjamin Chretien <chretien@lirmm.fr>
# Contributor: Thomas Moulard <thomas.moulard@gmail.com>
pkgname=roboptim-core
pkgver=3.1
pkgrel=1
pkgdesc="Numerical Optimization for Robotics"
arch=('i686' 'x86_64')
url="http://roboptim.net/"
license=('(L)GPL2')
depends=('eigen>=3.2' 'boost>=1.41' 'libltdl' 'log4cxx')
optdepends=()
makedepends=('cmake' 'doxygen' 'texlive-bin' 'ghostscript')
provides=('roboptim-core')
conflicts=('roboptim-core-git')
source=("https://github.com/roboptim/${pkgname}/releases/download/v${pkgver}/${pkgname}-${pkgver}.tar.bz2")
md5sums=('7d2178c1ed0dd8de0c93d441f403774d')

# Build type
_buildtype="RelWithDebInfo"

# Build the project
build() {
    cd "${srcdir}/${pkgname}-${pkgver}"

    msg "Starting CMake (build type = ${_buildtype})"

    # Create a build directory
    mkdir -p "${srcdir}/${pkgname}-${pkgver}-build"
    cd "${srcdir}/${pkgname}-${pkgver}-build"

    # Run CMake in release
    cmake -DCMAKE_BUILD_TYPE="${_buildtype}" \
          -DCMAKE_INSTALL_PREFIX="/usr" \
          "${srcdir}/${pkgname}-${pkgver}"

    # Compile the library
    msg "Building the project"
    make --silent

    # Create the documentation
    msg "Creating the documentation"
    make --silent doc
}

# Run unit tests
check() {
    msg "Running unit tests"
    cd "${srcdir}/${pkgname}-${pkgver}-build"
    # Note: some tests fail with more recent versions of Eigen
    # (print output style)
    make test || return 0
}

# Create the package
package() {
    # Install in /opt/roboptim
    cd "${srcdir}/${pkgname}-${pkgver}-build"

    msg "Installing files"
    make --silent DESTDIR="${pkgdir}/" install
}