summaryrefslogtreecommitdiff
path: root/libraries
diff options
context:
space:
mode:
authorChristoph Willing <chris.willing@linux.com>2018-02-08 16:56:05 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2018-02-10 08:09:33 +0700
commit9d3671ce67be5f0178fcfbea377fb4c83cfefca2 (patch)
tree8bd379e8d5c9baae562abfe2de079ef8307a6114 /libraries
parent7a995de505bfbb5ecdfbe82007b1d14924e8cde0 (diff)
downloadslackbuilds-9d3671ce67be5f0178fcfbea377fb4c83cfefca2.tar.gz
libraries/opencv-legacy: Added (Open Source Computer Vision).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'libraries')
-rw-r--r--libraries/opencv-legacy/README46
-rw-r--r--libraries/opencv-legacy/fsh.patch72
-rw-r--r--libraries/opencv-legacy/opencv-legacy.SlackBuild136
-rw-r--r--libraries/opencv-legacy/opencv-legacy.info14
-rw-r--r--libraries/opencv-legacy/patch_vtk7.diff21
-rw-r--r--libraries/opencv-legacy/slack-desc19
6 files changed, 308 insertions, 0 deletions
diff --git a/libraries/opencv-legacy/README b/libraries/opencv-legacy/README
new file mode 100644
index 0000000000..4376432804
--- /dev/null
+++ b/libraries/opencv-legacy/README
@@ -0,0 +1,46 @@
+This SlackBuild is intended for the few applications requiring a
+version of OpenCV no greater than v3.1.0. It is NOT recommended
+to install this version alongside the normal opencv package.
+
+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 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
+
+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-legacy.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-legacy.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-legacy.SlackBuild
+The graphviz package is an optional dependency for enhanced
+documentation.
diff --git a/libraries/opencv-legacy/fsh.patch b/libraries/opencv-legacy/fsh.patch
new file mode 100644
index 0000000000..4d391d4ad0
--- /dev/null
+++ b/libraries/opencv-legacy/fsh.patch
@@ -0,0 +1,72 @@
+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-legacy/opencv-legacy.SlackBuild b/libraries/opencv-legacy/opencv-legacy.SlackBuild
new file mode 100644
index 0000000000..ca5cd7d6b9
--- /dev/null
+++ b/libraries/opencv-legacy/opencv-legacy.SlackBuild
@@ -0,0 +1,136 @@
+#!/bin/sh
+
+# Slackware build script for opencv-legacy
+
+# Copyright 2012-2015 Matt Dinslage, Springfield, MO USA
+# All rights reserved.
+# Copyright 2016-2018 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:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+PRGNAM=opencv-legacy
+SRCNAM=opencv
+PRGNAM2=opencv_contrib
+VERSION=${VERSION:-3.1.0}
+BUILD=${BUILD:-1}
+TAG=${TAG:-_SBo}
+
+if [ -z "$ARCH" ]; then
+ case "$( uname -m )" in
+ i?86) ARCH=i586 ;;
+ arm*) ARCH=arm ;;
+ *) ARCH=$( uname -m ) ;;
+ esac
+fi
+
+CWD=$(pwd)
+TMP=${TMP:-/tmp/SBo}
+PKG=$TMP/package-$PRGNAM
+OUTPUT=${OUTPUT:-/tmp}
+
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "i686" ]; then
+ SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
+else
+ SLKCFLAGS="-O2"
+ 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 $SRCNAM-$VERSION
+tar xvf $CWD/$SRCNAM-$VERSION.tar.gz || tar xvf $CWD/$VERSION.tar.gz
+cd $SRCNAM-$VERSION
+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 \
+ -o -perm 511 \) -exec chmod 755 {} \; -o \
+ \( -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
+
+mkdir -p build
+cd build
+ cmake \
+ -DCMAKE_C_FLAGS="$SLKCFLAGS" \
+ -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \
+ -DCMAKE_BUILD_TYPE="Release" \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DLIB_SUFFIX=$LIBDIRSUFFIX \
+ -DBUILD_SHARED_LIBS=ON \
+ -DENABLE_PRECOMPILED_HEADERS=OFF \
+ -DWITH_IPP=OFF \
+ -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
+
+[ "${CVDOCS:-yes}" = "yes" ] && {
+ cp -a samples/java* samples/opencl* samples/opengl* $PKG/usr/share/opencv/samples
+ chmod -R 0755 $PKG/usr/share/opencv/samples
+}
+
+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
+
+cd $PKG
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/libraries/opencv-legacy/opencv-legacy.info b/libraries/opencv-legacy/opencv-legacy.info
new file mode 100644
index 0000000000..bd2543cf06
--- /dev/null
+++ b/libraries/opencv-legacy/opencv-legacy.info
@@ -0,0 +1,14 @@
+PRGNAM="opencv-legacy"
+VERSION="3.1.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_x86_64=""
+MD5SUM_x86_64=""
+REQUIRES=""
+MAINTAINER="Christoph Willing"
+EMAIL="chris.willing@linux.com"
diff --git a/libraries/opencv-legacy/patch_vtk7.diff b/libraries/opencv-legacy/patch_vtk7.diff
new file mode 100644
index 0000000000..a34d3458b2
--- /dev/null
+++ b/libraries/opencv-legacy/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-legacy/slack-desc b/libraries/opencv-legacy/slack-desc
new file mode 100644
index 0000000000..995d15d0c6
--- /dev/null
+++ b/libraries/opencv-legacy/slack-desc
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.
+# Line up the first '|' above the ':' following the base package name, and
+# the '|' on the right side marks the last column you can put a character in.
+# You must make exactly 11 lines for the formatting to be correct. It's also
+# customary to leave one space after the ':' except on otherwise blank lines.
+
+ |-----handy-ruler------------------------------------------------------|
+opencv-legacy: opencv-legacy (Open Source Computer Vision)
+opencv-legacy:
+opencv-legacy: OpenCV (Open Source Computer Vision Library) is an open source
+opencv-legacy: computer vision and machine learning software library. OpenCV was
+opencv-legacy: built to provide a common infrastructure for computer vision
+opencv-legacy: applications and to accelerate the use of machine perception in
+opencv-legacy: commercial products.
+opencv-legacy:
+opencv-legacy: Intended for SlackBuilds requiring opencv no greater than v3.1.0.
+opencv-legacy:
+opencv-legacy: Homepage: https://www.opencv.org