summaryrefslogtreecommitdiff
path: root/media-gfx/xloadimage
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/xloadimage
reinit the tree, so we can have metadata
Diffstat (limited to 'media-gfx/xloadimage')
-rw-r--r--media-gfx/xloadimage/Manifest14
-rw-r--r--media-gfx/xloadimage/files/xloadimage-4.1-bracket.patch13
-rw-r--r--media-gfx/xloadimage/files/xloadimage-4.1-endif.patch11
-rw-r--r--media-gfx/xloadimage/files/xloadimage-4.1-include-errno_h.patch13
-rw-r--r--media-gfx/xloadimage/files/xloadimage-4.1-ldflags_and_exit.patch23
-rw-r--r--media-gfx/xloadimage/files/xloadimage-4.1-libpng15.patch29
-rw-r--r--media-gfx/xloadimage/files/xloadimage-4.1-unaligned-access.patch51
-rw-r--r--media-gfx/xloadimage/files/xloadimage-4.1-zio-shell-meta-char.diff36
-rw-r--r--media-gfx/xloadimage/files/xloadimage-gentoo.patch258
-rw-r--r--media-gfx/xloadimage/metadata.xml8
-rw-r--r--media-gfx/xloadimage/xloadimage-4.1-r11.ebuild94
11 files changed, 550 insertions, 0 deletions
diff --git a/media-gfx/xloadimage/Manifest b/media-gfx/xloadimage/Manifest
new file mode 100644
index 000000000000..5998596c8b94
--- /dev/null
+++ b/media-gfx/xloadimage/Manifest
@@ -0,0 +1,14 @@
+AUX xloadimage-4.1-bracket.patch 518 SHA256 cc5289450dceb1794dcf99a230c7011d99fcd45e26dcc276a7de25dbd6f5867e SHA512 f73b8077c7fe03ca688646f63df24c6dcecf21b1ebccf9983c7c6fb0332b371b17f835985ffccbe39fcb7bfd553a78df70c94d734930e35310a1b8ba0e30bf34 WHIRLPOOL 0351a6425f3f6f7981221811a7a244b23b0930bc59343321c6309ee7b3ea9eb2f8a51ab8194c55ee52eb4f166cb0c358334f98df456b547b47b68e3baf4d044e
+AUX xloadimage-4.1-endif.patch 321 SHA256 a621ead90d893fd5d07d3034adf674d39235484f205198d47092e8e51bd71204 SHA512 503fd3672ae22a468ae6ec71a62b3113dc3df2e5bed4b90b641320d954c563118eb53b8681ad38edaff5a87a385fb063592ac422c24c2150084e0171f4f17d25 WHIRLPOOL c9647a95daf02350877d0d8024fb2cbaa9ca3b07b01c09866d4816bb0651b12f0f5bcf8840eceff45e7982e218809c744c1d806e45993b05e01daeaf49ff3912
+AUX xloadimage-4.1-include-errno_h.patch 303 SHA256 705ea25d75585bd763b4330757266ac412ee30562e65b937722dad3e3141c56a SHA512 208261855d1677a755e34b421bbb4f95cbbe1d9d494cb3c895e9f799a376f2162a3f8e08134b06029da5acd318c873c798bd2c64eaf0aaf1d0e2970a56f4ef2f WHIRLPOOL 842fb9b785ec6e748c1f14eb7e8893a511505170a26a17ee59f57cca6178a75d14e538b8bc556c354d29af02903de7e632d3bafaa398ced484bc28563946ef25
+AUX xloadimage-4.1-ldflags_and_exit.patch 775 SHA256 f2b80e39246e495a5118f27e815cb8100b9619184580d35696c512a0d81b55fb SHA512 724484e06868c818c6c66cfdca9b07972da6c6b7977da9dad4e05109506751641e211dd34a9afbf925fed712ed046764362856079dda11b628b32fe3f6813f59 WHIRLPOOL 184250574f7c521f2fc657ee39e3978b4fec9c7aa65686f8b2c157ad5008e01cc630c5f16e5d4005a70b3bae0a337b7f32979e18d4dad9a34dfb16f3cfa97b5a
+AUX xloadimage-4.1-libpng15.patch 747 SHA256 c0d30c64354d4261c3218b23498ae41f43215b875688a4c0d1efc3c6c12736fa SHA512 3a96676237388d9da6c05c654db33c862c02858d8e0b352461d25c5dd21128306ec7e492fbd6a20f6af6adb20070c9e9cfdd366803a747697f334955e11f5bb6 WHIRLPOOL 94a1cf48992629a362e81c9fcd2000ba3c6e835d0ab941a04f4832df2ce482079498692b69f2f10ff558e302c679bcc33845ba8095c22a66d389cf557813f424
+AUX xloadimage-4.1-unaligned-access.patch 1730 SHA256 35548e5242d32f66e7175c090af4b2df5ee6f20f51d7e7f83a9f430af568f6c9 SHA512 4861c805a4bca2cec81fa2e7de44838e8451f08a2e1d189cf9a27e1c078d1ae0403fda3ab9c8ad44187db4fd5078d088f755eef16fbe00d55c02e0c54a5be139 WHIRLPOOL 3eb1ece5e5b22bea1f1773d8a3223eb4cb6f8d99d007e193c7c4f10c57392199d0b786449d940c6c9274ac3cce3ab3a8384af6e9ff7b507039cbfce783fff24d
+AUX xloadimage-4.1-zio-shell-meta-char.diff 1372 SHA256 253064f5eebcd6c1c318b9637f1010657927b5f65be59581ef37523a50f3601e SHA512 38e449e005d84a5e93c1a1ef71929a4002b9dfb94d1ad785714f572e4adb0313722620947c091dc5ea2a73fe5d01d321f21259be9ff0770052f5f5ad13c727d6 WHIRLPOOL df48e877ca3d58b3607ad803f519a8b40a872d17f08a2c14dbeeeb7a0db43a353b40a6a6af721219eaf18afd65d051dcbb9aa7ee91e5df3fc0c55325e1442060
+AUX xloadimage-gentoo.patch 8956 SHA256 e03f0584b32a0be68f7baeb13df2ad29277ecdbb54baed0b5f878301122e0c30 SHA512 8eba3107d81f0dc6caf749e9a9889f1662e5d1004e480a9a170533f3ee00c6f9f11d3c2008655322242ab61f31b676406fd44b97d83e4ce93b8f68a12397830b WHIRLPOOL 14265bae04c592f0ee5d497ac70c0e0e52ae0757bb203c5614d7e699c43a2985879a990023d3ba088106632822cc77e8c3f646f03844edeede7fa881aedbd096
+DIST xloadimage-4.1-gentoo-r1.diff.bz2 41535 SHA256 addfd04c0a5667bb9c3f4ae6a9da35a443776086e30b84b2c3afa5eac161144a SHA512 a1a52d576eb68c44e5ff3b68a6bd87cd9b8f21f6fa8edee2d7df2329002d40f6513df6c04ecd57f66018583d0251019bd02e15756dac705b8c9cb8470cb386e3 WHIRLPOOL 6141e5f38c1b8435375021181321658b86140f28189d2d31d93ea7d23b6f6c4cd62a428b946ca35428c00cb4fcc10015a0948cda1238926a530ee9f00744f0b9
+DIST xloadimage.4.1.tar.gz 596021 SHA256 400bc7d84dcfb3265a7a1ce51819679dc3adaeda231514bd89b0f932b78ff5c4 SHA512 2c91699c8ef07c101ff9b458708ace01cab2979a5e88cf8a4e47ec971f7b4cb5571108afa3e53271ade4e8ccfdcf72ef9e2e09edfc0be6b8afaba50847aa0586 WHIRLPOOL 65ca85500a8171d95a56b5550951f6b64ad6176a48370ed41b6919cd92dde366235cf2df86fc093847102eccf6659aef1f747e32f02af97e90389cfbdc683a14
+EBUILD xloadimage-4.1-r11.ebuild 2552 SHA256 792f0baba433d3aebd72e440afdbb30184e435cfeb8263c5cfb04a0f4428c4e6 SHA512 03b9f7de5b6d51bde25176cbac7f82b37a13d73545916588b41469b1b158003663db5c534ad9fa0afde16773799634fe6f8527ab1335786d58d9daa604e7e2b9 WHIRLPOOL 572a00eb2b6aadd3eaa6391409106a4c5dd3354303f8e1ecc8a6d1046355ecad80b5c0f7248ca29a60843ef48ba45906f663915c960287af2d55f76d6740fb1a
+MISC ChangeLog 2780 SHA256 50d740147586083ad7d5bbb32a74dc0dc9d52055604b1ce5824bd7e9ea01535c SHA512 fa3bac70e59bc983dedfbe1e1dd8b25f1594eefb12f0660282077b3038e332594b19fd4435d5105576bc15cc4496890df6b5a4a343aa03fa915994fa2bab4ac2 WHIRLPOOL 2ee21b47a5c1bb7e21cea05d464c4a6ffdc7ae310fd4dcb25aef2fc9cabc1248253f8375ac8c0b9acb5e794094a01446a84d4fe1a95b7c33ccc954979df0195d
+MISC ChangeLog-2015 10181 SHA256 85217566a49975fa6f7799f1367a244b645fadbfb033225b8a21dce183a1482b SHA512 d0a5402497a501e63a91562a8d36e4aeb62874f1a5da7199e5cc85c638e5c29482bc40a0d6ee28649ab253e49327217184405c00a32cfe1ad5b0905f644baedc WHIRLPOOL 60b2eaf230dfbd702c1b9fbade06246e869e663c46b35645c56fe527c9e6a535ff674304b3d1dbad077f054035526fb543387d08de78d4409026da088e622e61
+MISC metadata.xml 265 SHA256 db1cfbffc28a5904257a8fbd4f99c081aa42b08239ff8d97aa299983b32d58fd SHA512 65fd64249e8dde8eb2ddcb67c58c05b36b10e51956e2237f60dd3ae50872492f3d5872b64106acb13e453a41960f4f817161be3c8b89e6b9a2367b8f1403ffaf WHIRLPOOL ea60bca9e9cd33aa65e8800ca0bc1c3e84a3f4cad168d7d3d8a8b73d335b866442271f1b027f7f1a6d69dbd1408555c495a581a9280c0b217036a6b736276906
diff --git a/media-gfx/xloadimage/files/xloadimage-4.1-bracket.patch b/media-gfx/xloadimage/files/xloadimage-4.1-bracket.patch
new file mode 100644
index 000000000000..5d71028652da
--- /dev/null
+++ b/media-gfx/xloadimage/files/xloadimage-4.1-bracket.patch
@@ -0,0 +1,13 @@
+diff -ruN xloadimage.4.1.patched/jpeg.c xloadimage.4.1/jpeg.c
+--- xloadimage.4.1.patched/jpeg.c 2011-08-25 22:44:04.835308001 +0200
++++ xloadimage.4.1/jpeg.c 2011-08-25 22:45:57.391307973 +0200
+@@ -321,8 +321,8 @@
+ cinfo->arith_code = TRUE;
+ #else
+ fprintf(stderr, "jpegDump: sorry, arithmetic coding not supported\n");
+- }
+ #endif
++ }
+ else if (!strncmp("grayscale", name, strlen(name)) ||
+ !strncmp("greyscale", name, strlen(name)) ||
+ !strncmp("monochrome", name, strlen(name))) {
diff --git a/media-gfx/xloadimage/files/xloadimage-4.1-endif.patch b/media-gfx/xloadimage/files/xloadimage-4.1-endif.patch
new file mode 100644
index 000000000000..df6f3e492190
--- /dev/null
+++ b/media-gfx/xloadimage/files/xloadimage-4.1-endif.patch
@@ -0,0 +1,11 @@
+--- xloadimage.4.1/copyright.orig 2005-03-04 12:58:27.347474256 +0100
++++ xloadimage.4.1/copyright.h 2005-03-04 12:58:42.913107920 +0100
+@@ -22,7 +22,7 @@
+ #ifndef __SABER__
+ #ifndef LINT
+ static char *Copyright= "Copyright 1989, 1993 Jim Frost";
+-#endif LINT
++#endif /* LINT */
+ #endif
+ #define _JIM_COPYRIGHT_
+ #endif
diff --git a/media-gfx/xloadimage/files/xloadimage-4.1-include-errno_h.patch b/media-gfx/xloadimage/files/xloadimage-4.1-include-errno_h.patch
new file mode 100644
index 000000000000..f071d761617a
--- /dev/null
+++ b/media-gfx/xloadimage/files/xloadimage-4.1-include-errno_h.patch
@@ -0,0 +1,13 @@
+--- xloadimage.4.1/img.c.orig 2003-01-01 15:14:47.000000000 +0200
++++ xloadimage.4.1/img.c 2003-01-01 15:15:05.000000000 +0200
+@@ -14,9 +14,9 @@
+ #include <stdlib.h>
+ #include <string.h>
+ #include <math.h>
++#include <errno.h>
+ #include "image.h"
+
+-extern int errno;
+
+ #define TRUE 1
+ #define FALSE 0
diff --git a/media-gfx/xloadimage/files/xloadimage-4.1-ldflags_and_exit.patch b/media-gfx/xloadimage/files/xloadimage-4.1-ldflags_and_exit.patch
new file mode 100644
index 000000000000..afdea768aa47
--- /dev/null
+++ b/media-gfx/xloadimage/files/xloadimage-4.1-ldflags_and_exit.patch
@@ -0,0 +1,23 @@
+diff -ur xloadimage.4.1.orig/Makefile.in xloadimage.4.1/Makefile.in
+--- xloadimage.4.1.orig/Makefile.in 2009-09-04 15:37:09.000000000 +0300
++++ xloadimage.4.1/Makefile.in 2009-09-04 15:38:50.000000000 +0300
+@@ -27,7 +27,7 @@
+ $(CC) -o $@ $(OBJS) build.o $(LDFLAGS) $(XLIB) $(LIBS)
+
+ uufilter: uufilter.c
+- $(CC) $(CFLAGS) $(DEFS) uufilter.c -o $@
++ $(CC) $(LDFLAGS) $(CFLAGS) $(DEFS) uufilter.c -o $@
+
+ .c.o: config.h image.h
+ $(CC) $(CFLAGS) -c $(DEFS) $<
+diff -ur xloadimage.4.1.orig/uufilter.c xloadimage.4.1/uufilter.c
+--- xloadimage.4.1.orig/uufilter.c 2009-09-04 15:37:09.000000000 +0300
++++ xloadimage.4.1/uufilter.c 2009-09-04 15:37:59.000000000 +0300
+@@ -11,6 +11,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include <string.h>
+
+ int main(argc, argv)
diff --git a/media-gfx/xloadimage/files/xloadimage-4.1-libpng15.patch b/media-gfx/xloadimage/files/xloadimage-4.1-libpng15.patch
new file mode 100644
index 000000000000..ffd05f62b332
--- /dev/null
+++ b/media-gfx/xloadimage/files/xloadimage-4.1-libpng15.patch
@@ -0,0 +1,29 @@
+--- png.c
++++ png.c
+@@ -75,7 +75,7 @@
+ {
+ debug(" #error ");
+ output_warn( png_ptr, str);
+- longjmp(png_ptr->jmpbuf, 1); /* return control to outer routine */
++ longjmp(png_jmpbuf(png_ptr), 1); /* return control to outer routine */
+ }
+
+
+@@ -164,7 +164,7 @@
+ png_destroy_read_struct(png_pp, info_pp, end_pp);
+ return 0;
+ }
+- if (setjmp((*png_pp)->jmpbuf)) {
++ if (setjmp(png_jmpbuf(*png_pp))) {
+ /* On error */
+ png_destroy_read_struct(png_pp, info_pp, end_pp);
+ return 0;
+@@ -220,7 +220,7 @@
+ zclose(zinput_file);
+ return 0;
+ }
+- if (setjmp(png_ptr->jmpbuf)) {
++ if (setjmp(png_jmpbuf(png_ptr))) {
+ /* On error */
+ freeImage(image);
+ png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
diff --git a/media-gfx/xloadimage/files/xloadimage-4.1-unaligned-access.patch b/media-gfx/xloadimage/files/xloadimage-4.1-unaligned-access.patch
new file mode 100644
index 000000000000..874ad8a4f329
--- /dev/null
+++ b/media-gfx/xloadimage/files/xloadimage-4.1-unaligned-access.patch
@@ -0,0 +1,51 @@
+diff -ruN ./cmuwmraster.c /tmp/xloadimage.4.1/cmuwmraster.c
+--- a/cmuwmraster.c 2005-07-23 13:15:50 -0700
++++ b/cmuwmraster.c 2005-07-23 13:08:36 -0700
+@@ -20,7 +20,7 @@
+ char *name;
+ struct cmuwm_header *headerp;
+ {
+- printf("%s is a %ldx%ld %ld plane CMU WM raster\n",
++ printf("%s is a %lux%lu %lu plane CMU WM raster\n",
+ name,
+ memToVal(headerp->width, sizeof(long)),
+ memToVal(headerp->height, sizeof(long)),
+diff -ruN ./niff.c /tmp/xloadimage.4.1/niff.c
+--- a/niff.c 2005-07-23 13:15:50 -0700
++++ b/niff.c 2005-07-23 13:07:55 -0700
+@@ -24,18 +24,18 @@
+ memToVal(header->width, 4),
+ memToVal(header->height, 4));
+ if (memToVal(header->version, 4) != NIFF_VERSION)
+- printf("version %ld ", memToVal(header->version, 4));
++ printf("version %lu ", memToVal(header->version, 4));
+ printf("NIFF ");
+ switch (header->type) {
+ case NIFF_BITMAP:
+ printf("bitmap image");
+ break;
+ case NIFF_RGB:
+- printf("%ld-bit RGB image with %ld colors",
++ printf("%lu-bit RGB image with %lu colors",
+ memToVal(header->depth, 4), memToVal(header->cmap_size, 4));
+ break;
+ case NIFF_TRUE:
+- printf("%ld-bit true color image", memToVal(header->depth, 4));
++ printf("%lu-bit true color image", memToVal(header->depth, 4));
+ break;
+ default:
+ printf("image with an unknown type");
+diff -ruN ./root.c /tmp/xloadimage.4.1/root.c
+--- a/root.c 2005-07-23 13:15:51 -0700
++++ b/root.c 2005-07-23 13:05:48 -0700
+@@ -68,8 +68,8 @@
+ Pixmap *pm;
+ Atom actual_type; /* NOTUSED */
+ int format;
+- int nitems;
+- int bytes_after;
++ unsigned long nitems;
++ unsigned long bytes_after;
+
+ /* intern the property name */
+ Atom atom = XInternAtom(dpy, RETAIN_PROP_NAME, 0);
diff --git a/media-gfx/xloadimage/files/xloadimage-4.1-zio-shell-meta-char.diff b/media-gfx/xloadimage/files/xloadimage-4.1-zio-shell-meta-char.diff
new file mode 100644
index 000000000000..730504fb43f6
--- /dev/null
+++ b/media-gfx/xloadimage/files/xloadimage-4.1-zio-shell-meta-char.diff
@@ -0,0 +1,36 @@
+--- xloadimage.4.1/zio.c 1993-10-28 17:10:02.000000000 +0000
++++ xloadimage.4.1/zio.c 2005-02-28 15:32:05.895470680 +0000
+@@ -210,9 +211,30 @@
+ if ((strlen(name) > strlen(filter->extension)) &&
+ !strcmp(filter->extension,
+ name + (strlen(name) - strlen(filter->extension)))) {
+- debug(("Filtering image through '%s'\n", filter->filter));
+- zf->type= ZPIPE;
+- sprintf(buf, "%s %s", filter->filter, name);
++ char *fname, *t, *s;
++
++ /* meta-char protection from xli.
++ *
++ * protect in single quotes, replacing single quotes
++ * with '"'"', so worst-case expansion is 5x
++ */
++
++ s = fname = (char *) lmalloc(1 + (5 * strlen(name)) + 1 + 1);
++ *s++ = '\'';
++ for (t = name; *t; ++t) {
++ if ('\'' == *t) {
++ /* 'foo'bar' -> 'foo'"'"'bar' */
++ strcpy(s, "'\"'\"'");
++ s += strlen(s);
++ } else {
++ *s++ = *t;
++ }
++ }
++ strcpy (s, "'");
++ debug(("Filtering image through '%s'\n", filter->filter));
++ zf->type= ZPIPE;
++ sprintf(buf, "%s %s", filter->filter, fname);
++ lfree (fname);
+ if (! (zf->stream= popen(buf, "r"))) {
+ lfree((byte *)zf->filename);
+ zf->filename= NULL;
diff --git a/media-gfx/xloadimage/files/xloadimage-gentoo.patch b/media-gfx/xloadimage/files/xloadimage-gentoo.patch
new file mode 100644
index 000000000000..896786680e30
--- /dev/null
+++ b/media-gfx/xloadimage/files/xloadimage-gentoo.patch
@@ -0,0 +1,258 @@
+diff -ru xloadimage.4.1.orig/config.c xloadimage.4.1/config.c
+--- xloadimage.4.1.orig/config.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/config.c 2005-10-22 15:58:16.000000000 +0200
+@@ -313,12 +313,13 @@
+ * -1 if access denied or not found, 0 if ok.
+ */
+
+-int findImage(name, fullname)
++int findImage(name, fullname, size)
+ char *name, *fullname;
++ size_t size;
+ { unsigned int p, e;
+ struct stat sbuf;
+
+- strcpy(fullname, name);
++ strncpy(fullname, name, size);
+ if (!strcmp(name, "stdin")) /* stdin is special name */
+ return(0);
+
+@@ -327,7 +328,7 @@
+ if (! stat(fullname, &sbuf))
+ return(fileIsOk(fullname, &sbuf));
+ #ifndef NO_COMPRESS
+- strcat(fullname, ".Z");
++ strncat(fullname, ".Z", size);
+ if (! stat(fullname, &sbuf))
+ return(fileIsOk(fullname, &sbuf));
+ #endif
+@@ -336,12 +337,12 @@
+ #ifdef VMS
+ sprintf(fullname, "%s%s", Paths[p], name);
+ #else
+- sprintf(fullname, "%s/%s", Paths[p], name);
++ snprintf(fullname, size, "%s/%s", Paths[p], name);
+ #endif
+ if (! stat(fullname, &sbuf))
+ return(fileIsOk(fullname, &sbuf));
+ #ifndef NO_COMPRESS
+- strcat(fullname, ".Z");
++ strncat(fullname, ".Z", size);
+ if (! stat(fullname, &sbuf))
+ #endif
+ return(fileIsOk(fullname, &sbuf));
+@@ -349,12 +350,12 @@
+ #ifdef VMS
+ sprintf(fullname, "%s%s%s", Paths[p], name, Exts[e]);
+ #else
+- sprintf(fullname, "%s/%s%s", Paths[p], name, Exts[e]);
++ snprintf(fullname, size, "%s/%s%s", Paths[p], name, Exts[e]);
+ #endif
+ if (! stat(fullname, &sbuf))
+ return(fileIsOk(fullname, &sbuf));
+ #ifndef NO_COMPRESS
+- strcat(fullname, ".Z");
++ strncat(fullname, ".Z", size);
+ if (! stat(fullname, &sbuf))
+ return(fileIsOk(fullname, &sbuf));
+ #endif
+@@ -362,11 +363,11 @@
+ }
+
+ for (e= 0; e < NumExts; e++) {
+- sprintf(fullname, "%s%s", name, Exts[e]);
++ snprintf(fullname, size, "%s%s", name, Exts[e]);
+ if (! stat(fullname, &sbuf))
+ return(fileIsOk(fullname, &sbuf));
+ #ifndef NO_COMPRESS
+- strcat(fullname, ".Z");
++ strncat(fullname, ".Z", size);
+ if (! stat(fullname, &sbuf))
+ return(fileIsOk(fullname, &sbuf));
+ #endif
+@@ -392,7 +393,7 @@
+ #ifdef VMS
+ sprintf(buf, "directory %s", Paths[a]);
+ #else
+- sprintf(buf, "ls %s", Paths[a]);
++ snprintf(buf, sizeof(buf)-1, "ls %s", Paths[a]);
+ #endif
+ if (system(buf) < 0) {
+ #ifdef VMS
+diff -ru xloadimage.4.1.orig/imagetypes.c xloadimage.4.1/imagetypes.c
+--- xloadimage.4.1.orig/imagetypes.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/imagetypes.c 2005-10-22 15:51:31.000000000 +0200
+@@ -17,7 +17,7 @@
+ /* SUPPRESS 560 */
+
+ extern int errno;
+-extern int findImage(char *name, char *fullname);
++extern int findImage(char *name, char *fullname, size_t size);
+
+ /* load a named image
+ */
+@@ -32,7 +32,7 @@
+ Image *image;
+ int a;
+
+- if (findImage(name, fullname) < 0) {
++ if (findImage(name, fullname, BUFSIZ) < 0) {
+ if (errno == ENOENT)
+ fprintf(stderr, "%s: image not found\n", name);
+ else
+@@ -109,7 +109,7 @@
+ { char fullname[BUFSIZ];
+ int a;
+
+- if (findImage(name, fullname) < 0) {
++ if (findImage(name, fullname, BUFSIZ) < 0) {
+ if (errno == ENOENT)
+ fprintf(stderr, "%s: image not found\n", name);
+ else
+diff -ru xloadimage.4.1.orig/jpeg.c xloadimage.4.1/jpeg.c
+--- xloadimage.4.1.orig/jpeg.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/jpeg.c 2005-10-22 16:02:03.000000000 +0200
+@@ -19,7 +19,7 @@
+ #undef debug
+
+ #ifdef DEBUG
+-# define debug(xx) fprintf(stderr,xx)
++# define debug(xx) fprintf(stderr, "%s", xx)
+ #else
+ # define debug(xx)
+ #endif
+diff -ru xloadimage.4.1.orig/mcidas.c xloadimage.4.1/mcidas.c
+--- xloadimage.4.1.orig/mcidas.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/mcidas.c 2005-10-22 15:48:49.000000000 +0200
+@@ -63,7 +63,7 @@
+ minute = (time % 10000) / 100;
+ second = (time % 100);
+
+- sprintf(buf, "%d:%2.2d:%2.2d %s %d, %d (day %d)",
++ snprintf(buf, 29, "%d:%2.2d:%2.2d %s %d, %d (day %d)",
+ hour, minute, second, month_info[month].name, day, year,
+ (date % 1000));
+ return(buf);
+diff -ru xloadimage.4.1.orig/png.c xloadimage.4.1/png.c
+--- xloadimage.4.1.orig/png.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/png.c 2005-10-22 16:02:20.000000000 +0200
+@@ -30,7 +30,7 @@
+ #undef debug
+
+ #ifdef DEBUG
+-# define debug(xx) fprintf(stderr,xx)
++# define debug(xx) fprintf(stderr, "%s", xx)
+ #else
+ # define debug(xx)
+ #endif
+diff -ru xloadimage.4.1.orig/reduce.c xloadimage.4.1/reduce.c
+--- xloadimage.4.1.orig/reduce.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/reduce.c 2005-10-22 15:48:49.000000000 +0200
+@@ -502,7 +502,7 @@
+
+ depth= colorsToDepth(n);
+ new_image= newRGBImage(image->width, image->height, depth);
+- sprintf(buf, "%s (%d colors)", image->title, n);
++ snprintf(buf, BUFSIZ - 1, "%s (%d colors)", image->title, n);
+ new_image->title= dupString(buf);
+
+ /* calculate RGB table from each color area. this should really calculate
+diff -ru xloadimage.4.1.orig/rle.c xloadimage.4.1/rle.c
+--- xloadimage.4.1.orig/rle.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/rle.c 2005-10-22 16:00:06.000000000 +0200
+@@ -21,7 +21,7 @@
+ #undef debug
+
+ #ifdef DEBUG
+-# define debug(xx) fprintf(stderr,xx)
++# define debug(xx) fprintf(stderr, "%s", xx)
+ #else
+ # define debug(xx)
+ #endif
+diff -ru xloadimage.4.1.orig/rotate.c xloadimage.4.1/rotate.c
+--- xloadimage.4.1.orig/rotate.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/rotate.c 2005-10-22 15:48:49.000000000 +0200
+@@ -70,7 +70,7 @@
+ { printf(" Rotating image by %d degrees...", degrees);
+ fflush(stdout);
+ }
+- sprintf(buf, "%s (rotated by %d degrees)", simage->title, degrees);
++ snprintf(buf, BUFSIZ - 1, "%s (rotated by %d degrees)", simage->title, degrees);
+
+ image1 = simage;
+ image2 = NULL;
+diff -ru xloadimage.4.1.orig/tiff.c xloadimage.4.1/tiff.c
+--- xloadimage.4.1.orig/tiff.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/tiff.c 2005-10-22 15:48:49.000000000 +0200
+@@ -133,14 +133,14 @@
+ switch (info->photometric) {
+ case PHOTOMETRIC_MINISBLACK:
+ if (info->bitspersample > 1) {
+- sprintf(buf, "%d-bit greyscale ", info->bitspersample);
++ snprintf(buf, 31, "%d-bit greyscale ", info->bitspersample);
+ return(buf);
+ }
+ else
+ return "white-on-black ";
+ case PHOTOMETRIC_MINISWHITE:
+ if (info->bitspersample > 1) {
+- sprintf(buf, "%d-bit greyscale ", info->bitspersample);
++ snprintf(buf, 31, "%d-bit greyscale ", info->bitspersample);
+ return(buf);
+ }
+ else
+diff -ru xloadimage.4.1.orig/window.c xloadimage.4.1/window.c
+--- xloadimage.4.1.orig/window.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/window.c 2005-10-22 15:48:50.000000000 +0200
+@@ -606,7 +606,7 @@
+ else {
+ char def_geom[30];
+
+- sprintf(def_geom, "%ux%u+0+0", image->width, image->height);
++ snprintf(def_geom, 29, "%ux%u+0+0", image->width, image->height);
+ XGeometry(disp, scrn, opt->info.geometry.string, def_geom, 0, 1, 1, 0, 0,
+ (int *)&winx, (int *)&winy, (int *)&winwidth, (int *)&winheight);
+ }
+diff -ru xloadimage.4.1.orig/zio.c xloadimage.4.1/zio.c
+--- xloadimage.4.1.orig/zio.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/zio.c 2005-10-22 15:48:50.000000000 +0200
+@@ -233,7 +233,7 @@
+ strcpy (s, "'");
+ debug(("Filtering image through '%s'\n", filter->filter));
+ zf->type= ZPIPE;
+- sprintf(buf, "%s %s", filter->filter, fname);
++ snprintf(buf, BUFSIZ - 1, "%s %s", filter->filter, fname);
+ lfree (fname);
+ if (! (zf->stream= popen(buf, "r"))) {
+ lfree((byte *)zf->filename);
+diff -ru xloadimage.4.1.orig/zoom.c xloadimage.4.1/zoom.c
+--- xloadimage.4.1.orig/zoom.c 2005-10-22 15:47:17.000000000 +0200
++++ xloadimage.4.1/zoom.c 2005-10-22 15:48:50.000000000 +0200
+@@ -63,23 +63,23 @@
+ if (!xzoom) {
+ if (verbose)
+ printf(" Zooming image Y axis by %d%%...", yzoom);
+- sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom);
++ snprintf(buf, BUFSIZ - 1, "%s (Y zoom %d%%)", oimage->title, yzoom);
+ }
+ else if (!yzoom) {
+ if (verbose)
+ printf(" Zooming image X axis by %d%%...", xzoom);
+- sprintf(buf, "%s (X zoom %d%%)", oimage->title, xzoom);
++ snprintf(buf, BUFSIZ - 1, "%s (X zoom %d%%)", oimage->title, xzoom);
+ }
+ else if (xzoom == yzoom) {
+ if (verbose)
+ printf(" Zooming image by %d%%...", xzoom);
+- sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
++ snprintf(buf, BUFSIZ - 1, "%s (%d%% zoom)", oimage->title, xzoom);
+ }
+ else {
+ if (verbose)
+ printf(" Zooming image X axis by %d%% and Y axis by %d%%...",
+ xzoom, yzoom);
+- sprintf(buf, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
++ snprintf(buf, BUFSIZ - 1, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
+ xzoom, yzoom);
+ }
+ if (verbose)
diff --git a/media-gfx/xloadimage/metadata.xml b/media-gfx/xloadimage/metadata.xml
new file mode 100644
index 000000000000..6ade85e1c642
--- /dev/null
+++ b/media-gfx/xloadimage/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 type="project">
+ <email>graphics@gentoo.org</email>
+ <name>Gentoo Graphics Project</name>
+ </maintainer>
+</pkgmetadata>
diff --git a/media-gfx/xloadimage/xloadimage-4.1-r11.ebuild b/media-gfx/xloadimage/xloadimage-4.1-r11.ebuild
new file mode 100644
index 000000000000..88c8bacd1277
--- /dev/null
+++ b/media-gfx/xloadimage/xloadimage-4.1-r11.ebuild
@@ -0,0 +1,94 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=2
+inherit autotools eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="utility to view many different types of images under X11"
+HOMEPAGE="http://world.std.com/~jimf/xloadimage.html"
+SRC_URI="ftp://ftp.x.org/R5contrib/${P/-/.}.tar.gz
+ mirror://gentoo/${P}-gentoo-r1.diff.bz2"
+
+LICENSE="MIT"
+SLOT="0"
+KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos"
+IUSE="tiff jpeg png"
+
+RDEPEND="x11-libs/libX11
+ tiff? ( media-libs/tiff )
+ png? ( media-libs/libpng )
+ jpeg? ( virtual/jpeg:0 )"
+DEPEND="${RDEPEND}
+ !media-gfx/xli"
+
+S=${WORKDIR}/${P/-/.}
+
+src_prepare() {
+ epatch "${WORKDIR}"/${P}-gentoo-r1.diff
+ epatch "${FILESDIR}"/${P}-zio-shell-meta-char.diff
+ epatch "${FILESDIR}"/${P}-endif.patch
+
+ # Do not define errno extern, but rather include errno.h
+ # <azarah@gentoo.org> (1 Jan 2003)
+ epatch "${FILESDIR}"/${P}-include-errno_h.patch
+
+ epatch "${FILESDIR}"/xloadimage-gentoo.patch
+
+ sed -i -e "s:OPT_FLAGS=:OPT_FLAGS=$CFLAGS:" Make.conf || die
+ sed -i -e "s:^#include <varargs.h>:#include <stdarg.h>:" rlelib.c || die
+
+ # On FreeBSD systems malloc.h is a false header asking for fixes.
+ # On MacOSX it would require malloc/malloc.h
+ # On other systems it's simply unneeded
+ sed -i -e 's,<malloc.h>,<stdlib.h>,' vicar.c || die
+
+ epatch "${FILESDIR}"/${P}-unaligned-access.patch
+ epatch "${FILESDIR}"/${P}-ldflags_and_exit.patch
+
+ sed -i -e "/^DEFS = /s:/etc:${EPREFIX}/etc:" Makefile.in
+
+ epatch "${FILESDIR}"/${P}-libpng15.patch
+ sed -i \
+ -e 's:png_set_gray_1_2_4_to_8:png_set_expand_gray_1_2_4_to_8:' \
+ png.c || die
+
+ # One of the previous patches screws up a bracket...
+ epatch "${FILESDIR}"/${P}-bracket.patch
+
+ chmod +x configure
+ eautoreconf
+}
+
+src_configure() {
+ # Set TIFFHeader to TIFFHeaderCommon wrt #319383
+ has_version '>=media-libs/tiff-4.0.0_pre' && \
+ append-flags -DTIFFHeader=TIFFHeaderCommon
+
+ tc-export CC
+ econf $(use_with jpeg) \
+ $(use_with png) \
+ $(use_with tiff)
+}
+
+src_compile() {
+ emake SYSPATHFILE="${EPREFIX}"/etc/X11/Xloadimage || die
+}
+
+src_install() {
+ dobin xloadimage uufilter || die
+
+ dosym xloadimage /usr/bin/xsetbg || die
+ dosym xloadimage /usr/bin/xview || die
+
+ insinto /etc/X11
+ doins xloadimagerc || die
+
+ newman xloadimage.man xloadimage.1 || die
+ newman uufilter.man uufilter.1 || die
+
+ echo ".so man1/xloadimage.1" > "${T}"/xsetbg.1
+ doman "${T}"/xsetbg.1 || die
+ newman "${T}"/xsetbg.1 xview.1 || die
+
+ dodoc README
+}