summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 6be09e19da46db8cb3052d217c7c2f6bc51a1247 (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
# Maintainer: Raimar Bühmann <raimar _at_ buehmann _dot_ de>

pkgname=anki-drive-sdk-git
pkgver=0.2.0.r20.20140303
pkgrel=1
pkgdesc="C implementation of message protocols and data parsing to communicate with Anki Drive vehicles"
arch=('i686' 'x86_64')
url="https://github.com/anki/drive-sdk"
license=('Apache')
depends=('glib2' 'readline')
optdepends=('bluez-utils: for command line tool hciconfig')
makedepends=('cmake' 'gcc')
source=("$pkgname::git+https://github.com/anki/drive-sdk.git")
md5sums=('SKIP')
pkgver() {
	# remove ".r*.*" from package version
	_pkgverTriple=$(echo $pkgver | sed "s/\.r.*//g")
	cd $pkgname
	# get number of last git commit
	_commitCount=$(git rev-list --count HEAD)
	# get time of last git commit
	_commitTime=$(git show -s --format="%ci" | grep -o "....-..-.." | sed "s/-//g")
	# add ".r*.*" from package version
	echo "$_pkgverTriple.r$_commitCount.$_commitTime"
}
build() {
	cd "$pkgname"
	mkdir -p build
	cd build
	cmake .. -DCMAKE_INSTALL_PREFIX= -DBUILD_EXAMPLES=ON
	make
}
package() {
	cd "$pkgname/build"
	make DESTDIR="${pkgdir}/usr" install
	# delete hciconfig, because it is already included in optional package bluez-utils
	rm "${pkgdir}/usr/bin/hciconfig"
	install -Dm644 '../LICENSE' "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}