name       : qt6-base
version    : 6.0.0
release    : 1
source     :
    - https://download.qt.io/development_releases/qt/6.0/6.0.0-beta3/submodules/qtbase-everywhere-src-6.0.0-beta3.tar.xz : 37a97e30cf769b8deaa65aff585968ffb78bda20409177fe46959cb591a53268
license    :
    - GFDL-1.3-only
    - GPL-2.0-only
    - GPL-3.0-only
    - LGPL-3.0-only
component  : desktop.qt
summary    : Cross platform application and UI Framework
description: |
    Cross platform application and UI Framework
builddeps  :
    - pkgconfig(alsa)
    - pkgconfig(atspi-2)
    - pkgconfig(gbm)
    - pkgconfig(gtk+-3.0)
    - pkgconfig(libb2)
    - pkgconfig(libglvnd)
    - pkgconfig(libinput)
    - pkgconfig(libpcre2-8)
    - pkgconfig(libpq)
    - pkgconfig(libproxy-1.0)
    - pkgconfig(libturbojpeg)
    - pkgconfig(mariadb)
    - pkgconfig(mtdev)
    - pkgconfig(sqlite3)
    - pkgconfig(tslib)
    - pkgconfig(vulkan)
    - pkgconfig(wayland-client)
    - pkgconfig(x11)
    - pkgconfig(xcb-cursor) 
    - pkgconfig(xcb-icccm)
    - pkgconfig(xcb-image)
    - pkgconfig(xcb-keysyms)
    - pkgconfig(xcb-renderutil)
    - pkgconfig(xcb-util)
    - pkgconfig(xcursor)
    - pkgconfig(xkbcommon-x11)
    - pkgconfig(xrender)
    - pkgconfig(zlib)
    - cups-devel
    - vulkan-headers
patterns   :
    - devel :
        - /usr/bin
        - /usr/lib64/qt6/bin
        - /usr/lib64/qt6/mkspecs
    - docs :
        - /usr/share/doc/qt6
    - demos :
        - /usr/lib64/qt6/examples
setup      : |
    %apply_patches

    ./configure -prefix /usr \
        -libdir %libdir% \
        -archdatadir %libdir%/qt6 \
        -bindir %libdir%/qt6/bin \
        -datadir /usr/share/qt6 \
        -docdir /usr/share/doc/qt6 \
        -examplesdir %libdir%/qt6/examples \
        -headerdir /usr/include \
        -sysconfdir /etc/xdg \
        -confirm-license \
        -gui \
        -journald \
        -no-rpath \
        -no-pch \
        -nomake tests \
        -openssl-linked \
        -opensource \
        -system-freetype \
        -system-libjpeg \
        -system-libpng \
        -system-pcre \
        -system-proxies \
        -system-sqlite \
        -system-zlib \
        -release \
        QMAKE_CFLAGS_RELEASE="${CFLAGS}" \
        QMAKE_CXXFLAGS_RELEASE="${CXXFLAGS}" \
        QMAKE_LFLAGS_RELEASE="${LDFLAGS}"
build      : |
    %make
install    : |
    %make_install INSTALL_ROOT=$installdir
    
    # Guarantee backwards compatibility
    install -Ddm00755 $installdir/usr/bin
    for bin in $installdir/usr/lib64/qt6/bin/* ; do
        ln -rvs $installdir/usr/lib64/qt6/bin/$(basename $bin) $installdir/usr/bin/$(basename $bin)-qt6
    done
