Commit 6b3bece7 authored by Tobias C. Berner's avatar Tobias C. Berner
Browse files

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
parent 877cceb2
Loading
Loading
Loading
Loading
+66 −13
Original line number Diff line number Diff line
@@ -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)
+3 −3
Original line number Diff line number Diff line
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
+3 −0
Original line number Diff line number Diff line
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
+1 −2
Original line number Diff line number Diff line
PORTNAME=	connectivity
DISTVERSION=	${QT5_VERSION}
PORTREVISION=	1
PORTVERSION=	${QT5_VERSION}${QT5_KDE_PATCH}
CATEGORIES=	comms
PKGNAMEPREFIX=	qt5-

+3 −0
Original line number Diff line number Diff line
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
Loading