ports/devel/qt5/files/create_kde-qt_release.sh
Tobias C. Berner 6b3bece75a 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
2022-01-02 09:47:54 +01:00

54 lines
1.5 KiB
Bash

#!/bin/sh
# Creates and updates a git checkout in ${BASE_DIRECTORY}
# for the given KDE Qt repository ${PROJECT}.
# After that, a new distfile for the ports tree is created.
DIST="$1"
PROJECT=qt"${DIST}"
BASE_DIRECTORY="$2"
# Remote KDE git repository
REPO="https://invent.kde.org/qt/qt/${PROJECT}.git"
# Local checkout
CHECKOUT="${BASE_DIRECTORY}/${PROJECT}"
# Version of Qt we want
VERSION=5.15.2
# KDE-Qt branch
BRANCH=kde/5.15
# Make sure we can use ${BASE_DIRECTORY}
if [ ! -d "${BASE_DIRECTORY}" ] || [ ! -w "${BASE_DIRECTORY}" ] ; then
echo "Directory '${BASE_DIRECTORY}' does not exist"
exit 1
fi
# Init a new git checkout if it is missing
if [ ! -d "${CHECKOUT}" ] ; then
git -C "${BASE_DIRECTORY}" clone "${REPO}"
fi
# Update the checkout of the required branch
git -C "${CHECKOUT}" checkout "${BRANCH}" && git -C "${CHECKOUT}" pull --ff-only --rebase --autostash
if [ $? -ne 0 ] ; then
echo "Failed to update ${CHECKOUT}"
exit 1
fi
# Count number of patches added by KDE
PATCH_COUNT=$(git -C ${CHECKOUT} rev-list --count origin/${VERSION}..origin/${BRANCH})
# Setup information for the distfile
DISTNAME="kde-${PROJECT}-${VERSION}p${PATCH_COUNT}"
DISTFILE="${BASE_DIRECTORY}/${DISTNAME}.tar.xz"
# Tar and compress distfile
git -C ${CHECKOUT} archive --format=tar --prefix="${DISTNAME}/" HEAD | xz > "${DISTFILE}"
if [ $? -ne 0 ] ; then
echo "Failed to create tarball ${DISTFILE}"
exit 1
fi
# Printout information required in qt-dist.mk
echo -e "Distfile:\t${DISTFILE}\n_KDE_${DIST}=\t${PATCH_COUNT}"