void-packages/srcpkgs/bcc/patches/musl.patch
Đoàn Trần Công Danh c6ce65d3d0 srcpkgs/b*: 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

50 lines
1 KiB
Diff

--- a/src/cc/api/BPFTable.cc
+++ b/src/cc/api/BPFTable.cc
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <linux/stddef.h>
#include <fcntl.h>
#include <linux/elf.h>
#include <linux/perf_event.h>
--- a/src/cc/api/BPF.cc
+++ b/src/cc/api/BPF.cc
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <linux/stddef.h>
#include <linux/bpf.h>
#include <linux/perf_event.h>
#include <unistd.h>
--- a/src/cc/perf_reader.c
+++ b/src/cc/perf_reader.c
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#include <linux/stddef.h>
#include <inttypes.h>
#include <poll.h>
#include <stdio.h>
--- a/src/cc/libbpf/src/libbpf.c
+++ b/src/cc/libbpf/src/libbpf.c
@@ -12,6 +12,7 @@
#ifndef _GNU_SOURCE
#define _GNU_SOURCE
#endif
+#include <linux/stddef.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
--- a/src/cc/libbpf.c
+++ b/src/cc/libbpf.c
@@ -17,6 +17,7 @@
#define _GNU_SOURCE
#endif
+#include <linux/stddef.h>
#include <arpa/inet.h>
#include <errno.h>
#include <fcntl.h>