ports/biology/sra-tools/files/patch-tools_external_driver-tool_file-path.posix.cpp
Jason W. Bacon 0f2f80ca38 biology/sra-tools: Update to 3.0.6
Major code and build system rework since 2.11
Now supports aarch64, unblocking rna-seq and atac-seq metaports
Changes: https://github.com/ncbi/sra-tools/commits/master

Reported by:    portscout
2023-08-10 12:17:24 -05:00

20 lines
892 B
C++

--- tools/external/driver-tool/file-path.posix.cpp.orig 2023-07-10 16:23:35 UTC
+++ tools/external/driver-tool/file-path.posix.cpp
@@ -193,7 +193,16 @@ static char const *find_executable_path(char const *co
FilePath FilePath::fullPathToExecutable(char const *const *const argv, char const *const *const envp, char const *const *const extra)
{
char const *path;
-#if LINUX
+// Assume sra-tools is installed by FreeBSD ports. FreeBSD users
+// don't often install software by other means. Default prefix
+// is /usr/local, but this can be overridden by the user building
+// the port. The port can replace /usr/local using sed if that's the
+// case.
+#if BSD
+ char full_path[PATH_MAX];
+ snprintf(full_path, PATH_MAX, "/usr/local/bin/%s", argv[0]);
+ path = full_path;
+#elif LINUX
path = "/proc/self/exe";
#elif MAC
path = find_executable_path(extra, argv[0]);