Index: head/misc/qtchooser/Makefile =================================================================== --- head/misc/qtchooser/Makefile (revision 528446) +++ head/misc/qtchooser/Makefile (revision 528447) @@ -1,56 +1,56 @@ # $FreeBSD$ PORTNAME= qtchooser PORTVERSION= 66 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= misc MASTER_SITES= QT/official_releases/${PORTNAME} DIST_SUBDIR= KDE/Qt/qtchooser MAINTAINER= kde@FreeBSD.org COMMENT= Qt tool wrapper LICENSE= GPLv3 LGPL21 LICENSE_COMB= dual USES= gmake tar:xz DESTDIRNAME= INSTALL_ROOT MAKE_ARGS= prefix=${PREFIX} SUB_FILES= update-qtchooser-wrapper # Keep this synchronized with qt.mk SUB_LIST= QT_SUPPORTED="5" # bin/linguist CONFLICTS_INSTALL= rubygem-github-linguist rubygem-github-linguist47 rubygem-gitlab-linguist QT_QTCHOOSERDIR=${PREFIX}/etc/xdg/qtchooser post-patch: @${REINPLACE_CMD} -e 's,/etc/xdg,${LOCALBASE}/etc/xdg,' \ ${WRKSRC}/src/${PORTNAME}/main.cpp post-install: # Install qtchooser config file. Note this is not optimal. # -> we could install the qtchooser config files via devel/qmake[45]. # 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 # 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. ${MKDIR} ${STAGEDIR}${QT_QTCHOOSERDIR} .for qt_version in 4 5 ${ECHO} ${PREFIX}/lib/qt${qt_version}/bin > ${STAGEDIR}${QT_QTCHOOSERDIR}/qt${qt_version}.conf ${ECHO} ${PREFIX}/lib/qt${qt_version} >> ${STAGEDIR}${QT_QTCHOOSERDIR}/qt${qt_version}.conf .endfor # Install man page. ${INSTALL_DATA} ${WRKSRC}/doc/qtchooser.1 ${STAGEDIR}${MAN1PREFIX}/man/man1 # Create the default profile. cd ${STAGEDIR}/${QT_QTCHOOSERDIR} && ${LN} -s qt5.conf default.conf ${INSTALL_SCRIPT} ${WRKDIR}/update-qtchooser-wrapper \ ${STAGEDIR}${PREFIX}/bin/update-qtchooser-wrapper .include Index: head/misc/qtchooser/files/update-qtchooser-wrapper.in =================================================================== --- head/misc/qtchooser/files/update-qtchooser-wrapper.in (revision 528446) +++ head/misc/qtchooser/files/update-qtchooser-wrapper.in (revision 528447) @@ -1,70 +1,64 @@ #!/bin/sh # $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`. # # 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. PREFIX=%%PREFIX%% BINDIR=${PREFIX}/bin QTCHOOSER=${BINDIR}/qtchooser VERSIONS=%%QT_SUPPORTED%% if [ ! -d ${BINDIR} ] ; then echo "Binary directory '${BINDIR}' missing." >&2 exit 1 fi if [ ! -x ${QTCHOOSER} ] ; then echo "Qtchooser binary '${QTCHOOSER}' missing." >&2 exit 2 fi remove_links() { - echo "Removing qtchooser links" for file in $(find -L ${BINDIR} -maxdepth 1 -samefile ${QTCHOOSER}) ; do 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. local found=0 for version in ${VERSIONS} ; do version_bin_dir=${PREFIX}/lib/qt${version}/bin target=${version_bin_dir}/$(basename ${file}) if [ -x ${target} ] ; then found=1 break fi done if [ ${found} -eq 0 ] ; then - echo " ${file}" rm ${file} fi done - echo "done" } create_links() { - echo "Creating qtchooser 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=${BINDIR}/$(basename ${file}) if [ ! -L ${target} -a ! -f ${target} ] ; then - echo " ${target}" ln -s ${QTCHOOSER} ${target} fi done fi done - echo "done" } remove_links create_links