audio/dexed: Add better workaround for broken ENVIRON(7) in shared libraries

This commit is contained in:
Yuri Victorovich 2022-10-16 16:42:04 -07:00
parent 391630db44
commit 4838430844
2 changed files with 8 additions and 6 deletions

View File

@ -2,7 +2,7 @@ PORTNAME= dexed
DISTVERSIONPREFIX= v
DISTVERSION= 0.9.6-16
DISTVERSIONSUFFIX= -g1df9a58
PORTREVISION= 4
PORTREVISION= 5
CATEGORIES= audio
PKGNAMESUFFIX= -synth

View File

@ -1,22 +1,24 @@
- otherwise it fails with unknown 'environ' symbol, see https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=263265
--- libs/JUCE/modules/juce_core/native/juce_linux_Files.cpp.orig 2022-04-13 18:55:08 UTC
--- libs/JUCE/modules/juce_core/native/juce_linux_Files.cpp.orig 2022-08-15 18:29:17 UTC
+++ libs/JUCE/modules/juce_core/native/juce_linux_Files.cpp
@@ -21,7 +21,7 @@
@@ -21,7 +21,9 @@
*/
#if JUCE_BSD
-extern char** environ;
+//extern char** environ;
+//extern char** environ; // this is broken on FreeBSD, see https://reviews.freebsd.org/D30842
+#include <dlfcn.h>
+static char*** environ_ptr = (char***)dlsym(RTLD_DEFAULT, "environ"); // workaround for the above
#endif
namespace juce
@@ -230,7 +230,7 @@ bool Process::openDocument (const String& fileName, co
@@ -229,7 +231,7 @@ bool Process::openDocument (const String& fileName, co
setsid();
// Child process
- execve (argv[0], (char**) argv, environ);
+ execv (argv[0], (char**) argv);
+ execve (argv[0], (char**) argv, *environ_ptr);
exit (0);
}