[arch-commits] Commit in opencv/trunk (PKGBUILD v4l-mmap.patch)

Ray Rashif schiv at archlinux.org
Fri Aug 27 08:02:01 EDT 2010


    Date: Friday, August 27, 2010 @ 08:02:00
  Author: schiv
Revision: 88973

upgpkg: opencv 2.1.0-2
-m

Added:
  opencv/trunk/v4l-mmap.patch
Modified:
  opencv/trunk/PKGBUILD

----------------+
 PKGBUILD       |   67 ++++++++++++++++++++++++++++++++++++-------------------
 v4l-mmap.patch |   14 +++++++++++
 2 files changed, 58 insertions(+), 23 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2010-08-27 08:01:21 UTC (rev 88972)
+++ PKGBUILD	2010-08-27 12:02:00 UTC (rev 88973)
@@ -1,42 +1,63 @@
 # $Id$
-# Maintainer:
+# Maintainer: Ray Rashif <schiv at archlinux.org>
 # Contributor: Tobias Powalowski <tpowa at archlinux.org>
 
 pkgname=opencv
+_pybin=python2
+_pydir=python2.7
 pkgver=2.1.0
-pkgrel=1
+pkgrel=2
 pkgdesc="Intel(R) Open Source Computer Vision Library"
 arch=('i686' 'x86_64')
-license=('custom')
+license=('BSD')
 url="http://opencv.willowgarage.com"
-depends=('jasper' 'gtk2' 'python' 'xine-lib' 'gstreamer0.10-base' 'libdc1394' 'libv4l')
-makedepends=('cmake' 'pkgconfig')
+depends=('jasper' 'python2' 'gstreamer0.10-base'
+          'gtk2' 'xine-lib' 'libdc1394' 'v4l-utils')
+makedepends=('pkg-config' 'cmake')
 options=('!libtool')
-source=(http://downloads.sourceforge.net/opencvlibrary/OpenCV-${pkgver}.tar.bz2 libpng-1.4.patch)
+source=(http://downloads.sourceforge.net/opencvlibrary/OpenCV-$pkgver.tar.bz2
+        libpng-1.4.patch
+        v4l-mmap.patch)
 md5sums=('1d71584fb4e04214c0085108f95e24c8'
-	'301f9108f2ee875d889c279adadb254e')
+         '301f9108f2ee875d889c279adadb254e'
+         'c0e2d8ecba3b56974ea2169f61e4905f')
+sha1sums=('8e2d6b653296364ab2ca0fa5a5e6b0edfca114a7'
+          '4de3772ac5e33c2b0050d1f7e6678027898d8545'
+          '981e4614b5360351426990e2e12d276b04b7043a')
 
 build() {
-  cd ${srcdir}/OpenCV-${pkgver}
-  patch -p1 -i ${srcdir}/libpng-1.4.patch || return 1
-  cd ${srcdir}
-  mkdir build
-  cd build
-  cmake ../OpenCV-${pkgver} \
-    -DCMAKE_BUILD_TYPE=Release \
-    -DCMAKE_INSTALL_PREFIX=/usr \
-    -DCMAKE_SKIP_RPATH=ON \
-    -DWITH_XINE=ON \
-    -DWITH_UNICAP=OFF || return 1
-  make || return 1
+  cd "$srcdir/OpenCV-$pkgver"
+
+  # libpng 1.4 compatibility
+  patch -Np1 -i ../libpng-1.4.patch
+
+  # fix v4l issue
+  patch -Np0 -i ../v4l-mmap.patch
+
+  # fix ffmpeg-related C++ issue
+  # see http://code.google.com/p/ffmpegsource/source/detail?r=311
+  export CXXFLAGS="$CXXFLAGS -D__STDC_CONSTANT_MACROS"
+
+  cmake . -DCMAKE_BUILD_TYPE=Release \
+          -DCMAKE_INSTALL_PREFIX=/usr \
+          -DCMAKE_SKIP_RPATH=ON \
+          -DWITH_XINE=ON \
+          -DWITH_UNICAP=OFF \
+          -DPYTHON_EXECUTABLE=/usr/bin/$_pybin \
+          -DPYTHON_INCLUDE_DIR=/usr/include/$_pydir \
+          -DPYTHON_LIBRARY=/usr/lib/lib$_pydir.so
+
+  make
 }
 
 package() {
-  cd ${srcdir}/build
-  make DESTDIR=$pkgdir install || return 1
+  cd "$srcdir/OpenCV-$pkgver"
 
+  make DESTDIR="$pkgdir/" install
+
   # install license file
-  install -D -m644 ${srcdir}/OpenCV-${pkgver}/doc/license.txt \
-    ${pkgdir}/usr/share/licenses/$pkgname/LICENSE || return 1
+  install -Dm644 "$srcdir/OpenCV-$pkgver/doc/license.txt" \
+    "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
 }
 
+# vim:set ts=2 sw=2 et:

Added: v4l-mmap.patch
===================================================================
--- v4l-mmap.patch	                        (rev 0)
+++ v4l-mmap.patch	2010-08-27 12:02:00 UTC (rev 88973)
@@ -0,0 +1,14 @@
+http://code.ros.org/trac/opencv/ticket/141
+http://bugs.gentoo.org/313649
+
+--- src/highgui/cvcap_libv4l.cpp
++++ src/highgui/cvcap_libv4l.cpp
+@@ -782,7 +782,7 @@
+ 
+        capture->buffers[n_buffers].length = buf.length;
+        capture->buffers[n_buffers].start =
+-         mmap (NULL /* start anywhere */,
++         v4l2_mmap (NULL /* start anywhere */,
+                buf.length,
+                PROT_READ | PROT_WRITE /* required */,
+                MAP_SHARED /* recommended */,



More information about the arch-commits mailing list