From owner-svn-ports-all@freebsd.org Sun Jul 19 21:37:57 2020 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id B6456369BF9; Sun, 19 Jul 2020 21:37:57 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B8yrj4QQSz44qy; Sun, 19 Jul 2020 21:37:57 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7B06F22497; Sun, 19 Jul 2020 21:37:57 +0000 (UTC) (envelope-from adridg@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 06JLbv5F090697; Sun, 19 Jul 2020 21:37:57 GMT (envelope-from adridg@FreeBSD.org) Received: (from adridg@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 06JLbvil090696; Sun, 19 Jul 2020 21:37:57 GMT (envelope-from adridg@FreeBSD.org) Message-Id: <202007192137.06JLbvil090696@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adridg set sender to adridg@FreeBSD.org using -f From: Adriaan de Groot Date: Sun, 19 Jul 2020 21:37:57 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r542599 - in head/misc/qtchooser: . files X-SVN-Group: ports-head X-SVN-Commit-Author: adridg X-SVN-Commit-Paths: in head/misc/qtchooser: . files X-SVN-Commit-Revision: 542599 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 19 Jul 2020 21:37:57 -0000 Author: adridg Date: Sun Jul 19 21:37:56 2020 New Revision: 542599 URL: https://svnweb.freebsd.org/changeset/ports/542599 Log: Massage misc/qtchooser - expand documentation of the tool used to manage the links; while we have only Qt5 in the tree the whole thing is rather moot, it's good to tidy up before Qt6 shows up on the horizon. - update the documentation in the Makefile to reflect the current state of Uses/qt.mk I've bumped PORTREVISION because the package contents will change with the updated script, but there's no functional change at all. SVN hooks have forced me to remove svn:executable from the script file, but this doesn't change the resulting permissions on the installed executable and script. PR: 242905 Modified: head/misc/qtchooser/Makefile head/misc/qtchooser/files/update-qtchooser-wrapper.in (contents, props changed) Modified: head/misc/qtchooser/Makefile ============================================================================== --- head/misc/qtchooser/Makefile Sun Jul 19 21:10:59 2020 (r542598) +++ head/misc/qtchooser/Makefile Sun Jul 19 21:37:56 2020 (r542599) @@ -2,7 +2,7 @@ PORTNAME= qtchooser PORTVERSION= 66 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= misc MASTER_SITES= QT/official_releases/${PORTNAME} DIST_SUBDIR= KDE/Qt/qtchooser @@ -18,11 +18,12 @@ DESTDIRNAME= INSTALL_ROOT MAKE_ARGS= prefix=${PREFIX} SUB_FILES= update-qtchooser-wrapper -# Keep this synchronized with qt.mk +# Keep this synchronized with Uses/qt.mk SUB_LIST= QT_SUPPORTED="5" -# bin/linguist -CONFLICTS_INSTALL= rubygem-github-linguist rubygem-github-linguist47 rubygem-gitlab-linguist +# bin/linguist -- the second bunch no longer exists in the ports tree +CONFLICTS_INSTALL= rubygem-github-linguist +CONFLICTS_INSTALL+= rubygem-github-linguist47 rubygem-gitlab-linguist QT_QTCHOOSERDIR=${PREFIX}/etc/xdg/qtchooser @@ -32,14 +33,20 @@ post-patch: post-install: # Install qtchooser config file. Note this is not optimal. -# -> we could install the qtchooser config files via devel/qmake[45]. +# -> we could install the qtchooser config files via devel/qt5-qmake. # Unfortunately they will be missing for ports that only use say "rcc" # without qmake. # So it is easier to install the config files in qtchooser. -# -> As we cannot include bsd.qt.mk at the moment without specifying +# -> As we cannot include Uses/qt.mk at the moment without specifying # a version, we also do not have the variables needed to sub the variables -# properly (this will probably change with qt.mk). -# Always make sure the following is in sync with bsd.qt.mk for now. +# properly (we could use USES=qt:5 just to get _QT_SUPPORTED, but that +# is a lot of overkill). +# +# Always make sure the following is in sync with Uses/qt.mk . +# At the very least all the _QT_SUPPORTED versions should be +# in the .for loop, although we still keep Qt4 around over a year +# after it was removed from the ports tree. +# ${MKDIR} ${STAGEDIR}${QT_QTCHOOSERDIR} .for qt_version in 4 5 ${ECHO} ${PREFIX}/lib/qt${qt_version}/bin > ${STAGEDIR}${QT_QTCHOOSERDIR}/qt${qt_version}.conf Modified: head/misc/qtchooser/files/update-qtchooser-wrapper.in ============================================================================== --- head/misc/qtchooser/files/update-qtchooser-wrapper.in Sun Jul 19 21:10:59 2020 (r542598) +++ head/misc/qtchooser/files/update-qtchooser-wrapper.in Sun Jul 19 21:37:56 2020 (r542599) @@ -2,18 +2,24 @@ # $FreeBSD$ -# If a port installs Qt version-specific binaries (e.g. "designer" which existed as a Qt4 application -# and exists as a Qt5 application and will probably be a Qt6 application) which should have a -# qtchooser-based wrapper, the port should set `QT_BINARIES=yes`. +# If a port installs Qt version-specific binaries (e.g. "designer" which +# existed as a Qt4 application and exists as a Qt5 application and will +# probably be a Qt6 application) which should have a qtchooser-based +# wrapper, the port should set `QT_BINARIES=yes`. # -# When QT_BINARIES is set to yes, compatibility symlinks (designer -> qtchooser, so that -# qtchooser can run designer-qt5 or whatever is the selected Qt version) are installed by the port. +# When QT_BINARIES is set to yes, compatibility symlinks (in bin/, +# designer -> qtchooser, so that qtchooser can run designer-qt5 or +# whatever is the selected Qt version) are installed by the port. +# +# Versioned binaries in ports are conventionally installed in /bin/, +# so qt5/bin/designer is the versioned form of "designer". PREFIX=%%PREFIX%% BINDIR=${PREFIX}/bin QTCHOOSER=${BINDIR}/qtchooser VERSIONS=%%QT_SUPPORTED%% +# Sanity-checking. Distinguish weird failure cases by exit code. if [ ! -d ${BINDIR} ] ; then echo "Binary directory '${BINDIR}' missing." >&2 exit 1 @@ -24,17 +30,31 @@ if [ ! -x ${QTCHOOSER} ] ; then exit 2 fi +# Remove links-to-qtchooser that are no longer needed. +# +# We check in ${BINDIR} -- only **directly** in bindir, hence the +# `-maxdepth 1` -- for symlinks to qtchooser. Those are unversioned +# names (e.g. designer -> qtchooser) for the case where qtchooser +# should pick the right one. +# +# If there aren't any versioned names for the same, remove the link +# (e.g. when designer is removed from the versioned bin/ directory +# under qt5/bin/, then designer -> qtchooser can go as well). +# remove_links() { for file in $(find -L ${BINDIR} -maxdepth 1 -samefile ${QTCHOOSER}) ; do + # Only symlinks count, since qtchooser lives here too if [ ! -L ${file} ] ; then continue fi - # If at least one versioned executable is found for this name, keep the - # qtchooser compatibility symlink for this name; otherwise, remove it. + # If at least one versioned executable is found for this name, + # keep the qtchooser compatibility symlink for this name; + # otherwise, remove it. local found=0 for version in ${VERSIONS} ; do version_bin_dir=${PREFIX}/lib/qt${version}/bin target=${version_bin_dir}/$(basename ${file}) + # Only need to find **one** to keep the link. if [ -x ${target} ] ; then found=1 break @@ -46,11 +66,22 @@ remove_links() { done } +# Create links-to-qtchooser when a versioned application is installed. +# +# We check directly under the versioned bin/ directories, not in subdirectories +# of bin/ -- so we need `-maxdepth 1` -- for names which can be hooked up to +# qtchooser. Each of the names in the versioned bin/ dir is connected to +# qtchooser if there isn't already a link of that name. +# create_links() { for version in ${VERSIONS} ; do version_bin_dir=${PREFIX}/lib/qt${version}/bin if [ -d ${version_bin_dir} ] ; then for file in $(find ${version_bin_dir} -type f -maxdepth 1) ; do + # target is the **unversioned** one (e.g. + # designer, living in bin/) which needs to + # be pointed at qtchooser because there is a + # **versioned** designer in e.g. qt5/bin/. target=${BINDIR}/$(basename ${file}) if [ ! -L ${target} -a ! -f ${target} ] ; then ln -s ${QTCHOOSER} ${target}