freebsd-ports/devel/qt5/files/create_kde-qt_release.sh
Tobias C. Berner 787e501e3d qt5: Update Qt to 5.15.5 (KDE patched)
- update patch-collection diff to be at the highest patch-level
- update patch-collection diff to be against 5.15.5 instead of 5.15.2
- update devel/qt5-script to 5.15.10
- libressl support by Felix Palmen <felix@palmen-it.de>

PR:			264944
Exp-run by:		antoine
Differential Revision:	https://reviews.freebsd.org/D35619
2022-07-04 09:31:38 +02:00

55 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"
# Version of Qt we want
VERSION="$3"
ORIGIN_TAG="$4"
# Remote KDE git repository
REPO="https://invent.kde.org/qt/qt/${PROJECT}.git"
# Local checkout
CHECKOUT="${BASE_DIRECTORY}/${PROJECT}"
# 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_TAG}..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}"