loadpng, update old bep file (#2381)

This commit is contained in:
Schrijvers Luc
2018-03-29 19:43:05 +02:00
committed by waddlesplash
parent a604a579ef
commit 5943a00b0a
3 changed files with 94 additions and 36 deletions

View File

@@ -1,33 +1,49 @@
DESCRIPTION="
loadpng is some glue that makes it easy to use libpng to load and save bitmaps \
from Allegro programs.
"
HOMEPAGE="http://tjaden.strangesoft.net/loadpng/"
SOURCE_URI="http://tjaden.strangesoft.net/loadpng/loadpng-1.5.tar.gz"
SUMMARY="Load and save bitmaps from Allegro programs"
DESCRIPTION="loadpng is some glue that makes it easy to use libpng to load \
and save bitmaps from Allegro programs."
HOMEPAGE="https://tjaden.strangesoft.net/loadpng/"
COPYRIGHT="1997-2004 Psyk Software."
LICENSE="Public Domain"
REVISION="1"
STATUS_HAIKU="stable"
DEPEND="media-libs/allegro >= 4.4
media-libs/libpng >=1.2"
MESSAGE="This might not build with libpng >= 1.4"
CHECKSUM_MD5="5e9ecdf1762c3fca47477bf0263b96ba"
SOURCE_URI="https://tjaden.strangesoft.net/loadpng/loadpng-1.5.tar.gz"
CHECKSUM_SHA256="ba0e496e5368de70e6df43cb5500468cda402e63ab95b6a466e29ec6b795b7d7"
PATCHES="loadpng-$portVersion.patchset"
libVersion="1.5"
ARCHITECTURES="?x86_gcc2 ?x86_64"
PROVIDES="
loadpng = $portVersion
lib:libloadpng_$libVersion = $libVersion compat >= 1
"
REQUIRES="
haiku
lib:liballeg
lib:libpng16
lib:libz
"
BUILD_REQUIRES="
haiku_devel
devel:liballeg
devel:libpng16
devel:libz
"
BUILD_PREREQUIRES="
cmd:gcc
cmd:make
"
BUILD()
{
cd loadpng-1.5
make
make $jobArgs shared
}
INSTALL()
{
cd loadpng-1.5
if [ -n ${DESTDIR} ];then
mkdir -p ${DESTDIR}/boot/common/lib
mkdir -p ${DESTDIR}/boot/common/include
make install DESTDIR=${DESTDIR}
else
make install
fi
make install
}
mkdir -p $libDir $includeDir
LICENSE="Public Domain"
COPYRIGHT="1997-2004 Psyk Software."
cp libloadpng-$libVersion.so $libDir
cp loadpng.h $includeDir
}

View File

@@ -1,11 +0,0 @@
diff -Naur loadpng-1.5/Makefile.unx loadpng-1.5-haiku/Makefile.unx
--- loadpng-1.5/Makefile.unx 2005-12-20 03:57:47.049807360 +0000
+++ loadpng-1.5-haiku/Makefile.unx 2010-01-30 00:44:02.861929472 +0000
@@ -1,6 +1,6 @@
## Aux -*- Makefile -*- for Unices
-prefix := /usr/local
+prefix := /boot/common
libdir := $(prefix)/lib
includedir := $(prefix)/include
DESTDIR :=

View File

@@ -0,0 +1,53 @@
From ff7e241d54000ae8110a108f8043ef63cd21367e Mon Sep 17 00:00:00 2001
From: begasus <begasus@gmail.com>
Date: Sat, 24 Mar 2018 17:24:19 +0100
Subject: loadpng, fix build
diff --git a/loadpng.c b/loadpng.c
index 3905f97..06f9b0b 100644
--- a/loadpng.c
+++ b/loadpng.c
@@ -9,6 +9,7 @@
#include <allegro.h>
#include <allegro/internal/aintern.h>
#include "loadpng.h"
+#include <zlib.h>
/* We need internals _color_load_depth and _fixup_loaded_bitmap. The
* first can be replaced by the new get_color_depth() function which
@@ -276,7 +277,8 @@ BITMAP *load_png_pf(PACKFILE *fp, RGB *pal)
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in the png_create_read_struct() earlier.
*/
- if (setjmp(png_ptr->jmpbuf)) {
+ // if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
/* If we get here, we had a problem reading the file */
@@ -372,7 +374,7 @@ BITMAP *load_memory_png(AL_CONST void *buffer, int bufsize, RGB *pal)
* the normal method of doing things with libpng). REQUIRED unless you
* set up your own error handlers in the png_create_read_struct() earlier.
*/
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
/* If we get here, we had a problem reading the file */
diff --git a/savepng.c b/savepng.c
index 02a3725..1602cf0 100644
--- a/savepng.c
+++ b/savepng.c
@@ -188,7 +188,7 @@ static int really_save_png(PACKFILE *fp, BITMAP *bmp, AL_CONST RGB *pal)
goto Error;
/* Set error handling. */
- if (setjmp(png_ptr->jmpbuf)) {
+ if (setjmp(png_jmpbuf(png_ptr))) {
/* If we get here, we had a problem reading the file. */
goto Error;
}
--
2.16.2