Subject: [alpine-aports] testing/opencv: update to v4.0.0

From: Dario Pellegrini <[email-masked]>
Date: Sat, 22 Dec 2018 12:32:04 +0100

From 2218e92498bb0a22ede00336ea5070d4cc299ecc Mon Sep 17 00:00:00 2001
From: Dario Pellegrini <[email-masked]>
Date: Sat, 22 Dec 2018 12:17:12 +0100
Subject: [PATCH] testing/opencv: Reviewed the APKBUILD and updated to v4.0.0

http://opencv.org/
Open Source Computer Vision Library
---
 testing/opencv/APKBUILD | 58 +++++++++++++++++++++++------------------
 1 file changed, 33 insertions(+), 25 deletions(-)

diff --git a/testing/opencv/APKBUILD b/testing/opencv/APKBUILD
index 5b35fbb666..fada847fc1 100644
--- a/testing/opencv/APKBUILD
+++ b/testing/opencv/APKBUILD
@@ -1,31 +1,26 @@
 # Contributor: Carlo Landmeter <[email-masked]>
-# Maintainer:
+# Maintainer: Dario Pellegrini <[email-masked]>
 pkgname=opencv
-pkgver=3.2.0
-pkgrel=4
+pkgver=4.0.0
+pkgrel=1
 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-base-dev
-	libgphoto2-dev v4l-utils-dev libwebp-dev libdc1394-dev doxygen"
+depends="openexr-dev gst-plugins-base-dev libdc1394-dev
+	lapack-dev libgphoto2-dev jasper-dev ffmpeg-dev gtk+3.0-dev"
+makedepends="cmake python3 ccache libpng-dev libjpeg-turbo-dev tiff-dev gtk+-dev
+	hdf5-dev gflags-dev eigen-dev glog-dev libwebp-dev tesseract-ocr-dev
+	leptonica-dev"
 install=""
 subpackages="$pkgname-dev $pkgname-libs"
-source="opencv-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/$pkgver.tar.gz"
-builddir="$srcdir/opencv-$pkgver"
+source="opencv-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/$pkgver.tar.gz
+	opencv_contrib-$pkgver.tar.gz::https://github.com/opencv/opencv_contrib/archive/$pkgver.tar.gz"
+builddir="$srcdir/build"
 
 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
+	default_prepare
+	mkdir -p "$builddir"
 }
 
 build() {
@@ -33,7 +28,8 @@ build() {
 	if [ "$CARCH" != "x86_64" ]; then
 		local _sse="-DENABLE_SSE=OFF -DENABLE_SSE2=OFF"
 	fi
-	cmake \
+	_pythonpath=`python3 -c "from sysconfig import get_path; print(get_path('platlib'))"`
+	cmake ../opencv-$pkgver \
 		-DCMAKE_INSTALL_PREFIX=/usr \
 		-DCMAKE_INSTALL_LIBDIR=lib \
 		-DBUILD_SHARED_LIBS=True \
@@ -42,16 +38,28 @@ build() {
 		-DCMAKE_C_FLAGS="$CFLAGS" \
 		-DENABLE_PRECOMPILED_HEADERS=OFF \
 		-DWITH_OPENMP=ON \
-		-WITH_OPENCL=ON \
+		-DWITH_OPENCL=ON \
+		-DWITH_TBB=OFF \
 		-DWITH_IPP=OFF \
-		$_sse \
-		|| return 1
-	make || return 1
+		-DOPENCV_EXTRA_MODULES_PATH="$srcdir/opencv_contrib-4.0.0/modules" \
+		-DOPENCV_SKIP_PYTHON_LOADER=ON \
+		-DOPENCV_PYTHON3_INSTALL_PATH=$_pythonpath \
+		-DLAPACK_LIBRARIES="/usr/lib/liblapack.so;/usr/lib/libblas.so;/usr/lib/libcblas.so" \
+		-DLAPACK_CBLAS_H="/usr/include/cblas.h" \
+		-DLAPACK_LAPACKE_H="/usr/include/lapacke.h" \
+		-DOPENCV_GENERATE_PKGCONFIG=ON \
+		-DBUILD_WITH_DEBUG_INFO=OFF \
+		-DBUILD_TESTS=OFF \
+		-DBUILD_PERF_TESTS=OFF \
+		-DBUILD_EXAMPLES=OFF \
+		$_sse
+	make -j4
 }
 
 package() {
 	cd "$builddir"
-	make DESTDIR="$pkgdir" install || return 1
+	make DESTDIR="$pkgdir" install
 }
 
-sha512sums="381fc8146722f7eeed5ec6f36a0180f3210a0bc8412f9f9d5d667827241a12709afee6fd42fb6f8b4e0ff4ed96cc645c55590ac89f65c529d4fbb6cd0ee752ed  opencv-3.2.0.tar.gz"
+sha512sums="0f1aff13bae68ca3e834e0e69fb22411f5a1bdad3e2b947f580e24e3aa291447bf85e82212caae3eaeef60910992de5575c250f2dbbff3edd37ce06ec810c6c6  opencv-4.0.0.tar.gz
+c84588f86ea0e48a13b24cb1998a9b95ed953b547193815229c84faa0059d39e8968f58d00b4164dbe8287324f0669880733ba7d068d695bea878b70daf61ad3  opencv_contrib-4.0.0.tar.gz"
-- 
2.20.1

---

From: Leonardo Arena <[email-masked]>
Date: Tue, 5 Feb 2019 15:29:42 +0100

Hi,

would you please send these patches with git-sendmail?

https://wiki.alpinelinux.org/wiki/Creating_patches

Thanks!

On Sat, Dec 22, 2018 at 12:32 PM Dario Pellegrini <
[email-masked]> wrote: