PKGBUILDs/qt6-base/mingw-w64/PKGBUILD

122 lines
5.4 KiB
Bash

# Maintainer: Martchus <martchus@gmx.net>
# 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
_qtver=6.4.1
pkgver=${_qtver/-/}
pkgrel=2
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' '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'
'0013-Revert-Port-default-font-resolve-to-SystemParameters.patch')
sha256sums=('532ad71cc0f9c8f7cb92766c47bc3d23263c60876becd9053802f9727af24fae'
'555998352955c22bcfbc778c70356f79c50f350deae76188a9f976121d3a47fc'
'7109f304e393223b977d48bca510158273c48fef645fda4a3a0e4f824a3e0e7a'
'd8ea7ad9727c2b7df4e8a9460aaa715d42cfcaa4319406b49c4e3c6d14c371e3'
'fec43b95034a9568f7f0ef627c803b883a06954d8662a964af2a3a23a5ddbbef'
'd371b4e7fe85d252b5dee5e45f89ef33ed47c09bd75e09a422ca50624648baa5'
'b73b6de4efd0f18ad7147bdf0b76f0caf867c6858e19d797fb4e049aa2b0d488'
'c8974fc3c18185ad8db0c8d1c6569fc2144877a1decd9cab912df838e3470c3d'
'51ca9371b44429005360bce0fd8b7579d9c6ef728ae1a412f4c02c2ede4c72a8'
'eec0ef663e3b4bd017f77eb4eb2b191429b91634722043da6dc7aba86c7bfc19'
'43cdc8ebd6b23dd4ce451028e713f250b00b38339c3d558b2784070c2b81f531'
'd58e5ec17cdffab5e89e01688de0e444ff009a4264537d56c284a2364ff3ddf6'
'c58be70d806a456e622397763e9da117917d8c48f6153d2003c13758a481fff6'
'baefcd4cceff54566e16e061ba4ff06c1df1690a4bcd977d9cee8f373fe45684')
_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 -G Ninja -B build-$_arch -S $_pkgfqn \
-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=runtime
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
# Add symlinks of DLLs in usual bin directory
mkdir -p "$pkgdir/usr/bin" "$pkgdir/usr/$_arch/bin"
for dll in "$pkgdir"/usr/$_arch/lib/qt6/bin/*.dll; do
ln -rs "$dll" "$pkgdir/usr/$_arch/bin/${dll##*/}"
done
# Symlinks for backwards compatibility
for qmake; do
ln -rs "$pkgdir"/usr/$_arch/lib/qt6/bin/$_b "$pkgdir"/usr/bin/$_arch-$_b-qt6
done
# Drop QMAKE_PRL_BUILD_DIR because reference the build dir
find "$pkgdir/usr/$_arch/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/share/doc" ]] && rm -r "$pkgdir/usr/$_arch/share/doc"
done
}