# Maintainer: BlackEagle <ike.devolder@gmail.com>>

pkgname=kodi-platform
_commit=809c5e9
pkgver=20190726.809c5e9
pkgrel=56
pkgdesc="platform library for external kodi addons"
arch=('x86_64')
url='https://github.com/xbmc/kodi-platform'
license=('GPL')
makedepends=('git' 'cmake' 'kodi-dev')
options=(!lto)
source=("$pkgname::git+https://github.com/xbmc/kodi-platform.git#commit=$_commit")
sha256sums=('845218e825425c6569fb7e5d5cd59dc8139ce43c9dd793a32b7973f6f68430eb')

pkgver() {
    cd "$pkgname"
    git log -1 --date=short --format="%cd.%h" | tr -d '-'
}

build() {
    cd "$pkgname"
    cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DCMAKE_BUILD_TYPE=Release \
        -DBUILD_SHARED_LIBS=1 \
        -DUSE_LTO=1 \
        .
    make
}

package() {
    depends=('kodi' 'p8-platform')
    cd "$pkgname"
    make DESTDIR="$pkgdir/" install
}

