# Description: Create mapping solutions using data available from popular location service providers
# URL: https://www.qt.io/
# Maintainer: Tim Biermann, tbier at posteo dot de
# Depends on: qt6-positioning

name=qt6-location
version=6.11.1
release=1
source=(https://download.qt.io/official_releases/qt/${version%.*}/$version/submodules/qtlocation-everywhere-src-$version.tar.xz)

build() {
  prt-get isinst ccache && PKGMK_QT6+=' -D QT_USE_CCACHE=ON' && PATH="$(echo ${PATH} | awk -v RS=: -v ORS=: '/ccache/ {next} {print}' | sed 's/:*$//')"

  cmake -S qtlocation-everywhere-src-$version -B build -G Ninja \
    -D CMAKE_BUILD_TYPE=Release \
    -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
    -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
    -Wno-dev
  cmake --build build -j ${JOBS-1}
  DESTDIR=$PKG cmake --install build
}
