summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c11f2b98b9f61012eee362b8a5af0763b777927c (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
62
63
# Maintainer: Forest Crossman <cyrozap at gmail dot com>

pkgname=opengv-git
pkgver=r144.306a54e
pkgrel=1
pkgdesc="An efficient C++ library for calibrated camera pose computation using geometric computer vision algorithms."
arch=('i686' 'x86_64')
url="https://laurentkneip.github.io/opengv/"
license=('BSD')
depends=('boost-libs' 'eigen>=3' 'python2-numpy')
makedepends=('boost' 'cmake' 'git')
provides=("${pkgname%-git}")
conflicts=("${pkgname%-git}")
source=("${pkgname%-git}::git+https://github.com/laurentkneip/opengv.git"
        "git+https://github.com/pybind/pybind11.git")
sha256sums=('SKIP'
            'SKIP')
pkgver() {
	cd "$srcdir/${pkgname%-git}"

	printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"
}

prepare() {
	cd "$srcdir/${pkgname%-git}"

	git submodule init
	git config submodule.pybind11.url "${srcdir}/pybind11"
	git submodule update
}

build() {
	cd "$srcdir/${pkgname%-git}"

	mkdir -p build
	cd build
	cmake .. \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DBUILD_SHARED_LIBS=ON \
		-DBUILD_PYTHON=ON \
		-DBUILD_POSITION_INDEPENDENT_CODE=ON \
		-DINSTALL_OPENGV=ON
	make
}

check() {
	cd "$srcdir/${pkgname%-git}"

	cd build/bin
	for test in test_*; do
		./$test
	done
}

package() {
	cd "$srcdir/${pkgname%-git}"

	install -d "$pkgdir/usr/share/licenses/$pkgname/"
	install -m 644 License.txt "$pkgdir/usr/share/licenses/$pkgname/"

	cd build
	make DESTDIR="$pkgdir/" install
}