Index: Mk/Uses/qt-dist.mk =================================================================== --- Mk/Uses/qt-dist.mk +++ Mk/Uses/qt-dist.mk @@ -380,5 +380,9 @@ >> ${TMPPLIST} . endif # ${QT_CONFIG:N-*} . endif # M5 - +# Handle misc/qtchooser wrapper installation and deinstallation +. if defined(QT_BINARIES) + ${ECHO_CMD} '@postexec if type update-qtchooser-wrapper >/dev/null 2>&1; then update-qtchooser-wrapper; fi' >> ${TMPPLIST} + ${ECHO_CMD} '@postunexec if type update-qtchooser-wrapper >/dev/null 2>&1; then update-qtchooser-wrapper; fi' >> ${TMPPLIST} +. endif .endif # defined(_QT_DIST_MK_INCLUDED) Index: comms/qt5-serialbus/Makefile =================================================================== --- comms/qt5-serialbus/Makefile +++ comms/qt5-serialbus/Makefile @@ -2,6 +2,7 @@ PORTNAME= serialbus DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= comms PKGNAMEPREFIX= qt5- @@ -11,5 +12,6 @@ USES= compiler:c++11-lib qmake qt-dist:5,serialbus USE_QT= core network serialport buildtools_build USE_LDCONFIG= ${PREFIX}/${QT_LIBDIR_REL} +QT_BINARIES= yes .include Index: devel/qt5-assistant/Makefile =================================================================== --- devel/qt5-assistant/Makefile +++ devel/qt5-assistant/Makefile @@ -2,6 +2,7 @@ PORTNAME= assistant DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -11,6 +12,7 @@ USES= compiler:c++11-lang qmake qt-dist:5,tools USE_QT= core gui help network printsupport sql widgets \ buildtools_build sql-sqlite3_run +QT_BINARIES= yes DESKTOP_ENTRIES="Qt 5 Assistant" "" \ "${PREFIX}/share/pixmaps/assistant-qt5.png" \ Index: devel/qt5-buildtools/Makefile =================================================================== --- devel/qt5-buildtools/Makefile +++ devel/qt5-buildtools/Makefile @@ -2,6 +2,7 @@ PORTNAME= buildtools DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -12,6 +13,7 @@ HAS_CONFIGURE= yes CONFIGURE_ARGS= -no-gui -no-xcb USE_LDCONFIG= ${PREFIX}/${QT_LIBDIR_REL} +QT_BINARIES= yes BUILD_WRKSRC= ${WRKSRC}/src/tools/bootstrap INSTALL_WRKSRC= ${BUILD_WRKSRC} Index: devel/qt5-core/Makefile =================================================================== --- devel/qt5-core/Makefile +++ devel/qt5-core/Makefile @@ -2,6 +2,7 @@ PORTNAME= core DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -30,6 +31,7 @@ BUILD_WRKSRC= ${WRKSRC}/src/corelib INSTALL_WRKSRC= ${BUILD_WRKSRC} +QT_BINARIES= yes QT_DEFINES= GLIB QT_CONFIG= glib icu Index: devel/qt5-dbus/Makefile =================================================================== --- devel/qt5-dbus/Makefile +++ devel/qt5-dbus/Makefile @@ -2,6 +2,7 @@ PORTNAME= dbus DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -21,6 +22,7 @@ TOOLS= qdbuscpp2xml qdbusxml2cpp +QT_BINARIES= yes QT_DEFINES= DBUS QT_CONFIG= dbus Index: devel/qt5-designer/Makefile =================================================================== --- devel/qt5-designer/Makefile +++ devel/qt5-designer/Makefile @@ -2,6 +2,7 @@ PORTNAME= designer DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -20,6 +21,8 @@ BUILD_WRKSRC= ${WRKSRC}/src/${PORTNAME} INSTALL_WRKSRC= ${WRKSRC}/src/${PORTNAME} + +QT_BINARIES= yes OPTIONS_DEFINE= WEBKIT OPTIONS_SUB= yes Index: devel/qt5-help/Makefile =================================================================== --- devel/qt5-help/Makefile +++ devel/qt5-help/Makefile @@ -2,6 +2,7 @@ PORTNAME= help DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -15,5 +16,7 @@ BUILD_WRKSRC= ${WRKSRC}/src/assistant INSTALL_WRKSRC= ${WRKSRC}/src/assistant + +QT_BINARIES= yes .include Index: devel/qt5-linguist/Makefile =================================================================== --- devel/qt5-linguist/Makefile +++ devel/qt5-linguist/Makefile @@ -2,6 +2,7 @@ PORTNAME= linguist DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -20,6 +21,8 @@ BUILD_WRKSRC= ${WRKSRC}/src/${PORTNAME}/${PORTNAME} INSTALL_WRKSRC= ${WRKSRC}/src/${PORTNAME}/${PORTNAME} + +QT_BINARIES= yes post-install: ${INSTALL_DATA} ${BUILD_WRKSRC}/images/icons/linguist-128-32.png \ Index: devel/qt5-linguisttools/Makefile =================================================================== --- devel/qt5-linguisttools/Makefile +++ devel/qt5-linguisttools/Makefile @@ -2,6 +2,7 @@ PORTNAME= linguisttools DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -13,6 +14,8 @@ BUILD_WRKSRC= ${WRKSRC}/src/linguist INSTALL_WRKSRC= ${WRKSRC}/src/linguist + +QT_BINARIES= yes post-patch: @${REINPLACE_CMD} -e '/SUBDIRS.*linguist/ d' \ Index: devel/qt5-qdbus/Makefile =================================================================== --- devel/qt5-qdbus/Makefile +++ devel/qt5-qdbus/Makefile @@ -2,6 +2,7 @@ PORTNAME= qdbus DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -13,5 +14,7 @@ BUILD_WRKSRC= ${WRKSRC}/src/${PORTNAME}/${PORTNAME} INSTALL_WRKSRC= ${BUILD_WRKSRC} + +QT_BINARIES= yes .include Index: devel/qt5-qdbusviewer/Makefile =================================================================== --- devel/qt5-qdbusviewer/Makefile +++ devel/qt5-qdbusviewer/Makefile @@ -2,6 +2,7 @@ PORTNAME= qdbusviewer DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -18,6 +19,8 @@ BUILD_WRKSRC= ${WRKSRC}/src/qdbus/${PORTNAME} INSTALL_WRKSRC= ${BUILD_WRKSRC} + +QT_BINARIES= yes post-install: ${INSTALL_DATA} ${BUILD_WRKSRC}/images/qdbusviewer-128.png \ Index: devel/qt5-qdoc/Makefile =================================================================== --- devel/qt5-qdoc/Makefile +++ devel/qt5-qdoc/Makefile @@ -2,6 +2,7 @@ PORTNAME= qdoc DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel textproc PKGNAMEPREFIX= qt5- @@ -20,5 +21,7 @@ PLIST_FILES= ${QT_BINDIR}/qdoc CONFIGURE_ENV= LLVM_INSTALL_DIR=${LOCALBASE}/llvm${LLVM_DEFAULT} + +QT_BINARIES= yes .include Index: devel/qt5-qmake/Makefile =================================================================== --- devel/qt5-qmake/Makefile +++ devel/qt5-qmake/Makefile @@ -2,6 +2,7 @@ PORTNAME= qmake DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -31,6 +32,8 @@ INSTALL_TARGET= sub-qmake-qmake-aux-pro-install_subtargets install_mkspecs BUILD_WRKSRC= ${WRKSRC}/${PORTNAME} + +QT_BINARIES= yes post-patch: # Clean up files created by patching Index: devel/qt5-remoteobjects/Makefile =================================================================== --- devel/qt5-remoteobjects/Makefile +++ devel/qt5-remoteobjects/Makefile @@ -2,6 +2,7 @@ PORTNAME= remoteobjects DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -13,5 +14,7 @@ USE_QT= core declarative network \ buildtools_build USE_LDCONFIG= ${PREFIX}/${QT_LIBDIR_REL} + +QT_BINARIES= yes .include Index: devel/qt5-scxml/Makefile =================================================================== --- devel/qt5-scxml/Makefile +++ devel/qt5-scxml/Makefile @@ -2,6 +2,7 @@ PORTNAME= scxml DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt5- @@ -11,5 +12,7 @@ USES= compiler:c++11-lang qmake qt-dist:5,scxml USE_QT= core declarative network buildtools_build USE_LDCONFIG= ${PREFIX}/${QT_LIBDIR_REL} + +QT_BINARIES= yes .include Index: graphics/qt5-3d/Makefile =================================================================== --- graphics/qt5-3d/Makefile +++ graphics/qt5-3d/Makefile @@ -2,6 +2,7 @@ PORTNAME= 3d DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= graphics PKGNAMEPREFIX= qt5- @@ -14,5 +15,7 @@ USE_QT= concurrent core declarative gui network buildtools_build USE_LDCONFIG= ${PREFIX}/${QT_LIBDIR_REL} + +QT_BINARIES= yes .include Index: graphics/qt5-pixeltool/Makefile =================================================================== --- graphics/qt5-pixeltool/Makefile +++ graphics/qt5-pixeltool/Makefile @@ -2,6 +2,7 @@ PORTNAME= pixeltool DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= graphics PKGNAMEPREFIX= qt5- @@ -19,5 +20,7 @@ BUILD_WRKSRC= ${WRKSRC}/src/${PORTNAME} INSTALL_WRKSRC= ${BUILD_WRKSRC} + +QT_BINARIES= yes .include Index: graphics/qt5-wayland/Makefile =================================================================== --- graphics/qt5-wayland/Makefile +++ graphics/qt5-wayland/Makefile @@ -2,6 +2,7 @@ PORTNAME= wayland DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= graphics PKGNAMEPREFIX= qt5- @@ -22,5 +23,7 @@ USE_XORG= x11 xcomposite USE_LDCONFIG= ${PREFIX}/${QT_LIBDIR_REL} + +QT_BINARIES= yes .include Index: misc/qtchooser/Makefile =================================================================== --- misc/qtchooser/Makefile +++ misc/qtchooser/Makefile @@ -2,6 +2,7 @@ PORTNAME= qtchooser PORTVERSION= 66 +PORTREVISION= 1 CATEGORIES= misc MASTER_SITES= QT/official_releases/${PORTNAME} DIST_SUBDIR= KDE/Qt/qtchooser @@ -16,6 +17,10 @@ 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 @@ -44,5 +49,8 @@ ${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: misc/qtchooser/files/patch-Makefile =================================================================== --- misc/qtchooser/files/patch-Makefile +++ misc/qtchooser/files/patch-Makefile @@ -1,6 +1,10 @@ ---- Makefile.orig 2018-10-08 18:18:42 UTC +--- Makefile.orig 2018-05-04 07:41:32 UTC +++ Makefile -@@ -70,8 +70,8 @@ install: +@@ -66,12 +66,11 @@ distclean: + + install: + cd src/qtchooser && $(MAKE) install +- for tool in $(TOOLS); do ln -sf qtchooser "$(INSTALL_ROOT)$(bindir)/$$tool"; done case `uname -s` in Darwin) \ for tool in $(MACTOOLS); do ln -sf qtchooser "$(INSTALL_ROOT)$(bindir)/$$tool"; done \ ;; esac Index: misc/qtchooser/files/update-qtchooser-wrapper.in =================================================================== --- /dev/null +++ misc/qtchooser/files/update-qtchooser-wrapper.in @@ -0,0 +1,70 @@ +#!/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 Index: misc/qtchooser/pkg-plist =================================================================== --- misc/qtchooser/pkg-plist +++ misc/qtchooser/pkg-plist @@ -1,50 +1,5 @@ -bin/assistant -bin/designer -bin/lconvert -bin/linguist -bin/lrelease -bin/lupdate -bin/moc -bin/pixeltool -bin/qcollectiongenerator -bin/qdbus -bin/qdbuscpp2xml -bin/qdbusviewer -bin/qdbusxml2cpp -bin/qdoc -bin/qdoc3 -bin/qgltf -bin/qhelpconverter -bin/qhelpgenerator -bin/qlalr -bin/qmake -bin/qml -bin/qml1plugindump -bin/qmlbundle -bin/qmlcachegen -bin/qmleasing -bin/qmlimportscanner -bin/qmljs -bin/qmllint -bin/qmlmin -bin/qmlplugindump -bin/qmlprofiler -bin/qmlscene -bin/qmltestrunner -bin/qmlviewer -bin/qtattributionsscanner bin/qtchooser -bin/qtconfig -bin/qtdiag -bin/qtpaths -bin/qtplugininfo -bin/qvkgen -bin/rcc -bin/repc -bin/uic -bin/uic3 -bin/xmlpatterns -bin/xmlpatternsvalidator +bin/update-qtchooser-wrapper etc/xdg/qtchooser/default.conf etc/xdg/qtchooser/qt4.conf etc/xdg/qtchooser/qt5.conf Index: sysutils/qt5-qtdiag/Makefile =================================================================== --- sysutils/qt5-qtdiag/Makefile +++ sysutils/qt5-qtdiag/Makefile @@ -2,6 +2,7 @@ PORTNAME= qtdiag DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= sysutils PKGNAMEPREFIX= qt5- @@ -18,6 +19,8 @@ # will look for a lot more dependencies for other tools such as lupdate, which # we do not really have to depend on. WRKSRC_SUBDIR= src/${PORTNAME} + +QT_BINARIES= yes post-patch: ${CP} ${WRKSRC}/../../.qmake.conf ${WRKSRC} Index: sysutils/qt5-qtpaths/Makefile =================================================================== --- sysutils/qt5-qtpaths/Makefile +++ sysutils/qt5-qtpaths/Makefile @@ -2,6 +2,7 @@ PORTNAME= qtpaths DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= sysutils PKGNAMEPREFIX= qt5- @@ -18,6 +19,8 @@ # will look for a lot more dependencies for other tools such as lupdate, which # we do not really have to depend on. WRKSRC_SUBDIR= src/${PORTNAME} + +QT_BINARIES= yes post-patch: ${CP} ${WRKSRC}/../../.qmake.conf ${WRKSRC} Index: sysutils/qt5-qtplugininfo/Makefile =================================================================== --- sysutils/qt5-qtplugininfo/Makefile +++ sysutils/qt5-qtplugininfo/Makefile @@ -2,6 +2,7 @@ PORTNAME= qtplugininfo DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= sysutils PKGNAMEPREFIX= qt5- @@ -18,6 +19,8 @@ # will look for a lot more dependencies for other tools such as lupdate, which # we do not really have to depend on. WRKSRC_SUBDIR= src/${PORTNAME} + +QT_BINARIES= yes post-patch: ${CP} ${WRKSRC}/../../.qmake.conf ${WRKSRC} Index: textproc/qt5-xmlpatterns/Makefile =================================================================== --- textproc/qt5-xmlpatterns/Makefile +++ textproc/qt5-xmlpatterns/Makefile @@ -2,6 +2,7 @@ PORTNAME= xmlpatterns DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= textproc PKGNAMEPREFIX= qt5- @@ -11,5 +12,7 @@ USES= compiler:c++11-lang qmake:norecursive qt-dist:5,xmlpatterns USE_QT= core network buildtools_build USE_LDCONFIG= ${PREFIX}/${QT_LIBDIR_REL} + +QT_BINARIES= yes .include Index: www/qt5-webengine/Makefile =================================================================== --- www/qt5-webengine/Makefile +++ www/qt5-webengine/Makefile @@ -18,6 +18,7 @@ PORTNAME= webengine DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= www PKGNAMEPREFIX= qt5- @@ -109,6 +110,8 @@ C_INCLUDE_PATH=${LOCALBASE}/include \ CPLUS_INCLUDE_PATH=${LOCALBASE}/include \ ${CONFIGURE_ENV} + +QT_BINARIES= yes .include Index: x11-toolkits/qt5-declarative/Makefile =================================================================== --- x11-toolkits/qt5-declarative/Makefile +++ x11-toolkits/qt5-declarative/Makefile @@ -2,6 +2,7 @@ PORTNAME= declarative DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= x11-toolkits PKGNAMEPREFIX= qt5- @@ -17,6 +18,7 @@ CONFLICTS= qt5-declarative-render2d-* qt5-qml qt5-quick +QT_BINARIES= yes QT_DEFINES= ACCESSIBILITY QT_CONFIG= accessibility accessibility-atspi-bridge Index: x11-toolkits/qt5-gui/Makefile =================================================================== --- x11-toolkits/qt5-gui/Makefile +++ x11-toolkits/qt5-gui/Makefile @@ -2,7 +2,7 @@ PORTNAME= gui DISTVERSION= ${QT5_VERSION} -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= x11-toolkits graphics PKGNAMEPREFIX= qt5- @@ -65,6 +65,7 @@ # openglextensions is the static library to use for further things like qtcanvas3d MORE_WRKSRCS+= src/openglextensions +QT_BINARIES= yes QT_DEFINES= ACCESSIBILITY DBUS FONTCONFIG FREETYPE GLIB \ IMAGEFORMAT_PNG OPENGL SHAPE XCB XKB XKBCOMMON XRENDER QT_CONFIG= accessibility accessibility-atspi-bridge dbus \ Index: x11-toolkits/qt5-widgets/Makefile =================================================================== --- x11-toolkits/qt5-widgets/Makefile +++ x11-toolkits/qt5-widgets/Makefile @@ -2,6 +2,7 @@ PORTNAME= widgets DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= x11-toolkits PKGNAMEPREFIX= qt5- @@ -19,6 +20,7 @@ MORE_WRKSRCS= src/tools/uic +QT_BINARIES= yes QT_DEFINES= ACCESSIBILITY WIDGETS XSYNC QT_CONFIG= accessibility accessibility-atspi-bridge xlib Index: x11/qt5-qev/Makefile =================================================================== --- x11/qt5-qev/Makefile +++ x11/qt5-qev/Makefile @@ -2,6 +2,7 @@ PORTNAME= qev DISTVERSION= ${QT5_VERSION} +PORTREVISION= 1 CATEGORIES= x11 PKGNAMEPREFIX= qt5- @@ -12,6 +13,8 @@ USE_QT= core widgets WRKSRC_SUBDIR= src/${PORTNAME} + +QT_BINARIES= yes # qev is not connected to qttool's build system, so we cannot just run qmake qt-dist:5,tools # and set {BUILD,INSTALL}_WRKSRC.