From 2d26a478ee992ae7c48ae828808820b695f5da6f Mon Sep 17 00:00:00 2001 From: Christoph Willing Date: Tue, 22 Nov 2016 14:20:10 +1000 Subject: libraries/opencv: Add VTK support + new maintainer Signed-off-by: Christoph Willing --- libraries/opencv/README | 45 +++++++++++++++++++++++++++++++++----- libraries/opencv/opencv.SlackBuild | 39 ++++++++++++++++++++++++++------- libraries/opencv/opencv.info | 12 +++++----- libraries/opencv/patch_vtk7.diff | 21 ++++++++++++++++++ libraries/opencv/slack-desc | 12 +++++----- 5 files changed, 105 insertions(+), 24 deletions(-) create mode 100644 libraries/opencv/patch_vtk7.diff (limited to 'libraries/opencv') diff --git a/libraries/opencv/README b/libraries/opencv/README index a50275f6b0..c7db8828bd 100644 --- a/libraries/opencv/README +++ b/libraries/opencv/README @@ -1,7 +1,42 @@ -OpenCV (Open Source Computer Vision) +OpenCV (Open Source Computer Vision Library) is an open source +computer vision and machine learning software library. +OpenCV was built to provide a common infrastructure for +computer vision applications and to accelerate the use of +machine perception in commercial products. -OpenCV is a library of programming functions mainly -aimed at real-time computer vision. +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 +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 -numpy (for the python bindings), ffmpeg and qt5 are -optional dependencies. +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 +Features that may be excluded in this manner are controlled by the +following environment variables: + CV1394 CVFFMPEG CVVTK + +At least one optional package is not autodetected, even though the +necessary prerequisite software may already have been installed. It +must therefore be explicitly enabled by setting the appropriate +environment variable: + CVGDAL=yes ./opencv.SlackBuild +(to support SBo's gis/gdal) + +Please note that some combinations of options may not be possible. In +particular, if both qt5 and VTK are installed on the host build system, +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. + +Documentation is generated by the SlackBuild unless it is switched off +by setting the CVDOCS environment variable i.e. + CVDOCS=no ./opencv.SlackBuild +The graphviz package is an optional dependency for enhanced +documentation. diff --git a/libraries/opencv/opencv.SlackBuild b/libraries/opencv/opencv.SlackBuild index d99f4006a7..c1e8c716f7 100644 --- a/libraries/opencv/opencv.SlackBuild +++ b/libraries/opencv/opencv.SlackBuild @@ -4,6 +4,8 @@ # Copyright 2012-2015 Matt Dinslage, Springfield, MO USA # All rights reserved. +# Copyright 2016 Christoph Willing, Brisbane, Australia +# All rights reserved. # # Redistribution and use of this script, with or without modification, is # permitted provided that the following conditions are met: @@ -25,7 +27,7 @@ PRGNAM=opencv PRGNAM2=opencv_contrib VERSION=${VERSION:-3.1.0} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -55,15 +57,24 @@ else LIBDIRSUFFIX="" fi +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" +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 rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$VERSION.tar.gz || tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/$VERSION.tar.gz cd $PRGNAM-$VERSION -unzip $CWD/$VERSION.zip || unzip $CWD/$PRGNAM2-$VERSION.zip +unzip $CWD/$PRGNAM2-$VERSION.zip || unzip $CWD/$VERSION.zip chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ @@ -73,6 +84,7 @@ find -L . \ # http://code.opencv.org/issues/2512 patch -p1 < $CWD/fsh.patch +patch -p0 < $CWD/patch_vtk7.diff mkdir -p build cd build @@ -81,27 +93,38 @@ cd build -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \ -DCMAKE_BUILD_TYPE="Release" \ -DCMAKE_INSTALL_PREFIX=/usr \ - -DINSTALL_MAN_DIR=man \ - -DINSTALL_DOC_DIR=doc/$PRGNAM-$VERSION \ + -DLIB_SUFFIX=$LIBDIRSUFFIX \ -DBUILD_SHARED_LIBS=ON \ -DENABLE_PRECOMPILED_HEADERS=OFF \ - -DWITH_QT=ON \ -DWITH_IPP=OFF \ - -DLIB_SUFFIX=$LIBDIRSUFFIX \ - -DLIB_INSTALL_DIR=/usr/lib$LIBDIRSUFFIX \ + -DWITH_QT=ON \ + -DWITH_OPENGL=ON \ + -DWITH_OPENMP=ON \ + -DWITH_XINE=ON \ -DBUILD_CUDA_STUBS=OFF \ -DWITH_CUDA=OFF \ + $cv1394 \ + $cvffmpeg \ + $cvvtk \ + $cvgdal \ + $cvplantuml \ + $cvdocs \ -DOPENCV_EXTRA_MODULES_PATH=../$PRGNAM2-$VERSION/modules .. make VERBOSE=1 + [ "${CVDOCS:-yes}" = "yes" ] && make doxygen make install DESTDIR=$PKG cd .. find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true +cp -a samples/java* samples/opencl* samples/opengl* $PKG/usr/share/opencv/samples +chmod -R 0755 $PKG/usr/share/opencv/samples/{python*,opencl*,opengl*} + mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION cp -a README.md $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild +mv $PKG/usr/share/doc/opencv/html $PKG/usr/doc/$PRGNAM-$VERSION && rm -rf $PKG/usr/share/doc mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc diff --git a/libraries/opencv/opencv.info b/libraries/opencv/opencv.info index f323ef7b4f..c92d8bd72f 100644 --- a/libraries/opencv/opencv.info +++ b/libraries/opencv/opencv.info @@ -1,12 +1,14 @@ PRGNAM="opencv" VERSION="3.1.0" HOMEPAGE="http://opencv.org/" -DOWNLOAD="https://github.com/Itseez/opencv/archive/3.1.0.tar.gz \ - https://github.com/Itseez/opencv_contrib/archive/3.1.0.zip" +DOWNLOAD="https://github.com/Itseez/opencv/archive/3.1.0/opencv-3.1.0.tar.gz \ + https://github.com/Itseez/opencv_contrib/archive/3.1.0/opencv_contrib-3.1.0.zip \ + http://sourceforge.net/projects/plantuml/files/plantuml.jar" MD5SUM="70e1dd07f0aa06606f1bc0e3fa15abd3 \ - 0d0bfeabe539542791b465ec1c7c90e6" + 0d0bfeabe539542791b465ec1c7c90e6 \ + cf7cf91a910eeee1a0a9bbff9ca00e22" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="M.Dinslage" -EMAIL="daedra1980@gmail.com" +MAINTAINER="Christoph Willing" +EMAIL="chris.willing@linux.com" diff --git a/libraries/opencv/patch_vtk7.diff b/libraries/opencv/patch_vtk7.diff new file mode 100644 index 0000000000..a34d3458b2 --- /dev/null +++ b/libraries/opencv/patch_vtk7.diff @@ -0,0 +1,21 @@ +# 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) diff --git a/libraries/opencv/slack-desc b/libraries/opencv/slack-desc index ab20903fa7..447ea96038 100644 --- a/libraries/opencv/slack-desc +++ b/libraries/opencv/slack-desc @@ -8,12 +8,12 @@ |-----handy-ruler------------------------------------------------------| opencv: opencv (Open Source Computer Vision) opencv: -opencv: OpenCV is a library of programming functions mainly aimed at real -opencv: time computer vision. -opencv: -opencv: -opencv: -opencv: Homepage: http://opencv.willowgarage.com +opencv: OpenCV (Open Source Computer Vision Library) is an open source +opencv: computer vision and machine learning software library. OpenCV was +opencv: built to provide a common infrastructure for computer vision +opencv: applications and to accelerate the use of machine perception in +opencv: commercial products. opencv: +opencv: Homepage: http://www.opencv.org opencv: opencv: -- cgit v1.2.3