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

pkgname=qt6-location
pkgver=6.7.1
pkgrel=1
arch=(x86_64 aarch64)
url='https://www.qt.io'
license=(GPL3 LGPL3 FDL custom)
pkgdesc='Helps you create viable mapping solutions using the data available from some of the popular location services'
depends=(gcc-libs
         glibc
         qt6-base
         qt6-declarative
         qt6-positioning)
makedepends=(cmake
             git
             ninja)
groups=(qt6)
_pkgfn=${pkgname/6-/}
source=(git+https://github.com/qt/$_pkgfn#tag=v$pkgver)
sha256sums=('e137ebb65b3384cd1f95c3fbc12a0cdc57d684af067af9baa86b1f6a6566a5d1')

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
}
