# Maintainer: Alexey Pavlov <alexpux@gmail.com>

_realname=libdvdcss
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=1.4.2
pkgrel=1
pkgdesc="Portable abstraction library for DVD decryption (mingw-w64)"
arch=('any')
mingw_arch=('mingw32' 'mingw64' 'ucrt64' 'clang64' 'clang32')
url="https://www.videolan.org/libdvdcss"
license=("GPL")
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc"
             "${MINGW_PACKAGE_PREFIX}-doxygen"
             "${MINGW_PACKAGE_PREFIX}-pkg-config"
             #"git"
             )
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs")
options=('staticlibs' 'strip')
source=("https://download.videolan.org/pub/${_realname}/${pkgver}/${_realname}-${pkgver}.tar.bz2"
        #"${_realname}-${pkgver}"::"git+https://git.videolan.org/git/${_realname}.git#tag=${pkgver}"
       )

prepare() {
  cd ${srcdir}/${_realname}-${pkgver}
  autoreconf -fi
}

build() {
  [[ -d "${srcdir}/build-${MINGW_CHOST}" ]] && rm -rf "${srcdir}/build-${MINGW_CHOST}"
  mkdir -p "${srcdir}/build-${MINGW_CHOST}"
  cd "${srcdir}/build-${MINGW_CHOST}"
  ../${_realname}-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --build=${MINGW_CHOST} \
    --host=${MINGW_CHOST} \
    --disable-doc

  make
}

package() {
  cd "${srcdir}/build-${MINGW_CHOST}"
  make DESTDIR="${pkgdir}" install
}
sha256sums=('78c2ed77ec9c0d8fbed7bf7d3abc82068b8864be494cfad165821377ff3f2575')
