From 4f2d7949f03e1c198bc888f2d05f421d35c57e21 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Mon, 9 Oct 2017 18:53:29 +0100 Subject: reinit the tree, so we can have metadata --- media-gfx/pngtools/Manifest | 8 + .../files/pngtools-0.3-implicit-declarations.patch | 40 +++++ .../pngtools/files/pngtools-0.4-libpng14.patch | 34 ++++ .../files/pngtools-0.4-libpng15-fixes.patch | 190 +++++++++++++++++++++ media-gfx/pngtools/metadata.xml | 11 ++ media-gfx/pngtools/pngtools-0.4-r2.ebuild | 34 ++++ 6 files changed, 317 insertions(+) create mode 100644 media-gfx/pngtools/Manifest create mode 100644 media-gfx/pngtools/files/pngtools-0.3-implicit-declarations.patch create mode 100644 media-gfx/pngtools/files/pngtools-0.4-libpng14.patch create mode 100644 media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch create mode 100644 media-gfx/pngtools/metadata.xml create mode 100644 media-gfx/pngtools/pngtools-0.4-r2.ebuild (limited to 'media-gfx/pngtools') diff --git a/media-gfx/pngtools/Manifest b/media-gfx/pngtools/Manifest new file mode 100644 index 000000000000..e79ede76cb51 --- /dev/null +++ b/media-gfx/pngtools/Manifest @@ -0,0 +1,8 @@ +AUX pngtools-0.3-implicit-declarations.patch 1428 SHA256 7ef75837f24736cbba7f7130ba1e31178a70088d883d6581f86acf0fed79ee62 SHA512 80ac14a46940324dcd33f0f6f215e56888cc46a24d216d120339e026fa2ef0624511c262daa195308d420ffa773e2279b73d332316f626dac4ec3c96d6a2ee6c WHIRLPOOL 7e0970400e0cc438fb778b77de1cfb438531eb9775c20efdb808bf279523fe09b918c7d752c22ac5f3e7309df054ca6311545776cad5d790880d40661192bc58 +AUX pngtools-0.4-libpng14.patch 1265 SHA256 22c623fee58ffc1b2c8f90b12e27ec56b9001decc97935d4caf94f991f4e44ee SHA512 94940722266361f90239712875067ab0d82c18545300d9d604b76eb00ffdb8e82af0e0ab78966b645aba2dbdf59666a2da593365d5b9c9745def2b8ede0a4480 WHIRLPOOL bf84c0d56e0aacba62ead161179ebd42fd0903c8b30186556874aff8e2f24ab2879a31a6e6985621d3b012750a2d106e339173a87399ab894dc3e2de126bea8e +AUX pngtools-0.4-libpng15-fixes.patch 6722 SHA256 999ea2bb674ed0b5d341eafcdf02cc837bca2670b83dc16a413c180112d84c4c SHA512 aafc4c746efc0ef00e9d9e59acf0dee58b56ce80a9f04ddfa9879f46f342170f4641f23081323299a143d4837367645240f823ba9900592fcfdec71961f3f330 WHIRLPOOL 54875cdb00bea5c9e285e2d28081e72cb773b1b48dfa24b29c2c9a7b4db2cf6e2a9629c21fb14ed5478eec5ae44a235b072e5a81988ebdc386196d1792f98351 +DIST pngtools_0_4.tgz 1312178 SHA256 da0035d140c5efbc7d42d95a27327928d982866851c4c67bac58d32936075655 SHA512 588b954c7c43ba48442ed4b22ad94fcfb456c7fc84a682e9126ca9d1c9b63dbb8f2d64e6e156664f327efbe11bb2ab1ac29d63ebb8a05329ac14200fb29f95a1 WHIRLPOOL 8e377f468e46f2de0a874899c8c00bf0ab08e3f6dc9754bbb3689717c949178ad61224b3276720ad918e028d78529951cc6388bafa02ff003e6dd2f66ace8309 +EBUILD pngtools-0.4-r2.ebuild 784 SHA256 8c5ac8963feef5d92802dc50e06ff1411817f816da95a5a545cd7606fbaa4918 SHA512 980cd7dc16287b78c51e049bee4aae83d89107f202dbb9a0dec9028e49e689c78b1f3e26535c1c29363088e7ee625fac5b2536473099383e0d244aefd5d0142c WHIRLPOOL e15d65d4e55f7bb17c8f9edd8531c64bd5c106532ece355e6cadb69428fca5fe8590d452643bb36acdf6226f53eeedd6a900a656e90c03161a49d957a472640d +MISC ChangeLog 2566 SHA256 2dd6a704f3dde294d7fd12906e55e87b154ebe25c205d739de5a44eee56e0713 SHA512 8e2a8e650e2b3624b146a16651fc1d922e968c9bf8d6bca56c846da63f73a627c5ad76d4cf6bfb4977134c660386e5586b56b02739b18a0cc0920ad1c36ba42e WHIRLPOOL fb80a1d9880518bc9b3cff5e5bba4a05d5163474abef0ce6a7c20b73e7c178b9cf912434d00c32852424e5bca424296798bbf5074db3ae56b2be0cf295c28d66 +MISC ChangeLog-2015 2330 SHA256 6c8ba84e325b798eda908124ef0f0d099854248c5783e3f0dccb642f0c2e351a SHA512 3c744543b54d9b0d6fffe647398f9295d25d7e51e7e639f76aaab352c8420197d798eefb8fbccab6b3430d911c11b3029168e1652036b826f96a34ad2e6fc2dd WHIRLPOOL 68a41f065641f570e3d80b7785a303fc4a15bfa723b18fbbcd2b1605514410e3ef6f6dc64e0c2e7fab63c357c29d94971b8a0d0c15cafc37ab31a9c957b4c06d +MISC metadata.xml 334 SHA256 1c3f767f2db2905e4a3dfdb44cc3ecb9569b9e809a71f40c8e9cfd6faef6e70f SHA512 348994bfded172670ed4e52da50cec54a3c059a65d8a00e5aca8109c9320964dec238ad3c6439e7eb7556b4ee047423b93ca34c88090dbe1bfbcdd7a5a9e6fe2 WHIRLPOOL bbbc717988353ece3dc4a2f09d36871480e32e59f17023745a05f557c8fd12a7b921785fff75b3aad0f8d434b809f1e46b333e9be777445ab099b6e4715bea92 diff --git a/media-gfx/pngtools/files/pngtools-0.3-implicit-declarations.patch b/media-gfx/pngtools/files/pngtools-0.3-implicit-declarations.patch new file mode 100644 index 000000000000..682bcc8c29d3 --- /dev/null +++ b/media-gfx/pngtools/files/pngtools-0.3-implicit-declarations.patch @@ -0,0 +1,40 @@ +diff -ur pngtools.orig/inflateraster.c pngtools/inflateraster.c +--- pngtools.orig/inflateraster.c 2005-04-08 04:23:34.000000000 +0300 ++++ pngtools/inflateraster.c 2008-04-23 20:38:05.000000000 +0300 +@@ -1,5 +1,6 @@ + #include + #include ++#include + + // Inflate a raster to a given pixel sample size + char *inflateraster(char *input, unsigned long width, unsigned long height, +diff -ur pngtools.orig/pngchunkdesc.c pngtools/pngchunkdesc.c +--- pngtools.orig/pngchunkdesc.c 2005-04-08 04:23:34.000000000 +0300 ++++ pngtools/pngchunkdesc.c 2008-04-23 20:44:38.000000000 +0300 +@@ -20,6 +20,7 @@ + ******************************************************************************/ + + #include ++#include + + char *meanings[4][2] = { + {"Critical", "Ancillary"}, +diff -ur pngtools.orig/pngchunks.c pngtools/pngchunks.c +--- pngtools.orig/pngchunks.c 2005-04-08 04:23:35.000000000 +0300 ++++ pngtools/pngchunks.c 2008-04-23 20:38:29.000000000 +0300 +@@ -1,6 +1,7 @@ + // List the chunks which appear in a given PNG image + + #include ++#include + #include + #include + #include +diff -ur pngtools.orig/pngcp.c pngtools/pngcp.c +--- pngtools.orig/pngcp.c 2005-04-08 04:23:35.000000000 +0300 ++++ pngtools/pngcp.c 2008-04-23 20:38:13.000000000 +0300 +@@ -1,3 +1,4 @@ ++#include + #include + #include + #include diff --git a/media-gfx/pngtools/files/pngtools-0.4-libpng14.patch b/media-gfx/pngtools/files/pngtools-0.4-libpng14.patch new file mode 100644 index 000000000000..f849549bae13 --- /dev/null +++ b/media-gfx/pngtools/files/pngtools-0.4-libpng14.patch @@ -0,0 +1,34 @@ +diff -ur pngtools-0.4.orig/Makefile.am pngtools-0.4/Makefile.am +--- pngtools-0.4.orig/Makefile.am 2008-11-27 01:14:17.000000000 +0200 ++++ pngtools-0.4/Makefile.am 2010-03-09 00:51:10.000000000 +0200 +@@ -4,3 +4,6 @@ + pngcp_SOURCES = pngcp.c pngread.c pngwrite.c inflateraster.c + pngchunkdesc_SOURCES = pngchunkdesc.c + pngchunks_SOURCES = pngchunks.c ++ ++pnginfo_LDADD = -lpng ++pngcp_LDADD = -lpng +diff -ur pngtools-0.4.orig/pnginfo.c pngtools-0.4/pnginfo.c +--- pngtools-0.4.orig/pnginfo.c 2008-11-27 01:14:17.000000000 +0200 ++++ pngtools-0.4/pnginfo.c 2010-03-09 00:42:58.000000000 +0200 +@@ -152,7 +152,7 @@ + + // Check that it really is a PNG file + fread (sig, 1, 8, image); +- if (!png_check_sig (sig, 8)) ++ if (!png_sig_cmp(sig, 0, 8) == 0) + { + printf (" This file is not a valid PNG file\n"); + fclose (image); +diff -ur pngtools-0.4.orig/pngread.c pngtools-0.4/pngread.c +--- pngtools-0.4.orig/pngread.c 2008-11-27 01:14:17.000000000 +0200 ++++ pngtools-0.4/pngread.c 2010-03-09 00:43:27.000000000 +0200 +@@ -26,7 +26,7 @@ + + // Check that it really is a PNG file + fread(sig, 1, 8, image); +- if(!png_check_sig(sig, 8)){ ++ if(!png_sig_cmp(sig, 0, 8) == 0){ + fprintf(stderr, "This file is not a valid PNG file\n"); + goto error; + } diff --git a/media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch b/media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch new file mode 100644 index 000000000000..29b73233610b --- /dev/null +++ b/media-gfx/pngtools/files/pngtools-0.4-libpng15-fixes.patch @@ -0,0 +1,190 @@ +diff -Nuar --exclude '*.orig' --exclude '*.rej' pngtools-0.4.orig//pnginfo.c pngtools-0.4/pnginfo.c +--- pngtools-0.4.orig//pnginfo.c 2011-09-16 07:05:05.235477249 +0000 ++++ pngtools-0.4/pnginfo.c 2011-09-16 07:07:52.385872705 +0000 +@@ -185,20 +185,25 @@ + /////////////////////////////////////////////////////////////////////////// + + printf (" Image Width: %d Image Length: %d\n", width, height); ++ int pixel_depth; ++ pixel_depth = bitdepth * png_get_channels(png, info); + if(tiffnames == pnginfo_true){ + printf (" Bits/Sample: %d\n", bitdepth); +- printf (" Samples/Pixel: %d\n", info->channels); +- printf (" Pixel Depth: %d\n", info->pixel_depth); // Does this add value? ++ printf (" Samples/Pixel: %d\n", png_get_channels(png, info)); ++ printf (" Pixel Depth: %d\n", pixel_depth); // Does this add value? + } + else{ + printf (" Bitdepth (Bits/Sample): %d\n", bitdepth); +- printf (" Channels (Samples/Pixel): %d\n", info->channels); +- printf (" Pixel depth (Pixel Depth): %d\n", info->pixel_depth); // Does this add value? ++ printf (" Channels (Samples/Pixel): %d\n", png_get_channels(png, info)); ++ printf (" Pixel depth (Pixel Depth): %d\n", pixel_depth); // Does this add value? + } + + // Photometric interp packs a lot of information + printf (" Colour Type (Photometric Interpretation): "); + ++ int num_palette; ++ int num_trans; ++ + switch (colourtype) + { + case PNG_COLOR_TYPE_GRAY: +@@ -207,10 +212,10 @@ + + case PNG_COLOR_TYPE_PALETTE: + printf ("PALETTED COLOUR "); +- if (info->num_trans > 0) ++ if (num_trans > 0) + printf ("with alpha "); + printf ("(%d colours, %d transparent) ", +- info->num_palette, info->num_trans); ++ num_palette, num_trans); + break; + + case PNG_COLOR_TYPE_RGB: +@@ -232,7 +237,7 @@ + printf ("\n"); + + printf (" Image filter: "); +- switch (info->filter_type) ++ switch (png_get_filter_type(png, info)) + { + case PNG_FILTER_TYPE_BASE: + printf ("Single row per byte filter "); +@@ -249,7 +254,7 @@ + printf ("\n"); + + printf (" Interlacing: "); +- switch (info->interlace_type) ++ switch (png_get_interlace_type(png, info)) + { + case PNG_INTERLACE_NONE: + printf ("No interlacing "); +@@ -266,7 +271,7 @@ + printf ("\n"); + + printf (" Compression Scheme: "); +- switch (info->compression_type) ++ switch (png_get_compression_type(png, info)) + { + case PNG_COMPRESSION_TYPE_BASE: + printf ("Deflate method 8, 32k window"); +@@ -278,9 +283,13 @@ + } + printf ("\n"); + ++ png_uint_32 x_pixels_per_unit, y_pixels_per_unit; ++ int phys_unit_type; ++ png_get_pHYs (png, info, &x_pixels_per_unit, &y_pixels_per_unit, &phys_unit_type); ++ + printf (" Resolution: %d, %d ", +- info->x_pixels_per_unit, info->y_pixels_per_unit); +- switch (info->phys_unit_type) ++ x_pixels_per_unit, y_pixels_per_unit); ++ switch (phys_unit_type) + { + case PNG_RESOLUTION_UNKNOWN: + printf ("(unit unknown)"); +@@ -299,15 +308,18 @@ + // FillOrder is always msb-to-lsb, big endian + printf (" FillOrder: msb-to-lsb\n Byte Order: Network (Big Endian)\n"); + ++ png_textp text; ++ int num_text, max_text; ++ + // Text comments + printf (" Number of text strings: %d of %d\n", +- info->num_text, info->max_text); ++ num_text, max_text); + +- for (i = 0; i < info->num_text; i++) ++ for (i = 0; i < num_text; i++) + { +- printf (" %s ", info->text[i].key); ++ printf (" %s ", text[i].key); + +- switch (info->text[1].compression) ++ switch (text[1].compression) + { + case -1: + printf ("(tEXt uncompressed)"); +@@ -332,12 +344,12 @@ + + printf (": "); + j = 0; +- while (info->text[i].text[j] != '\0') ++ while (text[i].text[j] != '\0') + { +- if (info->text[i].text[j] == '\n') ++ if (text[i].text[j] == '\n') + printf ("\\n"); + else +- fputc (info->text[i].text[j], stdout); ++ fputc (text[i].text[j], stdout); + + j++; + } +@@ -385,14 +397,14 @@ + + printf ("Dumping the bitmap for this image:\n"); + printf ("(Expanded samples result in %d bytes per pixel, %d channels with %d bytes per channel)\n\n", +- info->channels * bytespersample, info->channels, bytespersample); ++ png_get_channels(png, info) * bytespersample, png_get_channels(png, info), bytespersample); + + // runlen is used to stop us displaying repeated byte patterns over and over -- + // I display them once, and then tell you how many times it occured in the file. + // This currently only applies to runs on zeros -- I should one day add an + // option to extend this to runs of other values as well + runlen = 0; +- for (i = 0; i < rowbytes * height / info->channels; i += info->channels * bytespersample) ++ for (i = 0; i < rowbytes * height / png_get_channels(png, info); i += png_get_channels(png, info) * bytespersample) + { + int scount, bcount, pixel; + +@@ -408,16 +420,16 @@ + + // Determine if this is a pixel whose entire value is zero + pixel = 0; +- for(scount = 0; scount < info->channels; scount++) ++ for(scount = 0; scount < png_get_channels(png, info); scount++) + for(bcount = 0; bcount < bytespersample; bcount++) + pixel += bitmap[i + scount * bytespersample + bcount]; + + if ((runlen == 0) && !pixel) + { + printf ("["); +- for(scount = 0; scount < info->channels; scount++){ ++ for(scount = 0; scount < png_get_channels(png, info); scount++){ + for(bcount = 0; bcount < bytespersample; bcount++) printf("00"); +- if(scount != info->channels - 1) printf(" "); ++ if(scount != png_get_channels(png, info) - 1) printf(" "); + } + printf ("] "); + runlen++; +@@ -425,10 +437,10 @@ + + if (runlen == 0){ + printf ("["); +- for(scount = 0; scount < info->channels; scount++){ ++ for(scount = 0; scount < png_get_channels(png, info); scount++){ + for(bcount = 0; bcount < bytespersample; bcount++) + printf("%02x", (unsigned char) bitmap[i + scount * bytespersample + bcount]); +- if(scount != info->channels - 1) printf(" "); ++ if(scount != png_get_channels(png, info) - 1) printf(" "); + } + printf("] "); + } +diff -Nuar --exclude '*.orig' --exclude '*.rej' pngtools-0.4.orig//pngread.c pngtools-0.4/pngread.c +--- pngtools-0.4.orig//pngread.c 2011-09-16 07:05:05.235477249 +0000 ++++ pngtools-0.4/pngread.c 2011-09-16 07:05:44.865570870 +0000 +@@ -68,7 +68,7 @@ + // palette is correctly reported... + //png_set_strip_alpha (png); + png_read_update_info (png, info); +- *channels = info->channels; ++ *channels = png_get_channels(png, info); + + rowbytes = png_get_rowbytes (png, info); + if((row_pointers = malloc (*height * sizeof (png_bytep))) == NULL){ diff --git a/media-gfx/pngtools/metadata.xml b/media-gfx/pngtools/metadata.xml new file mode 100644 index 000000000000..612ab3f2987c --- /dev/null +++ b/media-gfx/pngtools/metadata.xml @@ -0,0 +1,11 @@ + + + + + robbat2@gentoo.org + + + graphics@gentoo.org + Gentoo Graphics Project + + diff --git a/media-gfx/pngtools/pngtools-0.4-r2.ebuild b/media-gfx/pngtools/pngtools-0.4-r2.ebuild new file mode 100644 index 000000000000..b561e2cde5e5 --- /dev/null +++ b/media-gfx/pngtools/pngtools-0.4-r2.ebuild @@ -0,0 +1,34 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=4 +inherit autotools eutils + +MY_PV=${PV/./_} + +DESCRIPTION="A series of tools for the PNG image format" +HOMEPAGE="http://www.stillhq.com/pngtools/" +SRC_URI="http://www.stillhq.com/pngtools/source/pngtools_${MY_PV}.tgz" + +LICENSE="GPL-2" +SLOT="0" +KEYWORDS="amd64 ppc x86" +IUSE="" + +RDEPEND=">=media-libs/libpng-1.4:0" +DEPEND="${RDEPEND}" + +src_prepare() { + epatch "${FILESDIR}"/${PN}-0.3-implicit-declarations.patch + epatch "${FILESDIR}"/${P}-libpng14.patch + epatch "${FILESDIR}"/${P}-libpng15-fixes.patch + + eautoreconf +} + +src_install() { + emake DESTDIR="${D}" install + dodoc ABOUT AUTHORS ChangeLog NEWS README chunks.txt + insinto /usr/share/doc/${PF}/examples + doins *.png +} -- cgit v1.2.3