aboutsummaryrefslogtreecommitdiffstats
path: root/testing/opencv/APKBUILD
blob: a7ffac1c195a5dc0d77bc93524de8dea6bf47a9b (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer:
pkgname=opencv
pkgver=3.2.0
pkgrel=2
pkgdesc="Computer vision and machine learning software library"
url="http://opencv.org"
arch="all"
license="BSD"
depends=""
depends_dev=""
makedepends="cmake ffmpeg-dev libpng-dev libjpeg-turbo-dev tiff-dev jasper-dev
	libgomp openexr-dev gtk+3.0-dev gtk+-dev gst-plugins-base1-dev
	libgphoto2-dev v4l-utils-dev libwebp-dev libdc1394-dev doxygen"
install=""
subpackages="$pkgname-dev $pkgname-libs"
source="opencv-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/$pkgver.tar.gz"
builddir="$srcdir/opencv-$pkgver"

prepare() {
	default_prepare || return 1
	# purge 3rd party except carotene
	for i in "$builddir"/3rdparty/*; do
		case $i in
		*/carotene*) continue;;
		esac
		rm -rf "$i"
	done
}

build() {
	cd "$builddir"
	if [ "$CARCH" != "x86_64" ]; then
		local _sse="-DENABLE_SSE=OFF -DENABLE_SSE2=OFF"
	fi
	cmake \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DBUILD_SHARED_LIBS=True \
		-DCMAKE_BUILD_TYPE=Release \
		-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
		-DCMAKE_C_FLAGS="$CFLAGS" \
		-DENABLE_PRECOMPILED_HEADERS=OFF \
		-DWITH_OPENMP=ON \
		-WITH_OPENCL=ON \
		-DWITH_IPP=OFF \
		$_sse \
		|| return 1
	make || return 1
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install || return 1
}

md5sums="a43b65488124ba33dde195fea9041b70  opencv-3.2.0.tar.gz"
sha256sums="b9d62dfffb8130d59d587627703d5f3e6252dce4a94c1955784998da7a39dd35  opencv-3.2.0.tar.gz"
sha512sums="a338f4b4cdebfc2dcd763427b9c9632b3a3b0d072117b8e6367c73ea1ac21f7148553a23c7afbb44b01a48be3be95520789c2de1d6ae230b7b414ee713d3606d  opencv-3.2.0.tar.gz"