# 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/qEmby/qEmby"
license=('MIT')
depends=(
  'fmt'
  'gcc-libs'
  'glibc'
  'hicolor-icon-theme'
  'mpv'
  'qcoro'
  'qt6-base'
  'qt6-svg'
  'qt6-websockets'
  'spdlog'
)
makedepends=(
  'cmake'
  'ninja'
  'pkgconf'
  'qt6-tools'
)
# Build from a local release archive exported from this repository until the
# new repository has published versioned release tags.
source=("${pkgname}-${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"
}
