From: Stuart Henderson Subject: qt5 getexecpath To: Rafael Sadowski Cc: ports , Christian Weisgerber Date: Mon, 28 Sep 2026 12:24:17 +0100 I noticed that qt6 has a getexecpath patch, but qt5 doesn't, this ports it across. Bonus fix to unbreak builds if ccache is enabled which I ran into when building qt5, but I noticed the same affects a bunch of other ports. Ports infra takes care of ccache and individual ports should not normally be testing USE_CCACHE, though there is a valid exception in sysutils/u-boot. Normally just set configure flags to disable anything in upstream's build infra relating to ccache; ports already places wrappers as needed and sets up env vars. Not sure if it really needs to go in for 8.0 but at least the ccache thing is annoying. Index: x11/qt5/qtbase/Makefile =================================================================== RCS file: /cvs/ports/x11/qt5/qtbase/Makefile,v diff -u -p -r1.81 Makefile --- x11/qt5/qtbase/Makefile 21 May 2026 19:25:26 -0000 1.81 +++ x11/qt5/qtbase/Makefile 28 Sep 2026 11:07:14 -0000 @@ -2,6 +2,7 @@ QT5NAME = QtBase KDE_COMMIT = c68297f66533200c9ff626b056d096c78b4b94db KDE_VERSION = 0 +REVISION-main = 0 COMMENT-main = C++ general-purpose toolkit COMMENT-global = global Qt5 documentation internals @@ -179,6 +180,7 @@ CONFIGURE_ARGS += -accessibility \ -dbus-linked \ -glib \ -icu \ + -no-ccache \ -opengl desktop \ -openssl-linked \ -pkg-config \ @@ -249,9 +251,3 @@ post-install: cd ${PREFIX}/lib/qt5 && ln -sf ../../include/X11/qt5 include .include - -.if ${USE_CCACHE:L} == "yes" -CONFIGURE_ARGS += -ccache -.else -CONFIGURE_ARGS += -no-ccache -.endif Index: x11/qt5/qtbase/patches/patch-src_corelib_kernel_qcoreapplication_cpp =================================================================== RCS file: x11/qt5/qtbase/patches/patch-src_corelib_kernel_qcoreapplication_cpp diff -N x11/qt5/qtbase/patches/patch-src_corelib_kernel_qcoreapplication_cpp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ x11/qt5/qtbase/patches/patch-src_corelib_kernel_qcoreapplication_cpp 28 Sep 2026 11:07:14 -0000 @@ -0,0 +1,17 @@ +Index: src/corelib/kernel/qcoreapplication.cpp +--- src/corelib/kernel/qcoreapplication.cpp.orig ++++ src/corelib/kernel/qcoreapplication.cpp +@@ -2343,6 +2343,13 @@ QString QCoreApplication::applicationFilePath() + QCoreApplicationPrivate::setApplicationFilePath(pfi.canonicalFilePath()); + return *QCoreApplicationPrivate::cachedApplicationFilePath; + } ++# elif defined(Q_OS_OPENBSD) ++ char buffer[PATH_MAX]; ++ qsizetype len = 0; ++ if (getexecpath(buffer, sizeof buffer) == 0) { ++ len = strlen(buffer); ++ return QFile::decodeName(QByteArray::fromRawData(buffer, len)); ++ } + # endif + if (!arguments().isEmpty()) { + QString argv0 = QFile::decodeName(arguments().at(0).toLocal8Bit()); Index: x11/qt6/Makefile.inc =================================================================== RCS file: /cvs/ports/x11/qt6/Makefile.inc,v diff -u -p -r1.14 Makefile.inc --- x11/qt6/Makefile.inc 10 Aug 2025 14:45:17 -0000 1.14 +++ x11/qt6/Makefile.inc 28 Sep 2026 11:07:14 -0000 @@ -40,12 +40,7 @@ CXXFLAGS += -I${LOCALBASE}/include MODCMAKE_LDFLAGS += -L${LOCALBASE}/lib CONFIGURE_ARGS += -DQT_GENERATE_SBOM=OFF - -.if defined(USE_CCACHE) && ${USE_CCACHE:L} == "yes" -CONFIGURE_ARGS += -DQT_USE_CCACHE=ON -.else CONFIGURE_ARGS += -DQT_USE_CCACHE=OFF -.endif SUBST_VARS += VERSION Index: graphics/digikam/Makefile =================================================================== RCS file: /cvs/ports/graphics/digikam/Makefile,v diff -u -p -r1.117 Makefile --- graphics/digikam/Makefile 9 Jun 2026 12:31:58 -0000 1.117 +++ graphics/digikam/Makefile 28 Sep 2026 11:06:48 -0000 @@ -152,7 +152,3 @@ TEST_IS_INTERACTIVE = X11 MODCMAKE_LDFLAGS = -L${LOCALBASE}/lib .include - -.if ${USE_CCACHE:L} == "yes" -CONFIGURE_ARGS += -DBUILD_WITH_CCACHE=0N -.endif Index: graphics/exiv2/Makefile =================================================================== RCS file: /cvs/ports/graphics/exiv2/Makefile,v diff -u -p -r1.53 Makefile --- graphics/exiv2/Makefile 31 Aug 2026 06:33:28 -0000 1.53 +++ graphics/exiv2/Makefile 28 Sep 2026 11:06:48 -0000 @@ -39,6 +39,3 @@ FIX_CRLF_FILES= cmake/compilerFlags.cma NO_TEST= Yes .include -.if ${USE_CCACHE:L} == "yes" -CONFIGURE_ARGS += -DBUILD_WITH_CCACHE=0N -.endif Index: graphics/openimageio/Makefile =================================================================== RCS file: /cvs/ports/graphics/openimageio/Makefile,v diff -u -p -r1.88 Makefile --- graphics/openimageio/Makefile 22 Sep 2026 19:14:37 -0000 1.88 +++ graphics/openimageio/Makefile 28 Sep 2026 11:06:48 -0000 @@ -73,8 +73,3 @@ WANTLIB += atomic .endif .include - -# fix build when ccache is installed but not enabled -.if ${USE_CCACHE:L} != "yes" -CONFIGURE_ARGS += -DWITH_CCACHE=OFF -.endif Index: net/bitcoin/Makefile =================================================================== RCS file: /cvs/ports/net/bitcoin/Makefile,v diff -u -p -r1.60 Makefile --- net/bitcoin/Makefile 23 Sep 2026 10:46:30 -0000 1.60 +++ net/bitcoin/Makefile 28 Sep 2026 11:06:48 -0000 @@ -36,7 +36,8 @@ WANTLIB += m sqlite3 zmq CONFIGURE_ARGS = -DCMAKE_DISABLE_FIND_PACKAGE_Git=ON \ -DCMAKE_DISABLE_FIND_PACKAGE_Doxygen=ON \ - -DCMAKE_DISABLE_FIND_PACKAGE_Python3=ON + -DCMAKE_DISABLE_FIND_PACKAGE_Python3=ON \ + -DWITH_CCACHE=OFF CONFIGURE_ARGS += -DWITH_ZMQ=ON @@ -86,8 +87,3 @@ post-install: .endif .include - -# fix build when ccache is installed but not enabled -.if ${USE_CCACHE:L} != "yes" -CONFIGURE_ARGS += -DWITH_CCACHE=OFF -.endif Index: net/litecoin/Makefile =================================================================== RCS file: /cvs/ports/net/litecoin/Makefile,v diff -u -p -r1.28 Makefile --- net/litecoin/Makefile 23 Sep 2026 10:46:30 -0000 1.28 +++ net/litecoin/Makefile 28 Sep 2026 11:06:48 -0000 @@ -45,7 +45,8 @@ AUTOMAKE_VERSION = 1.16 AUTORECONF = ./autogen.sh CONFIGURE_ARGS += --with-incompatible-bdb \ --with-sqlite=yes \ - --disable-bip70 + --disable-bip70 \ + --disable-ccache CONFIGURE_ENV += CPPFLAGS="-I${LOCALBASE}/include/db4 -I${LOCALBASE}/include" \ LDFLAGS="-L${LOCALBASE}/lib/db4 -L${LOCALBASE}/lib" @@ -127,8 +128,3 @@ post-install: .endif .include - -# fix build when ccache is installed but not enabled -.if ${USE_CCACHE:L} != "yes" -CONFIGURE_ARGS += --disable-ccache -.endif