# Description: MediaInfo is a convenient unified display of the most relevant technical and tag data for video and audio files
# URL: https://mediaarea.net/en/MediaInfo
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: libzen
# Optional: libmms tinyxml

name=libmediainfo
version=23.06
release=1
source=(https://mediaarea.net/download/source/libmediainfo/$version/libmediainfo_$version.tar.xz)

build() {
  cd MediaInfoLib/Project/GNU/Library

  prt-get isinst libmms && PKGMK_LIBMEDIAINFO+=' --with-libmms'
  #prt-get isinst tinyxml && PKGMK_LIBMEDIAINFO+=' --with-libtinyxml2'

  if prt-get isinst libmms; then
    export CFLAGS="$CFLAGS -I/usr/include/libmms -I /usr/include/ti "
    export CPPFLAGS="$CFLAGS"
    export CXXFLAGS="$CFLAGS"
  fi

  ./autogen.sh
  ./configure --prefix=/usr $PKGMK_LIBMEDIAINFO \
    --enable-shared \
    --disable-static \
    --with-libcurl

  make
  make DESTDIR=$PKG install
}
