Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Mar 2026 12:31:57 +0000
From:      Baptiste Daroussin <bapt@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 0b2876f7efd3 - main - graphics/f3d: avoid using /proc when possible
Message-ID:  <69c3d5bd.40c0d.6cff4a72@gitrepo.freebsd.org>

index | next in thread | raw e-mail

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");


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?69c3d5bd.40c0d.6cff4a72>