Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

PKGBUILD_opencv-old

By: oldbay on Jul 8th, 2012  |  syntax: Bash  |  size: 2.40 KB  |  views: 58  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. pkgname=opencv-old
  2. _pybin=python2
  3. _pydir=python2.7
  4. pkgver=2.1.0
  5. pkgrel=3
  6. pkgdesc="Older version of the Intel(R) Open Source Computer Vision Library, currently required by sikuli-ide"
  7. arch=('i686' 'x86_64')
  8. license=('BSD')
  9. url="http://opencv.willowgarage.com"
  10. depends=('jasper' 'python2-numpy' 'gstreamer0.10-base'
  11.           'gtk2' 'xine-lib' 'libdc1394' 'v4l-utils' 'libpng14')
  12. makedepends=('gcc44' 'pkg-config' 'cmake')
  13. options=('!libtool')
  14. source=(http://downloads.sourceforge.net/opencvlibrary/OpenCV-$pkgver.tar.bz2
  15.         libpng-1.4.patch v4l-mmap.patch
  16.         gcc46.patch linux-2.6.38.patch)
  17.  
  18. build() {
  19. #clear bin-lib data
  20.   if [ -d $srcdir/bin-lib ]; then
  21.     rm -rf $srcdir/bin-lib
  22.   fi
  23.   mkdir $srcdir/bin-lib -p
  24.  
  25.  
  26. #add gcc44 link
  27.   ln -s /usr/bin/gcc-4.4 $srcdir/bin-lib/gcc
  28.   ln -s /usr/bin/g++-4.4 $srcdir/bin-lib/g++
  29.   ln -s /usr/bin/c++-4.4 $srcdir/bin-lib/c++
  30.   ln -s /usr/bin/cpp-4.4 $srcdir/bin-lib/cpp
  31.  
  32. #add path on bin-lib
  33.   PATH="$srcdir/bin-lib/:$PATH"
  34.  
  35.   cd "$srcdir/OpenCV-$pkgver"
  36.   # fix ffmpeg-related C++ issue
  37.   # see http://code.google.com/p/ffmpegsource/source/detail?r=311
  38.   export CXXFLAGS="$CXXFLAGS -D__STDC_CONSTANT_MACROS"
  39.    
  40.   # libpng 1.5 compatibility
  41.   patch -Np1 -i ../libpng-1.4.patch
  42.  
  43.   # fix v4l issue
  44.   patch -Np0 -i ../v4l-mmap.patch
  45.  
  46.   # fix gcc4.6 issue
  47.   patch -Np1 -i ../gcc46.patch
  48.  
  49.   # linux 2.6.38 compatibility
  50.   patch -Np1 -i ../linux-2.6.38.patch
  51.  
  52.   cmake . -DCMAKE_BUILD_TYPE=Release \
  53.           -DCMAKE_INSTALL_PREFIX=/opt/opencv-old \
  54.           -DCMAKE_SKIP_RPATH=ON \
  55.           -DWITH_XINE=ON \
  56.           -DWITH_FFMPEG=OFF \
  57.           -DWITH_UNICAP=OFF \
  58.           -DPYTHON_EXECUTABLE=/usr/bin/$_pybin \
  59.           -DPYTHON_INCLUDE_DIR=/usr/include/$_pydir \
  60.           -DPYTHON_LIBRARY=/usr/lib/lib$_pydir.so
  61.  
  62.   make
  63. }
  64.  
  65. package() {
  66.   cd "$srcdir/OpenCV-$pkgver"
  67.  
  68.   make DESTDIR="$pkgdir/" install
  69.  
  70.   # install license file
  71.   install -Dm644 "$srcdir/OpenCV-$pkgver/doc/license.txt" \
  72.     "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  73.  
  74.   # add opencv-old library path to ld.so.conf
  75.   install -d $pkgdir/etc/ld.so.conf.d
  76.   echo "/opt/opencv-old/lib/" > $pkgdir/etc/ld.so.conf.d/opencv-old.conf
  77. }
  78. md5sums=('1d71584fb4e04214c0085108f95e24c8'
  79.          'e2d97228126aec1092f3201ccfa6891f'
  80.          'c0e2d8ecba3b56974ea2169f61e4905f'
  81.          '0949e4c01bbd942ea0ed13ad877952c8'
  82.          '6e7e4676671ef4e5b5a866f27289cdb0')
clone this paste RAW Paste Data