void-packages/srcpkgs/libopenshot-audio/patches/fix-musl.patch

47 lines
2.1 KiB
Diff

diff --git a/JuceLibraryCode/modules/juce_core/juce_core.cpp b/JuceLibraryCode/modules/juce_core/juce_core.cpp
index 8bac812..e23b422 100644
--- a/JuceLibraryCode/modules/juce_core/juce_core.cpp
+++ b/JuceLibraryCode/modules/juce_core/juce_core.cpp
@@ -92,7 +92,7 @@
#include <net/if.h>
#include <sys/ioctl.h>
- #if ! JUCE_ANDROID
+ #if ! JUCE_ANDROID && defined(__GLIBC__)
#include <execinfo.h>
#endif
#endif
diff --git a/JuceLibraryCode/modules/juce_core/native/juce_linux_SystemStats.cpp b/JuceLibraryCode/modules/juce_core/native/juce_linux_SystemStats.cpp
index 2d7faa3..f132405 100644
--- a/JuceLibraryCode/modules/juce_core/native/juce_linux_SystemStats.cpp
+++ b/JuceLibraryCode/modules/juce_core/native/juce_linux_SystemStats.cpp
@@ -139,8 +139,15 @@ static String getLocaleValue (nl_item key)
return result;
}
+#if defined(__GLIBC__)
String SystemStats::getUserLanguage() { return getLocaleValue (_NL_IDENTIFICATION_LANGUAGE); }
String SystemStats::getUserRegion() { return getLocaleValue (_NL_IDENTIFICATION_TERRITORY); }
+#else
+// The identifiers _NL_INDENTIFICATION_LANGUAGE and _TERRIRTORY are not defined in musl libc.
+// TODO: Find a better fix than just returning nonsense. Inspect env("LANG") perhaps?
+String SystemStats::getUserLanguage() { return String("en"); }
+String SystemStats::getUserRegion() { return String("US"); }
+#endif
String SystemStats::getDisplayLanguage() { return getUserLanguage() + "-" + getUserRegion(); }
//==============================================================================
diff --git a/JuceLibraryCode/modules/juce_core/system/juce_SystemStats.cpp b/JuceLibraryCode/modules/juce_core/system/juce_SystemStats.cpp
index 757ea24..6b61e16 100644
--- a/JuceLibraryCode/modules/juce_core/system/juce_SystemStats.cpp
+++ b/JuceLibraryCode/modules/juce_core/system/juce_SystemStats.cpp
@@ -138,7 +138,7 @@ String SystemStats::getStackBacktrace()
{
String result;
- #if JUCE_ANDROID || JUCE_MINGW
+ #if JUCE_ANDROID || JUCE_MINGW || !defined(__GLIBC__)
jassertfalse; // sorry, not implemented yet!
#elif JUCE_WINDOWS