# Description: a cross-distribution effort for enhancing the way we interact with the software repositories provided by (Linux) distributions by standardizing software component metadata
# URL: https://www.freedesktop.org/wiki/Distributions/AppStream/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: librsvg libsoup libxmlb libyaml vala
# Optional: docbook-xsl qt5

name=appstream
version=0.16.2
release=1
source=(https://www.freedesktop.org/software/appstream/releases/AppStream-$version.tar.xz)

build() {
  prt-get isinst qt5 && PKGMK_APPSTREAM+=' -D qt=true'

  # don't depend on docbook-xsl for manpages
  prt-get isinst docbook-xsl || sed -i "/subdir('docs\/')/d" AppStream-$version/meson.build

  meson setup AppStream-$version build $PKGMK_APPSTREAM \
    --prefix=/usr \
    --libexecdir=lib/$name \
    --buildtype=plain \
    --wrap-mode nodownload \
    -D b_lto=true \
    -D b_pie=true \
    -D vapi=true \
    -D compose=true \
    -D systemd=false \
    -D docs=false \
    -D apidocs=false \
    -D install-docs=false

  meson compile -C build
  DESTDIR=$PKG meson install -C build

  rm -r $PKG/usr/share/{locale,installed-tests}
}
