Files
ports/devel/android-tools/files/patch-vendor_libbase_file.cpp
T
Baptiste Daroussin 9cfd6164a2 devel/android-tools: update to 35.0.2
Recreate the port from scratch, and base in on the cmakified
https://github.com/nmeum/android-tools

Why recreating from scratch: android-tools has changed a lot since
latest version in the ports tree and it was easier for me to restart
the porting.

The main highlight is: create a libusb base backed for fastboot which now
uses lowlevel usb primitive on other targets.

Test by: flashing GrapheneOS (which requires this version as minimum
requirement and exercise fastboot extensively)
Working on LineageOS, Android and GrapheneOS over adb.

Other tools has not been tested.
Take maintainership

Approved by:		nc (maintainer timeout via email and phabricator)
Differential Revision:	https://reviews.freebsd.org/D56064
2026-04-13 09:22:42 +02:00

26 lines
719 B
C++

--- vendor/libbase/file.cpp 2024-08-29 19:46:57.000000000 +0200
+++ vendor/libbase/file.cpp 2026-03-21 14:02:01.670927000 +0100
@@ -35,6 +35,9 @@
#if defined(__APPLE__)
#include <mach-o/dyld.h>
+#endif
+#if defined(__FreeBSD__)
+#include <sys/sysctl.h>
#endif
#if defined(_WIN32)
#include <direct.h>
@@ -506,6 +509,12 @@
if (result == 0 || result == sizeof(path) - 1) return "";
path[PATH_MAX - 1] = 0;
return path;
+#elif defined(__FreeBSD__)
+ int mib[4] = {CTL_KERN, KERN_PROC, KERN_PROC_PATHNAME, -1};
+ char path[PATH_MAX + 1];
+ size_t path_len = sizeof(path);
+ if (sysctl(mib, 4, path, &path_len, nullptr, 0) < 0) return "";
+ return path;
#elif defined(__EMSCRIPTEN__)
abort();
#else