From 8c17163172f8f99efb55fc52eccdece4ca629cfe Mon Sep 17 00:00:00 2001 From: "M.Dinslage" Date: Mon, 28 Jun 2010 12:39:59 -0400 Subject: libraries/opencv: Updated for version 2.1.0. Signed-off-by: dsomero --- libraries/opencv/README | 7 +- libraries/opencv/libopencv-2.1.0-libdir.patch | 154 ++++++++++++++++++++++++++ libraries/opencv/libpng-1.4.patch | 12 ++ libraries/opencv/opencv-gcc4.4.patch | 12 -- libraries/opencv/opencv-libpng14.patch | 12 -- libraries/opencv/opencv.SlackBuild | 96 ++++++++-------- libraries/opencv/opencv.info | 14 +-- 7 files changed, 225 insertions(+), 82 deletions(-) create mode 100644 libraries/opencv/libopencv-2.1.0-libdir.patch create mode 100644 libraries/opencv/libpng-1.4.patch delete mode 100644 libraries/opencv/opencv-gcc4.4.patch delete mode 100644 libraries/opencv/opencv-libpng14.patch (limited to 'libraries/opencv') diff --git a/libraries/opencv/README b/libraries/opencv/README index e2566f95b3..ee009baf4e 100644 --- a/libraries/opencv/README +++ b/libraries/opencv/README @@ -1,5 +1,6 @@ OpenCV (Open Source Computer Vision) - -OpenCV is a library of programming functions mainly aimed at real time computer vision. - +OpenCV is a library of programming functions mainly aimed at real +opencv: time computer vision. + +FFmpeg is an optional runtime dependency (available here at SBo) diff --git a/libraries/opencv/libopencv-2.1.0-libdir.patch b/libraries/opencv/libopencv-2.1.0-libdir.patch new file mode 100644 index 0000000000..1e1600c1c6 --- /dev/null +++ b/libraries/opencv/libopencv-2.1.0-libdir.patch @@ -0,0 +1,154 @@ +diff -Naur OpenCV-2.1.0.orig/3rdparty/flann/CMakeLists.txt OpenCV-2.1.0/3rdparty/flann/CMakeLists.txt +--- OpenCV-2.1.0.orig/3rdparty/flann/CMakeLists.txt 2010-04-11 10:51:39.694283320 +0200 ++++ OpenCV-2.1.0/3rdparty/flann/CMakeLists.txt 2010-04-11 10:56:06.674279640 +0200 +@@ -89,8 +89,8 @@ + INSTALL ( + TARGETS flann # flann_s + RUNTIME DESTINATION bin +- LIBRARY DESTINATION lib +- ARCHIVE DESTINATION lib ++ LIBRARY DESTINATION lib${LIB_SUFFIX} ++ ARCHIVE DESTINATION lib${LIB_SUFFIX} + ) + + # INSTALL ( +diff -Naur OpenCV-2.1.0.orig/CMakeLists.txt OpenCV-2.1.0/CMakeLists.txt +--- OpenCV-2.1.0.orig/CMakeLists.txt 2010-04-11 10:51:39.564279640 +0200 ++++ OpenCV-2.1.0/CMakeLists.txt 2010-04-11 10:55:04.824279480 +0200 +@@ -467,8 +467,8 @@ + + string(REGEX MATCH "[0-9].[0-9]" PYTHON_VERSION_MAJOR_MINOR "${PYTHON_VERSION_FULL}") + if(UNIX) +- set(PYTHON_PLUGIN_INSTALL_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv) +- set(PYTHON_PACKAGES_PATH lib/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages) ++ set(PYTHON_PLUGIN_INSTALL_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages/opencv) ++ set(PYTHON_PACKAGES_PATH lib${LIB_SUFFIX}/python${PYTHON_VERSION_MAJOR_MINOR}/site-packages) + endif() + if(WIN32) + get_filename_component(PYTHON_PATH "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\${PYTHON_VERSION_MAJOR_MINOR}\\InstallPath]" ABSOLUTE CACHE) +@@ -895,7 +895,7 @@ + # PROCESS SUBDIRECTORIES: + # ---------------------------------------------------------------------------- + # Save libs and executables in the same place +-set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib CACHE PATH "Output directory for libraries" ) ++set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX} CACHE PATH "Output directory for libraries" ) + set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Output directory for applications" ) + + if(WIN32) +@@ -965,19 +965,19 @@ + # Part 2/2: ${BIN_DIR}/unix-install/opencv.pc -> For use *with* "make install" + # prefix=/usr + # exec_prefix=${prefix} +-# libdir=${exec_prefix}/lib ++# libdir=${exec_prefix}/lib${LIB_SUFFIX} + # includedir=${prefix}/include/opencv + # ------------------------------------------------------------------------------------------- + set(prefix ${CMAKE_INSTALL_PREFIX}) + set(exec_prefix "\${prefix}") +-set(libdir "\${exec_prefix}/lib") ++set(libdir "\${exec_prefix}/lib${LIB_SUFFIX}") + set(includedir "\${prefix}/include") + set(VERSION ${OPENCV_VERSION}) + + configure_file("${CMAKE_CURRENT_SOURCE_DIR}/opencv.pc.cmake.in" "${CMAKE_BINARY_DIR}/unix-install/opencv.pc" @ONLY IMMEDIATE) + + if(UNIX) +- install(FILES ${CMAKE_BINARY_DIR}/unix-install/opencv.pc DESTINATION lib/pkgconfig) ++ install(FILES ${CMAKE_BINARY_DIR}/unix-install/opencv.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig) + endif() + + +diff -Naur OpenCV-2.1.0.orig/interfaces/ffopencv/CMakeLists.txt OpenCV-2.1.0/interfaces/ffopencv/CMakeLists.txt +--- OpenCV-2.1.0.orig/interfaces/ffopencv/CMakeLists.txt 2010-04-11 10:51:39.634281600 +0200 ++++ OpenCV-2.1.0/interfaces/ffopencv/CMakeLists.txt 2010-04-11 10:56:58.114279520 +0200 +@@ -40,6 +40,6 @@ + + install(TARGETS ${the_target} + RUNTIME DESTINATION bin COMPONENT main +- ARCHIVE DESTINATION lib COMPONENT main +- LIBRARY DESTINATION lib COMPONENT main ++ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main ++ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main + ) +diff -Naur OpenCV-2.1.0.orig/src/cv/CMakeLists.txt OpenCV-2.1.0/src/cv/CMakeLists.txt +--- OpenCV-2.1.0.orig/src/cv/CMakeLists.txt 2010-04-11 10:51:39.644283200 +0200 ++++ OpenCV-2.1.0/src/cv/CMakeLists.txt 2010-04-11 10:58:19.664279600 +0200 +@@ -71,8 +71,8 @@ + + install(TARGETS ${the_target} + RUNTIME DESTINATION bin COMPONENT main +- LIBRARY DESTINATION lib COMPONENT main +- ARCHIVE DESTINATION lib COMPONENT main) ++ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main ++ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main) + + install(FILES ${lib_hdrs} + DESTINATION include/opencv +diff -Naur OpenCV-2.1.0.orig/src/cvaux/CMakeLists.txt OpenCV-2.1.0/src/cvaux/CMakeLists.txt +--- OpenCV-2.1.0.orig/src/cvaux/CMakeLists.txt 2010-04-11 10:51:39.634281600 +0200 ++++ OpenCV-2.1.0/src/cvaux/CMakeLists.txt 2010-04-11 10:58:43.064279480 +0200 +@@ -76,8 +76,8 @@ + + install(TARGETS ${the_target} + RUNTIME DESTINATION bin COMPONENT main +- LIBRARY DESTINATION lib COMPONENT main +- ARCHIVE DESTINATION lib COMPONENT main) ++ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main ++ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main) + + install(FILES ${aux_hdrs_ext} + DESTINATION include/opencv +diff -Naur OpenCV-2.1.0.orig/src/cxcore/CMakeLists.txt OpenCV-2.1.0/src/cxcore/CMakeLists.txt +--- OpenCV-2.1.0.orig/src/cxcore/CMakeLists.txt 2010-04-11 10:51:39.654284200 +0200 ++++ OpenCV-2.1.0/src/cxcore/CMakeLists.txt 2010-04-11 10:59:19.454279800 +0200 +@@ -71,8 +71,8 @@ + + install(TARGETS ${the_target} + RUNTIME DESTINATION bin COMPONENT main +- LIBRARY DESTINATION lib COMPONENT main +- ARCHIVE DESTINATION lib COMPONENT main) ++ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main ++ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main) + + # install each module headers separately + install(FILES ${lib_hdrs} +diff -Naur OpenCV-2.1.0.orig/src/highgui/CMakeLists.txt OpenCV-2.1.0/src/highgui/CMakeLists.txt +--- OpenCV-2.1.0.orig/src/highgui/CMakeLists.txt 2010-04-11 10:51:39.634281600 +0200 ++++ OpenCV-2.1.0/src/highgui/CMakeLists.txt 2010-04-11 11:00:25.174279600 +0200 +@@ -282,8 +282,8 @@ + + install(TARGETS ${the_target} + RUNTIME DESTINATION bin COMPONENT main +- LIBRARY DESTINATION lib COMPONENT main +- ARCHIVE DESTINATION lib COMPONENT main) ++ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main ++ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main) + + install(FILES ${highgui_ext_hdrs} + DESTINATION include/opencv +diff -Naur OpenCV-2.1.0.orig/src/ml/CMakeLists.txt OpenCV-2.1.0/src/ml/CMakeLists.txt +--- OpenCV-2.1.0.orig/src/ml/CMakeLists.txt 2010-04-11 10:51:39.654284200 +0200 ++++ OpenCV-2.1.0/src/ml/CMakeLists.txt 2010-04-11 11:00:43.714279320 +0200 +@@ -61,8 +61,8 @@ + + install(TARGETS ${the_target} + RUNTIME DESTINATION bin COMPONENT main +- LIBRARY DESTINATION lib COMPONENT main +- ARCHIVE DESTINATION lib COMPONENT main) ++ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main ++ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main) + + install(FILES ${lib_hdrs} + DESTINATION include/opencv +diff -Naur OpenCV-2.1.0.orig/tests/cxts/CMakeLists.txt OpenCV-2.1.0/tests/cxts/CMakeLists.txt +--- OpenCV-2.1.0.orig/tests/cxts/CMakeLists.txt 2010-04-11 10:51:39.724279600 +0200 ++++ OpenCV-2.1.0/tests/cxts/CMakeLists.txt 2010-04-11 11:01:36.324279440 +0200 +@@ -63,6 +63,6 @@ + if(WIN32) + install(TARGETS ${the_target} + RUNTIME DESTINATION bin COMPONENT main +- LIBRARY DESTINATION lib COMPONENT main +- ARCHIVE DESTINATION lib COMPONENT main) ++ LIBRARY DESTINATION lib${LIB_SUFFIX} COMPONENT main ++ ARCHIVE DESTINATION lib${LIB_SUFFIX} COMPONENT main) + endif() diff --git a/libraries/opencv/libpng-1.4.patch b/libraries/opencv/libpng-1.4.patch new file mode 100644 index 0000000000..8756f324c0 --- /dev/null +++ b/libraries/opencv/libpng-1.4.patch @@ -0,0 +1,12 @@ +diff -Naur OpenCV-2.0.0-orig/src/highgui/grfmt_png.cpp +--- OpenCV-2.0.0-orig/src/highgui/grfmt_png.cpp 2010-01-21 01:08:46.000000000 -0500 ++++ OpenCV-2.0.0/src/highgui/grfmt_png.cpp 2010-01-21 01:13:11.000000000 -0500 +@@ -223,7 +223,7 @@ + png_set_palette_to_rgb( png_ptr ); + + if( m_color_type == PNG_COLOR_TYPE_GRAY && m_bit_depth < 8 ) +- png_set_gray_1_2_4_to_8( png_ptr ); ++ png_set_expand_gray_1_2_4_to_8( png_ptr ); + + if( CV_MAT_CN(m_type) > 1 && color ) + png_set_bgr( png_ptr ); // convert RGB to BGR diff --git a/libraries/opencv/opencv-gcc4.4.patch b/libraries/opencv/opencv-gcc4.4.patch deleted file mode 100644 index 9621b32bcc..0000000000 --- a/libraries/opencv/opencv-gcc4.4.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -U 3 -H -d -r -N -- opencv-1.1.0.old/cxcore/include/cxmisc.h opencv-1.1.0/cxcore/include/cxmisc.h ---- opencv-1.1.0.old/cxcore/include/cxmisc.h 2008-07-29 15:05:04.000000000 -0400 -+++ opencv-1.1.0/cxcore/include/cxmisc.h 2010-05-23 17:23:44.000000000 -0400 -@@ -130,7 +130,7 @@ - #include - #elif defined HAVE_ALLOCA - #include --#elif -+#else - #error - #endif - diff --git a/libraries/opencv/opencv-libpng14.patch b/libraries/opencv/opencv-libpng14.patch deleted file mode 100644 index fa57f5e115..0000000000 --- a/libraries/opencv/opencv-libpng14.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -U 3 -H -d -r -N -- opencv-1.1.0.old/otherlibs/highgui/grfmt_png.cpp opencv-1.1.0/otherlibs/highgui/grfmt_png.cpp ---- opencv-1.1.0.old/otherlibs/highgui/grfmt_png.cpp 2006-10-11 12:51:43.000000000 -0400 -+++ opencv-1.1.0/otherlibs/highgui/grfmt_png.cpp 2010-05-23 17:46:19.232028822 -0400 -@@ -215,7 +215,7 @@ - png_set_palette_to_rgb( png_ptr ); - - if( m_color_type == PNG_COLOR_TYPE_GRAY && m_bit_depth < 8 ) -- png_set_gray_1_2_4_to_8( png_ptr ); -+ png_set_expand_gray_1_2_4_to_8( png_ptr ); - - if( m_iscolor && color ) - png_set_bgr( png_ptr ); // convert RGB to BGR 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 -# 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} diff --git a/libraries/opencv/opencv.info b/libraries/opencv/opencv.info index 06628467b6..cc20d37486 100644 --- a/libraries/opencv/opencv.info +++ b/libraries/opencv/opencv.info @@ -1,10 +1,10 @@ PRGNAM="opencv" -VERSION="1.1.0" -HOMEPAGE="http://opencv.willowgarage.com" -DOWNLOAD="http://downloads.sourceforge.net/opencvlibrary/opencv-1.1pre1.tar.gz" -MD5SUM="b147b7cd3c059831c415c5a2bcecdf95" +VERSION="2.1.0" +HOMEPAGE="http://opencv.willowgarage.com/wiki/" +DOWNLOAD="http://downloads.sourceforge.net/project/opencvlibrary/opencv-unix/2.1/OpenCV-2.1.0.tar.bz2" +MD5SUM="1d71584fb4e04214c0085108f95e24c8" DOWNLOAD_x86_64="" MD5SUM_x86_64="" -MAINTAINER="Ricardson Williams" -EMAIL="ricardsonwilliams@yahoo.com.br" -APPROVED="michiel" +MAINTAINER="M.Dinslage" +EMAIL="daedra1980@gmail.com" +APPROVED="dsomero" -- cgit v1.2.3