# Maintainer: Pablo Martin <pm@mega.nz>
pkgname=pdfium-mega
pkgver=5247.0
pkgrel=1
epoch=
pkgdesc="TODO"
arch=('x86_64')
url="TODO"
license=() #TODO
groups=()
depends=('glibc' 'gcc-libs')
makedepends=('unzip' 'ca-certificates' 'python3' 'rsync' 'git')
checkdepends=()
optdepends=()
provides=("pdfium-mega=${pkgver}")
conflicts=()
replaces=()
backup=()
options=()
#~ install=()
changelog= #TODO
source=("./pdfium-mega_${pkgver}.tar.gz"
)
noextract=()
md5sums=('SKIP')
validpgpkeys=()

prepare() {
    cd "$pkgname-$pkgver"
}

build() {
    cd "$pkgname-$pkgver"
    ./depot_tools/ninja ${BUILD_PARALLEL_JOBS} -C out pdfium
    #clean all unrequired stuff
    rm -rf `ls | grep -v "out\|public"`
}

check() {
    cd "$pkgname-$pkgver"
}

package() {
    cd "$pkgname-$pkgver"
    for i in `find out/obj -name "libpdfium.a" -type f`; do install -D $i $pkgdir/usr/lib/${i/out\/obj\//}; done
    for i in `find public -type f`; do install -D -m 444 $i $pkgdir/usr/include/${i/public\//}; done
}
