git: 0b2876f7efd3 - main - graphics/f3d: avoid using /proc when possible
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 25 Mar 2026 12:31:57 UTC
The branch main has been updated by bapt:
URL: https://cgit.FreeBSD.org/ports/commit/?id=0b2876f7efd38498c9d9d43ab12d684a3828df5c
commit 0b2876f7efd38498c9d9d43ab12d684a3828df5c
Author: Baptiste Daroussin <bapt@FreeBSD.org>
AuthorDate: 2026-03-25 12:30:54 +0000
Commit: Baptiste Daroussin <bapt@FreeBSD.org>
CommitDate: 2026-03-25 12:31:54 +0000
graphics/f3d: avoid using /proc when possible
This patch has also been submitted upstream:
https://github.com/f3d-app/f3d/pull/2972
---
graphics/f3d/Makefile | 1 +
.../f3d/files/patch-application_F3DSystemTools.cxx | 30 ++++++++++++++++++++++
2 files changed, 31 insertions(+)
diff --git a/graphics/f3d/Makefile b/graphics/f3d/Makefile
index ff503a744fda..ff3a598e2d62 100644
--- a/graphics/f3d/Makefile
+++ b/graphics/f3d/Makefile
@@ -1,6 +1,7 @@
PORTNAME= f3d
DISTVERSIONPREFIX= v
DISTVERSION= 3.4.1
+PORTREVISION= 1
CATEGORIES= graphics
MAINTAINER= yuri@FreeBSD.org
diff --git a/graphics/f3d/files/patch-application_F3DSystemTools.cxx b/graphics/f3d/files/patch-application_F3DSystemTools.cxx
new file mode 100644
index 000000000000..4ec193003a24
--- /dev/null
+++ b/graphics/f3d/files/patch-application_F3DSystemTools.cxx
@@ -0,0 +1,30 @@
+--- application/F3DSystemTools.cxx.orig 2025-07-21 09:00:00 UTC
++++ application/F3DSystemTools.cxx
+@@ -15,6 +15,10 @@
+ #ifdef __APPLE__
+ #include <mach-o/dyld.h>
+ #endif
++#ifdef __FreeBSD__
++#include <sys/types.h>
++#include <sys/sysctl.h>
++#endif
+
+ namespace fs = std::filesystem;
+
+@@ -44,7 +48,15 @@ fs::path GetApplicationPath()
+ #else
+ try
+ {
+-#if defined(__FreeBSD__)
++#if defined(__FreeBSD__)
++ int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1 };
++ char buf[PATH_MAX];
++ size_t len = sizeof(buf);
++ if (sysctl(mib, 4, buf, &len, nullptr, 0) == 0)
++ {
++ return fs::path(buf);
++ }
++ // Fallback to procfs if sysctl fails
+ return fs::canonical("/proc/curproc/file");
+ #else
+ return fs::canonical("/proc/self/exe");