git: 11df3b5634b0 - 2022Q1 - Qt: Switch Qt5 to use KDE's Qt patch collection

From: Tobias C. Berner <tcberner_at_FreeBSD.org>
Date: Sun, 02 Jan 2022 08:50:26 UTC
The branch 2022Q1 has been updated by tcberner:

URL: https://cgit.FreeBSD.org/ports/commit/?id=11df3b5634b023710abf4a8b5faa1bd18dac2a57

commit 11df3b5634b023710abf4a8b5faa1bd18dac2a57
Author:     Tobias C. Berner <tcberner@FreeBSD.org>
AuthorDate: 2021-12-18 09:11:53 +0000
Commit:     Tobias C. Berner <tcberner@FreeBSD.org>
CommitDate: 2022-01-02 08:50:15 +0000

    Qt: Switch Qt5 to use KDE's Qt patch collection
    
    From [1]
        What's this?
    
            This is a set of git repositories based on the last public
            commits available for Qt 5.15 branches with a curated collection
            of patches on top to ensure open source products can be used
            comfortably until users transition to their Qt 6-based ports.
    
        Which patches does it include?
    
            This collection of patches includes patches that fix at least
            one of the following:
    
                * Security issues
                * Crashes
                * Functional defects
    
            We only include patches that have been approved upstream in the
            Qt project. If a patch cannot be merged upstream for technical
            reasons (e.g. the class no longer exists), it can also be
            merged.
    
            The patches to merge will be decided based on their relevance
            towards Open Source products and their viability.
    
    PR:             260548
    Exp-run by:     antoine
    Differential Revision:  https://reviews.freebsd.org/D33446
    
    [1] https://community.kde.org/Qt5PatchCollection
    
    (cherry picked from commit 6b3bece75ad5a3d03e2751e5cdf78ae8aeb0abf9)
---
 Mk/Uses/qt-dist.mk                                 | 79 ++++++++++++++++----
 accessibility/qt5-speech/Makefile                  |  6 +-
 accessibility/qt5-speech/distinfo                  |  3 +
 comms/qt5-connectivity/Makefile                    |  3 +-
 comms/qt5-connectivity/distinfo                    |  3 +
 comms/qt5-sensors/Makefile                         |  3 +-
 comms/qt5-sensors/distinfo                         |  3 +
 comms/qt5-serialbus/Makefile                       |  6 +-
 comms/qt5-serialbus/distinfo                       |  3 +
 comms/qt5-serialport/Makefile                      |  6 +-
 comms/qt5-serialport/distinfo                      |  3 +
 databases/qt5-sql/Makefile                         |  6 +-
 databases/qt5-sql/distinfo                         |  3 +
 databases/qt5-sqldrivers-ibase/Makefile            |  2 +-
 databases/qt5-sqldrivers-ibase/distinfo            |  3 +
 databases/qt5-sqldrivers-mysql/Makefile            |  2 +-
 databases/qt5-sqldrivers-mysql/distinfo            |  3 +
 databases/qt5-sqldrivers-odbc/distinfo             |  3 +
 databases/qt5-sqldrivers-pgsql/distinfo            |  3 +
 databases/qt5-sqldrivers-sqlite2/distinfo          |  3 +
 databases/qt5-sqldrivers-sqlite3/distinfo          |  3 +
 databases/qt5-sqldrivers-tds/distinfo              |  3 +
 devel/qt5-assistant/Makefile                       |  2 +-
 devel/qt5-assistant/distinfo                       |  3 +
 devel/qt5-buildtools/Makefile                      |  4 +-
 devel/qt5-buildtools/distinfo                      |  3 +
 devel/qt5-concurrent/Makefile                      |  6 +-
 devel/qt5-concurrent/distinfo                      |  3 +
 devel/qt5-concurrent/files/patch-gcc11             | 15 ----
 devel/qt5-core/Makefile                            |  6 +-
 devel/qt5-core/distinfo                            |  3 +
 .../files/patch-src_corelib_io_qiodevice.cpp       | 17 -----
 devel/qt5-dbus/Makefile                            |  6 +-
 devel/qt5-dbus/distinfo                            |  3 +
 devel/qt5-designer/Makefile                        |  3 +-
 devel/qt5-designer/distinfo                        |  3 +
 devel/qt5-help/Makefile                            |  3 +-
 devel/qt5-help/distinfo                            |  3 +
 devel/qt5-linguist/Makefile                        |  2 +-
 devel/qt5-linguist/distinfo                        |  3 +
 devel/qt5-linguisttools/Makefile                   |  3 +-
 devel/qt5-linguisttools/distinfo                   |  3 +
 devel/qt5-location/Makefile                        |  3 +-
 devel/qt5-location/distinfo                        |  3 +
 devel/qt5-qdbus/Makefile                           |  3 +-
 devel/qt5-qdbus/distinfo                           |  3 +
 devel/qt5-qdbusviewer/Makefile                     |  2 +-
 devel/qt5-qdbusviewer/distinfo                     |  3 +
 devel/qt5-qdoc-data/Makefile                       |  1 -
 devel/qt5-qdoc-data/distinfo                       |  3 +
 devel/qt5-qdoc/Makefile                            |  2 +-
 devel/qt5-qdoc/distinfo                            |  3 +
 devel/qt5-qmake/Makefile                           |  6 +-
 devel/qt5-qmake/distinfo                           |  3 +
 devel/qt5-remoteobjects/Makefile                   |  3 +-
 devel/qt5-remoteobjects/distinfo                   |  3 +
 devel/qt5-script/Makefile                          |  6 +-
 devel/qt5-script/distinfo                          |  3 +
 devel/qt5-scripttools/Makefile                     |  3 +-
 devel/qt5-scripttools/distinfo                     |  3 +
 devel/qt5-scxml/Makefile                           |  3 +-
 devel/qt5-scxml/distinfo                           |  3 +
 devel/qt5-testlib/Makefile                         |  6 +-
 devel/qt5-testlib/distinfo                         |  3 +
 devel/qt5-uitools/Makefile                         |  3 +-
 devel/qt5-uitools/distinfo                         |  3 +
 devel/qt5/Makefile.sqldrivers                      |  5 +-
 devel/qt5/distinfo                                 | 86 +---------------------
 devel/qt5/files/create_kde-qt_release.sh           | 54 ++++++++++++++
 devel/qt5/files/extrapatch-sync.profiles           | 12 +++
 graphics/qt5-3d/Makefile                           |  6 +-
 graphics/qt5-3d/distinfo                           |  3 +
 graphics/qt5-3d/pkg-plist                          |  3 +
 graphics/qt5-graphicaleffects/Makefile             |  2 +-
 graphics/qt5-graphicaleffects/distinfo             |  3 +
 graphics/qt5-imageformats/Makefile                 |  2 +-
 graphics/qt5-imageformats/distinfo                 |  3 +
 graphics/qt5-opengl/Makefile                       |  6 +-
 graphics/qt5-opengl/distinfo                       |  3 +
 graphics/qt5-pixeltool/Makefile                    |  2 +-
 graphics/qt5-pixeltool/distinfo                    |  3 +
 graphics/qt5-svg/Makefile                          |  3 +-
 graphics/qt5-svg/distinfo                          |  3 +
 graphics/qt5-wayland/Makefile                      |  3 +-
 graphics/qt5-wayland/distinfo                      |  3 +
 misc/qt5-doc/Makefile                              |  2 +-
 misc/qt5-examples/Makefile                         |  2 +-
 misc/qt5-l10n/Makefile                             |  2 +-
 misc/qt5-l10n/distinfo                             |  3 +
 misc/qt5-l10n/pkg-plist                            | 64 +++++++++++++++-
 multimedia/qt5-multimedia/Makefile                 |  3 +-
 multimedia/qt5-multimedia/distinfo                 |  3 +
 net/qt5-network/Makefile                           |  6 +-
 net/qt5-network/distinfo                           |  3 +
 net/qt5-networkauth/Makefile                       |  6 +-
 net/qt5-networkauth/distinfo                       |  3 +
 print/qt5-printsupport/Makefile                    |  6 +-
 print/qt5-printsupport/distinfo                    |  3 +
 sysutils/qt5-qtdiag/Makefile                       |  2 +-
 sysutils/qt5-qtdiag/distinfo                       |  3 +
 sysutils/qt5-qtpaths/Makefile                      |  2 +-
 sysutils/qt5-qtpaths/distinfo                      |  3 +
 sysutils/qt5-qtplugininfo/Makefile                 |  2 +-
 sysutils/qt5-qtplugininfo/distinfo                 |  3 +
 textproc/qt5-xml/Makefile                          |  6 +-
 textproc/qt5-xml/distinfo                          |  3 +
 textproc/qt5-xmlpatterns/Makefile                  |  2 +-
 textproc/qt5-xmlpatterns/distinfo                  |  3 +
 www/qt5-webchannel/Makefile                        |  3 +-
 www/qt5-webchannel/distinfo                        |  3 +
 www/qt5-webglplugin/Makefile                       |  3 +-
 www/qt5-webglplugin/distinfo                       |  3 +
 www/qt5-websockets-qml/Makefile                    |  3 +-
 www/qt5-websockets-qml/distinfo                    |  3 +
 www/qt5-websockets/Makefile                        |  6 +-
 www/qt5-websockets/distinfo                        |  3 +
 www/qt5-webview/Makefile                           |  3 +-
 www/qt5-webview/distinfo                           |  3 +
 x11-toolkits/qt5-charts/Makefile                   |  2 +-
 x11-toolkits/qt5-charts/distinfo                   |  3 +
 x11-toolkits/qt5-datavis3d/Makefile                |  3 +-
 x11-toolkits/qt5-datavis3d/distinfo                |  3 +
 x11-toolkits/qt5-declarative-test/Makefile         |  2 +-
 x11-toolkits/qt5-declarative-test/distinfo         |  3 +
 x11-toolkits/qt5-declarative/Makefile              |  3 +-
 x11-toolkits/qt5-declarative/distinfo              |  3 +
 x11-toolkits/qt5-declarative/pkg-plist             |  2 +
 x11-toolkits/qt5-gamepad/Makefile                  |  3 +-
 x11-toolkits/qt5-gamepad/distinfo                  |  3 +
 x11-toolkits/qt5-gui/Makefile                      |  6 +-
 x11-toolkits/qt5-gui/distinfo                      |  3 +
 ...-add_timeout_control_when_reading_incr_property | 59 ---------------
 x11-toolkits/qt5-quick3d/Makefile                  |  6 +-
 x11-toolkits/qt5-quick3d/distinfo                  |  3 +
 .../files/patch-arch_qt5-quick3d-assimp-5.1        | 17 +++++
 x11-toolkits/qt5-quick3d/pkg-plist                 |  3 +
 x11-toolkits/qt5-quickcontrols/Makefile            |  3 +-
 x11-toolkits/qt5-quickcontrols/distinfo            |  3 +
 x11-toolkits/qt5-quickcontrols2/Makefile           |  3 +-
 x11-toolkits/qt5-quickcontrols2/distinfo           |  3 +
 x11-toolkits/qt5-quicktimeline/Makefile            |  3 +-
 x11-toolkits/qt5-quicktimeline/distinfo            |  3 +
 x11-toolkits/qt5-uiplugin/Makefile                 |  8 +-
 x11-toolkits/qt5-uiplugin/distinfo                 |  3 +
 x11-toolkits/qt5-virtualkeyboard/Makefile          |  3 +-
 x11-toolkits/qt5-virtualkeyboard/distinfo          |  3 +
 x11-toolkits/qt5-widgets/Makefile                  |  6 +-
 x11-toolkits/qt5-widgets/distinfo                  |  3 +
 x11/qt5-qev/Makefile                               |  2 +-
 x11/qt5-qev/distinfo                               |  3 +
 x11/qt5-x11extras/Makefile                         |  9 ++-
 x11/qt5-x11extras/distinfo                         |  3 +
 152 files changed, 553 insertions(+), 331 deletions(-)

diff --git a/Mk/Uses/qt-dist.mk b/Mk/Uses/qt-dist.mk
index 3611e949b00b..40b109ee4a9e 100644
--- a/Mk/Uses/qt-dist.mk
+++ b/Mk/Uses/qt-dist.mk
@@ -57,9 +57,6 @@ IGNORE=			Unsupported qt-dist ${_QT_DIST} for qt:${_QT_VER}
 ################################################################################
 
 # Set standard bsd.port.mk variables
-MASTER_SITES=		${MASTER_SITE_QT}
-DISTINFO_FILE?=		${PORTSDIR}/devel/${_QT_RELNAME}/distinfo
-
 LICENSE?=		LGPL21
 
 .  if !exists(${PKGDIR}/pkg-descr)
@@ -70,13 +67,57 @@ DESCR?=			${PORTSDIR}/devel/${_QT_RELNAME}/pkg-descr
 DESTDIRNAME=		INSTALL_ROOT
 
 .  if ${_QT_VER:M5}
-MASTER_SITE_SUBDIR?=	official_releases/qt/${_QT_VERSION:R}/${_QT_VERSION}/submodules/
-# www/qt5-webengine hackery: The tarballs of 5.9.5 had a different naming scheme.
-.    if ${QT5_VERSION} == "5.9.5"
-DISTNAME=		${_QT_DIST:S,^,qt,:S,$,-opensource-src-${DISTVERSION},}
+
+# KDE maintains a repository with a patched Qt5 distribution.
+_KDE_3d=		39
+_KDE_base=		263
+_KDE_charts=		2
+_KDE_connectivity=	1
+_KDE_datavis3d=		2
+_KDE_declarative=	41
+_KDE_gamepad=		2
+_KDE_graphicaleffects=	2
+_KDE_imageformats=	3
+_KDE_location=		6
+_KDE_multimedia=	3
+_KDE_networkauth=	2
+_KDE_quick3d=		19
+_KDE_quickcontrols=	3
+_KDE_quickcontrols2=	8
+_KDE_quicktimeline=	3
+_KDE_remoteobjects=	3
+_KDE_script=		4
+_KDE_scxml=		1
+_KDE_sensors=		2
+_KDE_serialbus=		2
+_KDE_serialport=	2
+_KDE_speech=		2
+_KDE_svg=		13
+_KDE_tools=		17
+_KDE_translations=	22
+_KDE_virtualkeyboard=	4
+_KDE_wayland=		37
+_KDE_webchannel=	2
+_KDE_webglplugin=	2
+_KDE_websockets=	4
+_KDE_webview=		2
+_KDE_x11extras=		1
+_KDE_xmlpatterns=	2
+
+.    if defined(_KDE_${_QT_DIST})
+# KDE patched Qt parts
+QT5_KDE_PATCH=		p${_KDE_${_QT_DIST}}
+MASTER_SITES=		LOCAL/tcberner/KDE/Qt/${_QT_VERSION}
+DISTNAME=		${_QT_DIST:S,^,kde-qt,:S,$,-${DISTVERSION},}
+COMMENT+=		(KDE patched)
 .    else
+# non KDE patched Qt parts
+QT5_KDE_PATCH=		#
+MASTER_SITES=		${MASTER_SITE_QT}
+MASTER_SITE_SUBDIR?=	official_releases/qt/${_QT_VERSION:R}/${_QT_VERSION}/submodules/
 DISTNAME=		${_QT_DIST:S,^,qt,:S,$,-everywhere-src-${DISTVERSION},}
 .    endif
+
 DISTFILES=		${DISTNAME:S,$,${EXTRACT_SUFX},}
 DIST_SUBDIR=		KDE/Qt/${_QT_VERSION}
 
@@ -91,9 +132,6 @@ LDFLAGS+=		-Wl,--as-needed
 	defined(DISABLE_SIZE) && defined(NO_CHECKSUM)
 # Ensure that the "makesum" target (with its inner "fetch" one) uses
 # devel/qt*/distinfo for every port.
-.      if ${DISTINFO_FILE:H} == ${PORTSDIR}/devel/${_QT_RELNAME}
-_QT_DIST=		${_QT5_DISTS}
-.      endif
 .    endif
 
 # Qt5's tarballs are xz compressed.
@@ -183,6 +221,7 @@ _EXTRA_PATCHES_QT5+=	${PORTSDIR}/devel/${_QT_RELNAME}/files/extra-patch-mkspecs_
 			${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-mkspecs_freebsd-g++_qmake.conf
 .    endif
 EXTRA_PATCHES?=		${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-configure \
+			${PORTSDIR}/devel/${_QT_RELNAME}/files/extrapatch-sync.profiles \
 			${_EXTRA_PATCHES_QT5}
 .  endif #  ${_QT_DIST} == "base"
 
@@ -208,8 +247,8 @@ QMAKE_ARGS+=		QT_CONFIG+="${QT_CONFIG:N-*:O:u}"
 QMAKE_ARGS+=		QT_CONFIG-="${QT_CONFIG:M-*:O:u:C/^-//}"
 .  endif
 
-PLIST_SUB+=		SHORTVER=${DISTVERSION:R} \
-			FULLVER=${DISTVERSION:C/-.*//}
+PLIST_SUB+=		SHORTVER=${_QT_VERSION:R} \
+			FULLVER=${_QT_VERSION:C/-.*//}
 
 # Handle additional PLIST directories, which should only be used for Qt-dist ports.
 .  for dir in CMAKE ETC
@@ -312,7 +351,15 @@ qt5-pre-configure:
 # value through to the configure script in qtbase).
 	${MKDIR} ${CONFIGURE_WRKSRC}
 	${ECHO_CMD} 'CMAKE_MODULE_TESTS = -' > ${CONFIGURE_WRKSRC}/.qmake.cache
-#
+
+	# configure will run syncqt.pl if it finds a .git entry in the working directory
+	touch ${WRKSRC}/.git
+	# As the patch collection was created after a version bump, all module verisions
+	# are tagged as 5.15.3
+	touch ${WRKSRC}/.qmake.conf # easier than to -f before the sed
+	${REINPLACE_CMD} -e '/MODULE_VERSION/s|5\.15\.[0-9]|${_QT_VERSION}|g' \
+		${WRKSRC}/.qmake.conf
+
 # **** THIS PART IS OBSOLETE FOR THE NEXT QT UPGRADE ****
 #
 # We piggyback on QMAKE_LIBDIR_FLAGS to make sure -L${WRKSRC}/lib is passed to
@@ -409,4 +456,10 @@ qt-post-install:
 		>> ${TMPPLIST}
 .    endif # ${QT_CONFIG:N-*}
 .  endif # M5
+
+qt-create-kde-distfile:
+	${SH} ${PORTSDIR}/devel/${_QT_RELNAME}/files/create_kde-qt_release.sh \
+		${_QT_DIST} \
+		${DISTDIR}/${DIST_SUBDIR}
+
 .endif # defined(_QT_DIST_MK_INCLUDED)
diff --git a/accessibility/qt5-speech/Makefile b/accessibility/qt5-speech/Makefile
index f78c49fdea3a..c999092c5cc1 100644
--- a/accessibility/qt5-speech/Makefile
+++ b/accessibility/qt5-speech/Makefile
@@ -1,15 +1,15 @@
 PORTNAME=	speech
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	2
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	accessibility
 PKGNAMEPREFIX=	qt5-
 
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	Accessibilty features for Qt5
 
-USES=		compiler:c++11-lang gl pkgconfig qmake:outsource,norecursive \
+USES=		compiler:c++11-lang gl pkgconfig perl5 qmake:outsource,norecursive \
 		qt-dist:5,speech xorg
 USE_GL=		gl
+USE_PERL5=	extract
 USE_QT=		core gui buildtools_build qmake_build
 
 OPTIONS_DEFINE=		ALSA
diff --git a/accessibility/qt5-speech/distinfo b/accessibility/qt5-speech/distinfo
new file mode 100644
index 000000000000..dc27ac3c85c7
--- /dev/null
+++ b/accessibility/qt5-speech/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423750
+SHA256 (KDE/Qt/5.15.2/kde-qtspeech-5.15.2p2.tar.xz) = 83f3543ef261b7603615fd07a3f9d938ba1377aa2a955e449b0cc87efd543989
+SIZE (KDE/Qt/5.15.2/kde-qtspeech-5.15.2p2.tar.xz) = 80208
diff --git a/comms/qt5-connectivity/Makefile b/comms/qt5-connectivity/Makefile
index ee21ba931939..e0d37eed3eab 100644
--- a/comms/qt5-connectivity/Makefile
+++ b/comms/qt5-connectivity/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	connectivity
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	comms
 PKGNAMEPREFIX=	qt5-
 
diff --git a/comms/qt5-connectivity/distinfo b/comms/qt5-connectivity/distinfo
new file mode 100644
index 000000000000..bd6f9d81063d
--- /dev/null
+++ b/comms/qt5-connectivity/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423751
+SHA256 (KDE/Qt/5.15.2/kde-qtconnectivity-5.15.2p1.tar.xz) = 768324678b18c535c34d10a304124352b6befc7be6f0496bbb7b6ed6376f382e
+SIZE (KDE/Qt/5.15.2/kde-qtconnectivity-5.15.2p1.tar.xz) = 2784408
diff --git a/comms/qt5-sensors/Makefile b/comms/qt5-sensors/Makefile
index 714b5a110fa3..41c9e62151b6 100644
--- a/comms/qt5-sensors/Makefile
+++ b/comms/qt5-sensors/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	sensors
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	comms
 PKGNAMEPREFIX=	qt5-
 
diff --git a/comms/qt5-sensors/distinfo b/comms/qt5-sensors/distinfo
new file mode 100644
index 000000000000..30da2f69b490
--- /dev/null
+++ b/comms/qt5-sensors/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423751
+SHA256 (KDE/Qt/5.15.2/kde-qtsensors-5.15.2p2.tar.xz) = ad17bde11441d00f5a0db4ecf87a40833953981ac3a8039243c8de1b0d2122de
+SIZE (KDE/Qt/5.15.2/kde-qtsensors-5.15.2p2.tar.xz) = 2030628
diff --git a/comms/qt5-serialbus/Makefile b/comms/qt5-serialbus/Makefile
index e0e429ab82eb..ba8702ac3a8b 100644
--- a/comms/qt5-serialbus/Makefile
+++ b/comms/qt5-serialbus/Makefile
@@ -1,13 +1,13 @@
 PORTNAME=	serialbus
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	comms
 PKGNAMEPREFIX=	qt5-
 
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	Qt functions to access industrial bus systems
 
-USES=		compiler:c++11-lib qmake qt-dist:5,serialbus
+USES=		compiler:c++11-lib perl5 qmake qt-dist:5,serialbus
+USE_PERL5=	extract
 USE_QT=		core network serialport buildtools_build
 QT_BINARIES=	yes
 
diff --git a/comms/qt5-serialbus/distinfo b/comms/qt5-serialbus/distinfo
new file mode 100644
index 000000000000..ae74f66d9194
--- /dev/null
+++ b/comms/qt5-serialbus/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423752
+SHA256 (KDE/Qt/5.15.2/kde-qtserialbus-5.15.2p2.tar.xz) = 0d0befb361f18e4b46a3f8ed6ceebc94d34c3266a609720e3ff980a459e26715
+SIZE (KDE/Qt/5.15.2/kde-qtserialbus-5.15.2p2.tar.xz) = 333156
diff --git a/comms/qt5-serialport/Makefile b/comms/qt5-serialport/Makefile
index ae63f5c1514b..59b1509c0960 100644
--- a/comms/qt5-serialport/Makefile
+++ b/comms/qt5-serialport/Makefile
@@ -1,13 +1,13 @@
 PORTNAME=	serialport
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	comms
 PKGNAMEPREFIX=	qt5-
 
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	Qt functions to access serial ports
 
-USES=		compiler:c++11-lang libtool qmake qt-dist:5,serialport
+USES=		compiler:c++11-lang libtool perl5 qmake qt-dist:5,serialport
+USE_PERL5=	extract
 USE_QT=		core buildtools_build
 
 .include <bsd.port.mk>
diff --git a/comms/qt5-serialport/distinfo b/comms/qt5-serialport/distinfo
new file mode 100644
index 000000000000..fb41f11fd71e
--- /dev/null
+++ b/comms/qt5-serialport/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423754
+SHA256 (KDE/Qt/5.15.2/kde-qtserialport-5.15.2p2.tar.xz) = 767e7b817b01ad747346c2c9bcccd26a652d8ca73915c68dd47386815eef445b
+SIZE (KDE/Qt/5.15.2/kde-qtserialport-5.15.2p2.tar.xz) = 300200
diff --git a/databases/qt5-sql/Makefile b/databases/qt5-sql/Makefile
index 950da5757e3d..673754c7b302 100644
--- a/databases/qt5-sql/Makefile
+++ b/databases/qt5-sql/Makefile
@@ -1,13 +1,13 @@
 PORTNAME=	sql
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	databases
 PKGNAMEPREFIX=	qt5-
 
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	Qt SQL database integration module
 
-USES=		compiler:c++11-lang qmake:no_env qt-dist:5,base
+USES=		compiler:c++11-lang perl5 qmake:no_env qt-dist:5,base
+USE_PERL5=	extract
 USE_QT=		core qmake_build buildtools_build
 HAS_CONFIGURE=	yes
 CONFIGURE_ARGS=	-no-gui -no-xcb
diff --git a/databases/qt5-sql/distinfo b/databases/qt5-sql/distinfo
new file mode 100644
index 000000000000..bcdb973c77d3
--- /dev/null
+++ b/databases/qt5-sql/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423756
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/databases/qt5-sqldrivers-ibase/Makefile b/databases/qt5-sqldrivers-ibase/Makefile
index 10f0e65da56c..7c1ea8d32520 100644
--- a/databases/qt5-sqldrivers-ibase/Makefile
+++ b/databases/qt5-sqldrivers-ibase/Makefile
@@ -1,4 +1,4 @@
-PORTREVISION=	1
+PORTREVISION=	0
 
 DB=		IBase
 DB_DESC=	InterBase/Firebird
diff --git a/databases/qt5-sqldrivers-ibase/distinfo b/databases/qt5-sqldrivers-ibase/distinfo
new file mode 100644
index 000000000000..edd4b2c0b72c
--- /dev/null
+++ b/databases/qt5-sqldrivers-ibase/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423854
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/databases/qt5-sqldrivers-mysql/Makefile b/databases/qt5-sqldrivers-mysql/Makefile
index 04a43c5fb77d..28aecaf37530 100644
--- a/databases/qt5-sqldrivers-mysql/Makefile
+++ b/databases/qt5-sqldrivers-mysql/Makefile
@@ -1,4 +1,4 @@
-PORTREVISION=	1
+PORTREVISION=	0
 
 DB=		MYSQL
 DB_DESC=	MySQL
diff --git a/databases/qt5-sqldrivers-mysql/distinfo b/databases/qt5-sqldrivers-mysql/distinfo
new file mode 100644
index 000000000000..dd3005449d03
--- /dev/null
+++ b/databases/qt5-sqldrivers-mysql/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423852
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/databases/qt5-sqldrivers-odbc/distinfo b/databases/qt5-sqldrivers-odbc/distinfo
new file mode 100644
index 000000000000..b86d11580e62
--- /dev/null
+++ b/databases/qt5-sqldrivers-odbc/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423853
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/databases/qt5-sqldrivers-pgsql/distinfo b/databases/qt5-sqldrivers-pgsql/distinfo
new file mode 100644
index 000000000000..edd4b2c0b72c
--- /dev/null
+++ b/databases/qt5-sqldrivers-pgsql/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423854
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/databases/qt5-sqldrivers-sqlite2/distinfo b/databases/qt5-sqldrivers-sqlite2/distinfo
new file mode 100644
index 000000000000..742bb0954b08
--- /dev/null
+++ b/databases/qt5-sqldrivers-sqlite2/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423856
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/databases/qt5-sqldrivers-sqlite3/distinfo b/databases/qt5-sqldrivers-sqlite3/distinfo
new file mode 100644
index 000000000000..9e2135710150
--- /dev/null
+++ b/databases/qt5-sqldrivers-sqlite3/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423857
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/databases/qt5-sqldrivers-tds/distinfo b/databases/qt5-sqldrivers-tds/distinfo
new file mode 100644
index 000000000000..d9b36e06ab9c
--- /dev/null
+++ b/databases/qt5-sqldrivers-tds/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423858
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/devel/qt5-assistant/Makefile b/devel/qt5-assistant/Makefile
index 9738b62bd85e..fe9a167bb187 100644
--- a/devel/qt5-assistant/Makefile
+++ b/devel/qt5-assistant/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	assistant
-DISTVERSION=	${QT5_VERSION}
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
diff --git a/devel/qt5-assistant/distinfo b/devel/qt5-assistant/distinfo
new file mode 100644
index 000000000000..0d4531b45bb2
--- /dev/null
+++ b/devel/qt5-assistant/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423860
+SHA256 (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 51281e37f5b140eeff242dfefe525bd7fca0223f8da5f33a2cf79e32745eb11a
+SIZE (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 8842464
diff --git a/devel/qt5-buildtools/Makefile b/devel/qt5-buildtools/Makefile
index 0f7ad4d0a3be..e9264a322ef4 100644
--- a/devel/qt5-buildtools/Makefile
+++ b/devel/qt5-buildtools/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	buildtools
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	2
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
@@ -8,6 +7,7 @@ MAINTAINER=	kde@FreeBSD.org
 COMMENT=	Qt build tools
 
 USES=		compiler:c++11-lang libtool perl5 qmake:no_env qt-dist:5,base
+USE_PERL5=	extract
 HAS_CONFIGURE=	yes
 CONFIGURE_ARGS=	-no-gui -no-xcb
 QT_BINARIES=	yes
diff --git a/devel/qt5-buildtools/distinfo b/devel/qt5-buildtools/distinfo
new file mode 100644
index 000000000000..ad7fd12014dd
--- /dev/null
+++ b/devel/qt5-buildtools/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423861
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/devel/qt5-concurrent/Makefile b/devel/qt5-concurrent/Makefile
index 5cc46363ff2a..6f3a42df0736 100644
--- a/devel/qt5-concurrent/Makefile
+++ b/devel/qt5-concurrent/Makefile
@@ -1,13 +1,13 @@
 PORTNAME=	concurrent
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	2
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	Qt multi-threading module
 
-USES=		compiler:c++11-lang qmake:no_env qt-dist:5,base
+USES=		compiler:c++11-lang perl5 qmake:no_env qt-dist:5,base
+USE_PERL5=	extract
 USE_QT=		core qmake_build buildtools_build
 HAS_CONFIGURE=	yes
 CONFIGURE_ARGS=	-no-gui -no-xcb
diff --git a/devel/qt5-concurrent/distinfo b/devel/qt5-concurrent/distinfo
new file mode 100644
index 000000000000..5c3758be8f88
--- /dev/null
+++ b/devel/qt5-concurrent/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423862
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/devel/qt5-concurrent/files/patch-gcc11 b/devel/qt5-concurrent/files/patch-gcc11
deleted file mode 100644
index 3198f6ed38ca..000000000000
--- a/devel/qt5-concurrent/files/patch-gcc11
+++ /dev/null
@@ -1,15 +0,0 @@
-https://codereview.qt-project.org/c/qt/qtbase/+/339417
-
---- src/concurrent/qtconcurrentthreadengine.h.orig	2020-10-27 08:02:11 UTC
-+++ src/concurrent/qtconcurrentthreadengine.h
-@@ -247,8 +247,8 @@ template <>
- class ThreadEngineStarter<void> : public ThreadEngineStarterBase<void>
- {
- public:
--    ThreadEngineStarter<void>(ThreadEngine<void> *_threadEngine)
--    :ThreadEngineStarterBase<void>(_threadEngine) {}
-+    ThreadEngineStarter(ThreadEngine<void> *_threadEngine)
-+        : ThreadEngineStarterBase<void>(_threadEngine) {}
- 
-     void startBlocking()
-     {
diff --git a/devel/qt5-core/Makefile b/devel/qt5-core/Makefile
index 846ea77ff07b..d2b938e1f768 100644
--- a/devel/qt5-core/Makefile
+++ b/devel/qt5-core/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	core
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	6
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
@@ -12,8 +11,9 @@ LIB_DEPENDS=	libdouble-conversion.so:devel/double-conversion \
 		libpcre2-posix.so:devel/pcre2 \
 		libzstd.so:archivers/zstd
 
-USES=		compiler:c++11-lang gnome qmake:no_env qt-dist:5,base
+USES=		compiler:c++11-lang gnome perl5 qmake:no_env qt-dist:5,base
 USE_GNOME=	glib20
+USE_PERL5=	extract
 USE_QT=		qmake_build buildtools_build
 HAS_CONFIGURE=	yes
 # Disable (almost) everything to install minimal qconfig.h.
diff --git a/devel/qt5-core/distinfo b/devel/qt5-core/distinfo
new file mode 100644
index 000000000000..afc62138a969
--- /dev/null
+++ b/devel/qt5-core/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423864
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/devel/qt5-core/files/patch-src_corelib_io_qiodevice.cpp b/devel/qt5-core/files/patch-src_corelib_io_qiodevice.cpp
deleted file mode 100644
index 3a35ca2b1259..000000000000
--- a/devel/qt5-core/files/patch-src_corelib_io_qiodevice.cpp
+++ /dev/null
@@ -1,17 +0,0 @@
---- src/corelib/io/qiodevice.cpp.orig	2020-05-11 08:15:08 UTC
-+++ src/corelib/io/qiodevice.cpp
-@@ -1480,10 +1480,12 @@ QByteArray QIODevice::readLine(qint64 maxSize)
-     } else
-         readBytes = readLine(result.data(), result.size());
- 
--    if (readBytes <= 0)
-+    if (readBytes <= 0) {
-         result.clear();
--    else
-+    } else {
-         result.resize(readBytes);
-+        result.squeeze();
-+    }
- 
-     return result;
- }
diff --git a/devel/qt5-dbus/Makefile b/devel/qt5-dbus/Makefile
index 47b0fa12f107..48334177fa16 100644
--- a/devel/qt5-dbus/Makefile
+++ b/devel/qt5-dbus/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	dbus
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
@@ -9,7 +8,8 @@ COMMENT=	Qt D-Bus inter-process communication module
 
 LIB_DEPENDS=	libdbus-1.so:devel/dbus
 
-USES=		compiler:c++11-lang qmake:no_env qt-dist:5,base
+USES=		compiler:c++11-lang perl5 qmake:no_env qt-dist:5,base
+USE_PERL5=	extract
 USE_QT=		core qmake_build buildtools_build
 HAS_CONFIGURE=	yes
 CONFIGURE_ARGS=	-no-gui -no-xcb
diff --git a/devel/qt5-dbus/distinfo b/devel/qt5-dbus/distinfo
new file mode 100644
index 000000000000..0e99e5287fd0
--- /dev/null
+++ b/devel/qt5-dbus/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423865
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
+SIZE (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = 49709048
diff --git a/devel/qt5-designer/Makefile b/devel/qt5-designer/Makefile
index 6d2a3f163331..08ee9e3742cf 100644
--- a/devel/qt5-designer/Makefile
+++ b/devel/qt5-designer/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	designer
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
diff --git a/devel/qt5-designer/distinfo b/devel/qt5-designer/distinfo
new file mode 100644
index 000000000000..3bf6e6575462
--- /dev/null
+++ b/devel/qt5-designer/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423866
+SHA256 (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 51281e37f5b140eeff242dfefe525bd7fca0223f8da5f33a2cf79e32745eb11a
+SIZE (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 8842464
diff --git a/devel/qt5-help/Makefile b/devel/qt5-help/Makefile
index c06d5b565895..b1c5f0c525ca 100644
--- a/devel/qt5-help/Makefile
+++ b/devel/qt5-help/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	help
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
diff --git a/devel/qt5-help/distinfo b/devel/qt5-help/distinfo
new file mode 100644
index 000000000000..18887f18a435
--- /dev/null
+++ b/devel/qt5-help/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423867
+SHA256 (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 51281e37f5b140eeff242dfefe525bd7fca0223f8da5f33a2cf79e32745eb11a
+SIZE (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 8842464
diff --git a/devel/qt5-linguist/Makefile b/devel/qt5-linguist/Makefile
index 5b407debb3fe..6a8fc0357cf0 100644
--- a/devel/qt5-linguist/Makefile
+++ b/devel/qt5-linguist/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	linguist
-DISTVERSION=	${QT5_VERSION}
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
diff --git a/devel/qt5-linguist/distinfo b/devel/qt5-linguist/distinfo
new file mode 100644
index 000000000000..984afb95baa4
--- /dev/null
+++ b/devel/qt5-linguist/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423868
+SHA256 (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 51281e37f5b140eeff242dfefe525bd7fca0223f8da5f33a2cf79e32745eb11a
+SIZE (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 8842464
diff --git a/devel/qt5-linguisttools/Makefile b/devel/qt5-linguisttools/Makefile
index 0311af3064e6..6d2865306381 100644
--- a/devel/qt5-linguisttools/Makefile
+++ b/devel/qt5-linguisttools/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	linguisttools
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
diff --git a/devel/qt5-linguisttools/distinfo b/devel/qt5-linguisttools/distinfo
new file mode 100644
index 000000000000..f1d1ebf9f91a
--- /dev/null
+++ b/devel/qt5-linguisttools/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423869
+SHA256 (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 51281e37f5b140eeff242dfefe525bd7fca0223f8da5f33a2cf79e32745eb11a
+SIZE (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 8842464
diff --git a/devel/qt5-location/Makefile b/devel/qt5-location/Makefile
index 159f88895ccb..1353a8619338 100644
--- a/devel/qt5-location/Makefile
+++ b/devel/qt5-location/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	location
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
diff --git a/devel/qt5-location/distinfo b/devel/qt5-location/distinfo
new file mode 100644
index 000000000000..705ae54f3698
--- /dev/null
+++ b/devel/qt5-location/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423870
+SHA256 (KDE/Qt/5.15.2/kde-qtlocation-5.15.2p6.tar.xz) = 82bcf791ce0651b24c43a2875e629a1500f7a9a29378d49100ea5050cd2fa076
+SIZE (KDE/Qt/5.15.2/kde-qtlocation-5.15.2p6.tar.xz) = 4212420
diff --git a/devel/qt5-qdbus/Makefile b/devel/qt5-qdbus/Makefile
index 811103590a7f..7453bb6f64ee 100644
--- a/devel/qt5-qdbus/Makefile
+++ b/devel/qt5-qdbus/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	qdbus
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	1
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
diff --git a/devel/qt5-qdbus/distinfo b/devel/qt5-qdbus/distinfo
new file mode 100644
index 000000000000..a9b350ab4e08
--- /dev/null
+++ b/devel/qt5-qdbus/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423871
+SHA256 (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 51281e37f5b140eeff242dfefe525bd7fca0223f8da5f33a2cf79e32745eb11a
+SIZE (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 8842464
diff --git a/devel/qt5-qdbusviewer/Makefile b/devel/qt5-qdbusviewer/Makefile
index 3f84dc4726ad..c2f155acb4dd 100644
--- a/devel/qt5-qdbusviewer/Makefile
+++ b/devel/qt5-qdbusviewer/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	qdbusviewer
-DISTVERSION=	${QT5_VERSION}
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
diff --git a/devel/qt5-qdbusviewer/distinfo b/devel/qt5-qdbusviewer/distinfo
new file mode 100644
index 000000000000..551e04498568
--- /dev/null
+++ b/devel/qt5-qdbusviewer/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423872
+SHA256 (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 51281e37f5b140eeff242dfefe525bd7fca0223f8da5f33a2cf79e32745eb11a
+SIZE (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 8842464
diff --git a/devel/qt5-qdoc-data/Makefile b/devel/qt5-qdoc-data/Makefile
index 020dc9f6083d..ae92b05fa7ac 100644
--- a/devel/qt5-qdoc-data/Makefile
+++ b/devel/qt5-qdoc-data/Makefile
@@ -26,7 +26,6 @@ NO_ARCH=	yes
 NO_BUILD=	yes
 
 DESCR=		${.CURDIR:H:H}/devel/qt5/pkg-descr
-DISTINFO_FILE=	${.CURDIR:H:H}/devel/qt5/distinfo
 
 do-install:
 	${MKDIR} ${STAGEDIR}${QT_DOCDIR} && \
diff --git a/devel/qt5-qdoc-data/distinfo b/devel/qt5-qdoc-data/distinfo
new file mode 100644
index 000000000000..69871b4e830c
--- /dev/null
+++ b/devel/qt5-qdoc-data/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639505201
+SHA256 (KDE/Qt/5.15.2/qtbase-everywhere-src-5.15.2.tar.xz) = 909fad2591ee367993a75d7e2ea50ad4db332f05e1c38dd7a5a274e156a4e0f8
+SIZE (KDE/Qt/5.15.2/qtbase-everywhere-src-5.15.2.tar.xz) = 50179672
diff --git a/devel/qt5-qdoc/Makefile b/devel/qt5-qdoc/Makefile
index 533643cf0830..f954b602e778 100644
--- a/devel/qt5-qdoc/Makefile
+++ b/devel/qt5-qdoc/Makefile
@@ -1,5 +1,5 @@
 PORTNAME=	qdoc
-DISTVERSION=	${QT5_VERSION}
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel textproc
 PKGNAMEPREFIX=	qt5-
 
diff --git a/devel/qt5-qdoc/distinfo b/devel/qt5-qdoc/distinfo
new file mode 100644
index 000000000000..79fad251e6a4
--- /dev/null
+++ b/devel/qt5-qdoc/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639423873
+SHA256 (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 51281e37f5b140eeff242dfefe525bd7fca0223f8da5f33a2cf79e32745eb11a
+SIZE (KDE/Qt/5.15.2/kde-qttools-5.15.2p17.tar.xz) = 8842464
diff --git a/devel/qt5-qmake/Makefile b/devel/qt5-qmake/Makefile
index c73de40c0aef..147f7b17cb93 100644
--- a/devel/qt5-qmake/Makefile
+++ b/devel/qt5-qmake/Makefile
@@ -1,13 +1,12 @@
 PORTNAME=	qmake
-DISTVERSION=	${QT5_VERSION}
-PORTREVISION=	2
+PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
 CATEGORIES=	devel
 PKGNAMEPREFIX=	qt5-
 
 MAINTAINER=	kde@FreeBSD.org
 COMMENT=	Qt Makefile generator
 
-USES=		compiler:c++11-lib gmake pkgconfig \
+USES=		compiler:c++11-lib gmake perl5 pkgconfig \
 		python:build qmake:no_env qt-dist:5,base shebangfix
 SHEBANG_FILES=	util/harfbuzz/update-harfbuzz \
 		util/unicode/x11/makeencodings \
@@ -15,6 +14,7 @@ SHEBANG_FILES=	util/harfbuzz/update-harfbuzz \
 		mkspecs/features/data/mac/objc_namespace.sh \
 		mkspecs/features/uikit/devices.py \
 		mkspecs/features/uikit/device_destinations.sh
+USE_PERL5=	extract
 
 REINPLACE_ARGS=	-i ""
 HAS_CONFIGURE=	yes
diff --git a/devel/qt5-qmake/distinfo b/devel/qt5-qmake/distinfo
new file mode 100644
index 000000000000..526e93f5af27
--- /dev/null
+++ b/devel/qt5-qmake/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1639421182
+SHA256 (KDE/Qt/5.15.2/kde-qtbase-5.15.2p263.tar.xz) = a516b110cc8c3ae1627711cf3f7fdfffcd300e75cca6c97aa037ea940780ad1e
*** 1651 LINES SKIPPED ***