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/xli/Manifest | 9 + media-gfx/xli/files/Xli.ad | 2 + .../xli/files/xli-1.17.0-fix-scale-zoom.patch | 61 +++++++ media-gfx/xli/files/xli-1.17.0-libpng14.patch | 14 ++ media-gfx/xli/files/xli-security-gentoo.diff | 199 +++++++++++++++++++++ media-gfx/xli/metadata.xml | 8 + media-gfx/xli/xli-1.17.0-r5.ebuild | 75 ++++++++ 7 files changed, 368 insertions(+) create mode 100644 media-gfx/xli/Manifest create mode 100644 media-gfx/xli/files/Xli.ad create mode 100644 media-gfx/xli/files/xli-1.17.0-fix-scale-zoom.patch create mode 100644 media-gfx/xli/files/xli-1.17.0-libpng14.patch create mode 100644 media-gfx/xli/files/xli-security-gentoo.diff create mode 100644 media-gfx/xli/metadata.xml create mode 100644 media-gfx/xli/xli-1.17.0-r5.ebuild (limited to 'media-gfx/xli') diff --git a/media-gfx/xli/Manifest b/media-gfx/xli/Manifest new file mode 100644 index 000000000000..6f71776c47d7 --- /dev/null +++ b/media-gfx/xli/Manifest @@ -0,0 +1,9 @@ +AUX Xli.ad 123 SHA256 a26e3c36c81d124a08d143e9ebfabfbd2507ffb9e48f077ea3e837eacd3f3bd9 SHA512 a37a8054e1533bc46f0e24b88137bf2ea8a7294f16e37edd6c323f42d28bfa0dc93b74d41fb1cb3df3488754db42fb5a269c42ae08dade61f22b8c42c8cd9c8b WHIRLPOOL 65f694ef730ce32287ce42f2606c174f5c2cccf2c703072f87024f0fcab93d85fa7fdd8be89fd82fd4c03dc60bf678beb8dfdbb6d5fe3536680486caeea0047b +AUX xli-1.17.0-fix-scale-zoom.patch 1942 SHA256 109af5c20d234650b99411fcd94c329cb7162e60e0349e46ee4fc5148bb1a67f SHA512 b77348b83e26b0684cf7292100bbdbbd2c3f7b025f14588f7b52935d997b7ca51c3aad70479ce74cd9193a045436b39233b7ebb1fea6abcdf3d3a9dc21c8b84f WHIRLPOOL 4b8e6dc4dbc4329b67a8af43312f95790048ea58dc1084ee642e4ae75695f5a8b4669773d5d7834055ba4af50ac94483ca9e17865ec6a85eb9c0046f42634f75 +AUX xli-1.17.0-libpng14.patch 241 SHA256 03b74b2bc1063a087bdec93f6f9b85eb4b4c7236ddd3bfe7d7742d19df6dc9d9 SHA512 e5a2de3525198d323ae6c89ab9b0455559761cd4f6b86b719934bc77e31582cd557090766875d97512cb60a42e88653f5dc204dffa9ae1370695c73bfc2231b1 WHIRLPOOL 5c00a998d71ffe022b701a9d398b1e6e2f43b3c2b673c879428cb42d70717cc11cabc60d279b3117ba2a70278a4c57f95072e1285e19ef11e46098308b1e9752 +AUX xli-security-gentoo.diff 6940 SHA256 d2d427f4eb0659786e18fb70aebb312e980e638a0034a24073e21c2e7b58e90a SHA512 b992219eb4b89bfee57429afbf67be6d6a04051b50de6e814c84c1adb209494d2faff15a228b43a992530fbeac83f15a94e9c1988982f98eabf287c26716671e WHIRLPOOL 6f836cdc5d8119c4550bcaecd677a959e1f67a64ccf92100d442bea4852822af9ed0be85ab802c8002f297029719849cd55069a73bfc7d84ca357034a30573f4 +DIST xli-2005-02-27.tar.gz 201011 SHA256 442dcf5ac75841e648c3bffed795d9301a6a485dc55f7998d0acfc2b8daad2bc SHA512 132b28396ebf3832dc35ff5fa7c102539ef30a194512fe6577ce1432bb84ecd7b4368e75eaf59f26a806900f63e1bfb9a93487ce1ebe3cfef2199256a783ccf7 WHIRLPOOL 1d3b45be838d397fdbc2521c9c5a466e4141248591ae00016fa316f67a4ab44bc712896a59581e3f9a2e10cabb56f041ef7a3e21cc2a4f59733dc44d446e541b +EBUILD xli-1.17.0-r5.ebuild 1940 SHA256 faa31765c9cca53df2cff03919666955ff02e0bbc9eb710137c4195d26a168f1 SHA512 e95f5c4f013af5d4d42acab2647e4a82c9cb3d679e6c19471d2130da721f9d14942a9c9f1b6643fe6867e41143e91f61edc5ae71028d2e0e361a3883bcc5fb4d WHIRLPOOL 15f00e5cef542a16fe365e4d874a12da8d6fb9edf956e3c020f1b6500f539ba1f0c2d8d1a911d727eaa52f05b30c762ec30c6daa389ac0dbc8e607100ec7a3b0 +MISC ChangeLog 2548 SHA256 347da4730a3eaebaa064682a6dd49db93488bb1bd058a9e334df81a77963025f SHA512 c8bad98c8bce836fde96c592756f7b7472fc38c7966dee16ac54d46d4c9fa73933f583fbcd37c70569e41757893054ac837e6e57b74a0e7d5b2db1a7b471f8d9 WHIRLPOOL 60bf6c3d61337669815b976d316d07ff26e339a6165311b681407839f7c59bdedd8e270355e0a83960cd2911095b268212762546e8563a7a7a139dd23eecff40 +MISC ChangeLog-2015 8152 SHA256 844f2186bcd4c815479e7ed8f68ddb0761f0b89626dd80cf11c9a4e4605a91ea SHA512 b553b6e5b9de0865a5c6f5ab1d1a2f6f58b48a92f244a5898ed1d20c5b2ab4aade0650507d9320bb1e567ec1bf0971708ac3aff33f8688759b16ffa7f64c3728 WHIRLPOOL 301608f246599efe51d40a89ca615c0a69eda65d09381b3d99828bf1273c3923552658100a8e383376c2908c246b40aab8f3996606237087e95a68898336b72e +MISC metadata.xml 265 SHA256 db1cfbffc28a5904257a8fbd4f99c081aa42b08239ff8d97aa299983b32d58fd SHA512 65fd64249e8dde8eb2ddcb67c58c05b36b10e51956e2237f60dd3ae50872492f3d5872b64106acb13e453a41960f4f817161be3c8b89e6b9a2367b8f1403ffaf WHIRLPOOL ea60bca9e9cd33aa65e8800ca0bc1c3e84a3f4cad168d7d3d8a8b73d335b866442271f1b027f7f1a6d69dbd1408555c495a581a9280c0b217036a6b736276906 diff --git a/media-gfx/xli/files/Xli.ad b/media-gfx/xli/files/Xli.ad new file mode 100644 index 000000000000..6c9a022e40b6 --- /dev/null +++ b/media-gfx/xli/files/Xli.ad @@ -0,0 +1,2 @@ +path=/usr/X11R6/include/X11/bitmaps /usr/X11R6/include/X11/images +extension=.gif .jpg .rle .csun .msun .sun .face .xbm .bm diff --git a/media-gfx/xli/files/xli-1.17.0-fix-scale-zoom.patch b/media-gfx/xli/files/xli-1.17.0-fix-scale-zoom.patch new file mode 100644 index 000000000000..44ee262aee25 --- /dev/null +++ b/media-gfx/xli/files/xli-1.17.0-fix-scale-zoom.patch @@ -0,0 +1,61 @@ +As of jpeg-7, the scale coefficents may be set to non-unitary values by the +initial DCT transform. This caused the original already-scale detection +algorithm in xli to break. + +To avoid this, set the already-scaled marker when we adjust the scale fraction +(that gets passed into the DCT). + +Signed-off-by: Robin H. Johnson + +diff -Nuar -X x xli-2005-02-27.orig/jpeg.c xli-2005-02-27/jpeg.c +--- xli-2005-02-27.orig/jpeg.c 2005-02-27 16:42:39.000000000 -0800 ++++ xli-2005-02-27/jpeg.c 2009-09-05 15:02:12.462635389 -0700 +@@ -211,7 +211,7 @@ + xli_jpg_err jerr; + Image *image = 0; + byte **rows = 0; +- int i, rowbytes; ++ int i, rowbytes, flags; + + CURRFUNC("jpegLoad"); + zfp = zopen(fullname); +@@ -248,9 +248,13 @@ + if (verbose) + describe_jpeg(&cinfo, fullname); + ++ flags = 0; + if (image_ops->iscale > 0 && image_ops->iscale < 4) { +- cinfo.scale_num = 1; +- cinfo.scale_denom = 1 << image_ops->iscale; ++ flags |= FLAG_ISCALE; ++ //cinfo.scale_num = 1; ++ cinfo.scale_denom *= 1 << image_ops->iscale; ++ if (verbose) ++ printf("scaling to %d/%d\n", cinfo.scale_num, cinfo.scale_denom); + } else if (image_ops->iscale_auto) { + image_ops->iscale = 0; + while (image_ops->iscale < 3 && (cinfo.image_width >> +@@ -258,9 +262,11 @@ + cinfo.image_height >> image_ops->iscale > + globals.dinfo.height * .9)) + image_ops->iscale += 1; +- cinfo.scale_denom = 1 << image_ops->iscale; ++ cinfo.scale_denom *= 1 << image_ops->iscale; ++ if(image_ops->iscale > 0) ++ flags |= FLAG_ISCALE; + if (verbose) +- printf("auto-scaling to 1/%d\n", cinfo.scale_denom); ++ printf("auto-scaling to %d/%d\n", cinfo.scale_num, cinfo.scale_denom); + } + znocache(zfp); + +@@ -288,8 +294,7 @@ + } + + image->gamma = RETURN_GAMMA; +- if (cinfo.scale_denom > 1) +- image->flags |= FLAG_ISCALE; ++ image->flags |= flags; + + rowbytes = cinfo.output_width * cinfo.output_components; + assert(image->pixlen * image->width == rowbytes); diff --git a/media-gfx/xli/files/xli-1.17.0-libpng14.patch b/media-gfx/xli/files/xli-1.17.0-libpng14.patch new file mode 100644 index 000000000000..afb4b24208d7 --- /dev/null +++ b/media-gfx/xli/files/xli-1.17.0-libpng14.patch @@ -0,0 +1,14 @@ +http://aur.archlinux.org/packages.php?ID=1676 +http://archwyrm.net/~me/xli-libpng.diff + +--- png.c ++++ png.c +@@ -27,7 +27,7 @@ + if (ret != 8) + return 0; + +- ret = png_check_sig(buf, 8); ++ ret = !png_sig_cmp(buf, 0, 8); + + return (ret); + } diff --git a/media-gfx/xli/files/xli-security-gentoo.diff b/media-gfx/xli/files/xli-security-gentoo.diff new file mode 100644 index 000000000000..7425e67c7c74 --- /dev/null +++ b/media-gfx/xli/files/xli-security-gentoo.diff @@ -0,0 +1,199 @@ +diff -Nrup xli-2005-02-27/imagetypes.c xli-2005-02-27/imagetypes.c +--- xli-2005-02-27/imagetypes.c 1999-10-24 22:14:57.000000000 -0400 ++++ xli-2005-02-27/imagetypes.c 2005-10-18 07:53:46.000000000 -0400 +@@ -53,7 +53,7 @@ Image *loadImage(ImageOptions * image_op + Image *image; + int a; + +- if (findImage(image_ops->name, fullname) < 0) { ++ if (findImage(image_ops->name, fullname, BUFSIZ) < 0) { + if (errno == ENOENT) + printf("%s: image not found\n", image_ops->name); + else if (errno == EISDIR) +@@ -95,7 +95,7 @@ void identifyImage(char *name) + char fullname[BUFSIZ]; + int a; + +- if (findImage(name, fullname) < 0) { ++ if (findImage(name, fullname, BUFSIZ) < 0) { + if (errno == ENOENT) + printf("%s: image not found\n", name); + else if (errno == EISDIR) +diff -Nrup xli-2005-02-27/path.c xli-2005-02-27/path.c +--- xli-2005-02-27/path.c 2005-02-27 19:42:39.000000000 -0500 ++++ xli-2005-02-27/path.c 2005-10-18 07:56:45.000000000 -0400 +@@ -172,12 +172,12 @@ static int fileIsOk(char *fullname, stru + /* find an image with paths and extensions from defaults files. returns + * -1 if access denied or not found, 0 if ok. + */ +-int findImage(char *name, char *fullname) ++int findImage(char *name, char *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); + +@@ -185,26 +185,26 @@ int findImage(char *name, char *fullname + 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 + + for (p = 0; p < NumPaths; p++) { +- sprintf(fullname, "%s/%s", Paths[p], name); ++ snprintf(fullname, size, "%s/%s", Paths[p], name); + 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)); + for (e = 0; e < NumExts; e++) { +- sprintf(fullname, "%s/%s%s", Paths[p], name, Exts[e]); ++ snprintf(fullname, size, "%s/%s%s", Paths[p], 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 +@@ -212,11 +212,11 @@ int findImage(char *name, char *fullname + } + + 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 +@@ -241,7 +241,7 @@ void listImages(void) + for (a = 0; a < NumPaths; a++) { + printf("%s:\n", Paths[a]); + fflush(stdout); +- sprintf(buf, "ls %s", Paths[a]); ++ snprintf(buf, sizeof(buf)-1, "ls %s", Paths[a]); + if (system(buf) < 0) { + perror("ls"); + return; +@@ -296,14 +296,14 @@ char *expandPath(char *p) + var++; + else if (*p == '~') { + buf1[b1] = '\0'; +- strcat(buf1, getenv("HOME")); ++ strncat(buf1, getenv("HOME"), sizeof(buf1)-1); + b1 = strlen(buf1); + var = 0; + } else if (*p == '/' || *p == '}') { + if (var) { + buf1[b1] = '\0'; + buf2[b2] = '\0'; +- strcat(buf1, getenv(buf2)); ++ strncat(buf1, getenv(buf2), sizeof(buf1)); + b1 = strlen(buf1); + buf2[0] = '\0'; + b2 = 0; +diff -Nrup xli-2005-02-27/reduce.c xli-2005-02-27/reduce.c +--- xli-2005-02-27/reduce.c 1999-10-24 22:15:02.000000000 -0400 ++++ xli-2005-02-27/reduce.c 2005-10-18 07:33:34.000000000 -0400 +@@ -178,7 +178,7 @@ Image *reduce(Image *image, unsigned col + /* get destination image */ + depth = colorsToDepth(OutColors); + new_image = newRGBImage(image->width, image->height, depth); +- sprintf(buf, "%s (%d colors)", image->title, OutColors); ++ snprintf(buf, sizeof(buf)-1, "%s (%d colors)", image->title, OutColors); + new_image->title = dupString(buf); + new_image->gamma = image->gamma; + +diff -Nrup xli-2005-02-27/rlelib.c xli-2005-02-27/rlelib.c +--- xli-2005-02-27/rlelib.c 2005-10-18 07:40:51.000000000 -0400 ++++ xli-2005-02-27/rlelib.c 2005-10-18 07:48:12.000000000 -0400 +@@ -18,7 +18,7 @@ + #undef DEBUG + + #ifdef DEBUG +-# define debug(xx) fprintf(stderr,xx) ++# define debug(xx) fprintf(stderr, "%s", xx) + #else + # define debug(xx) + #endif +Files xli-2005-02-27/xli and xli-2005-02-27/xli differ +diff -Nrup xli-2005-02-27/xli.h xli-2005-02-27/xli.h +--- xli-2005-02-27/xli.h 1999-10-24 22:15:07.000000000 -0400 ++++ xli-2005-02-27/xli.h 2005-10-19 07:49:21.000000000 -0400 +@@ -229,7 +229,7 @@ char *xlistrstr(char *s1, char *s2); + + /* path.c */ + char *expandPath(char *p); +-int findImage(char *name, char *fullname); ++int findImage(char *name, char *fullname, size_t size); + void listImages(void); + void loadPathsAndExts(void); + void showPath(void); +diff -Nrup xli-2005-02-27/xlito.c xli-2005-02-27/xlito.c +--- xli-2005-02-27/xlito.c 2005-02-27 19:42:39.000000000 -0500 ++++ xli-2005-02-27/xlito.c 2005-10-18 07:48:54.000000000 -0400 +@@ -31,7 +31,7 @@ char *pname, *fname; + #undef DEBUG + + #ifdef DEBUG +-# define debug(xx) fprintf(stderr,xx) ++# define debug(xx) fprintf(stderr, "%s", xx) + #else + # define debug(xx) + #endif +diff -Nrup xli-2005-02-27/zoom.c xli-2005-02-27/zoom.c +--- xli-2005-02-27/zoom.c 2005-02-27 19:42:39.000000000 -0500 ++++ xli-2005-02-27/zoom.c 2005-10-18 07:35:42.000000000 -0400 +@@ -52,30 +52,30 @@ Image *zoom(Image *oimage, unsigned int + if (verbose) + printf(" Zooming image Y axis by %d%%...", yzoom); + if (changetitle) +- sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom); ++ snprintf(buf, sizeof(buf)-1, "%s (Y zoom %d%%)", oimage->title, yzoom); + } + else if (!yzoom) { + if (verbose) + printf(" Zooming image X axis by %d%%...", xzoom); + if (changetitle) +- sprintf(buf, "%s (X zoom %d%%)", oimage->title, xzoom); ++ snprintf(buf, sizeof(buf)-1, "%s (X zoom %d%%)", oimage->title, xzoom); + } + else if (xzoom == yzoom) { + if (verbose) + printf(" Zooming image by %d%%...", xzoom); + if (changetitle) +- sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom); ++ snprintf(buf, sizeof(buf)-1, "%s (%d%% zoom)", oimage->title, xzoom); + } + else { + if (verbose) + printf(" Zooming image X axis by %d%% and Y axis by %d%%...", + xzoom, yzoom); + if (changetitle) +- sprintf(buf, "%s (X zoom %d%% Y zoom %d%%)", oimage->title, ++ snprintf(buf, sizeof(buf)-1, "%s (X zoom %d%% Y zoom %d%%)", oimage->title, + xzoom, yzoom); + } + if (!changetitle) +- strcpy(buf,oimage->title); ++ strncpy(buf,oimage->title, sizeof(buf)-1); + + if (verbose) + fflush(stdout); diff --git a/media-gfx/xli/metadata.xml b/media-gfx/xli/metadata.xml new file mode 100644 index 000000000000..6ade85e1c642 --- /dev/null +++ b/media-gfx/xli/metadata.xml @@ -0,0 +1,8 @@ + + + + + graphics@gentoo.org + Gentoo Graphics Project + + diff --git a/media-gfx/xli/xli-1.17.0-r5.ebuild b/media-gfx/xli/xli-1.17.0-r5.ebuild new file mode 100644 index 000000000000..64185ccfaefb --- /dev/null +++ b/media-gfx/xli/xli-1.17.0-r5.ebuild @@ -0,0 +1,75 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI="5" + +inherit eutils + +SNAPSHOT="2005-02-27" +DESCRIPTION="X Load Image: view images or load them to root window" +HOMEPAGE="ftp://ftp.ibiblio.org/pub/Linux/apps/graphics/viewers/X/xli-1.16.README" +SRC_URI="http://pantransit.reptiles.org/prog/xli/xli-${SNAPSHOT}.tar.gz" + +LICENSE="HPND" +SLOT="0" +KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 sparc x86 ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos" + +RDEPEND="app-arch/bzip2 + >=media-libs/libpng-1.0.5 + >=sys-libs/zlib-1.1.4 + virtual/jpeg:0 + x11-libs/libXext" + +DEPEND="${RDEPEND} + app-text/rman + x11-proto/xextproto + x11-misc/imake + !media-gfx/xloadimage" + +S=${WORKDIR}/${PN}-${SNAPSHOT} + +src_prepare() { + # avoid conflicts on systems that have zopen in system headers + sed -i -e "s:zopen:xli_zopen:g" * + + sed -i Imakefile \ + -e '/^DEFINES =/s/$/ -DHAVE_GUNZIP -DHAVE_BUNZIP2 /' \ + -e '/CCOPTIONS =/s/=.*/=/' + + # This is a hack to avoid a parse error on /usr/include/string.h + # when _BSD_SOURCE is defined. This may be a bug in that header. + sed -i png.c \ + -e '/^#include "xli.h"/i#undef _BSD_SOURCE' + + # This hack will allow xli to compile using gcc-3.3 + sed -i rlelib.c \ + -e 's/#include //' + + # fix potential security issues. + EPATCH_OPTS="-F3 -l" epatch "${FILESDIR}"/xli-security-gentoo.diff + + # Fix scale per bug 282979 + epatch "${FILESDIR}"/${P}-fix-scale-zoom.patch \ + "${FILESDIR}"/${P}-libpng14.patch +} + +src_compile() { + xmkmf || die + emake CDEBUGFLAGS="${CFLAGS}" CC="$(tc-getCC)" EXTRA_LDOPTIONS="${LDFLAGS}" +} + +src_install() { + dobin xli xlito + + dosym xli /usr/bin/xsetbg + dosym xli /usr/bin/xview + + dodoc README README.xloadimage ABOUTGAMMA TODO chkgamma.jpg + newman xli.man xli.1 + newman xliguide.man xliguide.1 + newman xlito.man xlito.1 + + insinto /etc/X11/app-defaults + newins "${FILESDIR}"/Xli.ad Xli + fperms a+r /etc/X11/app-defaults/Xli +} -- cgit v1.2.3