From 18bdf1765754f5721916dd9a069923ccc154a5d3 Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 16 Oct 2013 16:25:54 -0600 Subject: [PATCH] Convert/update pngcrush to working recipe --- .../pngcrush/patches/pngcrush-1.7.11.patch | 15 ----- .../pngcrush/patches/pngcrush-1.7.12.patch | 15 ----- .../pngcrush/patches/pngcrush-1.7.6.patch | 15 ----- .../pngcrush/patches/pngcrush-1.7.67.patch | 21 +++++++ media-gfx/pngcrush/pngcrush-1.7.11.recipe | 23 -------- media-gfx/pngcrush/pngcrush-1.7.12.recipe | 23 -------- media-gfx/pngcrush/pngcrush-1.7.6.recipe | 21 ------- media-gfx/pngcrush/pngcrush-1.7.67.recipe | 56 +++++++++++++++++++ 8 files changed, 77 insertions(+), 112 deletions(-) delete mode 100644 media-gfx/pngcrush/patches/pngcrush-1.7.11.patch delete mode 100644 media-gfx/pngcrush/patches/pngcrush-1.7.12.patch delete mode 100644 media-gfx/pngcrush/patches/pngcrush-1.7.6.patch create mode 100644 media-gfx/pngcrush/patches/pngcrush-1.7.67.patch delete mode 100644 media-gfx/pngcrush/pngcrush-1.7.11.recipe delete mode 100644 media-gfx/pngcrush/pngcrush-1.7.12.recipe delete mode 100644 media-gfx/pngcrush/pngcrush-1.7.6.recipe create mode 100644 media-gfx/pngcrush/pngcrush-1.7.67.recipe diff --git a/media-gfx/pngcrush/patches/pngcrush-1.7.11.patch b/media-gfx/pngcrush/patches/pngcrush-1.7.11.patch deleted file mode 100644 index d5692c951..000000000 --- a/media-gfx/pngcrush/patches/pngcrush-1.7.11.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up pngcrush-1.7.11-nolib/Makefile.orig pngcrush-1.7.11-nolib/Makefile ---- pngcrush-1.7.11-nolib/Makefile.orig 2010-02-25 21:21:23.004980736 -0700 -+++ pngcrush-1.7.11-nolib/Makefile 2010-05-18 14:10:18.201588736 -0600 -@@ -31,7 +31,11 @@ E = - PNGCRUSH = pngcrush - - # LIBS = -lm -+ifeq ($(shell uname), Haiku) -+LIBS = -lpng -lz -+else - LIBS = -L$(PNGLIB) -lpng -lz -lm -+endif - # LIBS = -lpng -lz -lm - #LIBS = ${ZLIB}/libz.a -lm - diff --git a/media-gfx/pngcrush/patches/pngcrush-1.7.12.patch b/media-gfx/pngcrush/patches/pngcrush-1.7.12.patch deleted file mode 100644 index f42ca191f..000000000 --- a/media-gfx/pngcrush/patches/pngcrush-1.7.12.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -up pngcrush-1.7.12-nolib/Makefile.orig pngcrush-1.7.12-nolib/Makefile ---- pngcrush-1.7.12-nolib/Makefile.orig 2010-02-25 21:21:23.004980736 -0700 -+++ pngcrush-1.7.12-nolib/Makefile 2010-05-18 14:10:18.201588736 -0600 -@@ -31,7 +31,11 @@ E = - PNGCRUSH = pngcrush - - # LIBS = -lm -+ifeq ($(shell uname), Haiku) -+LIBS = -lpng -lz -+else - LIBS = -L$(PNGLIB) -lpng -lz -lm -+endif - # LIBS = -lpng -lz -lm - #LIBS = ${ZLIB}/libz.a -lm - diff --git a/media-gfx/pngcrush/patches/pngcrush-1.7.6.patch b/media-gfx/pngcrush/patches/pngcrush-1.7.6.patch deleted file mode 100644 index a8b0b5713..000000000 --- a/media-gfx/pngcrush/patches/pngcrush-1.7.6.patch +++ /dev/null @@ -1,15 +0,0 @@ -diff -ur pngcrush-1.7.6-nolib/Makefile pngcrush-1.7.6-nolib-haiku/Makefile ---- pngcrush-1.7.6-nolib/Makefile 2006-03-30 18:39:16.000000000 -0700 -+++ pngcrush-1.7.6-nolib-haiku/Makefile 2009-12-29 01:02:29.000000000 -0700 -@@ -36,7 +36,11 @@ - PNGCRUSH = pngcrush - - # LIBS = -lm -+ifeq ($(shell uname), Haiku) -+LIBS = -L/boot/system/lib -lpng -lz -+else - LIBS = -L$(PNGLIB) -lpng -lz -lm -+endif - # LIBS = -lpng -lz -lm - #LIBS = ${ZLIB}/libz.a -lm - diff --git a/media-gfx/pngcrush/patches/pngcrush-1.7.67.patch b/media-gfx/pngcrush/patches/pngcrush-1.7.67.patch new file mode 100644 index 000000000..215fca135 --- /dev/null +++ b/media-gfx/pngcrush/patches/pngcrush-1.7.67.patch @@ -0,0 +1,21 @@ +diff -up pngcrush-1.7.67-nolib/pngcrush.c.orig pngcrush-1.7.67-nolib/pngcrush.c +--- pngcrush-1.7.67-nolib/pngcrush.c.orig 2013-10-15 00:27:02.442236928 -0600 ++++ pngcrush-1.7.67-nolib/pngcrush.c 2013-10-15 00:27:50.849084416 -0600 +@@ -6146,6 +6146,8 @@ int main(int argc, char *argv[]) + png_uint_32 zbuf_size; + png_uint_32 required_window; + int channels = 0; ++ png_uint_32 rowbytes; ++ png_uint_32 h = height; + png_set_compression_strategy(write_ptr, + z_strategy); + png_set_compression_mem_level(write_ptr, +@@ -6167,8 +6169,6 @@ int main(int argc, char *argv[]) + * a png_uint_32, by limiting the width and height used + * to 15 bits. + */ +- png_uint_32 rowbytes; +- png_uint_32 h = height; + + rowbytes = png_get_rowbytes(read_ptr, read_info_ptr); + #ifndef PNGCRUSH_H diff --git a/media-gfx/pngcrush/pngcrush-1.7.11.recipe b/media-gfx/pngcrush/pngcrush-1.7.11.recipe deleted file mode 100644 index 30ebeadd0..000000000 --- a/media-gfx/pngcrush/pngcrush-1.7.11.recipe +++ /dev/null @@ -1,23 +0,0 @@ -DESCRIPTION="Pngcrush is an optimizer for PNG (Portable Network Graphics) files." -HOMEPAGE="http://pmt.sourceforge.net/pngcrush/" -SRC_URI="http://sourceforge.net/projects/pmt/files/pngcrush/1.7.11/pngcrush-1.7.11-nolib.tar.bz2/download" -CHECKSUM_MD5="f9f5adfd36c5b0b84e0a5115e841e38a" -REVISION="1" -STATUS_HAIKU="stable" -DEPEND="" - -BUILD() -{ - cd pngcrush-1.7.11-nolib - make -} -INSTALL() -{ - cd pngcrush-1.7.11-nolib - mkdir -p ${DESTDIR}`finddir B_COMMON_BIN_DIRECTORY` - cp -a -f pngcrush ${DESTDIR}`finddir B_COMMON_BIN_DIRECTORY` -} - -LICENSE="LibPNG" -COPYRIGHT="1998-2009 Glenn Randers-Pehrson - 2005 Greg Roelofs" diff --git a/media-gfx/pngcrush/pngcrush-1.7.12.recipe b/media-gfx/pngcrush/pngcrush-1.7.12.recipe deleted file mode 100644 index 67391fe1f..000000000 --- a/media-gfx/pngcrush/pngcrush-1.7.12.recipe +++ /dev/null @@ -1,23 +0,0 @@ -DESCRIPTION="Pngcrush is an optimizer for PNG (Portable Network Graphics) files." -HOMEPAGE="http://pmt.sourceforge.net/pngcrush/" -SRC_URI="http://sourceforge.net/projects/pmt/files/pngcrush/00-1.7.12/pngcrush-1.7.12-nolib.tar.bz2/download" -CHECKSUM_MD5="10d43bf881a591ba1e5d87e6888de722" -REVISION="1" -STATUS_HAIKU="stable" -DEPEND="" - -BUILD() -{ - cd pngcrush-1.7.12-nolib - make -} -INSTALL() -{ - cd pngcrush-1.7.12-nolib - mkdir -p ${DESTDIR}`finddir B_COMMON_BIN_DIRECTORY` - cp -a -f pngcrush ${DESTDIR}`finddir B_COMMON_BIN_DIRECTORY` -} - -LICENSE="LibPNG" -COPYRIGHT="1998-2009 Glenn Randers-Pehrson - 2005 Greg Roelofs" diff --git a/media-gfx/pngcrush/pngcrush-1.7.6.recipe b/media-gfx/pngcrush/pngcrush-1.7.6.recipe deleted file mode 100644 index cf2825ac6..000000000 --- a/media-gfx/pngcrush/pngcrush-1.7.6.recipe +++ /dev/null @@ -1,21 +0,0 @@ -DESCRIPTION="Pngcrush is an optimizer for PNG (Portable Network Graphics) files." -HOMEPAGE="http://pmt.sourceforge.net/pngcrush/" -SRC_URI="http://sourceforge.net/projects/pmt/files/pngcrush/00-1.7.6/pngcrush-1.7.6-nolib.tar.bz2/download" -CHECKSUM_MD5="79fdedccf761f6391c11aa851c9fc6b2" -REVISION="1" -STATUS_HAIKU="stable" -DEPEND="" -BUILD() -{ - cd pngcrush-1.7.6-nolib - make -} - -INSTALL() -{ - cd pngcrush-1.7.6-nolib - cp -a -f pngcrush `finddir B_COMMON_BIN_DIRECTORY` -} -LICENSE="LibPNG" -COPYRIGHT="1998-2009 Glenn Randers-Pehrson - 2005 Greg Roelofs" diff --git a/media-gfx/pngcrush/pngcrush-1.7.67.recipe b/media-gfx/pngcrush/pngcrush-1.7.67.recipe new file mode 100644 index 000000000..c35be6463 --- /dev/null +++ b/media-gfx/pngcrush/pngcrush-1.7.67.recipe @@ -0,0 +1,56 @@ +SUMMARY="Pngcrush is an optimizer for PNG (Portable Network Graphics) files." +DESCRIPTION=" +Pngcrush is an optimizer for PNG (Portable Network Graphics) files. +It can be run from a commandline in an MSDOS window, or from a UNIX +or LINUX commandline. Its main purpose is to reduce the size of the +PNG IDAT datastream by trying various compression levels and PNG +filter methods. It also can be used to remove unwanted ancillary +chunks, or to add certain chunks including gAMA, tRNS, iCCP, and +textual chunks." + +HOMEPAGE="http://pmt.sourceforge.net/pngcrush/" +SRC_URI="http://sourceforge.net/projects/pmt/files/pngcrush/1.7.67/pngcrush-1.7.67-nolib.tar.xz" +CHECKSUM_MD5="682318b86be2e01056b8dba7b90dee01" +REVISION="1" +LICENSE="LibPNG" +COPYRIGHT="1998-2009 Glenn Randers-Pehrson + 2005 Greg Roelofs" +ARCHITECTURES="x86 x86_gcc2" + +SOURCE_DIR="${portVersionedName}-nolib" + +PROVIDES=" + pngcrush = $portVersion compat >= 1.7 + cmd:pngcrush = $portVersion compat >= 1.7 + " + +REQUIRES=" + haiku >= $haikuVersion + lib:libpng + lib:libz + " + +BUILD_REQUIRES=" + devel:libpng + devel:libz + " + +BUILD_PREREQUIRES=" + haiku_devel >= $haikuVersion + cmd:make + cmd:gcc + " + +PATCHES="pngcrush-1.7.67.patch" + +BUILD() +{ + make LIBS="-L$libDir -lpng -lz" +} + +INSTALL() +{ + mkdir -p $binDir + cp -af pngcrush $binDir +} +