void-packages/srcpkgs/glyr/patches/musl-execinfo.patch
Đoàn Trần Công Danh 7fc9190f0e srcpkgs/g*: convert patches to -Np1
* gcc is kept at -Np0, because of void-cross

```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

29 lines
1,015 B
Diff

--- a/src/glyrc/glyrc.c.original
+++ b/src/glyrc/glyrc.c
@@ -24,7 +24,7 @@
#include <glib.h>
#include <glib/gstdio.h>
-#ifdef __linux__
+#ifdef __GLIBC__
/* Backtrace*/
#include <execinfo.h>
#endif
@@ -102,7 +102,7 @@
////////////////////////////////////////////////////////////////
-#ifdef __linux__
+#ifdef __GLIBC__
#define STACK_FRAME_SIZE 20
/* Obtain a backtrace and print it to stdout. */
@@ -141,7 +141,7 @@
cvprint (DEFAULT," It would be just natural to blame us now, so just visit <https://github.com/sahib/glyr/issues>\n");
cvprint (DEFAULT," and throw hard words like 'backtrace', 'bug report' or even the '$(command I issued' at them).\n");
cvprint (DEFAULT," The libglyr developers will try to fix it as soon as possible so please stop pulling their hair.\n");
-#ifdef __linux__
+#ifdef __GLIBC__
cvprint (DEFAULT,"\nA list of the last called functions follows, please add this to your report:\n");
print_trace();
#endif