# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=appstream-generator
pkgver=0.8.5
pkgrel=3
pkgdesc='A fast AppStream metadata generator'
arch=(x86_64)
url='https://github.com/ximion/appstream-generator'
license=(GPL3)
depends=(appstream libarchive librsvg optipng glibd)
makedepends=(ldc meson ninja mustache-d curl gir-to-d gobject-introspection docbook-xsl)
source=(https://github.com/ximion/appstream-generator/archive/v$pkgver/$pkgname-$pkgver.tar.gz
        https://github.com/ximion/appstream-generator/commit/4283ed5d.patch)
sha256sums=('857f78329b716481731f6b8a298fa65e3d35dbf3a36825b14bb9673254ea5cfd'
            'e0639970c889a8877be1ee73de9e33020f7e4cd99383d8e39d0f5341ebe18eca')

prepare() {
  patch -d $pkgname-$pkgver -p1 < 4283ed5d.patch # Fix missing icons in exported data
}

build() {
  meson build $pkgname-$pkgver -Ddownload-js=false --prefix=/usr
  ninja -C build
}

package() {
  DESTDIR="$pkgdir" ninja install -C build
}
