# Maintainer: Balló György <ballogyor+arch at gmail dot com>
# Contributor: Jan de Groot <jgc@archlinux.org>
# Contributor: Thomas Baechler <thomas@archlinux.org>
# Contributor: Tom Newsom <Jeepster@gmx.co.uk>

pkgname=libdvdread
pkgver=7.0.1
pkgrel=1
pkgdesc='Library for reading DVD video disks'
arch=(x86_64 aarch64)
url='https://www.videolan.org/developers/libdvdnav.html'
license=(GPL-2.0-or-later)
depends=(glibc)
makedepends=(
  git
  meson
)
optdepends=('libdvdcss: Decoding encrypted DVDs')
source=("git+https://code.videolan.org/videolan/libdvdread.git#tag=$pkgver")
b2sums=('9d649778290335ae732f68f24e229a8efc244eb3a4d19300eb9d81290edb9e35057182481b0100168db95d2413b1e83e073d7c068a8a9b7353fd402681742c39')
validpgpkeys=(65F7C6B4206BD057A7EB73787180713BE58D1ADC) # VideoLAN Release Signing Key (2015)

prepare() {
  cd $pkgname

  # Fix out of tree build
  sed -i "s|'git', 'log'|'git', '-C', meson.project_source_root(), 'log' |" meson.build
}

build() {
  arch-meson $pkgname build \
    -D libdvdcss=disabled
  meson compile -C build
}

package() {
  meson install -C build --destdir "$pkgdir"
}
