# $Id$
# Maintainer: MediaArea.net SARL <info@mediaarea.net>
# Contributor: hydro <hydro@freenet.de>

pkgname=('mediainfo' 'mediainfo-gui')
pkgver=26.05.20260627
pkgrel=1
pkgdesc="supplies technical and tag information about a video or audio file"
url="http://mediaarea.net"
license=('BSD-2-Clause')
source=(${pkgname}_${pkgver}.orig.tar.xz)
md5sums=('00000000000000000000000000000000')
arch=('i686' 'x86_64')

depends=('libzen>=0.4.41' 'libmediainfo>=26.05' 'wxwidgets-gtk3' 'bubblewrap' 'webkit2gtk-4.1' 'libsm' 'desktop-file-utils')

prepare() {
    cd "${srcdir}"/MediaInfo/Project/GNU/CLI
    sh ./autogen.sh
    ./configure --prefix=/usr

    cd "${srcdir}"/MediaInfo/Project/GNU/GUI
    sh ./autogen.sh
    ./configure --prefix=/usr --with-wx-config=/usr/bin/wx-config
}

build() {
    cd "${srcdir}"/MediaInfo/Project/GNU/CLI
    make

    cd "${srcdir}"/MediaInfo/Project/GNU/GUI
    make
}

package_mediainfo() {
    pkgdesc="${pkgdesc} (CLI)"
    depends=('libmediainfo')

    cd "${srcdir}"/MediaInfo/Project/GNU/CLI
    make DESTDIR="${pkgdir}" install
}

package_mediainfo-gui() {
    pkgdesc="${pkgdesc} (GUI)"
    depends=('libmediainfo' 'wxwidgets-gtk3' 'webkit2gtk-4.1' 'libsm' 'desktop-file-utils')

    cd "${srcdir}"/MediaInfo/Project/GNU/GUI
    make DESTDIR="${pkgdir}" install
}
