summaryrefslogtreecommitdiff
path: root/media-gfx/xv
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /media-gfx/xv
reinit the tree, so we can have metadata
Diffstat (limited to 'media-gfx/xv')
-rw-r--r--media-gfx/xv/Manifest15
-rw-r--r--media-gfx/xv/files/xv-3.10a-add-ldflags-20070520.patch27
-rw-r--r--media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch23
-rw-r--r--media-gfx/xv/files/xv-3.10a-fix-wait-20070520.patch40
-rw-r--r--media-gfx/xv/files/xv-3.10a-libpng15-r1.patch520
-rw-r--r--media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch38
-rw-r--r--media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch11
-rw-r--r--media-gfx/xv/files/xv-3.10a-wformat-security.patch19
-rw-r--r--media-gfx/xv/metadata.xml8
-rw-r--r--media-gfx/xv/xv-3.10a-r17.ebuild91
-rw-r--r--media-gfx/xv/xv-3.10a-r19.ebuild85
11 files changed, 877 insertions, 0 deletions
diff --git a/media-gfx/xv/Manifest b/media-gfx/xv/Manifest
new file mode 100644
index 000000000000..fad814f36fd5
--- /dev/null
+++ b/media-gfx/xv/Manifest
@@ -0,0 +1,15 @@
+AUX xv-3.10a-add-ldflags-20070520.patch 757 SHA256 c63c7461b2bdae9f42828871522ffe384bd1bf3f1dd982a7ed7346e267531762 SHA512 64d2d53dd301228aed398e6ec4813e6fcc37b7033f6a7e0dad49541d8ea7394ea18eb44f74a1ee08a33964bc6fcfc8000960bd3e2df7e363edc0365a71f1e8cc WHIRLPOOL 0391f9f8c58178b097790f01ff045ef2951c53188e6e3cbbd132c4e34427ff7c656e5db6fad3c316d12100f682b4a7f22b9e01adbfc2ab677978da404f540205
+AUX xv-3.10a-disable-jp2k-20070520.patch 607 SHA256 e6df5b9f70fbf121ffd7329b1360cb4a993a0cd39eab510322204d5c17e4e91d SHA512 e764150b153921bbb0a9dff6399efdf4ec5bec425e10529616fa0912a1bea819c5f1638b9f1ab7676ed0c51156c0e2e738c2641ff0899456cae394c67148702b WHIRLPOOL ddffce5f58560fbfd6b74523c16afd6e91824d8eab8426a23927aa74e81f5d6dded6eb7a16f87a8f7cfcb4e8683a1c6c2c903e05ec475b6b80056057c2646731
+AUX xv-3.10a-fix-wait-20070520.patch 1664 SHA256 840d8e0397367360004e23a26e27fa6074318bb20fc7ffcc575884369f66cece SHA512 da9ebfe21d9a9bf466b167215faed0548bd5711125ce84a8f886e9b6d6d298f48eba5385b77430cf07199f067b9e0fe23373d1951d6fe7456a927fc2aac77cc6 WHIRLPOOL 7bc3f2394e81ce5a415cf94481ad638d4c98abf0db5d7d013acd97e4bdcaa3251fe3d8bac92af7b629177da76fdd209f384f3d6d0c67ce2b723346079d95f2fa
+AUX xv-3.10a-libpng15-r1.patch 16530 SHA256 78dffcd6aef4a8d6de612bdfab2a1b0aa5f39eaceddb2ad356c8263d12e0cfca SHA512 f7ad73ddf83ac241565b99ea7c375b7ffe17f60ff7aa138521b887da14ec4b236a61a67068f3baf6048011a52d46b276940a3965cf34ad9dd46678ba100b6d08 WHIRLPOOL 218934f38a08925e577022f84c9a1829a6860a5e8513a4257cf93425944766a847712413a630890fb5bed3dda23162625402d68442fbe24d63c08b339f9fc7b0
+AUX xv-3.10a-osx-bsd-20070520.patch 1497 SHA256 481fe19b439d703f448142d7444dc72b66b84217e4d95042cd5594e227625048 SHA512 a6f1160c0658ae4f3394cf2bb0b324392593010539ac2dd52176a587c41844cd5bca61823af31633d765f3399a9cb52e0296f894a2f08060ef4c2b4d687d8b51 WHIRLPOOL 000950b0d32004c65b5d64f7a0407e96be56ab7e5ef69cee33024a2e3c0aeced21409cdc926f27beed48077b226575cf9a015474d33ab622cbb088e4b51310a2
+AUX xv-3.10a-vdcomp-osx-20070520.patch 455 SHA256 c4e29c992476598457ff53c6e1409c374d17e82385dd145922bb29967efd5cbc SHA512 8e389040ae3ac52dd086fbc1858699ea4bef417053952766a5569aab4ec70dbbd674a4e26adbc9434c0b411754d9643064d4254e72fbc79f99d3aefaf35f997b WHIRLPOOL d06958a14995f84e0b1459c53dd661dd90e600debdc70377878d867fd12bf71dfd2395482c93df81dd4292da322cd7e4283f342367c5bf401c9d34b87426554f
+AUX xv-3.10a-wformat-security.patch 519 SHA256 9aee4805bb3441ae3b925a39fbf2ddad4bda4bcb27dee6033dda752446d6fc26 SHA512 7e1150fdda9359e7b105729c92b8059bf5c762d468bcdaeadbb91ed75c2517b0ad627784a7a6f2bb8f7857884dc47f2d41c7c7247824fa4af8533dc023ceea52 WHIRLPOOL 8226b463a524050e077c461a753204a9f6b9bf0d08606620f2d026c6095da5a1936d9ca2a5bff0e3d4005d87cc35506cca336f26bd74b12ad5dd7626cbdc1718
+DIST xv-3.10a-jumbo-patches-20070520.tar.gz 1363802 SHA256 221ec89fdf0772bd09c845cbb337aecf411a1aee215140b676717f49e9e65c80 SHA512 e2ac5a3b4d743bf142c162b00815dd9d8dcaf345d0649016b2c6441fe2329879471b19453808e677c1a0b8eeb3468295dba160b1f30eacb2a7a9d8524ce03e75 WHIRLPOOL d4466b7a7fb2405dc9696e6d547e09746c7137e615ec3675c4c534bcd014ec4305b46731ff1f764fcbb309d8da67bc5c753f1af3fad0582ebcbeb16ae5ec5b9f
+DIST xv-3.10a.png.bz2 3082 SHA256 244cd9da79e86e0c0bc00bfaad09a18e229795eb0146925328ad147ec7adcfe9 SHA512 41e81c34e74a034292c2a8f525d1452614a2b42e980a1a2c93e3fcf990db528853d633496815e5fb2c897a780a2da171af590f436e2c7ef181eea00eb6922e9b WHIRLPOOL 9c98561933b3c69c795e88981a8d6719a3833b2b2680875bbd58baba4764dafacb19f426c23c00371ab11cf5eefe588b6ef460032599d6d33b55ce7a6c947211
+DIST xv-3.10a.tar.gz 2259124 SHA256 03eb26b1e8f315c3093f4ae794862ba46637d16c055e8efbe5e3beb5d40fc451 SHA512 5b8c5890503e2796638921cabae8967e458c73e332acea8561b1025ed13c771bc44c0e309b4592852e33726eeaa9784f933d1312073b0ba2e0b8c0cedabcaa3f WHIRLPOOL 1fd41559d0a3c02ba3f4da3b88925c982ddea5a14d16792a458e144e19c8cd1aef1759f232cdc20827892568a4cdee99df19562bbcad45039ee7f3ace7c13767
+EBUILD xv-3.10a-r17.ebuild 2598 SHA256 0e412adcd63e8601d615fc777b4cb1d3d7b7bb33188b4e1792b6aa6deed92c68 SHA512 6f56e5bc72b1912a8901355ed6847bbaea44bc4c11f05e5537e1921bb1b177537604116683e2f80d523675d778ca182fb474eb2070ee3c9d002ea621b467dd24 WHIRLPOOL 5320a866b2872608a1300daffb71882ccd1e5e83273f271562932ffa07d34cca9959f13399b9e04f9174c7c021a0d86e1215e23d942dc219e7e0beb85c995ae2
+EBUILD xv-3.10a-r19.ebuild 2455 SHA256 36fb5431f2c5f1ac598f85f081266ba001df95c85bc093ab6ebf401ff7750654 SHA512 580e634dc26b86c8b5ad6cc8076d9ef3d76777b1725a37dd46c0fa1ff8e5528ed5d5a81cf8474549263e77c657726330805cf963a98367af5c2cef7860df587c WHIRLPOOL e025d646056ef87190a5104fce32c970050953aa59f8fbf993f528598bf75cb77fed5ddb486a98920d5925d07500b84e11a6ebb79e769adb11825496d025c445
+MISC ChangeLog 5637 SHA256 7e3d79fb33706fe543f9f7895a5e8598f2b59ee000511cac38388a2a4cad2724 SHA512 c6f2385f0ac666de6677be4603cfc2a4c572243e0df1d7f1f531524cb63aaf40abf53cdbb6b033a497a8c272b024ab5164c1126c60f126c9ccdc43605fa126fe WHIRLPOOL 48ab56605a390c064bfdeb1177146601e20f7363bd1c5e45d5c5749e441d1e06214710e86488d04be31dd9dae0b49ed0a2d1b24307a922cb1e46faa080f7105d
+MISC ChangeLog-2015 16503 SHA256 badc1e0cc1514623cda4abf5fe67ffb84428a4d38f7dc93bccd6eac1b6b8e3b8 SHA512 0349730f96413c0292f6be74b44adfb7c1b097e42772e593eab1df825c691258a9d2411edc70494091940eb70e1f6df386b690951c2fa09642c1e5b62a04a069 WHIRLPOOL 45e6bd8e7f202765797010375a18f225ceed9f662c85cc5282363bf9dc9bdb6c8854947c10e50fc9f7f22712f5ef7425beec1ac682d162131e2620a841f2a8cd
+MISC metadata.xml 249 SHA256 7622b382eca17018140f7d12d366c6c452d7879d1c9006076e51f062ca3869e1 SHA512 2250a3bff9eebe0962c70d89aed4f7e95dd3d33b5c3171f02bcf99d972d5242ec04b25d73b3ffd99ce96a641cf8eb78befb41941a352f4ff754702712b4e937d WHIRLPOOL 3bff562cd95b4218b078a796ea324bf18ac8547fd2e5a78fa466a4c92a95af91530f7bc6b5211d84e5dc5a8cf83730dba5b4739abef50db99594f47154a5e3d4
diff --git a/media-gfx/xv/files/xv-3.10a-add-ldflags-20070520.patch b/media-gfx/xv/files/xv-3.10a-add-ldflags-20070520.patch
new file mode 100644
index 000000000000..da53ccb8bd6b
--- /dev/null
+++ b/media-gfx/xv/files/xv-3.10a-add-ldflags-20070520.patch
@@ -0,0 +1,27 @@
+--- xv-3.10a/Makefile.orig 2008-06-16 08:32:39.000000000 -0600
++++ xv-3.10a/Makefile 2008-06-16 08:49:19.000000000 -0600
+@@ -369,19 +369,19 @@
+
+ #xv: $(OBJS) $(JPEGLIB) $(TIFFLIB)
+ xv: $(OBJS)
+- $(CC) -o xv $(CFLAGS) $(OBJS) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o xv $(OBJS) $(LIBS)
+
+ bggen: bggen.c
+- $(CC) $(CFLAGS) -o bggen bggen.c $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o bggen bggen.c $(LIBS)
+
+ vdcomp: vdcomp.c
+- $(CC) $(CFLAGS) -o vdcomp vdcomp.c
++ $(CC) $(CFLAGS) $(LDFLAGS) -o vdcomp vdcomp.c
+
+ xcmap: xcmap.c
+- $(CC) $(CFLAGS) -o xcmap xcmap.c $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o xcmap xcmap.c $(LIBS)
+
+ xvpictoppm: xvpictoppm.c
+- $(CC) $(CFLAGS) -o xvpictoppm xvpictoppm.c
++ $(CC) $(CFLAGS) $(LDFLAGS) -o xvpictoppm xvpictoppm.c
+
+
+
diff --git a/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch b/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch
new file mode 100644
index 000000000000..7e42484abf48
--- /dev/null
+++ b/media-gfx/xv/files/xv-3.10a-disable-jp2k-20070520.patch
@@ -0,0 +1,23 @@
+--- xv-3.10a/Makefile~ 2007-06-24 15:41:58 -0600
++++ xv-3.10a/Makefile 2007-06-24 15:42:43 -0600
+@@ -176,16 +176,16 @@
+ ### if, for whatever reason, you're unable to get the JasPer JPEG-2000 library
+ ### to compile on your machine, *COMMENT OUT* the following lines
+ ###
+-JP2K = -DDOJP2K
++#JP2K = -DDOJP2K
+ ###
+ #JP2KDIR = ../../jasper
+-JP2KDIR = /usr/local/lib
++#JP2KDIR = /usr/local/lib
+ ###
+ #JP2KINC = -I$(JP2KDIR)
+-JP2KINC = -I/usr/local/include
++#JP2KINC = -I/usr/local/include
+ ###
+ #JP2KLIB = -L$(JP2KDIR) -ljasper
+-JP2KLIB = $(JP2KDIR)/libjasper.a
++#JP2KLIB = $(JP2KDIR)/libjasper.a
+
+
+ ###
diff --git a/media-gfx/xv/files/xv-3.10a-fix-wait-20070520.patch b/media-gfx/xv/files/xv-3.10a-fix-wait-20070520.patch
new file mode 100644
index 000000000000..ec093ab309c9
--- /dev/null
+++ b/media-gfx/xv/files/xv-3.10a-fix-wait-20070520.patch
@@ -0,0 +1,40 @@
+diff -Nur xv-3.10a_old/xvevent.c xv-3.10a/xvevent.c
+--- xv-3.10a_old/xvevent.c 2008-05-06 12:44:41.000000000 -0600
++++ xv-3.10a/xvevent.c 2008-05-06 15:55:59.000000000 -0600
+@@ -82,7 +82,7 @@
+ int retval,done,waiting;
+ #ifdef USE_TICKS
+ clock_t waitsec_ticks=0L, orgtime_ticks=0L, curtime_ticks;
+- clock_t elapsed_ticks=0L, remaining_interval;
++ clock_t elapsed_ticks=0L, remaining_interval, clock_ticks_per_sec;
+ #else
+ time_t orgtime=0L, curtime;
+ #endif
+@@ -126,7 +126,8 @@
+ all pending events (ie, drawing the image the first time)
+ have been dealt with: START WAITING */
+ #ifdef USE_TICKS
+- waitsec_ticks = (clock_t)(waitsec * CLK_TCK);
++ clock_ticks_per_sec = sysconf(_SC_CLK_TCK);
++ waitsec_ticks = (clock_t)(waitsec * clock_ticks_per_sec);
+ orgtime_ticks = times(NULL); /* unclear if NULL valid, but OK on Linux */
+ #else
+ orgtime = time(NULL);
+@@ -168,11 +169,14 @@
+ } else
+ elapsed_ticks = curtime_ticks - orgtime_ticks;
+ remaining_interval = waitsec_ticks - elapsed_ticks;
+- if (remaining_interval >= (clock_t)(1 * CLK_TCK))
++ if (remaining_interval > clock_ticks_per_sec)
+ sleep(1);
+ else {
+- /* less than one second remaining: do delay in msec, then return */
+- Timer((remaining_interval * 1000L) / CLK_TCK); /* can't overflow */
++ if (remaining_interval > 0) {
++ /* less than one second remaining: do delay in msec, then return */
++ Timer((remaining_interval * 1000L) / clock_ticks_per_sec); /* can't overflow */
++ }
++
+ return waitloop? NEXTLOOP : NEXTQUIT;
+ }
+ #else
diff --git a/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch b/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch
new file mode 100644
index 000000000000..9905c4b8ae7e
--- /dev/null
+++ b/media-gfx/xv/files/xv-3.10a-libpng15-r1.patch
@@ -0,0 +1,520 @@
+--- xv-3.10a/xvinfo.c
++++ xv-3.10a/xvinfo.c
+@@ -26,7 +26,7 @@
+ #define INFOHIGH 270
+
+ /* max length of an Info String */
+-#define ISTRLEN 80
++#define ISTRLEN 256
+
+ /* baseline of top line of text */
+ #define TOPBASE (36 + penn_height/2 + 4 + 8 + ASCENT)
+--- xv-3.10a/xvpng.c
++++ xv-3.10a/xvpng.c
+@@ -31,6 +31,7 @@
+
+ #ifdef HAVE_PNG
+
++#include "zlib.h"
+ #include "png.h"
+
+ /*** Stuff for PNG Dialog box ***/
+@@ -41,7 +42,9 @@
+ #define COMPRESSION 6 /* default zlib compression level, not max
+ (Z_BEST_COMPRESSION) */
+
+-#define HAVE_tRNS (info_ptr->valid & PNG_INFO_tRNS)
++/* old
++#define HAVE_tRNS (info_ptr->valid & PNG_INFO_tRNS) */
++#define HAVE_tRNS png_get_valid(png_ptr,info_ptr,PNG_INFO_tRNS)
+
+ #define DWIDE 86
+ #define DHIGH 104
+@@ -444,6 +447,10 @@
+ byte *p, *png_line;
+ char software[256];
+ char *savecmnt;
++ /* for storing values until all are accumulated, so that the image header can be set in full */
++ int _bit_depth,_color_type,_interlace_type,_compression_type,_filter_type;
++ png_uint_32 _width,_height;
++ png_time _mod_time;
+
+ if ((png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL,
+ png_xv_error, png_xv_warning)) == NULL) {
+@@ -458,7 +465,7 @@
+ FatalError(software);
+ }
+
+- if (setjmp(png_ptr->jmpbuf)) {
++ if (setjmp(png_jmpbuf(png_ptr))) {
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ return -1;
+ }
+@@ -489,8 +496,8 @@
+ png_set_filter(png_ptr, 0, filter);
+ }
+
+- info_ptr->width = w;
+- info_ptr->height = h;
++ _width = w;
++ _height = h;
+ if (w <= 0 || h <= 0) {
+ SetISTR(ISTR_WARNING, "%s: image dimensions out of range (%dx%d)",
+ fbasename, w, h);
+@@ -498,7 +505,7 @@
+ return -1;
+ }
+
+- info_ptr->interlace_type = interCB.val ? 1 : 0;
++ _interlace_type = interCB.val ? PNG_INTERLACE_ADAM7 : PNG_INTERLACE_NONE;
+
+ linesize = 0; /* quiet a compiler warning */
+
+@@ -542,40 +549,44 @@
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ return -1;
+ }
+- info_ptr->color_type = PNG_COLOR_TYPE_RGB;
+- info_ptr->bit_depth = 8;
++ _color_type = PNG_COLOR_TYPE_RGB;
++ _bit_depth = 8;
+ } else /* ptype == PIC8 */ {
+ linesize = w;
+- info_ptr->color_type = PNG_COLOR_TYPE_PALETTE;
++ _color_type = PNG_COLOR_TYPE_PALETTE;
+ if (numuniqcols <= 2)
+- info_ptr->bit_depth = 1;
++ _bit_depth = 1;
+ else
+ if (numuniqcols <= 4)
+- info_ptr->bit_depth = 2;
++ _bit_depth = 2;
+ else
+ if (numuniqcols <= 16)
+- info_ptr->bit_depth = 4;
++ _bit_depth = 4;
+ else
+- info_ptr->bit_depth = 8;
++ _bit_depth = 8;
+
+ for (i = 0; i < numuniqcols; i++) {
+ palette[i].red = r1[i];
+ palette[i].green = g1[i];
+ palette[i].blue = b1[i];
+ }
+- info_ptr->num_palette = numuniqcols;
+- info_ptr->palette = palette;
++/* cannot find a setter for this, unsure if it is necessary anymore...
+ info_ptr->valid |= PNG_INFO_PLTE;
++*/
++ /* set the header just in case it's needed */
++ png_set_IHDR(png_ptr,info_ptr,_width,_height,_bit_depth,_color_type,
++ _interlace_type,PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT);
++ png_set_PLTE(png_ptr,info_ptr,palette,numuniqcols);
+ }
+ }
+
+ else if (colorType == F_GREYSCALE || colorType == F_BWDITHER) {
+- info_ptr->color_type = PNG_COLOR_TYPE_GRAY;
++ _color_type = PNG_COLOR_TYPE_GRAY;
+ if (colorType == F_BWDITHER) {
+ /* shouldn't happen */
+ if (ptype == PIC24) FatalError("PIC24 and B/W Stipple in WritePNG()");
+
+- info_ptr->bit_depth = 1;
++ _bit_depth = 1;
+ if (MONO(r1[0], g1[0], b1[0]) > MONO(r1[1], g1[1], b1[1])) {
+ remap[0] = 1;
+ remap[1] = 0;
+@@ -595,7 +606,7 @@
+ png_destroy_write_struct(&png_ptr, &info_ptr);
+ return -1;
+ }
+- info_ptr->bit_depth = 8;
++ _bit_depth = 8;
+ }
+ else /* ptype == PIC8 */ {
+ int low_precision;
+@@ -617,7 +628,7 @@
+ for (; i < 256; i++)
+ remap[i]=0; /* shouldn't be necessary, but... */
+
+- info_ptr->bit_depth = 8;
++ _bit_depth = 8;
+
+ /* Note that this fails most of the time because of gamma */
+ /* (and that would be a bug: GRR FIXME) */
+@@ -636,7 +647,7 @@
+ for (i = 0; i < numuniqcols; i++) {
+ remap[i] &= 0xf;
+ }
+- info_ptr->bit_depth = 4;
++ _bit_depth = 4;
+
+ /* try to adjust to 2-bit precision grayscale */
+
+@@ -652,7 +663,7 @@
+ for (i = 0; i < numuniqcols; i++) {
+ remap[i] &= 3;
+ }
+- info_ptr->bit_depth = 2;
++ _bit_depth = 2;
+
+ /* try to adjust to 1-bit precision grayscale */
+
+@@ -668,7 +679,7 @@
+ for (i = 0; i < numuniqcols; i++) {
+ remap[i] &= 1;
+ }
+- info_ptr->bit_depth = 1;
++ _bit_depth = 1;
+ }
+ }
+ }
+@@ -677,6 +688,9 @@
+ else
+ png_error(png_ptr, "Unknown colorstyle in WritePNG");
+
++ png_set_IHDR(png_ptr,info_ptr,_width,_height,_bit_depth,_color_type,
++ _interlace_type,PNG_COMPRESSION_TYPE_DEFAULT,PNG_FILTER_TYPE_DEFAULT);
++
+ if ((text = (png_textp)malloc(sizeof(png_text)))) {
+ sprintf(software, "XV %s", REVDATE);
+
+@@ -685,20 +699,22 @@
+ text->text = software;
+ text->text_length = strlen(text->text);
+
+- info_ptr->max_text = 1;
+- info_ptr->num_text = 1;
+- info_ptr->text = text;
++/* max_text seems to be internal only now, do not set
++ info_ptr->max_text = 1; */
++ png_set_text(png_ptr,info_ptr,text,1);
+ }
+
+ Display_Gamma = gDial.val; /* Save the current gamma for loading */
+
+ // GRR FIXME: add .Xdefaults option to omit writing gamma (size, cumulative errors when editing)--alternatively, modify save box to include "omit" checkbox
+- info_ptr->gamma = 1.0/gDial.val;
+- info_ptr->valid |= PNG_INFO_gAMA;
++ png_set_gAMA(png_ptr,info_ptr,1.0/gDial.val);
++/* doesn't seem to be a way to set valid directly anymore, unnecessary maybe..
++ info_ptr->valid |= PNG_INFO_gAMA; */
+
++/* might need to be png_write_info_before_PLTE() ... */
+ png_write_info(png_ptr, info_ptr);
+
+- if (info_ptr->bit_depth < 8)
++ if (_bit_depth < 8)
+ png_set_packing(png_ptr);
+
+ pass=png_set_interlace_handling(png_ptr);
+@@ -711,13 +727,13 @@
+ int j;
+ p = pic;
+ for (j = 0; j < h; ++j) {
+- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY) {
++ if (_color_type == PNG_COLOR_TYPE_GRAY) {
+ int k;
+ for (k = 0; k < w; ++k)
+ png_line[k] = ptype==PIC24 ? MONO(p[k*3], p[k*3+1], p[k*3+2]) :
+ remap[pc2nc[p[k]]];
+ png_write_row(png_ptr, png_line);
+- } else if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE) {
++ } else if (_color_type == PNG_COLOR_TYPE_PALETTE) {
+ int k;
+ for (k = 0; k < w; ++k)
+ png_line[k] = pc2nc[p[k]];
+@@ -739,28 +755,31 @@
+ (savecmnt = (char *)malloc((strlen(picComments) + 1)*sizeof(char)))) {
+ png_textp tp;
+ char *comment, *key;
++ int nt;
++ int mt;
+
+ strcpy(savecmnt, picComments);
+ key = savecmnt;
++ png_get_text(png_ptr,info_ptr,&tp,&mt); /* to get 'max_text' */
+ tp = text;
+- info_ptr->num_text = 0;
++ nt = 0;
+
+ comment = strchr(key, ':');
+
+ do {
+ /* Allocate a larger structure for comments if necessary */
+- if (info_ptr->num_text >= info_ptr->max_text)
++ if (nt >= mt)
+ {
+ if ((tp =
+- realloc(text, (info_ptr->num_text + 2)*sizeof(png_text))) == NULL)
++ realloc(text, (nt + 2)*sizeof(png_text))) == NULL)
+ {
+ break;
+ }
+ else
+ {
+ text = tp;
+- tp = &text[info_ptr->num_text];
+- info_ptr->max_text += 2;
++ tp = &text[nt];
++ mt += 2;
+ }
+ }
+
+@@ -810,7 +829,7 @@
+ }
+
+ tp->compression = tp->text_length > 640 ? 0 : -1;
+- info_ptr->num_text++;
++ nt++;
+ tp++;
+ }
+ }
+@@ -834,27 +853,29 @@
+ tp->text = key;
+ tp->text_length = q - key;
+ tp->compression = tp->text_length > 750 ? 0 : -1;
+- info_ptr->num_text++;
++ nt++;
+ key = NULL;
+ }
+ } while (key && *key);
++ png_set_text(png_ptr,info_ptr,text,nt);
+ }
+ else {
+- info_ptr->num_text = 0;
++ png_set_text(png_ptr,info_ptr,text,0);
+ }
+ }
+- info_ptr->text = text;
+
+- png_convert_from_time_t(&(info_ptr->mod_time), time(NULL));
+- info_ptr->valid |= PNG_INFO_tIME;
++ png_convert_from_time_t(&_mod_time, time(NULL));
++ png_set_tIME(png_ptr,info_ptr,&_mod_time);
++/* dunno how to set validity
++ info_ptr->valid |= PNG_INFO_tIME; */
+
+ png_write_end(png_ptr, info_ptr);
+ fflush(fp); /* just in case we core-dump before finishing... */
+
+ if (text) {
+ free(text);
+- /* must do this or png_destroy_write_struct() 0.97+ will free text again: */
+- info_ptr->text = (png_textp)NULL;
++ /* must do this or png_destroy_write_struct() 0.97+ will free text again:
++ info_ptr->text = (png_textp)NULL; */
+ if (savecmnt)
+ {
+ free(savecmnt);
+@@ -886,6 +907,14 @@
+ int pass;
+ int gray_to_rgb;
+ size_t commentsize;
++ /* temp storage vars for libpng15 migration */
++ int _bit_depth,_color_type,_interlace_type,_compression_type,_filter_type,_num_text,_num_palette;
++ png_uint_32 _width,_height;
++ png_timep _mod_time;
++ double _gamma;
++ png_textp _text;
++ png_colorp _palette;
++ png_color_16p _background;
+
+ fbasename = BaseName(fname);
+
+@@ -921,7 +950,7 @@
+ FatalError("malloc failure in LoadPNG");
+ }
+
+- if (setjmp(png_ptr->jmpbuf)) {
++ if (setjmp(png_jmpbuf(png_ptr))) {
+ fclose(fp);
+ png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL);
+ if (!read_anything) {
+@@ -945,8 +974,10 @@
+ #endif
+ png_read_info(png_ptr, info_ptr);
+
+- pinfo->w = pinfo->normw = info_ptr->width;
+- pinfo->h = pinfo->normh = info_ptr->height;
++ png_get_IHDR(png_ptr,info_ptr,&_width,&_height,&_bit_depth,&_color_type,&_interlace_type,NULL,NULL);
++
++ pinfo->w = pinfo->normw = _width;
++ pinfo->h = pinfo->normh = _height;
+ if (pinfo->w <= 0 || pinfo->h <= 0) {
+ SetISTR(ISTR_WARNING, "%s: image dimensions out of range (%dx%d)",
+ fbasename, pinfo->w, pinfo->h);
+@@ -957,9 +988,9 @@
+ pinfo->frmType = F_PNG;
+
+ sprintf(pinfo->fullInfo, "PNG, %d bit ",
+- info_ptr->bit_depth * info_ptr->channels);
++ _bit_depth * png_get_channels(png_ptr,info_ptr));
+
+- switch(info_ptr->color_type) {
++ switch(_color_type) {
+ case PNG_COLOR_TYPE_PALETTE:
+ strcat(pinfo->fullInfo, "palette color");
+ break;
+@@ -983,15 +1014,17 @@
+
+ sprintf(pinfo->fullInfo + strlen(pinfo->fullInfo),
+ ", %sinterlaced. (%d bytes)",
+- info_ptr->interlace_type ? "" : "non-", filesize);
++ _interlace_type ? "" : "non-", filesize);
+
+- sprintf(pinfo->shrtInfo, "%lux%lu PNG", info_ptr->width, info_ptr->height);
++ sprintf(pinfo->shrtInfo, "%lux%lu PNG", _width, _height);
+
+- if (info_ptr->bit_depth < 8)
++ if (_bit_depth < 8)
+ png_set_packing(png_ptr);
+
+- if (info_ptr->valid & PNG_INFO_gAMA)
+- png_set_gamma(png_ptr, Display_Gamma, info_ptr->gamma);
++ if (png_get_valid(png_ptr,info_ptr,PNG_INFO_gAMA)) {
++ png_get_gAMA(png_ptr,info_ptr,&_gamma);
++ png_set_gamma(png_ptr, Display_Gamma, _gamma);
++ }
+ /*
+ *else
+ * png_set_gamma(png_ptr, Display_Gamma, 0.45);
+@@ -1000,7 +1033,7 @@
+ gray_to_rgb = 0; /* quiet a compiler warning */
+
+ if (have_imagebg) {
+- if (info_ptr->bit_depth == 16) {
++ if (_bit_depth == 16) {
+ my_background.red = imagebgR;
+ my_background.green = imagebgG;
+ my_background.blue = imagebgB;
+@@ -1013,8 +1046,8 @@
+ }
+ png_set_background(png_ptr, &my_background, PNG_BACKGROUND_GAMMA_SCREEN,
+ 0, Display_Gamma);
+- if ((info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA ||
+- (info_ptr->color_type == PNG_COLOR_TYPE_GRAY && HAVE_tRNS)) &&
++ if ((_color_type == PNG_COLOR_TYPE_GRAY_ALPHA ||
++ (_color_type == PNG_COLOR_TYPE_GRAY && HAVE_tRNS)) &&
+ (imagebgR != imagebgG || imagebgR != imagebgB)) /* i.e., colored bg */
+ {
+ png_set_gray_to_rgb(png_ptr);
+@@ -1022,8 +1055,9 @@
+ gray_to_rgb = 1;
+ }
+ } else {
+- if (info_ptr->valid & PNG_INFO_bKGD) {
+- png_set_background(png_ptr, &info_ptr->background,
++ if (png_get_valid(png_ptr,info_ptr,PNG_INFO_bKGD)) {
++ png_get_bKGD(png_ptr,info_ptr,&_background);
++ png_set_background(png_ptr, _background,
+ PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
+ } else {
+ my_background.red = my_background.green = my_background.blue =
+@@ -1033,13 +1067,13 @@
+ }
+ }
+
+- if (info_ptr->bit_depth == 16)
++ if (_bit_depth == 16)
+ png_set_strip_16(png_ptr);
+
+- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
++ if (_color_type == PNG_COLOR_TYPE_GRAY ||
++ _color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
+ {
+- if (info_ptr->bit_depth == 1)
++ if (_bit_depth == 1)
+ pinfo->colType = F_BWDITHER;
+ else
+ pinfo->colType = F_GREYSCALE;
+@@ -1049,9 +1083,11 @@
+ pass=png_set_interlace_handling(png_ptr);
+
+ png_read_update_info(png_ptr, info_ptr);
++ /* get HIDR again just in case the info_ptr changed */
++ png_get_IHDR(png_ptr,info_ptr,&_width,&_height,&_bit_depth,&_color_type,&_interlace_type,NULL,NULL);
+
+- if (info_ptr->color_type == PNG_COLOR_TYPE_RGB ||
+- info_ptr->color_type == PNG_COLOR_TYPE_RGB_ALPHA || gray_to_rgb)
++ if (_color_type == PNG_COLOR_TYPE_RGB ||
++ _color_type == PNG_COLOR_TYPE_RGB_ALPHA || gray_to_rgb)
+ {
+ linesize = 3 * pinfo->w;
+ if (linesize/3 < pinfo->w) { /* know pinfo->w > 0 (see above) */
+@@ -1065,16 +1101,17 @@
+ } else {
+ linesize = pinfo->w;
+ pinfo->type = PIC8;
+- if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY ||
+- info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
++ if (_color_type == PNG_COLOR_TYPE_GRAY ||
++ _color_type == PNG_COLOR_TYPE_GRAY_ALPHA) {
+ for (i = 0; i < 256; i++)
+ pinfo->r[i] = pinfo->g[i] = pinfo->b[i] = i;
+ } else {
+ pinfo->colType = F_FULLCOLOR;
+- for (i = 0; i < info_ptr->num_palette; i++) {
+- pinfo->r[i] = info_ptr->palette[i].red;
+- pinfo->g[i] = info_ptr->palette[i].green;
+- pinfo->b[i] = info_ptr->palette[i].blue;
++ png_get_PLTE(png_ptr,info_ptr,&_palette,&_num_palette);
++ for (i = 0; i < _num_palette; i++) {
++ pinfo->r[i] = _palette[i].red;
++ pinfo->g[i] = _palette[i].green;
++ pinfo->b[i] = _palette[i].blue;
+ }
+ }
+ }
+@@ -1092,7 +1129,7 @@
+ png_error(png_ptr, "can't allocate space for PNG image");
+ }
+
+- png_start_read_image(png_ptr);
++ /*png_start_read_image(png_ptr); -- causes a warning and seems to be unnecessary */
+
+ for (i = 0; i < pass; i++) {
+ byte *p = pinfo->pic;
+@@ -1106,22 +1143,23 @@
+
+ png_read_end(png_ptr, info_ptr);
+
+- if (info_ptr->num_text > 0) {
++ png_get_text(png_ptr,info_ptr,&_text,&_num_text);
++ if (_num_text > 0) {
+ commentsize = 1;
+
+- for (i = 0; i < info_ptr->num_text; i++)
+- commentsize += strlen(info_ptr->text[i].key) + 1 +
+- info_ptr->text[i].text_length + 2;
++ for (i = 0; i < _num_text; i++)
++ commentsize += strlen(_text[i].key) + 1 +
++ _text[i].text_length + 2;
+
+ if ((pinfo->comment = malloc(commentsize)) == NULL) {
+ png_warning(png_ptr,"can't allocate comment string");
+ }
+ else {
+ pinfo->comment[0] = '\0';
+- for (i = 0; i < info_ptr->num_text; i++) {
+- strcat(pinfo->comment, info_ptr->text[i].key);
++ for (i = 0; i < _num_text; i++) {
++ strcat(pinfo->comment, _text[i].key);
+ strcat(pinfo->comment, "::");
+- strcat(pinfo->comment, info_ptr->text[i].text);
++ strncat(pinfo->comment, _text[i].text, _text[i].text_length);
+ strcat(pinfo->comment, "\n");
+ }
+ }
+@@ -1143,7 +1181,7 @@
+ {
+ SetISTR(ISTR_WARNING,"%s: libpng error: %s", fbasename, message);
+
+- longjmp(png_ptr->jmpbuf, 1);
++ longjmp(png_jmpbuf(png_ptr), 1);
+ }
+
+
diff --git a/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch b/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch
new file mode 100644
index 000000000000..ecafd1ddf56e
--- /dev/null
+++ b/media-gfx/xv/files/xv-3.10a-osx-bsd-20070520.patch
@@ -0,0 +1,38 @@
+--- xv-3.10a/xv.h~ 2007-06-24 14:30:42 -0600
++++ xv-3.10a/xv.h 2007-06-24 14:42:04 -0600
+@@ -158,7 +158,7 @@
+
+ #ifndef VMS
+ # include <errno.h>
+-# ifndef __NetBSD__
++# if !defined(__NetBSD__) && !defined(__FreeBSD__) && !defined(__APPLE__)
+ # if !(defined __GLIBC__ && __GLIBC__ >= 2)
+ extern int errno; /* SHOULD be in errno.h, but often isn't */
+ extern char *sys_errlist[]; /* this too... */
+@@ -171,7 +171,7 @@
+ #ifdef VMS
+ # define ERRSTR(x) strerror(x, vaxc$errno)
+ #else
+-# if defined(__BEOS__) || defined(__linux__) /* or all modern/glibc systems? */
++# if defined(__BEOS__) || defined(__linux__) || defined(__APPLE__) /* or all modern/glibc systems? */
+ # define ERRSTR(x) strerror(x)
+ # else
+ # define ERRSTR(x) sys_errlist[x]
+@@ -206,6 +206,8 @@
+ #ifdef NEED_MALLOC_H
+ # if defined(hp300) || defined(hp800) || defined(NeXT)
+ # include <sys/malloc.h> /* it's in "sys" on HPs and NeXT */
++# elif defined(__APPLE__)
++# include <malloc/malloc.h>
+ # else
+ # include <malloc.h>
+ # endif
+@@ -369,7 +371,7 @@
+ * them later. */
+ #ifndef VMS /* VMS hates multi-line definitions */
+ # if defined(__linux__) || defined(__OpenBSD__) || defined(__NetBSD__) || \
+- defined(__bsdi__)
++ defined(__FreeBSD__) || defined(__bsdi__) || defined(__APPLE__)
+ # ifndef USE_MKSTEMP
+ # define USE_MKSTEMP /* use 'mkstemp()' instead of 'mktemp()' */
+ # endif /* >> SECURITY ISSUE << */
diff --git a/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch b/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch
new file mode 100644
index 000000000000..2c82b1ae43e6
--- /dev/null
+++ b/media-gfx/xv/files/xv-3.10a-vdcomp-osx-20070520.patch
@@ -0,0 +1,11 @@
+--- xv-3.10a/vdcomp.c~ 2007-06-24 14:30:42 -0600
++++ xv-3.10a/vdcomp.c 2007-06-24 14:48:12 -0600
+@@ -123,6 +123,8 @@
+
+ # if defined(hp300) || defined(hp800) || defined(NeXT)
+ # include <sys/malloc.h> /* it's in "sys" on HPs and NeXT */
++# elif defined(__APPLE__)
++# include <malloc/malloc.h>
+ # else
+ # include <malloc.h> /* FIXME: should explicitly list systems that NEED this, not everyone that doesn't */
+ # endif
diff --git a/media-gfx/xv/files/xv-3.10a-wformat-security.patch b/media-gfx/xv/files/xv-3.10a-wformat-security.patch
new file mode 100644
index 000000000000..34d2c19ebae3
--- /dev/null
+++ b/media-gfx/xv/files/xv-3.10a-wformat-security.patch
@@ -0,0 +1,19 @@
+Fix errors caused by -Wformat -Werror=format-security
+https://bugs.gentoo.org/show_bug.cgi?id=542134
+
+* xvpbm.c:888:4: error: format not a string literal and no format arguments [-Werror=format-security]
+* if (*pix) fprintf(fp,str1);
+
+--- xv-3.10a/xvpbm.c
++++ xv-3.10a/xvpbm.c
+@@ -885,8 +885,8 @@
+ }
+ }
+ else {
+- if (*pix) fprintf(fp,str1);
+- else fprintf(fp,str0);
++ if (*pix) fprintf(fp,"%s",str1);
++ else fprintf(fp,"%s",str0);
+ len+=2;
+ if (len>68) { fprintf(fp,"\n"); len=0; }
+ }
diff --git a/media-gfx/xv/metadata.xml b/media-gfx/xv/metadata.xml
new file mode 100644
index 000000000000..8235e845464e
--- /dev/null
+++ b/media-gfx/xv/metadata.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <!-- maintainer-needed -->
+ <upstream>
+ <remote-id type="sourceforge">png-mng</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-gfx/xv/xv-3.10a-r17.ebuild b/media-gfx/xv/xv-3.10a-r17.ebuild
new file mode 100644
index 000000000000..84423f73c816
--- /dev/null
+++ b/media-gfx/xv/xv-3.10a-r17.ebuild
@@ -0,0 +1,91 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=5
+inherit eutils flag-o-matic
+
+JUMBOV=20070520
+DESCRIPTION="Interactive image manipulation program supporting a wide variety of formats"
+HOMEPAGE="http://www.trilon.com/xv/index.html http://www.sonic.net/~roelofs/greg_xv.html"
+SRC_URI="mirror://sourceforge/png-mng/${P}-jumbo-patches-${JUMBOV}.tar.gz
+ ftp://ftp.cis.upenn.edu/pub/xv/${P}.tar.gz
+ mirror://gentoo/${P}.png.bz2"
+
+LICENSE="xv"
+SLOT="0"
+KEYWORDS="alpha amd64 hppa ia64 ~mips ppc ppc64 sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="jpeg tiff png"
+
+DEPEND="x11-libs/libXt
+ jpeg? ( virtual/jpeg:0 )
+ tiff? ( media-libs/tiff:0 )
+ png? ( >=media-libs/libpng-1.2:0= sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+src_prepare() {
+ # Apply the jumbo patch
+ epatch "${WORKDIR}"/${P}-jumbo-fix-enh-patch-${JUMBOV}.txt
+
+ # OSX and BSD xv.h define patches
+ epatch "${FILESDIR}"/${P}-osx-bsd-${JUMBOV}.patch
+
+ # OSX malloc patch
+ epatch "${FILESDIR}"/${P}-vdcomp-osx-${JUMBOV}.patch
+
+ # Disable JP2K (i.e. use system JPEG libs)
+ epatch "${FILESDIR}"/${P}-disable-jp2k-${JUMBOV}.patch
+
+ # Fix -wait option (do not rely on obsolete CLK_TCK)
+ epatch "${FILESDIR}"/${P}-fix-wait-${JUMBOV}.patch
+
+ # Use LDFLAGS on link lines
+ epatch "${FILESDIR}"/${P}-add-ldflags-${JUMBOV}.patch
+
+ epatch "${FILESDIR}"/${P}-libpng15-r1.patch
+
+ # Link with various image libraries depending on use flags
+ IMAGE_LIBS=""
+ use jpeg && IMAGE_LIBS="${IMAGE_LIBS} -ljpeg"
+ use png && IMAGE_LIBS="${IMAGE_LIBS} -lz -lpng"
+ use tiff && IMAGE_LIBS="${IMAGE_LIBS} -ltiff"
+
+ sed -i \
+ -e 's/\(^JPEG.*\)/#\1/g' \
+ -e 's/\(^PNG.*\)/#\1/g' \
+ -e 's/\(^TIFF.*\)/#\1/g' \
+ -e "s/\(^LIBS = .*\)/\1${IMAGE_LIBS}/g" Makefile
+
+ # /usr/bin/gzip => /bin/gzip
+ sed -i -e 's#/usr\(/bin/gzip\)#'"${EPREFIX}"'\1#g' config.h
+
+ # Fix installation of ps docs
+ sed -i -e 's#$(DESTDIR)$(LIBDIR)#$(LIBDIR)#g' Makefile
+}
+
+src_compile() {
+ append-flags -DUSE_GETCWD -DLINUX -DUSLEEP
+ use jpeg && append-flags -DDOJPEG
+ use png && append-flags -DDOPNG
+ use tiff && append-flags -DDOTIFF -DUSE_TILED_TIFF_BOTLEFT_FIX
+
+ emake \
+ CC="$(tc-getCC)" CCOPTS="${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+ PREFIX="${EPREFIX}"/usr \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ LIBDIR="${T}"
+}
+
+src_install() {
+ dodir /usr/bin
+ dodir /usr/share/man/man1
+
+ emake \
+ DESTDIR="${D}" \
+ PREFIX="${EPREFIX}"/usr \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ LIBDIR="${T}" install
+
+ dodoc CHANGELOG BUGS IDEAS
+ newicon "${WORKDIR}"/${P}.png ${PN}.png
+ make_desktop_entry xv "" "" "Graphics;Viewer"
+}
diff --git a/media-gfx/xv/xv-3.10a-r19.ebuild b/media-gfx/xv/xv-3.10a-r19.ebuild
new file mode 100644
index 000000000000..1b021ad5df62
--- /dev/null
+++ b/media-gfx/xv/xv-3.10a-r19.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+inherit eutils flag-o-matic
+
+JUMBOV=20070520
+DESCRIPTION="Interactive image manipulation program supporting a wide variety of formats"
+HOMEPAGE="http://www.trilon.com/xv/index.html http://www.sonic.net/~roelofs/greg_xv.html"
+SRC_URI="mirror://sourceforge/png-mng/${P}-jumbo-patches-${JUMBOV}.tar.gz
+ ftp://ftp.cis.upenn.edu/pub/xv/${P}.tar.gz
+ mirror://gentoo/${P}.png.bz2"
+
+LICENSE="xv"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~sparc ~x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
+IUSE="jpeg tiff png"
+
+DEPEND="x11-libs/libXt
+ jpeg? ( virtual/jpeg:0 )
+ tiff? ( media-libs/tiff:0 )
+ png? ( >=media-libs/libpng-1.2:0= sys-libs/zlib )"
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${WORKDIR}/${P}-jumbo-fix-enh-patch-${JUMBOV}.txt"
+ "${FILESDIR}/${P}-osx-bsd-${JUMBOV}.patch"
+ "${FILESDIR}/${P}-vdcomp-osx-${JUMBOV}.patch"
+ "${FILESDIR}/${P}-disable-jp2k-${JUMBOV}.patch"
+ "${FILESDIR}/${P}-fix-wait-${JUMBOV}.patch"
+ "${FILESDIR}/${P}-add-ldflags-${JUMBOV}.patch"
+ "${FILESDIR}/${P}-libpng15-r1.patch"
+ "${FILESDIR}/${P}-wformat-security.patch"
+)
+
+src_prepare() {
+ default
+
+ append-cppflags -DUSE_GETCWD -DLINUX -DUSLEEP
+ use jpeg && append-cppflags -DDOJPEG
+ use png && append-cppflags -DDOPNG
+ use tiff && append-cppflags -DDOTIFF -DUSE_TILED_TIFF_BOTLEFT_FIX
+
+ # Link with various image libraries depending on use flags
+ IMAGE_LIBS=""
+ use jpeg && IMAGE_LIBS="${IMAGE_LIBS} -ljpeg"
+ use png && IMAGE_LIBS="${IMAGE_LIBS} -lz -lpng"
+ use tiff && IMAGE_LIBS="${IMAGE_LIBS} -ltiff"
+
+ sed -i \
+ -e 's/\(^JPEG.*\)/#\1/g' \
+ -e 's/\(^PNG.*\)/#\1/g' \
+ -e 's/\(^TIFF.*\)/#\1/g' \
+ -e "s/\(^LIBS = .*\)/\1${IMAGE_LIBS}/g" Makefile || die
+
+ # /usr/bin/gzip => /bin/gzip
+ sed -i -e 's#/usr\(/bin/gzip\)#'"${EPREFIX}"'\1#g' config.h || die
+
+ # Fix installation of ps docs
+ sed -i -e 's#$(DESTDIR)$(LIBDIR)#$(LIBDIR)#g' Makefile || die
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" CCOPTS="${CPPFLAGS} ${CFLAGS}" LDFLAGS="${LDFLAGS}" \
+ PREFIX="${EPREFIX}"/usr \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ LIBDIR="${T}"
+}
+
+src_install() {
+ dodir /usr/bin
+ dodir /usr/share/man/man1
+
+ emake \
+ DESTDIR="${D}" \
+ PREFIX="${EPREFIX}"/usr \
+ DOCDIR="${EPREFIX}/usr/share/doc/${PF}" \
+ LIBDIR="${T}" install
+
+ dodoc CHANGELOG BUGS IDEAS
+ newicon "${WORKDIR}"/${P}.png ${PN}.png
+ make_desktop_entry xv "" "" "Graphics;Viewer"
+}