Wednesday, September 16, 2026

Re: UPDATE: SDL3 - getexecpath()

On Fri, 11 Sep 2026 02:56:32 -0400 Brad Smith <brad@comstyle.com> wrote: > Here is a diff to SDL3 to add getexecpath() support. Thanks, Brad! I committed it, with a reminder XXX to clean up more once getexecpath(3) is established enough to remove the workaround. I think we can make upstream quite happy then with the simplification of that part of SDL. > > > Index: Makefile > =================================================================== > RCS file: /cvs/ports/devel/sdl3/Makefile,v > retrieving revision 1.9 > diff -u -p -u -p -r1.9 Makefile > --- Makefile 8 Sep 2026 12:45:28 -0000 1.9 > +++ Makefile 11 Sep 2026 06:31:18 -0000 > @@ -3,6 +3,7 @@ COMMENT = cross-platform multimedia lib > V = 3.4.16 > DISTNAME = SDL3-${V} > PKGNAME = ${DISTNAME:L} > +REVISION = 0 > > SHARED_LIBS += SDL3 0.1 # 3.4.0 > > Index: patches/patch-CMakeLists_txt > =================================================================== > RCS file: patches/patch-CMakeLists_txt > diff -N patches/patch-CMakeLists_txt > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-CMakeLists_txt 11 Sep 2026 06:31:18 -0000 > @@ -0,0 +1,14 @@ > +- fs: Use getexecpath() on OpenBSD for GetExePath(). > + b7606be372bff4f434d0e2e06ca8a1edd249cde4 > + > +Index: CMakeLists.txt > +--- CMakeLists.txt.orig > ++++ CMakeLists.txt > +@@ -1159,6 +1159,7 @@ if(SDL_LIBC) > + > + if(NOT WINDOWS) > + check_symbol_exists(fdatasync "unistd.h" HAVE_FDATASYNC) > ++ check_symbol_exists(getexecpath "unistd.h" HAVE_GETEXECPATH) > + check_symbol_exists(gethostname "unistd.h" HAVE_GETHOSTNAME) > + check_symbol_exists(getpagesize "unistd.h" HAVE_GETPAGESIZE) > + check_symbol_exists(getresgid "unistd.h" HAVE_GETRESGID) > Index: patches/patch-include_build_config_SDL_build_config_h_cmake > =================================================================== > RCS file: patches/patch-include_build_config_SDL_build_config_h_cmake > diff -N patches/patch-include_build_config_SDL_build_config_h_cmake > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ > patches/patch-include_build_config_SDL_build_config_h_cmake 11 > Sep 2026 06:31:18 -0000 @@ -0,0 +1,14 @@ +- fs: Follow up to the > initial getexecpath() support > + c545b20bd7fbd536a37c00271e6d474acc861a34 > + > +Index: include/build_config/SDL_build_config.h.cmake > +--- include/build_config/SDL_build_config.h.cmake.orig > ++++ include/build_config/SDL_build_config.h.cmake > +@@ -73,6 +73,7 @@ > + #cmakedefine HAVE_DLOPEN 1 > + #cmakedefine HAVE_MALLOC 1 > + #cmakedefine HAVE_FDATASYNC 1 > ++#cmakedefine HAVE_GETEXECPATH 1 > + #cmakedefine HAVE_GETENV 1 > + #cmakedefine HAVE_GETHOSTNAME 1 > + #cmakedefine HAVE_SETENV 1 > Index: patches/patch-src_filesystem_unix_SDL_sysfilesystem_c > =================================================================== > RCS file: patches/patch-src_filesystem_unix_SDL_sysfilesystem_c > diff -N patches/patch-src_filesystem_unix_SDL_sysfilesystem_c > --- /dev/null 1 Jan 1970 00:00:00 -0000 > +++ patches/patch-src_filesystem_unix_SDL_sysfilesystem_c 11 > Sep 2026 06:31:18 -0000 @@ -0,0 +1,41 @@ > +- fs: Use getexecpath() on OpenBSD for GetExePath(). > + b7606be372bff4f434d0e2e06ca8a1edd249cde4 > +- fs: Follow up to the initial getexecpath() support > + c545b20bd7fbd536a37c00271e6d474acc861a34 > + > +Index: src/filesystem/unix/SDL_sysfilesystem.c > +--- src/filesystem/unix/SDL_sysfilesystem.c.orig > ++++ src/filesystem/unix/SDL_sysfilesystem.c > +@@ -71,7 +71,7 @@ static char *readSymLink(const char *path) > + return NULL; > + } > + > +-#ifdef SDL_PLATFORM_OPENBSD > ++#if defined(SDL_PLATFORM_OPENBSD) && !defined(HAVE_GETEXECPATH) > + static char *search_path_for_binary(const char *bin) > + { > + const char *envr_real = SDL_getenv("PATH"); > +@@ -138,6 +138,15 @@ static char *GetExePath(void) > + } > +

No comments:

Post a Comment