# Maintainer: local

pkgname=qemby
pkgver=0.0.5
pkgrel=1
pkgdesc="Desktop client for Emby and Jellyfin media servers"
arch=('x86_64')
url="https://github.com/AlanHJ/qEmby"
license=('MIT')
depends=(
  'gcc-libs'
  'glibc'
  'mpv'
  'qcoro'
  'qt6-base'
  'qt6-svg'
  'qt6-websockets'
  'spdlog'
)
makedepends=(
  'cmake'
  'ninja'
  'pkgconf'
  'qt6-tools'
)
source=("${pkgname}-${pkgver}.tar.gz::${url}/archive/refs/tags/v${pkgver}.tar.gz")
sha256sums=('SKIP')

build() {
  cmake -S "${srcdir}/qEmby-${pkgver}" -B "${srcdir}/build" -G Ninja \
    -DCMAKE_BUILD_TYPE=None \
    -DCMAKE_INSTALL_PREFIX=/usr \
    -DCMAKE_INSTALL_LIBDIR=lib \
    -DQEMBY_USE_SYSTEM_DEPS=ON \
    -DQEMBY_FETCHCONTENT_FALLBACK=OFF \
    -DFETCHCONTENT_FULLY_DISCONNECTED=ON \
    -DQEMBY_NATIVE_OPTIMIZE=OFF \
    -DQEMBY_ENABLE_IPO=OFF
  cmake --build "${srcdir}/build"
}

package() {
  DESTDIR="${pkgdir}" cmake --install "${srcdir}/build" --prefix /usr
  install -Dm644 "${srcdir}/qEmby-${pkgver}/LICENSE" \
    "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
