updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / opencv-old / PKGBUILD
blobb8d11973d150f200b7cab23441d4054008b26263
1 # Heavily based on 'opencv' by Ray Rashif & Tobias Powalowski
2 # Maintainer: Simone Sclavi 'Ito' <darkhado@gmail.com>
3 pkgname=opencv-old
4 _pybin=python2
5 _pydir=python2.7
6 pkgver=2.1.0
7 pkgrel=3
8 pkgdesc="Older version of the Intel(R) Open Source Computer Vision Library, currently required by sikuli-ide"
9 arch=('i686' 'x86_64')
10 license=('BSD')
11 url="http://opencv.willowgarage.com"
12 depends=('jasper' 'python2-numpy' 'gstreamer0.10-base'
13           'gtk2' 'xine-lib' 'libdc1394' 'v4l-utils')
14 makedepends=('pkg-config' 'cmake')
15 options=('!libtool')
16 source=(http://downloads.sourceforge.net/opencvlibrary/OpenCV-$pkgver.tar.bz2
17         libpng-1.4.patch v4l-mmap.patch
18         gcc46.patch linux-2.6.38.patch)
19 md5sums=('1d71584fb4e04214c0085108f95e24c8'
20          '301f9108f2ee875d889c279adadb254e'
21          'c0e2d8ecba3b56974ea2169f61e4905f'
22          '0949e4c01bbd942ea0ed13ad877952c8'
23          '6e7e4676671ef4e5b5a866f27289cdb0')
25 build() {
26   cd "$srcdir/OpenCV-$pkgver"
27   # fix ffmpeg-related C++ issue
28   # see http://code.google.com/p/ffmpegsource/source/detail?r=311
29   export CXXFLAGS="$CXXFLAGS -D__STDC_CONSTANT_MACROS"
30     
31   # libpng 1.4 compatibility
32   patch -Np1 -i ../libpng-1.4.patch
34   # fix v4l issue
35   patch -Np0 -i ../v4l-mmap.patch
37   # fix gcc4.6 issue
38   patch -Np1 -i ../gcc46.patch
40   # linux 2.6.38 compatibility
41   patch -Np1 -i ../linux-2.6.38.patch 
43   cmake . -DCMAKE_BUILD_TYPE=Release \
44           -DCMAKE_INSTALL_PREFIX=/opt/opencv-old \
45           -DCMAKE_SKIP_RPATH=ON \
46           -DWITH_XINE=ON \
47           -DWITH_UNICAP=OFF \
48           -DPYTHON_EXECUTABLE=/usr/bin/$_pybin \
49           -DPYTHON_INCLUDE_DIR=/usr/include/$_pydir \
50           -DPYTHON_LIBRARY=/usr/lib/lib$_pydir.so
52   make
55 package() {
56   cd "$srcdir/OpenCV-$pkgver"
58   make DESTDIR="$pkgdir/" install
60   # install license file
61   install -Dm644 "$srcdir/OpenCV-$pkgver/doc/license.txt" \
62     "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
64   # add opencv-old library path to ld.so.conf
65   install -d $pkgdir/etc/ld.so.conf.d
66   echo "/opt/opencv-old/lib/" > $pkgdir/etc/ld.so.conf.d/opencv-old.conf
69 # vim:set ts=2 sw=2 et: