diff options
author | Christoph Willing <chris.willing@linux.com> | 2018-02-08 07:39:08 +1000 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2018-02-10 08:09:27 +0700 |
commit | 9413c7b3871955f2bbd0b92a4979a2f1049c2011 (patch) | |
tree | cb4ca61f8b5843f9a72ea22e77f0af30b3df601c /libraries | |
parent | 5e9788141de15694e695f44f01da9a69520bc63a (diff) | |
download | slackbuilds-9413c7b3871955f2bbd0b92a4979a2f1049c2011.tar.gz |
libraries/opencv: Updated for version 3.4.0
Signed-off-by: Christoph Willing <chris.willing@linux.com>
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/opencv/README | 22 | ||||
-rw-r--r-- | libraries/opencv/fsh.patch | 72 | ||||
-rw-r--r-- | libraries/opencv/opencv.SlackBuild | 27 | ||||
-rw-r--r-- | libraries/opencv/opencv.info | 14 | ||||
-rw-r--r-- | libraries/opencv/patch_fsh-3.4.0.diff | 50 | ||||
-rw-r--r-- | libraries/opencv/patch_vtk7.diff | 21 |
6 files changed, 91 insertions, 115 deletions
diff --git a/libraries/opencv/README b/libraries/opencv/README index c7db8828bd..71168738ff 100644 --- a/libraries/opencv/README +++ b/libraries/opencv/README @@ -4,6 +4,9 @@ OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in commercial products. +This SlackBuild is incompatible with the opencv-legacy SlackBuild +so they should not be installed simultaneously. + OpenCV will incorporate features from a wide range of additional software that may exist on the host system at build time. The more of the relevant software packages that are available, the greater @@ -11,13 +14,15 @@ the feature set available in the resulting OpenCV package. The additional optional packages will mostly be autodetected and used at build time without any user intervention. Packages that are processed in this way include (by SBo package name): - qt5 libdc1394 ffmpeg hdf5 VTK jdk apache-ant numpy python3 numpy3 + qt5 libdc1394 ffmpeg hdf5 VTK libwebp tesseract + glog apache-ant numpy python3 numpy3 OpenBLAS + openjdk8 (or openjdk or jdk) In the unlikely situation that features from these packages are not wanted despite already being installed on the host system, incorporation of some of them into OpenCV may be suppressed by setting the appropriate environment variable to "no" e.g. - CVFFMPEG=no ./opencv.SlackBuild + CVFFMPEG=no sh ./opencv.SlackBuild Features that may be excluded in this manner are controlled by the following environment variables: CV1394 CVFFMPEG CVVTK @@ -35,8 +40,19 @@ VTK support will be disabled unless it was built with qt5 support (which is possible but not its default). Conversely, if VTK has been built with qt5, it will be disabled in OpenCV unless it too is being built with qt5. +The Deep Neural Network module and Extra 2D Features Framework from +OpenCV's "extra modules" section are disabled by default. They may be +enabled by setting the DNN and/or XF2D environment variables as required +e.g. + DNN=yes sh ./opencv.SlackBuild +Enabling either of these modules results in additional downloading during +the configure stage of building. + Documentation is generated by the SlackBuild unless it is switched off by setting the CVDOCS environment variable i.e. - CVDOCS=no ./opencv.SlackBuild + CVDOCS=no sh ./opencv.SlackBuild +Enabling the documentation results in additional downloading of example data +during the configure stage of building. + The graphviz package is an optional dependency for enhanced documentation. diff --git a/libraries/opencv/fsh.patch b/libraries/opencv/fsh.patch deleted file mode 100644 index 4d391d4ad0..0000000000 --- a/libraries/opencv/fsh.patch +++ /dev/null @@ -1,72 +0,0 @@ -From 2bb4ca7cc656969a9e2c655e594428b465edbfed Mon Sep 17 00:00:00 2001 -From: Valentin Churavy <v.churavy@gmail.com> -Date: Sat, 28 Mar 2015 01:30:01 +0900 -Subject: [PATCH] fsh.patch - ---- - CMakeLists.txt | 14 +++++++------- - cmake/templates/opencv_run_all_tests_unix.sh.in | 2 +- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d9a17b3..3b4d9ad 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -300,7 +300,7 @@ endif() - if(ANDROID OR WIN32) - set(OPENCV_DOC_INSTALL_PATH doc) - else() -- set(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc) -+ set(OPENCV_DOC_INSTALL_PATH share/doc/opencv) - endif() - - if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows) -@@ -342,7 +342,7 @@ if(OPENCV_TEST_DATA_PATH AND NOT OPENCV_TEST_DATA_INSTALL_PATH) - elseif(WIN32) - set(OPENCV_TEST_DATA_INSTALL_PATH "testdata") - else() -- set(OPENCV_TEST_DATA_INSTALL_PATH "share/OpenCV/testdata") -+ set(OPENCV_TEST_DATA_INSTALL_PATH "share/opencv/testdata") - endif() - endif() - -@@ -371,10 +371,10 @@ else() - set(OPENCV_OTHER_INSTALL_PATH etc) - else() - set(OPENCV_LIB_INSTALL_PATH lib${LIB_SUFFIX}) -- set(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}) -- set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples) -- set(OPENCV_JAR_INSTALL_PATH share/OpenCV/java) -- set(OPENCV_OTHER_INSTALL_PATH share/OpenCV) -+ set(OPENCV_3P_LIB_INSTALL_PATH share/opencv/3rdparty/${OPENCV_LIB_INSTALL_PATH}) -+ set(OPENCV_SAMPLES_SRC_INSTALL_PATH share/opencv/samples) -+ set(OPENCV_JAR_INSTALL_PATH share/opencv/java) -+ set(OPENCV_OTHER_INSTALL_PATH share/opencv) - endif() - set(OPENCV_INCLUDE_INSTALL_PATH "include") - -@@ -382,7 +382,7 @@ else() - if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX) - set(OPENCV_CONFIG_INSTALL_PATH lib${LIB_SUFFIX}/cmake/opencv) - else() -- set(OPENCV_CONFIG_INSTALL_PATH share/OpenCV) -+ set(OPENCV_CONFIG_INSTALL_PATH share/opencv) - endif() - endif() - -diff --git a/cmake/templates/opencv_run_all_tests_unix.sh.in b/cmake/templates/opencv_run_all_tests_unix.sh.in -index 7b946af..82370dc 100644 ---- a/cmake/templates/opencv_run_all_tests_unix.sh.in -+++ b/cmake/templates/opencv_run_all_tests_unix.sh.in -@@ -53,7 +53,7 @@ fi - - OPENCV_TEST_PATH=@CMAKE_INSTALL_PREFIX@/@OPENCV_TEST_INSTALL_PATH@ - OPENCV_PYTHON_TESTS=@OPENCV_PYTHON_TESTS_LIST@ --export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/OpenCV/testdata -+export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/opencv/testdata - - # Run tests - --- -2.4.2 - diff --git a/libraries/opencv/opencv.SlackBuild b/libraries/opencv/opencv.SlackBuild index 8aef68edb5..956423eb16 100644 --- a/libraries/opencv/opencv.SlackBuild +++ b/libraries/opencv/opencv.SlackBuild @@ -4,7 +4,7 @@ # Copyright 2012-2015 Matt Dinslage, Springfield, MO USA # All rights reserved. -# Copyright 2016 Christoph Willing, Brisbane, Australia +# Copyright 2016-2018 Christoph Willing, Brisbane, Australia # All rights reserved. # # Redistribution and use of this script, with or without modification, is @@ -26,8 +26,8 @@ PRGNAM=opencv PRGNAM2=opencv_contrib -VERSION=${VERSION:-3.1.0} -BUILD=${BUILD:-3} +VERSION=${VERSION:-3.4.0} +BUILD=${BUILD:-1} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -61,10 +61,10 @@ cv1394="" ; [ "${CV1394:-yes}" = "no" ] && cv1394="-DWITH_1394=OFF" cvffmpeg="" ; [ "${CVFFMPEG:-yes}" = "no" ] && cvffmpeg="-DWITH_FFMPEG=OFF" cvvtk="" ; [ "${CVVTK:-yes}" = "no" ] && cvvtk="-DWITH_VTK=OFF" cvgdal="" ; [ "${CVGDAL:-no}" = "yes" ] && cvgdal="-DWITH_GDAL=ON" +dnn="-DBUILD_opencv_dnn_modern=OFF" ; [ "${DNN:-no}" = "yes" ] && dnn="" +xf2d="-DBUILD_opencv_xfeatures2d=OFF" ; [ "${XF2D:-no}" = "yes" ] && xf2d="" cvdocs="-DBUILD_DOCS=ON -DBUILD_EXAMPLES=ON -DINSTALL_C_EXAMPLES=ON -DINSTALL_PYTHON_EXAMPLES=ON " ; [ "${CVDOCS:-yes}" = "no" ] && cvdocs="" -# Only enable PlantUML if java is available -cvplantuml="" ; [ $(which java 2>/dev/null ) ] && cvplantuml="-DPLANTUML_JAR=$CWD/plantuml.jar" set -e @@ -72,9 +72,10 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/$VERSION.tar.gz +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION -unzip $CWD/$PRGNAM2-$VERSION.zip || unzip $CWD/$VERSION.zip +tar xf $CWD/$PRGNAM2-$VERSION.tar.gz +patch -p0 < $CWD/patch_fsh-${VERSION}.diff chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -82,9 +83,11 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -# http://code.opencv.org/issues/2512 -patch -p1 < $CWD/fsh.patch -patch -p0 < $CWD/patch_vtk7.diff + +[ "${DNN:-no}" = "no" ] && { + sed -i '2s/^/ocv_module_disable(dnn_modern) \n/' $PRGNAM2-$VERSION/modules/dnn_modern/CMakeLists.txt + rm -rf $PRGNAM2-$VERSION/modules/face +} mkdir -p build cd build @@ -107,9 +110,11 @@ cd build $cvffmpeg \ $cvvtk \ $cvgdal \ - $cvplantuml \ + $dnn \ + $xf2d \ $cvdocs \ -DOPENCV_EXTRA_MODULES_PATH=../$PRGNAM2-$VERSION/modules .. + make VERBOSE=1 [ "${CVDOCS:-yes}" = "yes" ] && make doxygen make install DESTDIR=$PKG diff --git a/libraries/opencv/opencv.info b/libraries/opencv/opencv.info index b6ae92dbb4..9e27463720 100644 --- a/libraries/opencv/opencv.info +++ b/libraries/opencv/opencv.info @@ -1,14 +1,12 @@ PRGNAM="opencv" -VERSION="3.1.0" +VERSION="3.4.0" HOMEPAGE="https://opencv.org/" -DOWNLOAD="https://github.com/opencv/opencv/archive/3.1.0/opencv-3.1.0.tar.gz \ - https://github.com/opencv/opencv_contrib/archive/3.1.0/opencv_contrib-3.1.0.zip \ - http://sourceforge.net/projects/plantuml/files/plantuml.8051.jar" -MD5SUM="a0669e22172dfc3225835b180744c9f0 \ - 0d0bfeabe539542791b465ec1c7c90e6 \ - 6ee8103fed6ad731fff2323cb28da848" +DOWNLOAD="https://github.com/opencv/opencv/archive/3.4.0/opencv-3.4.0.tar.gz \ + https://github.com/opencv/opencv_contrib/archive/3.4.0/opencv_contrib-3.4.0.tar.gz" +MD5SUM="170732dc760e5f7ddeccbe53ba5d16a6 \ + 315c3725234ec02fb4f6e55383376d00" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -REQUIRES="" +REQUIRES="python3" MAINTAINER="Christoph Willing" EMAIL="chris.willing@linux.com" diff --git a/libraries/opencv/patch_fsh-3.4.0.diff b/libraries/opencv/patch_fsh-3.4.0.diff new file mode 100644 index 0000000000..0f5deebebb --- /dev/null +++ b/libraries/opencv/patch_fsh-3.4.0.diff @@ -0,0 +1,50 @@ +--- CMakeLists.txt.orig 2017-12-23 05:46:21.000000000 +1000 ++++ CMakeLists.txt 2018-02-06 11:04:07.434035665 +1000 +@@ -351,7 +351,7 @@ + if(ANDROID OR WIN32) + ocv_update(OPENCV_DOC_INSTALL_PATH doc) + else() +- ocv_update(OPENCV_DOC_INSTALL_PATH share/OpenCV/doc) ++ ocv_update(OPENCV_DOC_INSTALL_PATH share/opencv/doc) + endif() + + if(WIN32 AND CMAKE_HOST_SYSTEM_NAME MATCHES Windows) +@@ -392,7 +392,7 @@ + elseif(WIN32) + ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "testdata") + else() +- ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "share/OpenCV/testdata") ++ ocv_update(OPENCV_TEST_DATA_INSTALL_PATH "share/opencv/testdata") + endif() + + if(ANDROID) +@@ -421,18 +421,18 @@ + ocv_update(OPENCV_CONFIG_INSTALL_PATH ".") + else() + include(GNUInstallDirs) +- ocv_update(OPENCV_LIB_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}) +- ocv_update(OPENCV_3P_LIB_INSTALL_PATH share/OpenCV/3rdparty/${OPENCV_LIB_INSTALL_PATH}) +- ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH share/OpenCV/samples) +- ocv_update(OPENCV_JAR_INSTALL_PATH share/OpenCV/java) +- ocv_update(OPENCV_OTHER_INSTALL_PATH share/OpenCV) ++ ocv_update(OPENCV_LIB_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}) ++ ocv_update(OPENCV_3P_LIB_INSTALL_PATH share/opencv/3rdparty/${OPENCV_LIB_INSTALL_PATH}) ++ ocv_update(OPENCV_SAMPLES_SRC_INSTALL_PATH share/opencv/samples) ++ ocv_update(OPENCV_JAR_INSTALL_PATH share/opencv/java) ++ ocv_update(OPENCV_OTHER_INSTALL_PATH share/opencv) + + if(NOT DEFINED OPENCV_CONFIG_INSTALL_PATH) + math(EXPR SIZEOF_VOID_P_BITS "8 * ${CMAKE_SIZEOF_VOID_P}") + if(LIB_SUFFIX AND NOT SIZEOF_VOID_P_BITS EQUAL LIB_SUFFIX) +- ocv_update(OPENCV_CONFIG_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}${LIB_SUFFIX}/cmake/opencv) ++ ocv_update(OPENCV_CONFIG_INSTALL_PATH ${CMAKE_INSTALL_LIBDIR}/cmake/opencv) + else() +- ocv_update(OPENCV_CONFIG_INSTALL_PATH share/OpenCV) ++ ocv_update(OPENCV_CONFIG_INSTALL_PATH share/opencv) + endif() + endif() + endif() +56c56 +< export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/OpenCV/testdata +--- +> export OPENCV_TEST_DATA_PATH=@CMAKE_INSTALL_PREFIX@/share/opencv/testdata diff --git a/libraries/opencv/patch_vtk7.diff b/libraries/opencv/patch_vtk7.diff deleted file mode 100644 index a34d3458b2..0000000000 --- a/libraries/opencv/patch_vtk7.diff +++ /dev/null @@ -1,21 +0,0 @@ -# Patch for VTK-7.x derived by diff from upstream: -# https://raw.githubusercontent.com/opencv/opencv/master/cmake/OpenCVDetectVTK.cmake -# ---- cmake/OpenCVDetectVTK.cmake.orig 2015-12-19 01:02:16.000000000 +1000 -+++ cmake/OpenCVDetectVTK.cmake 2016-11-19 15:46:10.468197286 +1000 -@@ -3,7 +3,14 @@ - endif() - - # VTK 6.x components --find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE) -+find_package(VTK QUIET COMPONENTS vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE) -+IF(VTK_FOUND) -+ IF(VTK_RENDERING_BACKEND) #in vtk 7, the rendering backend is exported as a var. -+ find_package(VTK QUIET COMPONENTS vtkRendering${VTK_RENDERING_BACKEND} vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport vtkIOGeometry NO_MODULE) -+ ELSE(VTK_RENDERING_BACKEND) -+ find_package(VTK QUIET COMPONENTS vtkRenderingOpenGL vtkInteractionStyle vtkRenderingLOD vtkIOPLY vtkFiltersTexture vtkRenderingFreeType vtkIOExport NO_MODULE) -+ ENDIF(VTK_RENDERING_BACKEND) -+ENDIF(VTK_FOUND) - - # VTK 5.x components - if(NOT VTK_FOUND) |