# Maintainer (arch): David Runge <dvzrv@archlinux.org>
# Contributor: speps <speps at aur dot archlinux dot org>
# Maintainer: Omar Vega Ramos <ovruni@gnu.org.pe>
# Contributor: fauno <fauno@parabola.nu>


# parabola changes and ratuonale:
# - remove 'AppsWidget' with non-free recommendations


pkgname=minitube
pkgver=3.9
pkgrel=1
pkgrel+=.parabola1
pkgdesc="A YouTube desktop application"
pkgdesc+=", without non-free recommendations"
arch=('x86_64')
arch+=('i686')
url="https://flavio.tordini.org/minitube"
license=('GPL3')
depends=('gcc-libs' 'glibc' 'qt5-base' 'qt5-declarative' 'qt5-x11extras')
makedepends=('mpv' 'qt5-tools')
source=("https://github.com/flaviotordini/${pkgname}/releases/download/${pkgver}/${pkgname}-${pkgver}.tar.bz2")
source+=('remove_unfree_recommendations.patch')
sha512sums=('d68545ce81eae730213bc7abe8de52d28c0230f92cef727d9129b9b512c3b396afffb06839f491bc9edaf2174658b0457859ddaa4660ba005650e6a8c65772f4')
sha512sums+=('eca111cbdcaa1608e37be4fc795d0db5c60caa3a17d76ebe9bccd809b57a6a6c6fae64e0c52e6565898c63aebe0ad6be67cf23d6a2e9b44c1139781f541e8d6c')

prepare() {
  cd "${pkgname}-${pkgver}"
  patch -p1 -i ../remove_unfree_recommendations.patch
}

build() {
  cd "${pkgname}-${pkgver}"
  qmake
}

package() {
  depends+=('libmpv.so')
  cd "${pkgname}-${pkgver}"
  make install INSTALL_ROOT="${pkgdir}/"
  install -vDm 644 {AUTHORS,CHANGES,README.md,TODO} \
    -t "${pkgdir}/usr/share/doc/${pkgname}"
}
