void-packages/srcpkgs/hexer/patches/fix-cross.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

22 lines
651 B
Diff

--- a/Makefile
+++ b/Makefile
@@ -29,8 +29,8 @@ CPPFLAGS_STD ?= -D_POSIX_C_SOURCE=200809L -D_XOPEN_SOURCE=700 \
CPPFLAGS += $(CPPFLAGS_STD) -DHEXER_VERSION=\"1.0.4\"
# -- Which compiler? --
-CC ?= cc
-CC_FOR_BUILD ?= $(CC)
+CC := cc
+CC_FOR_BUILD := $(CC)
CFLAGS ?= -O
LDFLAGS ?=
LDLIBS = $(LTERMCAP) -lm
@@ -72,7 +72,7 @@ $(MYC): calc.c config.h
$(CC) $(LDFLAGS) $(CPPFLAGS) $(CFLAGS) -DMYCALC=1 -o $@ calc.c -lm
bin2c: bin2c.c
- $(CC_FOR_BUILD) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ bin2c.c
+ $(CC_FOR_BUILD) $(HOSTCPPFLAGS) $(HOSTCFLAGS) $(HOSTLDFLAGS) -o $@ bin2c.c
helptext.c: help.txt bin2c
./bin2c -n helptext -o $@ help.txt