# Template file for 'pdf.js'
pkgname=pdf.js
version=2.2.228
revision=2
archs=noarch
hostmakedepends="nodejs python pkg-config"
makedepends="pixman-devel cairo-devel pango-devel libjpeg-turbo-devel"
short_desc="Portable Document Format (PDF) viewer built with HTML5"
maintainer="Daniel Santana <daniel@santana.tech>"
license="Apache-2.0"
homepage="https://mozilla.github.io/pdf.js/"
distfiles="https://github.com/mozilla/pdf.js/archive/v${version}.tar.gz"
checksum=0b553a31764c85ea5dca76b6c5fdb5b40c1ea69af34c5b5655904955df616f96

nocross="doesn't respect CFLAGS"

case "${XBPS_TARGET_MACHINE}" in
	i686*) broken="https://build.voidlinux.org/builders/i686_builder/builds/15674/steps/shell_3/logs/stdio" ;;
	ppc*) broken="attempts to build v8 and fails" ;;
esac

do_build() {
	npm install
	npm install --no-save gulp-cli
	node_modules/.bin/gulp generic
}

do_install() {
	vmkdir usr/share/$pkgname
	vcopy "build/generic/*" usr/share/$pkgname
}
