NAME="vlc"
DESC="A media player, streamer, and encoder"
VERSION="3.0.18"
FILES=("https://download.videolan.org/vlc/$VERSION/vlc-$VERSION.tar.xz")
HASHES=("f3c031357c0eeffb41e928eca220a803")
DEPENDS=(
  "alsa-lib" "desktop-file-utils" "ffmpeg" "liba52"
  "libgcrypt" "libmad" "lua" "dbus" "libidn2" "libssh2"
  "libarchive" "libcddb" "libdv" "libdvdcss" "libdvdread"
  "libdvdnav" "opencv" "v4l-utils" "libogg" "faad2" "flac"
  "libaom" "libass" "libmpeg2" "libpng" "libtheora" "libva"
  "libvorbis" "opus" "speex" "libvpx" "x264" "aalib" "fontconfig"
  "freetype" "fribidi" "librsvg" "libvdpau" "sdl12-compat" "pulseaudio"
  "libsamplerate" "qt5" "avahi" "libnotify" "gnutls" "libxml2" "taglib"
  "xdg-utils" "gtk3"
)

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

  export LUAC=/usr/bin/luac
  export LUA_LIBS="$(pkg-config --libs lua)"
  export CPPFLAGS="$(pkg-config --cflags lua)"

  BUILDCC=gcc ./configure --prefix=/usr
  make && make DESTDIR="$ROOTDIR" docdir=/usr/share/doc/vlc-$VERSION install

  unset CPPFLAGS LUAC LUA_LIBS
  cd .. && rm -r $NAME-$VERSION
}

INSTALL(){
  update-icon-cache
  update-desktop-database -q
}
