# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: Allan McRae <allan@archlinux.org>
# Contributor: Alessio 'mOLOk' Bolognino <themolok@gmail.com>
# Contributor: shamrok <szamrok@gmail.com>

pkgname=smplayer
pkgver=21.8.0
pkgrel=1
pkgdesc='Media player with built-in codecs that can play virtually all video and audio formats'
url='https://www.smplayer.info/'
arch=('x86_64')
license=('GPL')
depends=('glibc' 'qt5-script' 'qt5-base' 'mpv' 'libx11' 'zlib' 'gcc-libs' 'hicolor-icon-theme')
makedepends=('qt5-tools')
optdepends=('smplayer-themes: icon themes collection'
            'smplayer-skins: skin themes collection'
            'smtube: browse and play youtube videos'
            'youtube-dl: youtube videos and streaming'
            'mplayer: alternative multimedia engine')
source=(https://downloads.sourceforge.net/${pkgname}/${pkgname}-${pkgver}.tar.bz2)
sha512sums=('4513718ca8cf1529ef5e4b8595cba9d9177073acaada6f7e8aed242a1fd56cb8fdf932a757ae147aa645a5422c1e8f52863b562f7e697f643769b1c57f7e647e')
b2sums=('a13146dac8c78d70c8e9db64aaf9da6c64267b389d6b06cb523548306733853276623d8d9e0ba1e94fb2bee5ab1da97109edb1fef4ce88a3569ca96f26e4d653')

prepare() {
  cd ${pkgname}-${pkgver}
  # make build reproducible, we compress ourselves
  sed '/gzip -9/d' -i Makefile
}

build() {
  cd ${pkgname}-${pkgver}
  export CXXFLAGS="${CXXFLAGS} ${CPPFLAGS}"
  make \
    PREFIX=/usr \
    DOC_PATH="\\\"/usr/share/doc/smplayer\\\"" \
    QMAKE_OPTS=DEFINES+=NO_DEBUG_ON_CONSOLE \
    CFLAGS_EXTRA="${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" \
    all
}

package() {
  cd ${pkgname}-${pkgver}
  make \
    PREFIX=/usr \
    DOC_PATH=/usr/share/doc/smplayer \
    DESTDIR="${pkgdir}" \
    install
}

# vim: ts=2 sw=2 et:
