summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--user/opencv/APKBUILD64
1 files changed, 64 insertions, 0 deletions
diff --git a/user/opencv/APKBUILD b/user/opencv/APKBUILD
new file mode 100644
index 000000000..b77d414a9
--- /dev/null
+++ b/user/opencv/APKBUILD
@@ -0,0 +1,64 @@
+# Contributor: Carlo Landmeter <clandmeter@gmail.com>
+# Maintainer:
+pkgname=opencv
+pkgver=3.4.1
+pkgrel=0
+pkgdesc="Computer vision and machine learning software library"
+url="https://opencv.org"
+arch="all"
+options="!check" # an hour on the talos is madness
+license="BSD-3-Clause"
+depends=""
+makedepends="cmake doxygen ffmpeg-dev gst-plugins-base-dev gtk+2.0-dev
+ gtk+3.0-dev jasper-dev libdc1394-dev libgomp libgphoto2-dev
+ libjpeg-turbo-dev libpng-dev libwebp-dev openexr-dev tiff-dev
+ v4l-utils-dev"
+subpackages="$pkgname-dev $pkgname-libs"
+source="opencv-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/$pkgver.tar.gz"
+
+prepare() {
+ cd "$builddir"
+ default_prepare
+ # purge 3rd party except carotene
+ for i in 3rdparty/*; do
+ case $i in
+ */carotene*) continue;;
+ */protobuf*) continue;;
+ esac
+ rm -rf "$i"
+ done
+ mkdir -p build
+}
+
+build() {
+ cd "$builddir"/build
+ 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=RelWithDebugInfo \
+ -DCMAKE_CXX_FLAGS="$CXXFLAGS" \
+ -DCMAKE_C_FLAGS="$CFLAGS" \
+ -DENABLE_PRECOMPILED_HEADERS=OFF \
+ -DWITH_OPENMP=ON \
+ -WITH_OPENCL=ON \
+ -DWITH_IPP=OFF \
+ $_sse \
+ ..
+ make
+}
+
+check() {
+ cd "$builddir"/build
+ CTEST_OUTPUT_ON_FAILURE=TRUE ctest
+}
+
+package() {
+ cd "$builddir"/build
+ make DESTDIR="$pkgdir" install
+}
+
+sha512sums="e1fc14285090c6fe9e26e721f2d67d7096650c523147e925567426ef76aa7f4c6f12035d6f6ce3ec7991a75a6828a810fd4f9b75f78ed5fcccecefbadd79944b opencv-3.4.1.tar.gz"