app=v4l-utils
version=1.20.0
build=1sml
homepage="http://linuxtv.org"
download="https://linuxtv.org/downloads/v4l-utils/v4l-utils-1.20.0.tar.bz2"
desc="libraries and utilities for writing video applications"
requires="gcc-libs argp-standalone hicolor-icon-theme libjpeg-turbo sdl2"

build() {
  mkandenterbuilddir
  rm -rf $app-$version

  tar xf $srcdir/$app-$version.tar.?z*
  cd $app-$version 
  fixbuilddirpermissions

  applypatch $srcdir/getsubopt.patch
  applypatch $srcdir/types.patch

  CFLAGS="$CFLAGS -D__off_t=off_t" \
  LIBS="-largp" \
  ./configure \
    --prefix="" \
    --sysconfdir=/etc \
    --sbindir=/bin \
    --disable-static

  make
  make -j1 install DESTDIR=$pkg 

  cp COPYING* $pkgdocs/

  mkfinalpkg
}

sha512sums="
179ca8dbbf7af5fa4870b70f17645d7834fe6ba52670ae6b58473efa257db0cd812ce14f16574cc4491c0bcb218835e4c29f1354882a151687eecec97852fc63  v4l-utils-1.20.0.tar.bz2
3e51af7a77a8f06e1278022362347808b233cf021a277ce9cd66a9553e754bf91b3923c32ab17a86b11f4ef2555a5f1d544d0fc22e82a2997e34060dd561f760  getsubopt.patch
358611fbae8348f17bf49c08820b4641deb1f7282ce2c1e20b8fdf0a85cd73ca4b46f6668c2a7328b5261e401c12f471170a9a1f3fc2982b6897ff11386c06c6  types.patch
"
