NAME="opencv"
DESC="Contains graphics libraries mainly aimed at real-time computer vision"
VERSION="4.8.0"
FILES=("https://github.com/opencv/opencv/archive/$VERSION/opencv-$VERSION.tar.gz")
HASHES=("c2225e737ce7f671b839a687f2dc7ab9")
DEPENDS=(
  "ffmpeg" "gst-plugins-base" "gtk3" 
  "libexif" "libjpeg-turbo" "libpng"
  "libtiff" "libwebp" "jasper"
  "v4l-utils" "xine-lib"
)

PACKAGE() {
  tar xf $NAME-$VERSION.tar.gz
  cd $NAME-$VERSION

  mkdir build &&
  cd    build &&

  cmake -DCMAKE_INSTALL_PREFIX=/usr    \
      -DCMAKE_BUILD_TYPE=Release       \
      -DENABLE_CXX11=ON                \
      -DBUILD_PERF_TESTS=OFF           \
      -DWITH_XINE=ON                   \
      -DBUILD_TESTS=OFF                \
      -DENABLE_PRECOMPILED_HEADERS=OFF \
      -DCMAKE_SKIP_RPATH=ON            \
      -DBUILD_WITH_DEBUG_INFO=OFF      \
      -Wno-dev  ..
  make && make DESTDIR="$ROOTDIR" install

  cd ../.. && rm -r $NAME-$VERSION
}
