# Maintainer: Martchus # Based on: AUR packages qt6-base-git and mingw-w64-qt6-base-git, official qt5-base package # All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where # you also find the URL of a binary repository. # This file is created from PKGBUILD.sh.ep contained by the mentioned repository. # Do not edit it manually! See README.md in the repository's root directory # for more information. # All patches are managed at https://github.com/Martchus/qtbase pkgname=mingw-w64-qt6-base-static _qtver=6.5.0 pkgver=${_qtver/-/} pkgrel=1 arch=(any) url='https://www.qt.io' license=(GPL3 LGPL3 FDL custom) pkgdesc='A cross-platform application and UI framework (mingw-w64)' depends=('mingw-w64-crt' 'mingw-w64-zlib' 'mingw-w64-libjpeg-turbo' 'mingw-w64-sqlite' 'mingw-w64-libpng' 'mingw-w64-openssl' 'mingw-w64-dbus' 'mingw-w64-harfbuzz' 'mingw-w64-brotli' 'mingw-w64-pcre2' 'mingw-w64-zstd') makedepends=('mingw-w64-cmake-static' 'mingw-w64-postgresql' 'mingw-w64-mariadb-connector-c' 'mingw-w64-vulkan-headers' 'mingw-w64-vulkan-icd-loader' 'mingw-w64-pkg-config' 'qt6-base' 'ninja') optdepends=('mingw-w64-postgresql: PostgreSQL driver' 'mingw-w64-mariadb-connector-c: MariaDB driver' 'qt6-base: development tools') options=('!strip' '!buildflags' 'staticlibs' '!emptydirs') groups=(mingw-w64-qt6) _pkgfqn="qtbase-everywhere-src-${_qtver}" source=("https://download.qt.io/official_releases/qt/${pkgver%.*}/${_qtver}/submodules/${_pkgfqn}.tar.xz" '0001-Use-CMake-s-default-import-library-suffix.patch' '0002-Fix-finding-D-Bus.patch' '0003-Fix-using-static-PCRE2-and-DBus-1.patch' '0004-Fix-transitive-dependencies-of-static-libraries.patch' '0005-Fix-libjpeg-workaround-for-conflict-with-rpcndr.h.patch' '0006-Support-finding-static-MariaDB-client-library.patch' '0007-Allow-overriding-CMAKE_FIND_LIBRARY_SUFFIXES-to-pref.patch' '0008-Fix-crashes-in-rasterization-code-using-setjmp.patch' '0009-Find-fontconfig-via-pkg-config-for-correct-handling-.patch' '0010-Fix-dependency-of-xcb-image-on-xcb-util.patch' '0011-Allow-using-properties-of-PkgConfig-targets-for-glib.patch' '0012-Allow-using-properties-of-PkgConfig-targets-for-Wayl.patch') sha256sums=('fde1aa7b4fbe64ec1b4fc576a57f4688ad1453d2fab59cbadd948a10a6eaf5ef' '0cb9c1a10d04575b36b0abe4a422af1e7279b3e07249b2af5fa7631dcc93d262' 'a26661954e7c1b1c74bb1563d8d269f8b7dfda196640e30eded9c03be27656e1' '61fd2877aff4ba0d471ec88cf85c08dac8e522d0a0312739c134fb1a483474f0' '95d18cb173cc0c13323a8394f8c536c2f78157928d6ddc959f20031a913f3960' '004a09d1e475f3288f599f83c6ec183e479ba58ed8e12286e0050935428ee470' 'e3ea83b5c934ff3f5f8d9c48ecc3831eb66379f134247d61664a10837107bd46' 'fb3b3e2c49d0e3466410dd03a936dc127b7669e5de7e11dbbe721baed8544043' '32f80d7cedbb4b32e4689c28b4d0ddb64ea4e4d74612738a56c771d9179eecf7' 'a2d54f21fa6205fb4273dd8f7b51b679c9c20f91021af46ccfd251addce775b8' '4c8f6c5aec035a6fbe59973e88adb0817b24464881f958d70eff030c42884072' '3bdbbab00cbef3915031f7eb1d174e54107fee8b326f17c8291d5129ba0d606f' '0908f24881d7ae5c09abe58a1d5a1ca81a6f8139fcf15924cae9fc9feb6eb4dc') _architectures='i686-w64-mingw32 x86_64-w64-mingw32' prepare () { cd $_pkgfqn # apply patches; further descriptions can be found in patch files itself for patch in "$srcdir/"*.patch; do msg2 "Applying patch $patch" patch -p1 -i "$patch" done } build() { for _arch in ${_architectures}; do export PKG_CONFIG=/usr/bin/$_arch-pkg-config $_arch-cmake-static -G Ninja -B build-$_arch -S $_pkgfqn \ -DCMAKE_INSTALL_PREFIX:PATH="/usr/$_arch/static" \ -DFEATURE_static_runtime=ON \ -DFEATURE_openssl_linked=ON \ -DFEATURE_pkg_config=ON \ -DFEATURE_system_pcre2=ON \ -DFEATURE_system_freetype=ON \ -DFEATURE_system_harfbuzz=ON \ -DFEATURE_system_sqlite=ON \ -DINSTALL_BINDIR=lib/qt6/bin \ -DINSTALL_DOCDIR=share/doc/qt6 \ -DINSTALL_ARCHDATADIR=lib/qt6 \ -DINSTALL_DATADIR=share/qt6 \ -DINSTALL_INCLUDEDIR=include/qt6 \ -DINSTALL_MKSPECSDIR=lib/qt6/mkspecs \ -DINSTALL_EXAMPLESDIR=share/doc/qt6/examples \ -DINPUT_openssl=linked VERBOSE=1 cmake --build build-$_arch done } package() { for _arch in ${_architectures}; do DESTDIR="$pkgdir" cmake --install build-$_arch install -Dm644 $_pkgfqn/LICENSES/* -t "$pkgdir"/usr/share/licenses/$pkgname # Drop QMAKE_PRL_BUILD_DIR because reference the build dir find "$pkgdir/usr/$_arch/static/lib" -type f -name '*.prl' \ -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; find "$pkgdir/usr/$_arch" -iname '*.exe' -exec $_arch-strip --strip-all {} \; find "$pkgdir/usr/$_arch" -iname '*.dll' -exec $_arch-strip --strip-unneeded {} \; find "$pkgdir/usr/$_arch" -iname '*.a' -exec $_arch-strip -g {} \; [[ -d "$pkgdir/usr/$_arch/static/share/doc" ]] && rm -r "$pkgdir/usr/$_arch/static/share/doc" done }