void-packages/srcpkgs/cdb/patches/makefile.patch
Đoàn Trần Công Danh c987560802 srcpkgs/c*: 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

93 lines
2 KiB
Diff

--- a/Makefile 2000-02-19 15:42:05.000000000 -0500
+++ b/Makefile 2016-02-22 16:58:48.006067048 -0500
@@ -2,7 +2,7 @@
SHELL=/bin/sh
-default: it
+default: prog
alloc.a: \
makelib alloc.o
@@ -12,22 +12,6 @@
compile alloc.c alloc.h error.h
./compile alloc.c
-auto-str: \
-load auto-str.o buffer.a unix.a byte.a
- ./load auto-str buffer.a unix.a byte.a
-
-auto-str.o: \
-compile auto-str.c buffer.h readwrite.h exit.h
- ./compile auto-str.c
-
-auto_home.c: \
-auto-str conf-home
- ./auto-str auto_home `head -1 conf-home` > auto_home.c
-
-auto_home.o: \
-compile auto_home.c
- ./compile auto_home.c
-
buffer.a: \
makelib strerr_sys.o buffer.o buffer_put.o buffer_2.o strerr_die.o \
buffer_get.o buffer_copy.o buffer_1.o buffer_0.o buffer_1s.o
@@ -167,7 +151,7 @@
compile: \
warn-auto.sh conf-cc
( cat warn-auto.sh; \
- echo exec "`head -1 conf-cc`" '-c $${1+"$$@"}' \
+ echo exec "$(CC) $(CFLAGS)" '-c $${1+"$$@"}' \
) > compile
chmod 755 compile
@@ -183,35 +167,13 @@
compile fmt_ulong.c fmt.h
./compile fmt_ulong.c
-hier.o: \
-compile hier.c auto_home.h
- ./compile hier.c
-
-install: \
-load install.o hier.o auto_home.o buffer.a unix.a byte.a
- ./load install hier.o auto_home.o buffer.a unix.a byte.a
-
-install.o: \
-compile install.c buffer.h strerr.h error.h open.h readwrite.h exit.h
- ./compile install.c
-
-instcheck: \
-load instcheck.o hier.o auto_home.o buffer.a unix.a byte.a
- ./load instcheck hier.o auto_home.o buffer.a unix.a byte.a
-
-instcheck.o: \
-compile instcheck.c strerr.h error.h readwrite.h exit.h
- ./compile instcheck.c
-
-it: \
-prog install instcheck
-
load: \
warn-auto.sh conf-ld
( cat warn-auto.sh; \
echo 'main="$$1"; shift'; \
- echo exec "`head -1 conf-ld`" \
+ echo exec "$(CC) $(CFLAGS) $(LDFLAGS)" \
'-o "$$main" "$$main".o $${1+"$$@"}' \
+ $(LIBS) \
) > load
chmod 755 load
@@ -265,10 +227,6 @@
compile seek_set.c seek.h
./compile seek_set.c
-setup: \
-it install
- ./install
-
str_len.o: \
compile str_len.c str.h
./compile str_len.c