mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
extra/opencv to 4.0.0-4
This commit is contained in:
parent
3291ee3110
commit
d3ae88c9c3
2 changed files with 29 additions and 16 deletions
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
pkgbase=opencv
|
pkgbase=opencv
|
||||||
pkgname=(opencv opencv-samples)
|
pkgname=(opencv opencv-samples)
|
||||||
pkgver=3.4.4
|
pkgver=4.0.0
|
||||||
pkgrel=1
|
pkgrel=4
|
||||||
pkgdesc="Open Source Computer Vision Library"
|
pkgdesc="Open Source Computer Vision Library"
|
||||||
arch=(x86_64)
|
arch=(x86_64)
|
||||||
license=(BSD)
|
license=(BSD)
|
||||||
|
@ -22,8 +22,8 @@ optdepends=('opencv-samples: samples'
|
||||||
'python-numpy: Python interface')
|
'python-numpy: Python interface')
|
||||||
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")
|
||||||
sha256sums=('b5755384cbadf67f55838c6cfd9ae1aad0ebad2c7cfe4c1174417c80d2ed15a9'
|
sha256sums=('86fd08fc02893e05e2944fa7b0daa7d02643232450f020b475e1b2f24587b99a'
|
||||||
'765446d994713363554978d1da447fef77a2cdf9e38742f0a98b13b92652626d')
|
'4fb0681414df4baedce6e3f4a01318d6f4fcde6ee14854d761fd4e397a397763')
|
||||||
|
|
||||||
prepare() {
|
prepare() {
|
||||||
mkdir -p build
|
mkdir -p build
|
||||||
|
@ -32,6 +32,7 @@ prepare() {
|
||||||
build() {
|
build() {
|
||||||
cd build
|
cd build
|
||||||
# cmake's FindLAPACK doesn't add cblas to LAPACK_LIBRARIES, so we need to specify them manually
|
# cmake's FindLAPACK doesn't add cblas to LAPACK_LIBRARIES, so we need to specify them manually
|
||||||
|
_pythonpath=`python -c "from sysconfig import get_path; print(get_path('platlib'))"`
|
||||||
cmake ../$pkgname-$pkgver \
|
cmake ../$pkgname-$pkgver \
|
||||||
-DWITH_OPENCL=ON \
|
-DWITH_OPENCL=ON \
|
||||||
-DWITH_OPENGL=ON \
|
-DWITH_OPENGL=ON \
|
||||||
|
@ -46,31 +47,31 @@ build() {
|
||||||
-DCMAKE_INSTALL_PREFIX=/usr \
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
||||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||||
-DOPENCV_EXTRA_MODULES_PATH="$srcdir/opencv_contrib-$pkgver/modules" \
|
-DOPENCV_EXTRA_MODULES_PATH="$srcdir/opencv_contrib-$pkgver/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_LIBRARIES="/usr/lib/liblapack.so;/usr/lib/libblas.so;/usr/lib/libcblas.so" \
|
||||||
-DLAPACK_CBLAS_H="/usr/include/cblas.h" \
|
-DLAPACK_CBLAS_H="/usr/include/cblas.h" \
|
||||||
-DLAPACK_LAPACKE_H="/usr/include/lapacke.h"
|
-DLAPACK_LAPACKE_H="/usr/include/lapacke.h" \
|
||||||
|
-DOPENCV_GENERATE_PKGCONFIG=ON
|
||||||
make
|
make
|
||||||
}
|
}
|
||||||
|
|
||||||
package_opencv() {
|
package_opencv() {
|
||||||
options=(staticlibs)
|
|
||||||
|
|
||||||
cd build
|
cd build
|
||||||
make DESTDIR="$pkgdir" install
|
make DESTDIR="$pkgdir" install
|
||||||
|
|
||||||
# install license file
|
# install license file
|
||||||
install -Dm644 "$srcdir"/$pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
|
install -Dm644 "$srcdir"/$pkgname-$pkgver/LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname
|
||||||
|
|
||||||
# install python bindings
|
|
||||||
cd python_loader
|
|
||||||
python setup.py install --root="$pkgdir"
|
|
||||||
rm -r "$pkgdir"/usr/python
|
|
||||||
|
|
||||||
cd "$pkgdir"/usr/share
|
|
||||||
|
|
||||||
# separate samples package
|
# separate samples package
|
||||||
mv OpenCV/samples "$srcdir/$pkgname-samples"
|
cd "$pkgdir"/usr/share
|
||||||
mv OpenCV $pkgname # otherwise folder naming is inconsistent
|
mv opencv4/samples "$srcdir"/$pkgname-samples
|
||||||
|
|
||||||
|
# install missing headers https://github.com/opencv/opencv/issues/13201
|
||||||
|
for _module in imgcodecs videoio photo; do
|
||||||
|
cp -r "$srcdir"/$pkgname-$pkgver/modules/$_module/include/opencv2/$_module/legacy \
|
||||||
|
"$pkgdir"/usr/include/opencv4/opencv2/$_module
|
||||||
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
package_opencv-samples() {
|
package_opencv-samples() {
|
||||||
|
|
12
extra/opencv/opencv-legacy-headers.patch
Normal file
12
extra/opencv/opencv-legacy-headers.patch
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
diff --git a/modules/imgcodecs/CMakeLists.txt b/modules/imgcodecs/CMakeLists.txt
|
||||||
|
index d771224d4..dc9587927 100644
|
||||||
|
--- a/modules/imgcodecs/CMakeLists.txt
|
||||||
|
+++ b/modules/imgcodecs/CMakeLists.txt
|
||||||
|
@@ -102,6 +102,7 @@ file(GLOB imgcodecs_ext_hdrs
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/*.hpp"
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.hpp"
|
||||||
|
"${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*.h"
|
||||||
|
+ "${CMAKE_CURRENT_LIST_DIR}/include/opencv2/${name}/*/*.h"
|
||||||
|
)
|
||||||
|
|
||||||
|
if(IOS)
|
Loading…
Reference in a new issue