# Maintainer: Developer <dev@opalos.org>
# Maintainer: Developer <dev@opalos.org>

pkgname=libbluray
pkgver=%version%
pkgrel=%release%
pkgdesc='Library to access Blu-Ray disks for video playback'
arch=(x86_64)
url=https://www.videolan.org/developers/libbluray.html
license=(LGPL2.1)
depends=(
  fontconfig
  libfreetype.so
  libxml2
)
makedepends=(
  apache-ant
  git
  java-environment
)
optdepends=('java-runtime: BD-J library')
provides=(libbluray.so)
_tag=bb5bc108ec695889855f06df338958004ff289ef
source=(
  git+https://code.videolan.org/videolan/libbluray.git#tag=${_tag}
  git+https://code.videolan.org/videolan/libudfread.git
)
b2sums=(
  SKIP
  SKIP
)

pkgver() {
  cd libbluray
  git describe --tags
}

prepare() {
  cd libbluray
  git config --global protocol.file.allow always
  for submodule in contrib/libudfread; do
    git submodule init ${submodule}
    git config submodule.${submodule}.url ../${submodule#*/}
    git submodule update ${submodule}
  done
  autoreconf -fiv
}

build() {
  cd libbluray
  ./configure \
    --prefix=/usr
  make
}

package() {
  make DESTDIR="${pkgdir}" -C libbluray install
}

# vim: ts=2 sw=2 et:
