PKGBUILDs/qt6-base/mingw-w64/PKGBUILD

142 lines
6.5 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.7.0
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-cppwinrt' '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-Find-fontconfig-via-pkg-config-for-correct-handling-.patch'
'0009-Fix-dependency-of-xcb-image-on-xcb-util.patch'
'0010-Allow-using-properties-of-PkgConfig-targets-for-glib.patch'
'0011-Allow-using-properties-of-PkgConfig-targets-for-Wayl.patch'
'0012-Allow-overriding-preference-for-shared-libzstd-libra.patch'
'0013-Fix-errors-due-to-disabled-exceptions-with-cpp_winrt.patch'
'0014-Fix-setting-exception-flags-of-plugin-targets.patch'
'0015-Link-corelib-correctly-against-runtimeobject-when-co.patch'
'0016-Workaround-linker-error-about-missing-symbol-__sync_.patch'
'0017-Fix-wrong-cpp-conditional-in-qspan.h.patch'
'0018-Fix-crashes-in-rasterization-code-using-setjmp.patch')
sha256sums=('11b2e29e2e52fb0e3b453ea13bbe51a10fdff36e1c192d8868c5a40233b8b254'
'2bcfcdfe0fabdb7e7600eb6e1b85d9cda8f86af558a8c09658bc1867cc273ca0'
'a053880e1bd15d1eb4ee8fb27a2f1345af88235fb7cf1515461c3525f0be4daf'
'779093bfe4fafebf278d39de4f4f3f9b7dc6dd6871c3e86de7af51639290fe69'
'4e694cc40009b1a0cb62aa03b6d3d2b692ddca156e776c52f9babdc6e0cb2c32'
'3953be3b3cb029f47994779824c7b7875aa7b5c1c21156dbf76bccce68244d28'
'b359923aae5cddb7f52d9fc803ed2945a5644d0ae637728a401899ccc09c73af'
'ed14103ac853bd72e203ce93c13586dc40bb4d1194e390e5cc631afa29eb920f'
'76d49fe063b197b68f9a5c3e09047e4aad581639682c985762341d16e08c95bb'
'cbd5f1777ecb380fe6444eb3eb04b8abdc5988c3f97ae1f58da422d214448bd1'
'40e287b41d3e09b7fa09804ce1feca87eea1b0a4d662cfb5d7e938c6a43bf155'
'818f0a500a37ff2b5a1fe0502ce2321468482423714f4ca4d9ee02a1c8a85120'
'7de9a5e4adf4afa4d4a4ba6a90c58df810748d97631e8ee2d7051cb64d312069'
'a29667637bbd0949200d6dbb18f8b9b75e55164c6e8dd049296f7dcbe4910a21'
'167921dd76e072857413538fbdbd56b4fab19cb53c739a70fe8aa613ca8c5651'
'9177a5c59465953777faca9f0651106f0b6e98e6f825e276f81f2dd9e4ce5426'
'b5eeae582ddba1b96c600f1cb2b73083cf8ae619af7ade2b45dfc17214497b5e'
'80b2cc652b087ac950a398b554842ce66d1b0703d890d52bfffb2af0ea6ab1a7'
'bfca3b0894ce1b6764217905835db50b9251ad19084c7f89967f37bfb1366cf4')
_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
local _enable_winrt_support=ON
if [[ ! -e /usr/${_arch}/include/winrt/Windows.Foundation.h ]]; then
echo "cppwinrt headers seem incomplete, disabling FEATURE_cpp_winrt"
_enable_winrt_support=OFF
fi
$_arch-cmake -G Ninja -B build-$_arch -S $_pkgfqn \
-DCMAKE_CXX_STANDARD=20 \
-DCMAKE_CXX_FLAGS="$CXX_FLAGS -std=c++20" \
-DFEATURE_cpp_winrt=$_enable_winrt_support \
-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
}