aboutsummarylogtreecommitdiffstats
path: root/PKGBUILD
diff options
context:
space:
mode:
authorMartchus2016-09-06 22:31:28 +0200
committerMartchus2016-09-06 22:31:28 +0200
commitee89ccc823018f2fca776b6611f16f8491519348 (patch)
tree6971cf703e79c78e38d64422968d81d28f5acce8 /PKGBUILD
parente4ba1d65f9497d890d90c0774830a14cd813d719 (diff)
downloadaur-ee89ccc823018f2fca776b6611f16f8491519348.tar.gz
Add opengl -dynamic support, fix checksums
Diffstat (limited to 'PKGBUILD')
-rw-r--r--PKGBUILD144
1 files changed, 93 insertions, 51 deletions
diff --git a/PKGBUILD b/PKGBUILD
index 4241a0c90c0d..f972220c8532 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,14 +6,23 @@
# All my PKGBUILDs are managed at https://github.com/Martchus/PKGBUILDs where
# you also find the URL of a binary repository.
-# There currently three variants of the package:
-# - mingw-w64-qt5-base: includes dynamic libs only, using native OpenGL
-# - mingw-w64-qt5-base-angle: includes dynamic libs only, using ANGLE, conflicts with OpenGL version
-# - mingw-w64-qt5-base-static: includes static libs only, relies on mingw-w64-qt5-base for headers and tools
-
-# By default CMake and qmake will link against the dynamic libary.
-
-# To use the static variant with CMake set the following variable before calling find_package for finding a Qt module:
+# There are different variants of the package which can be selected by simply adjusting pkgname:
+# - mingw-w64-qt5-base or mingw-w64-qt5-base-opengl: using native OpenGL
+# - mingw-w64-qt5-base-angle: using ANGLE rather than native OpenGL
+# - mingw-w64-qt5-base-dynamic: allows choosing between ANGLE and native OpenGL dynamically at runtime
+# - mingw-w64-qt5-base-noopenql: no OpenGL support
+# The variants are conflicting (and hence can not be installed at the same time).
+# See also: http://doc.qt.io/qt-5/windows-requirements.html#dynamically-loading-graphics-drivers
+
+# The variants listed above only contain dynamic libraries. For building static libraries
+# just append '-static' to the package name, eg. mingw-w64-qt5-base-static or mingw-w64-qt5-base-angle-static.
+# The static variants rely on the corresponding dynamic variant for headers and tools.
+# I only tested the static version using native OpenGL so far (mingw-w64-qt5-base-static).
+# Note that ANGLE will still be loaded as dynamic library in mingw-w64-qt5-base-dynamic-static.
+
+# By default CMake and qmake will link against the dynamic Qt libraries.
+
+# To use the static Qt libraries with CMake set the following variable before calling find_package for finding a Qt module:
# set(USE_STATIC_QT_BUILD ON)
# To use a static plugin, add the corresponding imported target, eg.
# target_link_libraries(target ... Qt5::QWindowsIntegrationPlugin)
@@ -21,47 +30,55 @@
# #include<QtPlugin>
# Q_IMPORT_PLUGIN(QWindowsIntegrationPlugin)
-# To use the static variant with qmake set the following variables (either inside the *.pro file or as qmake argument):
+# To use the static Qt libraries with qmake set the following variables (either inside the *.pro file or as qmake argument):
# CONFIG+=static
# Further Qt modules (those not found in the base repository and hence not included in this package) include by default
-# static and dynamic libraries; if only one version is requried, just
-# set $NO_STATIC_LIBS or $NO_SHARED_LIBS.
+# static and dynamic libraries; if only one version is requried, just set $NO_STATIC_LIBS or $NO_SHARED_LIBS.
# By default, executables will not be removed because I find them useful when testing. To remove executables
-# set $NO_EXECUTABLES or $NO_STATIC_EXECUTABLES to remove statically linked executables only.
+# set $NO_EXECUTABLES (or $NO_STATIC_EXECUTABLES to remove statically linked executables only).
# However, if Qt modules containing tools are built as static and as dynamic library only the dynamically linked
# tools will be present in the package.
# Qt packages can be built in the following order (for example):
-# qt5-base qt5-declarative qt5-tools qt5-xmlpatterns qt5-script qt5-location qt5-multimedia qt5-sensors qt5-webchannel qt5-3d qt5-imageformats qt5-quickcontrols qt5-quickcontrols2 qt5-translations qt5-svg qt5-websockets qt5-winextras qt5-serialport qt5-canvas3d qt5-connectivity qt5-charts qt5-gamepad qt5-scxml qt5-datavis3s qt5-virtualkeyboard qt5-activeqt qt5-webkit
+# qt5-base qt5-base-static qt5-declarative qt5-tools qt5-xmlpatterns qt5-script qt5-location qt5-multimedia qt5-sensors qt5-webchannel qt5-3d qt5-imageformats qt5-quickcontrols qt5-quickcontrols2 qt5-translations qt5-svg qt5-websockets qt5-winextras qt5-serialport qt5-canvas3d qt5-connectivity qt5-charts qt5-gamepad qt5-scxml qt5-datavis3s qt5-virtualkeyboard qt5-activeqt qt5-webkit
# Helper functions for the split builds
+isDefault() {
+ [[ $pkgname = 'mingw-w64-qt5-base' ]] || [[ $pkgname = 'mingw-w64-qt5-base-static' ]]
+}
isStatic() {
- [[ $pkgname = "mingw-w64-qt5-base-static" ]] || \
- [[ $pkgname == 'mingw-w64-qt5-base-angle-static' ]] || \
- [[ $pkgname == 'mingw-w64-qt5-base-noopengl-static' ]]
+ [ "${pkgname##*-}" = 'static' ]
}
isOpenGL() {
- [[ $pkgname = "mingw-w64-qt5-base" ]] || [[ $pkgname = "mingw-w64-qt5-base-static" ]]
+ # Currently use native OpenGL by default
+ isDefault || \
+ [[ $pkgname = 'mingw-w64-qt5-base-opengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-opengl-static' ]]
}
isANGLE() {
- [[ $pkgname == 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname == 'mingw-w64-qt5-base-angle-static' ]]
+ [[ $pkgname = 'mingw-w64-qt5-base-angle' ]] || [[ $pkgname = 'mingw-w64-qt5-base-angle-static' ]] || \
+ [[ $pkgname = 'mingw-w64-qt5-base-dynamic' ]] || [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]]
+ # Treat dynamic version like ANGLE version, correct?
+}
+isDynamic() {
+ [[ $pkgname = 'mingw-w64-qt5-base-dynamic' ]] || [[ $pkgname = 'mingw-w64-qt5-base-dynamic-static' ]]
}
isNoOpenGL() {
- [[ $pkgname == 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname == 'mingw-w64-qt5-base-noopengl-static' ]]
+ [[ $pkgname = 'mingw-w64-qt5-base-noopengl' ]] || [[ $pkgname = 'mingw-w64-qt5-base-noopengl-static' ]]
}
pkgname=mingw-w64-qt5-base
pkgver=5.7.0
-pkgrel=4
+pkgrel=5
pkgdesc="A cross-platform application and UI framework (mingw-w64)"
-# the static variant doesn't contain any executables which need to be executed on the build machine
+# The static variant doesn't contain any executables which need to be executed on the build machine
isStatic && arch=('any') || arch=('i686' 'x86_64')
url='https://www.qt.io/'
license=('GPL3' 'LGPL3' 'FDL' 'custom')
depends=('mingw-w64-crt' 'mingw-w64-zlib' 'mingw-w64-libjpeg-turbo' 'mingw-w64-sqlite'
- 'mingw-w64-libpng' 'mingw-w64-openssl' 'mingw-w64-libdbus' 'mingw-w64-harfbuzz')
+ 'mingw-w64-libpng' 'mingw-w64-openssl' 'mingw-w64-dbus' 'mingw-w64-harfbuzz'
+ 'mingw-w64-pcre')
groups=('mingw-w64-qt' 'mingw-w64-qt5')
optdepends=('mingw-w64-postgresql-libs: PostgreSQL support' 'mingw-w64-mariadb-connector-c: MySQL support'
'qtchooser')
@@ -69,7 +86,7 @@ makedepends=('mingw-w64-gcc' 'mingw-w64-postgresql-libs' 'mingw-w64-mariadb-conn
options=(!strip !buildflags staticlibs !emptydirs)
_pkgfqn="qtbase-opensource-src-${pkgver}"
source=("https://download.qt.io/official_releases/qt/${pkgver:0:3}/${pkgver}/submodules/${_pkgfqn}.tar.xz"
- "qt5-add-angle-support.patch"
+ "qt5-add-angle-and-dynamic-support.patch"
"qt5-use-external-angle-library.patch"
"qt5-workaround-pkgconfig-install-issue.patch"
"qt5-merge-static-and-shared-library-trees.patch"
@@ -93,10 +110,10 @@ source=("https://download.qt.io/official_releases/qt/${pkgver:0:3}/${pkgver}/sub
"qt5-use-correct-pkg-config-static-flags.patch"
"qt5-use-pkgconfig-for-harfbuzz.patch")
md5sums=('184f9460b40752d71b15b827260580c2'
- 'bab00ccc19d888997f323c80354a7c3f'
- 'f7e1487de6e85116d9c6bde2eac4fb73'
+ '55a11d8ea5db9ca0cced06b06655b417'
+ '1f7aea5e8bed840b3efc9172081ddb45'
'bc99c4cc6998295d76f37ed681c20d47'
- '370218fd439f25ab3f35bd1f14652988'
+ 'e2ffff39673b37c4d9974e92fcf7213c'
'4fe6523dd1c34398df3aa5a8763530cc'
'f32a768e1acb9785c79c8e93aa266db2'
'3bd322551924543553a2bf81b4419a09'
@@ -104,7 +121,7 @@ md5sums=('184f9460b40752d71b15b827260580c2'
'99bb9f51ec684803768f36e407baf486'
'6a6bc88f35ac8080869de39bc128ce5b'
'261d9071a6af3f1d5c3f955da3781573'
- 'f28edb1fe61c575522d3df814e680f9a'
+ '0524dc5427a6c5338ebd45ab08c6ce80'
'c15d9f480d0248648fa52aeacb46e3c7'
'612a4dfb9f1a3898a1920c28bb999159'
'd0eb81aef1a21c65813fe4ddabbc4206'
@@ -115,18 +132,29 @@ md5sums=('184f9460b40752d71b15b827260580c2'
'1dc792faa7761d8d7d2f17170da04d6b'
'41ec67d9e5e70e0d6d93b42aebd0e12a'
'61c0f9d0095c5a6dec8d14e9ec35a608'
- 'bba65d27704cf36e148d8f18ad02ad15')
+ '16a7d505b503bb1087fc00fad819f64b')
_architectures='i686-w64-mingw32 x86_64-w64-mingw32'
+#_architectures='x86_64-w64-mingw32 i686-w64-mingw32'
isStatic && depends+=(${pkgname%-static})
-isANGLE && depends+=('mingw-w64-angleproject')
-if ! isOpenGL; then
- provides+=('mingw-w64-qt5-base')
+if isANGLE; then
+ if isDynamic; then
+ makedepends+=('mingw-w64-angleproject')
+ optdepends+=('mingw-w64-angleproject: use ANGLE instead of native OpenGL')
+ else
+ depends+=('mingw-w64-angleproject')
+ fi
+fi
+if ! isDefault; then
if isStatic; then
- conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static')
+ provides+=('mingw-w64-qt5-base-static')
+ conflicts+=('mingw-w64-qt5-base-static' 'mingw-w64-qt5-base-angle-static' 'mingw-w64-qt5-base-noopengl-static'
+ 'mingw-w64-qt5-base-dynamic-static' 'mingw-w64-qt5-base-openql-static')
else
- conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl')
+ provides+=('mingw-w64-qt5-base')
+ conflicts+=('mingw-w64-qt5-base' 'mingw-w64-qt5-base-angle' 'mingw-w64-qt5-base-noopengl'
+ 'mingw-w64-qt5-base-dynamic' 'mingw-w64-qt5-base-openql')
fi
fi
@@ -147,18 +175,21 @@ patch() {
prepare() {
cd "${srcdir}/${_pkgfqn}"
- # include fixes from MXE
+ # Include fixes from MXE
patch -p1 -b -i ../qt5-fixes-from-mxe.patch
if isANGLE; then
- # Add support for Angle
- patch -p1 -i ../qt5-add-angle-support.patch
+ # Add support for configure options '-opengl angle' and '-opengl dynamic'
+ # to the configure shell script
+ patch -p0 -i ../qt5-add-angle-and-dynamic-support.patch
# Make sure our external Angle package is used instead of the bundled one
patch -p1 -i ../qt5-use-external-angle-library.patch
fi
- # Fix opengl to many sections error
- isOpenGL && patch -p0 -i ../qt5-fix-opengl-to-many-sections.patch
+ # Prevent too many sections / File too big assembler error
+ # (On x86_64 qopenglversionfunctionsfactory.o exceeds limit of 32768 sections
+ # otherwise.)
+ patch -p0 -i ../qt5-fix-opengl-to-many-sections.patch
# Make sure the .pc files of the Qt5 modules are installed correctly
patch -p0 -i ../qt5-workaround-pkgconfig-install-issue.patch
@@ -208,7 +239,7 @@ prepare() {
# We have to use rpath here as the library which the
# various tools depend on (libQt5Bootstrap.so) resides
# in the folder /usr/${_arch}/lib
- # We can't use the regular %%_libdir for this as we
+ # We can't use the regular lib dir for this as we
# want to avoid conflicts with the native qt5 packages
patch -p1 -i ../qt5-enable-rpath-for-host-tools.patch
@@ -247,10 +278,11 @@ prepare() {
build() {
cd "${srcdir}/${_pkgfqn}"
- # Setup flags
- local mingw_flags='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4'
- export CFLAGS="$mingw_flags"
- export CXXFLAGS="$mingw_flags"
+ # Do not set any flags here, flags are configured via mkspec
+ # Setting flags here is not appropriate as it does not allow to
+ # distinguish between flags for native compiler and cross compiler
+ unset CFLAGS
+ unset CXXFLAGS
unset LDFLAGS
for _arch in ${_architectures}; do
@@ -260,7 +292,7 @@ build() {
# are all available in the same folder with these exact file names
# To prevent conflicts with the mingw-w64-qt4 package we have
# to put these tools in a dedicated folder
- qt_configure_args="\
+ local qt_configure_args="\
-xplatform win32-g++ \
-optimized-qmake \
-verbose \
@@ -273,7 +305,9 @@ build() {
-system-libpng \
-system-libjpeg \
-system-sqlite \
+ -system-freetype \
-system-harfbuzz \
+ -system-pcre \
-no-fontconfig \
-iconv \
-openssl \
@@ -299,19 +333,27 @@ build() {
-translationdir /usr/${_arch}/share/qt/translations \
-device-option CROSS_COMPILE=${_arch}-"
- # Fix include directory of dbus
- qt_configure_args+=" $(${_arch}-pkg-config --cflags-only-I dbus-1 --cflags)"
+ # Fix include directory of freetype2 and dbus
+ qt_configure_args+=" $(${_arch}-pkg-config --cflags-only-I freetype2 dbus-1)"
# Configure usage of ANGLE/OpenGL
if isOpenGL; then
+ msg2 'Using native OpenGL backend'
qt_configure_args+=' -opengl desktop'
elif isNoOpenGL; then
+ msg2 'Building without OpenGL support'
qt_configure_args+=' -no-opengl'
- else
- # GL_GLEXT_PROTOTYPES must be defined to enable declarations GLES functions
+ elif isANGLE; then
+ if isDynamic; then
+ msg2 'Using dynamic OpenGL backend'
+ qt_configure_args+=' -opengl dynamic'
+ else
+ msg2 'Using ANGLE as OpenGL backend'
+ qt_configure_args+=' -opengl angle'
+ fi
+ # GL_GLEXT_PROTOTYPES must be defined to enable declarations of GLES functions
qt_configure_args+=' -DGL_GLEXT_PROTOTYPES'
fi
- # TODO: allow dynamic OpenGL configuration
unset PKG_CONFIG_PATH
@@ -353,8 +395,8 @@ package() {
# The static release contains only the static libs itself but relies on the
# shared release for Qt5Bootstrap library and tools (qmake, uic, ...)
- # Drop Qt5Bootstrap and libraries which are only provided as statically
- # and are hence already present in the shared version
+ # Drop Qt5Bootstrap and libraries which are only provided as static lib
+ # and are hence already present in static form in the shared version
rm -f "${pkgdir}/usr/${_arch}/lib/"{lib,}qt5main* \
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5OpenGLExtensions* \
"${pkgdir}/usr/${_arch}/lib/"{lib,}Qt5PlatformSupport* \