summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 1ad51db98ba56d5d17b6647822ed0b667c7cc7de (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
# Maintainer: Timon Engelke <aur@timonengelke.de>
pkgdesc="ROS - Library for visual odometry"
url='http://www.ros.org/wiki/viso2'

pkgname='ros-melodic-libviso2'
pkgver='0.0.1'
_pkgver_patch=0
arch=('any')
pkgrel=1
license=('GPL')

makedepends=('cmake' 'gcc-libs')
depends=('gcc-libs')

_dir="viso2/libviso2"
source=("viso2"::"git+https://github.com/srv/viso2.git")
sha256sums=('SKIP')

prepare() {
  sed -i -e "/install(DIRECTORY/s/$/\//" -e "/PATTERN/s/.cpp/*.cpp/" ${srcdir}/${_dir}/CMakeLists.txt
}

build() {
  # Use ROS environment variables
  source /usr/share/ros-build-tools/clear-ros-env.sh
  [ -f /opt/ros/melodic/setup.bash ] && source /opt/ros/melodic/setup.bash

  # Create build directory
  [ -d ${srcdir}/build ] || mkdir ${srcdir}/build
  cd ${srcdir}/build

  # Build project
  cmake ${srcdir}/${_dir} \
        -DCMAKE_BUILD_TYPE=Release \
        -DCATKIN_BUILD_BINARY_PACKAGE=ON \
        -DCMAKE_INSTALL_PREFIX=/opt/ros/melodic \
        -DPYTHON_EXECUTABLE=/usr/bin/python3 \
        -DPYTHON_INCLUDE_DIR=/usr/include/python3.7 \
        -DPYTHON_LIBRARY=/usr/lib/libpython3.7.so \
        -DPYTHON_BASENAME=-python3.7 \
        -DSETUPTOOLS_DEB_LAYOUT=OFF
  make
}

package() {
  cd "${srcdir}/build"
  make DESTDIR="${pkgdir}/" install
}