# Description: a backend implementation for xdg-desktop-portal using Qt/KF5
# URL: https://kde.org/plasma-desktop/
# Maintainer: CRUX KDE Ports, kde-ports at crux dot nu
# Depends on:  kglobalaccel kio kirigami kpipewire kstatusnotifieritem kwayland xdg-desktop-portal

name=xdg-desktop-portal-kde
version=6.7.1
release=1
source=(https://download.kde.org/stable/plasma/$version/$name-$version.tar.xz)

build() {
    if ! find /usr/include/qt6 -name qcups_p.h | grep -q .; then
        printf '\e[1;31m%-6s\e[m\n' "qt6-base is not build with cups support, install opt/cups, then rebuild opt/qt6-base"
        exit 1
    fi

    cmake -S $name-$version -B build -G Ninja \
        -D CMAKE_INSTALL_PREFIX=/usr \
        -D CMAKE_INSTALL_LIBDIR=lib \
        -D CMAKE_INSTALL_LIBEXECDIR=lib \
        -D CMAKE_BUILD_TYPE=Release \
        -D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
        -D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
        -D BUILD_TESTING=OFF \
        -Wno-dev
    cmake --build build
    DESTDIR=$PKG cmake --install build

    rm -r $PKG/usr/share/locale
}

# vim: set ts=4 et:
