void-packages/srcpkgs/helm/patches/fix-musl.patch
Đoàn Trần Công Danh 200bed5c06 srcpkgs/h*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

40 lines
1.7 KiB
Diff

--- a/JUCE/modules/juce_core/juce_core.cpp 2016-08-30 06:24:27.000000000 +0200
+++ b/JUCE/modules/juce_core/juce_core.cpp 2016-12-12 14:53:23.532613378 +0100
@@ -97,7 +97,7 @@
#include <net/if.h>
#include <sys/ioctl.h>
- #if ! JUCE_ANDROID
+ #if ! JUCE_ANDROID && defined(__GLIBC__)
#include <execinfo.h>
#endif
#endif
--- a/JUCE/modules/juce_core/system/juce_SystemStats.cpp 2016-08-30 06:24:27.000000000 +0200
+++ b/JUCE/modules/juce_core/system/juce_SystemStats.cpp 2016-12-12 14:58:35.988986030 +0100
@@ -134,6 +134,8 @@
}
}
+ #elif !defined(__GLIBC__)
+ jassertfalse; // sorry, not implemented yet!
#else
void* stack[128];
int frames = backtrace (stack, numElementsInArray (stack));
--- a/JUCE/modules/juce_core/native/juce_linux_SystemStats.cpp 2016-08-30 06:24:27.000000000 +0200
+++ b/JUCE/modules/juce_core/native/juce_linux_SystemStats.cpp 2016-12-12 15:07:35.046607788 +0100
@@ -142,8 +142,15 @@
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(); }
//==============================================================================