diff options
author | M.Dinslage <daedra1980@gmail.com> | 2010-06-28 12:39:59 -0400 |
---|---|---|
committer | dsomero <xgizzmo@slackbuilds.org> | 2010-06-28 12:39:59 -0400 |
commit | 8c17163172f8f99efb55fc52eccdece4ca629cfe (patch) | |
tree | 1e2864d90d710eaac5b764b15131ed942d433ce9 /libraries/opencv/opencv.SlackBuild | |
parent | 479aeb2b3a042293245c5fd160812e2fe86def5a (diff) | |
download | slackbuilds-8c17163172f8f99efb55fc52eccdece4ca629cfe.tar.gz |
libraries/opencv: Updated for version 2.1.0.
Signed-off-by: dsomero <xgizzmo@slackbuilds.org>
Diffstat (limited to 'libraries/opencv/opencv.SlackBuild')
-rw-r--r-- | libraries/opencv/opencv.SlackBuild | 96 |
1 files changed, 48 insertions, 48 deletions
diff --git a/libraries/opencv/opencv.SlackBuild b/libraries/opencv/opencv.SlackBuild index 699aaa42a2..27a795be87 100644 --- a/libraries/opencv/opencv.SlackBuild +++ b/libraries/opencv/opencv.SlackBuild @@ -1,29 +1,13 @@ #!/bin/sh -# -# Slackware build script of opencv - -# Copyright 2006 Ricardson Williams <ricardsonwilliams at yahoo.com.br> -# 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. + +# Slackware build script for cwp (customizable weather plasmoid) + +# Written by M.Dinslage contact: daedra1980@gmail.com +# Big thanks to ponce for the patches. PRGNAM=opencv -VERSION=1.1pre1 +SRCNAM=OpenCV +VERSION=${VERSION:-2.1.0} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -45,55 +29,71 @@ OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" LIBDIRSUFFIX="" + SLKLDFLAGS="-L/usr/lib -L/lib" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" + SLKLDFLAGS="-L/usr/lib -L/lib" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" + SLKLDFLAGS="-L/usr/lib64 -L/lib64" else SLKCFLAGS="-O2" LIBDIRSUFFIX="" + SLKLDFLAGS="-L/usr/lib -L/lib" fi +set -e + rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT -cd $TMP || exit 1 -rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || exit 1 -mv $PRGNAM-1.1.0 $PRGNAM-$VERSION || exit 1 -cd $PRGNAM-$VERSION || exit 1 +cd $TMP +rm -rf $SRCNAM-$VERSION +tar xvf $CWD/$SRCNAM-$VERSION.tar.bz2 +cd $SRCNAM-$VERSION chown -R root:root . -chmod -R u+w,go+r-w,a-s . +find . \ + \( -perm 777 -o -perm 775 -o -perm 711 -o -perm 555 -o -perm 511 \) \ + -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \ + -exec chmod 644 {} \; + +# patch for libpng-1.4 +patch -p1 < $CWD/libpng-1.4.patch -# Patch to build with libpng14 and gcc4.4. -patch -p1 < $CWD/opencv-gcc4.4.patch -patch -p1 < $CWD/opencv-libpng14.patch +# Honor LIB_SUFFIX http://sourceforge.net/tracker/index.php?func=detail&aid=2876292&group_id=22870&atid=376679 +# rewritten by ponce for 2.1.0 +patch -p1 < $CWD/libopencv-2.1.0-libdir.patch -CFLAGS="$SLKCFLAGS" \ -CXXFLAGS="$SLKCFLAGS" \ -./configure \ - --prefix=/usr \ - --libdir=/usr/lib${LIBDIRSUFFIX} \ - --sysconfdir=/etc \ - --localstatedir=/var \ - --build=$ARCH-slackware-linux \ - || exit 1 +mkdir -p build +cd build + LDFLAGS=$SLKLDFLAGS cmake \ + -DCMAKE_C_FLAGS="$SLKCFLAGS" \ + -DCMAKE_CXX_FLAGS="$SLKCFLAGS" \ + -DCMAKE_BUILD_TYPE="Release" \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DINSTALL_MAN_DIR=man \ + -DINSTALL_DOC_DIR=doc/$PRGNAM-$VERSION \ + -DBUILD_SHARED_LIBS=ON \ + -DLIB_SUFFIX=$LIBDIRSUFFIX \ + -DLIB_INSTALL_DIR=/usr/lib$LIBDIRSUFFIX \ + .. + make VERBOSE=1 + make install DESTDIR=$PKG -make || exit 1 -make install DESTDIR=$PKG || exit 1 +cd - find $PKG | xargs file | grep -e "executable" -e "shared object" \ | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README THANKS TODO \ - $PKG/usr/doc/$PRGNAM-$VERSION -mv $PKG/usr/share/$PRGNAM/doc $PKG/usr/doc/$PRGNAM-$VERSION/ +mkdir $PKG/usr/doc +mv $PKG/usr/share/$PRGNAM/doc $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README doc/opencv.pdf $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cd $PKG -/sbin/makepkg -c n -l y -p $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} |