autotrace: enable on x64 arch

*enable libz and libpng support
This commit is contained in:
Gerasim Troeglazov
2018-04-01 19:00:30 +10:00
parent ca5128e355
commit e2901455e4
2 changed files with 68 additions and 3 deletions

View File

@@ -6,13 +6,16 @@ commercial products that do the same."
HOMEPAGE="http://autotrace.sourceforge.net"
COPYRIGHT="2000-2002 AutoTrace contributors"
LICENSE="GNU GPL v2"
REVISION="1"
REVISION="2"
SOURCE_URI="http://sourceforge.net/projects/autotrace/files/AutoTrace/0.31.1/autotrace-0.31.1.tar.gz/download"
CHECKSUM_SHA256="5a1a923c3335dfd7cbcccb2bbd4cc3d68cafe7713686a2f46a1591ed8a92aff6"
SOURCE_DIR="autotrace-0.31.1"
PATCHES="autotrace-0.31.1.patchset"
PATCHES="
autotrace-0.31.1.patchset
autotrace-libpng.patch
"
ARCHITECTURES="x86_gcc2 ?x86 ?x86_64"
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
PROVIDES="
@@ -23,6 +26,8 @@ PROVIDES="
"
REQUIRES="
haiku$secondaryArchSuffix
lib:libpng16$secondaryArchSuffix
lib:libz$secondaryArchSuffix
"
PROVIDES_devel="
@@ -36,6 +41,8 @@ REQUIRES_devel="
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel
devel:libpng16$secondaryArchSuffix
devel:libz$secondaryArchSuffix
"
BUILD_PREREQUIRES="
cmd:make

View File

@@ -0,0 +1,58 @@
--- autotrace-0.31.1/input-png.c.orig 2002-10-10 22:44:14.000000000 +0200
+++ autotrace-0.31.1/input-png.c 2013-03-22 20:20:49.835238916 +0100
@@ -42,17 +42,17 @@
static void handle_warning(png_structp png, const at_string message) {
LOG1("PNG warning: %s", message);
- at_exception_warning((at_exception_type *)png->error_ptr,
+ at_exception_warning((at_exception_type *)png_get_error_ptr(png),
message);
- /* at_exception_fatal((at_exception_type *)at_png->error_ptr,
+ /* at_exception_fatal((at_exception_type *)png_get_error_ptr(at_png),
"PNG warning"); */
}
static void handle_error(png_structp png, const at_string message) {
LOG1("PNG error: %s", message);
- at_exception_fatal((at_exception_type *)png->error_ptr,
+ at_exception_fatal((at_exception_type *)png_get_error_ptr(png),
message);
- /* at_exception_fatal((at_exception_type *)at_png->error_ptr,
+ /* at_exception_fatal((at_exception_type *)png_get_error_ptr(at_png),
"PNG error"); */
}
@@ -157,8 +157,8 @@
png_set_strip_16(png_ptr);
png_set_packing(png_ptr);
- if ((png_ptr->bit_depth < 8) ||
- (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE) ||
+ if ((png_get_bit_depth(png_ptr, info_ptr) < 8) ||
+ (png_get_color_type(png_ptr, info_ptr) == PNG_COLOR_TYPE_PALETTE) ||
(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)))
png_set_expand(png_ptr);
@@ -184,17 +184,16 @@
png_read_update_info(png_ptr, info_ptr);
- info_ptr->row_pointers = (png_bytepp)png_malloc(png_ptr,
- info_ptr->height * sizeof(png_bytep));
+ png_set_rows(png_ptr, info_ptr, (png_bytepp)png_malloc(png_ptr,
+ png_get_image_height(png_ptr, info_ptr) * sizeof(png_bytep)));
#ifdef PNG_FREE_ME_SUPPORTED
info_ptr->free_me |= PNG_FREE_ROWS;
#endif
- for (row = 0; row < (int)info_ptr->height; row++)
- info_ptr->row_pointers[row] = (png_bytep)png_malloc(png_ptr,
+ for (row = 0; row < (int)png_get_image_height(png_ptr, info_ptr); row++)
+ png_get_rows(png_ptr, info_ptr)[row] = (png_bytep)png_malloc(png_ptr,
png_get_rowbytes(png_ptr, info_ptr));
- png_read_image(png_ptr, info_ptr->row_pointers);
- info_ptr->valid |= PNG_INFO_IDAT;
+ png_read_image(png_ptr, png_get_rows(png_ptr, info_ptr));
png_read_end(png_ptr, info_ptr);
return png_get_rows(png_ptr, info_ptr);
}