- fix build for png-1.4.1

This commit is contained in:
Dirk Meyer 2010-03-30 11:22:14 +00:00
parent 3519b8488b
commit 7d91ac8425
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=251805
4 changed files with 28 additions and 6 deletions

View file

@ -31,4 +31,11 @@ CONFIGURE_ARGS= --with-tcl="${TCL_LIBDIR}" \
--with-gl-libs="${LOCALBASE}/lib" \
--with-gl-inc="${LOCALBASE}/include"
post-patch:
${REINPLACE_CMD} -e 's|libpng12|libpng14|g' \
${WRKSRC}/configure
${REINPLACE_CMD} -e 's|int_p_NULL|NULL|g' \
-e 's|png_infopp_NULL|NULL|g' \
${WRKSRC}/src/ppgltk/images/png_reader.cpp
.include <bsd.port.post.mk>

View file

@ -1,5 +1,5 @@
--- ./image.c.orig Sun Oct 16 22:47:00 2005
+++ ./image.c Sat May 20 10:00:24 2006
--- image.c.orig 2005-10-16 22:47:00.000000000 +0200
+++ image.c 2010-03-30 11:54:39.000000000 +0200
@@ -422,6 +422,7 @@
buffer[i+2] = temp;
}
@ -8,6 +8,15 @@
if (!COM_WriteFile(filename, buffer, size + 18))
retval = false;
free (buffer);
@@ -533,7 +534,7 @@
}
if (colortype == PNG_COLOR_TYPE_GRAY && bitdepth < 8)
- png_set_gray_1_2_4_to_8 (png_ptr);
+ png_set_expand_gray_1_2_4_to_8 (png_ptr);
if (png_get_valid(png_ptr, pnginfo, PNG_INFO_tRNS))
png_set_tRNS_to_alpha (png_ptr);
@@ -585,17 +586,14 @@
Image_WritePNG
=============
@ -27,7 +36,7 @@
width_sign = (width < 0) ? -1 : 1;
width = abs(width);
@@ -816,15 +814,12 @@
@@ -816,16 +814,13 @@
Image_WriteJPEG
=============
*/
@ -39,8 +48,9 @@
FILE *fout;
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
-
- Q_snprintfz (name, MAX_OSPATH, "%s/%s", com_basedir, filename);
- Q_snprintfz (name, MAX_OSPATH, "%s/%s", com_basedir, filename);
-
if (!(fout = fopen(name, "wb")))
{
COM_CreatePath (name);

View file

@ -139,8 +139,9 @@ PLIST_SUB+= SDL="@comment "
.endif
post-patch:
# Resolve name collision with jpeg-8
# Resolve name collision with jpeg-8 and API png
${REINPLACE_CMD} -e 's|jpeg_mem_src|local_jpeg_mem_src|' \
-e 's|png_set_gray_1_2_4_to_8|png_set_expand_gray_1_2_4_to_8|' \
${WRKSRC}/renderer/r_image.c
.if defined(MOD_REQUESTED)
@${FIND} ${WRKDIR}/${KMQ2_ADDONS:S/-1${EXTRACT_SUFX}//} \

View file

@ -38,6 +38,10 @@ MAKE_ENV= PTHREAD_LIBS="${PTHREAD_LIBS}"
MAKE_ENV+= USE_ASM=1
.endif
post-patch:
${REINPLACE_CMD} -e 's|png_set_gray_1_2_4_to_8|png_set_expand_gray_1_2_4_to_8|' \
${WRKSRC}/gl_warp.c
pre-build:
@cd ${BUILD_WRKSRC} && ${LN} -sf Makefile.i386linux Makefile