PKGBUILDs/qt6-base/mingw-w64/PKGBUILD

109 lines
4.5 KiB
Bash
Raw Normal View History

2020-10-07 18:30:59 +02:00
# 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
2020-11-25 17:16:57 +01:00
_qtver=6.0.0-rc
2020-10-07 18:30:59 +02:00
pkgver=${_qtver/-/}
2020-10-20 10:57:38 +02:00
pkgrel=1
2020-10-07 18:30:59 +02:00
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'
2020-10-20 10:57:38 +02:00
'mingw-w64-vulkan-headers' 'mingw-w64-vulkan-icd-loader' 'mingw-w64-pkg-config'
'qt6-base' 'ninja')
2020-10-07 18:30:59 +02:00
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/development_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-MariaDB.patch'
'0007-Allow-overriding-CMAKE_FIND_LIBRARY_SUFFIXES-to-pref.patch')
2020-11-25 17:16:57 +01:00
sha256sums=('8dc2c6fe053235e4a2866d8e1927fd667e5e8c853c96de708b9688012089138d'
2020-11-10 17:31:01 +01:00
'bb9bec76506c3425d6fa2394c2c15cf8c8e84d6ce090f8cd9136c77e7a286d8f'
'9ba0563f3c47327ca2f51c864fc1916a4355f56f82da77dea81c8a90cf315579'
'37e533855b3b498bd1e93879aac05cc77dad3b2df64f9a61440aa2bcb73e9847'
'3bdb93179f5258aa87ce3c2b8e560e2ff9fc9446bfd4688b2faf46c5deb45fc8'
'f2f64e7b6bc2a3b7c4414fc4c857b206c597ee7174cdaadaccc51ca4c0f5ada1'
'bd3a50b6a034e647a36cc4bf6a37532d892561255cda3e6cbdaf5849e710b657'
'df804bde0b39e507f07cbedc18001ea8eb939497c89586e93dc1cbb8c878fbed')
2020-10-07 18:30:59 +02:00
_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
2020-10-07 18:30:59 +02:00
VERBOSE=1 cmake --build build-$_arch
done
}
package() {
for _arch in ${_architectures}; do
DESTDIR="$pkgdir" cmake --install build-$_arch
install -Dm644 $_pkgfqn/LICENSE* -t "$pkgdir"/usr/$_arch/share/licenses/$pkgname
2020-10-08 17:50:23 +02:00
# Add symlinks of DLLs in usual bin directory
2020-10-07 18:30:59 +02:00
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
2020-10-08 17:50:23 +02:00
# Symlinks for backwards compatibility
2020-10-07 18:30:59 +02:00
for qmake; do
ln -rs "$pkgdir"/usr/$_arch/lib/qt6/bin/$_b "$pkgdir"/usr/bin/$_arch-$_b-qt6
done
2020-10-08 17:50:23 +02:00
# 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 {} \;
2020-10-07 18:30:59 +02:00
done
}