# Maintainer: Antonio Rojas <arojas@archlinux.org>
# Maintainer: Felix Yan <felixonmars@archlinux.org>

pkgname=qt6-httpserver
pkgver=6.7.1
pkgrel=1
arch=(x86_64 aarch64)
url='https://www.qt.io'
license=(GPL3 LGPL3 FDL custom)
pkgdesc='Qt HTTP Server'
depends=(gcc-libs
         glibc
         qt6-base
         qt6-websockets)
makedepends=(cmake
             git
             ninja)
groups=(qt6)
_pkgfn=${pkgname/6-/}
source=(git+https://github.com/qt/$_pkgfn#tag=v$pkgver)
sha256sums=('a15b063e93231c1b2d7a7426236cc19b6657ea878a9bcc3f9d1a78a19ccca5ab')

build() {
  cmake -B build -S $_pkgfn -G Ninja \
    -DCMAKE_MESSAGE_LOG_LEVEL=STATUS
  cmake --build build
}

package() {
  DESTDIR="$pkgdir" cmake --install build

  install -d "$pkgdir"/usr/share/licenses
  ln -s /usr/share/licenses/qt6-base "$pkgdir"/usr/share/licenses/$pkgname
}
