aboutsummaryrefslogtreecommitdiff
path: root/libraries/opencv/opencv.SlackBuild
diff options
context:
space:
mode:
authorChristoph Willing <chris.willing@iinet.net.au>2016-11-22 14:20:10 +1000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2016-11-26 11:47:45 +0700
commit2d26a478ee992ae7c48ae828808820b695f5da6f (patch)
tree3fa85b3acb6dfc2049198b5d6f0c1f07b8e09658 /libraries/opencv/opencv.SlackBuild
parent83117967e7c84095d0e37968ea8924e264aea519 (diff)
libraries/opencv: Add VTK support + new maintainer
Signed-off-by: Christoph Willing <chris.willing@iinet.net.au>
Diffstat (limited to 'libraries/opencv/opencv.SlackBuild')
-rw-r--r--libraries/opencv/opencv.SlackBuild39
1 files changed, 31 insertions, 8 deletions
diff --git a/libraries/opencv/opencv.SlackBuild b/libraries/opencv/opencv.SlackBuild
index d99f4006a7e7..c1e8c716f753 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