summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 0d12c29d7e9f3e71aff62292b69e3930ed257a19 (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
# Maintainer: Finn-Thorben Sell <aur@finn-thorben.me>
pkgname="ros-dashing-ament-cmake-core"
pkgdesc="ROS - The core of the ament buildsystem in CMake"
url="https://index.ros.org/doc/ros2/"
license=("Apache License 2.0")

pkgver=0.7.3
_pkgver_patch=0
pkgrel=1
arch=('any')

_ros_makedepends=()
makedepends=(ros-build-tools
	${_ros_makedepends[@]})

_ros_depends=(ros-dashing-ament-package)
depends=(cmake python-setuptools python-catkin_pkg
	${_ros_depends[@]})

_dir="ament_cmake-release-release-dashing-ament_cmake_core"
source=("${pkgname}-${pkgver}.tar.gz::https://github.com/ros2-gbp/ament_cmake-release/archive/release/dashing/ament_cmake_core/${pkgver}-${_pkgver_patch}.tar.gz")
sha256sums=('9339e4ee30d0325f8ea35222fef0874fb6a9b8fda71a3d45a54a8dd375549693')


build() {
	# Figure out installed python version
	PYTHON_VERSION=$(python --version | cut -d " " -f 2 | sed 's/\.[0-9]$//g')

	# Use empty ROS dashing environment
	export ROS_PREFIX=/opt/ros/dashing
	source /usr/share/ros-build-tools/clear-ros-env.sh
	[ -f ${ROS_PREFIX}/setup.bash ] && source ${ROS_PREFIX}/setup.bash
	export PYTHONPATH="${PYTHONPATH}:${ROS_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"

	# Create build directory
	[ -d "${srcdir}/build" ] || mkdir "${srcdir}/build"
	cd "${srcdir}/build"
	
	# Build package
	cmake "${srcdir}/${_dir}" \
		-DCMAKE_BUILD_TYPE=Release \
		-DBUILD_TESTING=Off \
		-DCMAKE_INSTALL_PREFIX=${ROS_PREFIX}
	make
}


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