void-packages/srcpkgs/fbv/patches/libpng-1.5.13.patch
Đoàn Trần Công Danh be5369a0cb srcpkgs/f*: convert patches to -Np1
* fpc is kept at -Np0

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

36 lines
1.1 KiB
Diff

From d048b0ee0272eac78f25cc8ba9535efa795d8bad Mon Sep 17 00:00:00 2001
From: =?utf8?q?Christian=20Gim=C3=A9nez?= <cnngimenez@gmail.com>
Date: Tue, 8 Jul 2014 19:00:52 -0300
Subject: [PATCH 1/1] For libpng 1.5.13 the jmpbuf pointer for the png_structp
doesn't exists, we need to use png_jmpbuf() function. See libpng-manual.txt
at the /usr/share/doc/libpng-xxxx directory.
---
png.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git png.c png.c
index 2b59269..52b6797 100644
--- a/png.c
+++ b/png.c
@@ -69,7 +69,7 @@ int fh_png_load(char *name,unsigned char *buffer, unsigned char ** alpha,int x,i
fclose(fh); return(FH_ERROR_FORMAT);
}
rp=0;
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
if(rp) free(rp);
@@ -161,7 +161,7 @@ int fh_png_getsize(char *name,int *x,int *y)
fclose(fh); return(FH_ERROR_FORMAT);
}
rp=0;
- if (setjmp(png_ptr->jmpbuf))
+ if (setjmp(png_jmpbuf(png_ptr)))
{
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
if(rp) free(rp);
--
2.4.10.GIT