# Maintainer: Mateusz Paluszkiewicz # Contributor: Swift Geek # Contributor: Jerome Leclanche # Contributor: Andrea Scarpino # Contributor: Pier Luigi Fiorini # Contributor: Gustavo _pkgname=qt5-wayland pkgname=${_pkgname}-dev-git pkgver=5.4.0.r0.g7882407 pkgrel=3 pkgdesc="A cross-platform application and UI framework (QtWayland) - Version for Developers!" arch=("i686" "x86_64") url="https://qt.gitorious.org/qt/qtwayland/" license=("GPL3" "LGPL") depends=("qt5-base" "qt5-declarative" "libxcomposite" "wayland" "libdrm" "libxkbcommon" "mesa") optdepends=("weston") makedepends=("git") provides=("${_pkgname}") conflicts=("${_pkgname}" "${_pkgname}-git") options=("staticlibs" "libtool") sha256sums=("SKIP") # Definition with userside version of Qt5 _qt5_userversion=`pkg-config --modversion Qt5Core` # REPLACE '${_qt5_userversion}' to 'branch' IF YOU WANT USING DEV BRANCH!!! source=("$_pkgname::git://gitorious.org/qt/qtwayland.git#branch=${_qt5_userversion}") # Number of real cores * number of processors = :) # TODO : Repair #_cores_multiplication_processors=$(( `grep "^core id" /proc/cpuinfo | sort -u | wc -l` * `grep "^physical id" /proc/cpuinfo | sort -u | wc -l` )) pkgver() { cd "${_pkgname}" #pkg ver withtout 'v' prefix git describe --long | sed -r 's/^v//;s/([^-]*-g)/r\1/;s/-/./g' } prepare() { warning "REMEMBER! If you want use other version, change line 28!" cd "${_pkgname}" # Repair for Qt5.3.2 warning "Enabling hacks due to FS#38819. All packages relying on this one will need simlar one\n (not needed to just run Qt5 apps in wayland)" if [ ${_qt5_userversion} == "5.3.2" ] then msg "Repair qwaylandscreen.cpp for Qt 5.3.2" sed -i "s/QWindowSystemInterface::handleScreenGeometryChange(screen(), mGeometry, mGeometry)/QWindowSystemInterface::handleScreenGeometryChange(screen(), mGeometry)/" \ ./src/client/qwaylandscreen.cpp fi } build() { cd "${_pkgname}" # Replace Qt version to user version (Qt) msg "Patching QtWayland to user version QT" sed -i "/MODULE_VERSION/c\MODULE_VERSION = ${_qt5_userversion}" .qmake.conf mkdir build cd build export QT_SELECT=5 msg "Preparing library... (QMAKE_LIBS_PRIVATE is NEEDED now)" qmake CONFIG+=wayland-compositor QMAKE_LIBS_PRIVATE+=-lXrender .. msg "Build library..." make -j`nproc` } package() { cd "${_pkgname}" cd build msg "Packing library..." make INSTALL_ROOT="${pkgdir}" install # Create custom directories mkdir -p ${pkgdir}/usr/share/licenses/qt5-wayland/ # Install generated private headers #cp ./include/QtCompositor/${_qt5_userversion}/QtCompositor/private/{qwayland-server-*,*protocol*}.h ${pkgdir}/usr/include/qt/QtCompositor/${_qt5_userversion}/QtCompositor/private/ # TODO: Needed? #cp ./include/QtCompositor/${_qt5_userversion}/QtCompositor/private/*.h ${pkgdir}/usr/include/qt/QtCompositor/${_qt5_userversion}/QtCompositor/private/ # Back to main directory cd ../ # Copy custom files cp ./LGPL_EXCEPTION.txt ${pkgdir}/usr/share/licenses/qt5-wayland/ }