Date: Fri, 16 Aug 2024 15:11:28 GMT From: Gleb Popov <arrowd@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 521477482bb6 - main - devel/qt6-base: Include QLockFile patch from devel/qt5-core Message-ID: <202408161511.47GFBSHI041240@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by arrowd: URL: https://cgit.FreeBSD.org/ports/commit/?id=521477482bb60d7dbfc9deffb4adbf01c4b56d8c commit 521477482bb60d7dbfc9deffb4adbf01c4b56d8c Author: Gleb Popov <arrowd@FreeBSD.org> AuthorDate: 2024-08-13 20:18:37 +0000 Commit: Gleb Popov <arrowd@FreeBSD.org> CommitDate: 2024-08-16 15:11:25 +0000 devel/qt6-base: Include QLockFile patch from devel/qt5-core Sponsored by: Serenity Cybersecurity, LLC Pull Request: https://github.com/freebsd/freebsd-ports/pull/293 --- devel/qt6-base/Makefile | 1 + .../files/patch-src_corelib_CMakeLists.txt | 13 +++++ .../files/patch-src_corelib_io_qlockfile__unix.cpp | 63 ++++++++++++++++++++++ 3 files changed, 77 insertions(+) diff --git a/devel/qt6-base/Makefile b/devel/qt6-base/Makefile index dd0c5ef4a01e..0053a9754758 100644 --- a/devel/qt6-base/Makefile +++ b/devel/qt6-base/Makefile @@ -1,5 +1,6 @@ PORTNAME= base DISTVERSION= ${QT6_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMEPREFIX= qt6- diff --git a/devel/qt6-base/files/patch-src_corelib_CMakeLists.txt b/devel/qt6-base/files/patch-src_corelib_CMakeLists.txt new file mode 100644 index 000000000000..e574c4c77272 --- /dev/null +++ b/devel/qt6-base/files/patch-src_corelib_CMakeLists.txt @@ -0,0 +1,13 @@ +--- src/corelib/CMakeLists.txt.orig 2024-05-06 23:06:44 UTC ++++ src/corelib/CMakeLists.txt +@@ -381,6 +381,10 @@ endif() + target_link_libraries(Platform INTERFACE Threads::Threads) + endif() + ++if(CMAKE_SYSTEM_NAME STREQUAL FreeBSD) ++ target_link_libraries(Core PRIVATE kvm procstat) ++endif() ++ + # Skip AUTOMOC processing of qobject.cpp and its headers. + # We do this on purpose, because qobject.cpp contains a bunch of Q_GADGET, Q_NAMESPACE, etc + # keywords and AUTOMOC gets confused about wanting to compile a qobject.moc file as well. diff --git a/devel/qt6-base/files/patch-src_corelib_io_qlockfile__unix.cpp b/devel/qt6-base/files/patch-src_corelib_io_qlockfile__unix.cpp new file mode 100644 index 000000000000..73787a319f0b --- /dev/null +++ b/devel/qt6-base/files/patch-src_corelib_io_qlockfile__unix.cpp @@ -0,0 +1,63 @@ +--- src/corelib/io/qlockfile_unix.cpp.orig 2024-08-13 19:47:11 UTC ++++ src/corelib/io/qlockfile_unix.cpp +@@ -46,6 +46,8 @@ + # include <sys/sysctl.h> + # if !defined(Q_OS_NETBSD) + # include <sys/user.h> ++# include <kvm.h> ++# include <libprocstat.h> + # endif + #endif + +@@ -223,23 +225,44 @@ QString QLockFilePrivate::processNameByPid(qint64 pid) + struct kinfo_proc kp; + int mib[6] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, (int)pid, sizeof(struct kinfo_proc), 1 }; + # else ++ QString nameFromProcstat; ++ kvm_t *kvm = kvm_open(nullptr, "/dev/null", nullptr, O_RDONLY, ""); ++ if (kvm) { ++ int cnt; ++ struct kinfo_proc *kp = kvm_getprocs(kvm, KERN_PROC_PID, getpid(), &cnt); ++ if (kp) { ++ struct procstat *ps = procstat_open_sysctl(); ++ char **argv = procstat_getargv(ps, kp, 0); ++ if (argv != nullptr && argv[0] != nullptr) ++ nameFromProcstat = QString::fromLocal8Bit(argv[0]); ++ procstat_close(ps); ++ } ++ kvm_close(kvm); ++ } + struct kinfo_proc kp; + int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PID, (int)pid }; + # endif +- size_t len = sizeof(kp); +- u_int mib_len = sizeof(mib)/sizeof(u_int); ++ if (nameFromProcstat.isEmpty()) { ++ size_t len = sizeof(kp); ++ u_int mib_len = sizeof(mib)/sizeof(u_int); + +- if (sysctl(mib, mib_len, &kp, &len, NULL, 0) < 0) +- return QString(); +- ++ if (sysctl(mib, mib_len, &kp, &len, NULL, 0) < 0) ++ return QString(); ++ } + # if defined(Q_OS_OPENBSD) || defined(Q_OS_NETBSD) + if (kp.p_pid != pid) + return QString(); + QString name = QFile::decodeName(kp.p_comm); + # else +- if (kp.ki_pid != pid) ++ QString name; ++ if (!nameFromProcstat.isEmpty()) { ++ QFileInfo fi(nameFromProcstat); ++ name = fi.fileName(); ++ } ++ else if (kp.ki_pid != pid) + return QString(); +- QString name = QFile::decodeName(kp.ki_comm); ++ else ++ name = QFile::decodeName(kp.ki_comm); + # endif + return name; + #elif defined(Q_OS_QNX)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202408161511.47GFBSHI041240>