extra/opencv to 4.2.0-2

This commit is contained in:
Kevin Mihelich 2020-02-28 13:20:22 +00:00
parent 5b73114c0d
commit 67f9740e6a

View file

@ -8,7 +8,7 @@
pkgbase=opencv pkgbase=opencv
pkgname=(opencv opencv-samples) pkgname=(opencv opencv-samples)
pkgver=4.2.0 pkgver=4.2.0
pkgrel=1 pkgrel=2
pkgdesc="Open Source Computer Vision Library" pkgdesc="Open Source Computer Vision Library"
arch=(x86_64) arch=(x86_64)
license=(BSD) license=(BSD)
@ -25,10 +25,12 @@ optdepends=('opencv-samples: samples'
source=("$pkgbase-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/$pkgver.zip" source=("$pkgbase-$pkgver.tar.gz::https://github.com/opencv/opencv/archive/$pkgver.zip"
"opencv_contrib-$pkgver.tar.gz::https://github.com/opencv/opencv_contrib/archive/$pkgver.tar.gz" "opencv_contrib-$pkgver.tar.gz::https://github.com/opencv/opencv_contrib/archive/$pkgver.tar.gz"
opencv-includedir.patch opencv-includedir.patch
opencv-install-samples_utils.patch::"https://github.com/opencv/opencv/commit/981e63d8.patch"
0001-link-with-libatomic.patch) 0001-link-with-libatomic.patch)
sha256sums=('55bd939079d141a50fca74bde5b61b339dd0f0ece6320ec76859aaff03c90d9f' sha256sums=('55bd939079d141a50fca74bde5b61b339dd0f0ece6320ec76859aaff03c90d9f'
'8a6b5661611d89baa59a26eb7ccf4abb3e55d73f99bb52d8f7c32265c8a43020' '8a6b5661611d89baa59a26eb7ccf4abb3e55d73f99bb52d8f7c32265c8a43020'
'a96e35c9592e655b21a62cfe04e864a10e21535ad900e5de67356b9e9f40ca10' 'a96e35c9592e655b21a62cfe04e864a10e21535ad900e5de67356b9e9f40ca10'
'c370f234931d46cd01234d48a01af02642d7e90a0486278fa7845d3bac1c514a'
'3376bc87ac7404c6f396f1bee03b76ab0e5cb18829f535bbc97cef71d28ab168') '3376bc87ac7404c6f396f1bee03b76ab0e5cb18829f535bbc97cef71d28ab168')
prepare() { prepare() {
@ -36,6 +38,7 @@ prepare() {
cd $pkgname-$pkgver cd $pkgname-$pkgver
patch -p1 -i ../opencv-includedir.patch # Fix wrong include patch in pkgconfig file patch -p1 -i ../opencv-includedir.patch # Fix wrong include patch in pkgconfig file
patch -p1 -i ../opencv-install-samples_utils.patch # Install all CMake files required to build samples
sed -e '/ocv_tbb_cmake_guess(HAVE_TBB)/d' -i cmake/OpenCVDetectTBB.cmake # Don't use TBB's cmake config, it breaks build sed -e '/ocv_tbb_cmake_guess(HAVE_TBB)/d' -i cmake/OpenCVDetectTBB.cmake # Don't use TBB's cmake config, it breaks build
@ -83,8 +86,7 @@ package_opencv() {
install -Dm644 "$srcdir"/$pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname install -Dm644 "$srcdir"/$pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
# separate samples package # separate samples package
cd "$pkgdir"/usr/share mv "$pkgdir"/usr/share/opencv4/samples "$srcdir"
mv opencv4/samples "$srcdir"/$pkgname-samples
} }
package_opencv-samples() { package_opencv-samples() {
@ -92,10 +94,9 @@ package_opencv-samples() {
depends=("opencv=$pkgver") depends=("opencv=$pkgver")
unset optdepends unset optdepends
mkdir -p "$pkgdir"/usr/share/opencv cd build
cp -r "$srcdir"/opencv-samples "$pkgdir"/usr/share/opencv/samples mkdir -p "$pkgdir"/usr/share/opencv4
# fix permissions mv "$srcdir"/samples "$pkgdir"/usr/share/opencv4
chmod 755 "$pkgdir"/usr/share/opencv/samples/*
# install license file # install license file
install -Dm644 "$srcdir"/opencv-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname install -Dm644 "$srcdir"/opencv-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname