summaryrefslogtreecommitdiff
path: root/media-libs/urt
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-libs/urt
reinit the tree, so we can have metadata
Diffstat (limited to 'media-libs/urt')
-rw-r--r--media-libs/urt/Manifest12
-rw-r--r--media-libs/urt/files/gentoo-config53
-rw-r--r--media-libs/urt/files/urt-3.1b-build-fixes.patch151
-rw-r--r--media-libs/urt/files/urt-3.1b-compile-updates.patch141
-rw-r--r--media-libs/urt/files/urt-3.1b-make.patch75
-rw-r--r--media-libs/urt/files/urt-3.1b-rle-fixes.patch203
-rw-r--r--media-libs/urt/files/urt-3.1b-solaris.patch14
-rw-r--r--media-libs/urt/files/urt-3.1b-tempfile.patch19
-rw-r--r--media-libs/urt/metadata.xml8
-rw-r--r--media-libs/urt/urt-3.1b-r1.ebuild77
10 files changed, 753 insertions, 0 deletions
diff --git a/media-libs/urt/Manifest b/media-libs/urt/Manifest
new file mode 100644
index 000000000000..c608755712bf
--- /dev/null
+++ b/media-libs/urt/Manifest
@@ -0,0 +1,12 @@
+AUX gentoo-config 989 SHA256 9b9905c668402dc0de756eef54ae47a8173f9c80100441812afaf6743ed29925 SHA512 bfd38aeb08f26b158dd1127c33bc858f5e59cda0b3aecf79d2283391018201b35ccac051309662ae11df46241fc30461923e2d542d4fa2580e3dc6f8c8d91f6d WHIRLPOOL d36102ee246223fc40f95c102b9d6ae82f1ad4a92986fb5267d90c2d120a01a280b61af2056f33480889f7ec2a77018cd504c2865fd79178a0f372c8d45cedcb
+AUX urt-3.1b-build-fixes.patch 5182 SHA256 e4e768b8198fa1f1c76e308ae931dee483cdd58fdc9e14b079cfddb083c5d6d7 SHA512 0649f89182b7d197e126ea5874be7c531a5396953a56d360d7e8809f9fc1694646dbbcce871893d9015d2e6d62d828d082c045cf2fd68fd9621059fa6fff75fa WHIRLPOOL 0ea261431363e29b6bb2706de740e5101f8496560c67948a49b0c16bc3d3cfa878ef3bade03a21c345f45fca99b55d5acf1d6b63c1b0d25d64975d78858869c8
+AUX urt-3.1b-compile-updates.patch 3397 SHA256 b4f1b926bc3592ed44b2913a29fab3dd8265007dd9c395541691816344909d16 SHA512 27f2266983c108d166e8704512beec36a57a14e9f92b226a33195deaf9966ef089e29bd739061a35bcbfc0601e45ab270a654b0f036d23c4e2bdc9607609b683 WHIRLPOOL a64140744285f691d7d33c4265220346278736ed3b9f7a69914246fff6e7aac966e27158c869475c5d6cd7df18ee94691831bd4f12682f2e5f6d99884863f00c
+AUX urt-3.1b-make.patch 2455 SHA256 50fe429544c72eb21460cbd9e3283166f9cc703ade7e3b5529537d908e6361de SHA512 44b4463fb9b63e5a0c9af3f574ff523138117f7e0b5012e4bbd5c7b3119797f812410da7909d22dce914017bc3e704ea830307d63f908b4c508b48fff8d8898a WHIRLPOOL bb792767cb895305bab56b663586cf31b9dd752fe53141eb785dc609573737dd96e29a12440d46206dcb0abd970e5ab4e2afae5af5c83716576b55a9af6302ea
+AUX urt-3.1b-rle-fixes.patch 5072 SHA256 02e71a51b6ce7d9565ed5501a7f93429ec6697ceb9a700833fdf62229fbcdef7 SHA512 ea6b5211ff23abd9480b371ef4fb0feb87b759621d8604ec6634c38f3ed66dbc0327e01fc4382f03ae41bf1133e9a21844235f59b15e24072efc5dc7ecacac51 WHIRLPOOL cca30f58e7b0c7ef9ed9231c418704e0cb11251b0cfcf744f03834a3601e024fa6fc23093e9b591d4659306e90cecaca08dfa81cc10364109aa0c385a050b4bc
+AUX urt-3.1b-solaris.patch 277 SHA256 6139ca7854b71e4bf50d2f85fb69e4ca8c958a1ce7b4685bb591ab2ef68f6cd5 SHA512 871ff71abd69473b23e133aa01868803a4c6776828ae80761b4215648605c6b18fee7fb4c6948963bb1705c51476b4de30f89221fe5240aca6f6c90399b439c6 WHIRLPOOL 83b21543361a6851c3fee060ef8aff95852414ceea8691c932fd77f9013d067e1739c120ca2e97af35e92f3a01309f08727d01c7404d4efb5d1412e96b19d419
+AUX urt-3.1b-tempfile.patch 593 SHA256 4b5c741ed1f55ec83e7076e45eda6b88828fbb6b0af6192eb97dd0a285151f45 SHA512 d456b7219a3d7986698f8f4f7b75c6b10c5b4d9fb5ef1491ec3e85e4263832f24514d187f31a5c76c747dd9381cb7a6be94b1c2147153e774c70dec7b5ca1b11 WHIRLPOOL 2eec5ed61d324eee418040dc31d8a981f20bcbdd984f7bb2b63478b2323424de48467c59d003779ca3c6d30b52dbf811d2fde32a935075da22dae70f7b728d41
+DIST urt-3.1b.tar.Z 1016405 SHA256 6d8b67f03507818ebdca3a342c96454780cc5eadcc58ac2713cbcdfdb61a6b41 SHA512 6c9070cd106f1d696d22f862cc1c4e10325fafc7bae51e8bb1fb98f6bf8babe21a133e21b3acc0c11cf1b28a23123c8ee7bb064c9d86301b14a1c217fbe1a12d WHIRLPOOL 8930cafe6391f5164bde8c464d2b3af08b740c500639f1bfc846dbec0b4285f6653b537c11c53ef992c9078e15466cb9597270605e5deee05f0991a0fed6ecf1
+EBUILD urt-3.1b-r1.ebuild 2048 SHA256 79f16fb6d48edfa778eb7f0f1fffe247febc7657323304a66f645a4a6a1bf1a0 SHA512 b0c317132fc4e715a95cd99c8b321cfeefbe3d60141c1e9b49941d1fe1873f65f12d0f2717b5cf9604f3efa561495e16f97d5d3cbdebe46d7a6ffa014d709bbd WHIRLPOOL b4fd766b02e719b180fe0c09b9393dadbf5f96a0b5ea7247769821d9f099bf47dca8093533e6cb4b7b31ad0073eede53776e5e28fdc8801a76a9d56195fbf711
+MISC ChangeLog 2737 SHA256 5762d2829373a1cc73ddbb07bd1f7b352f3baf7c96779a03768682df4f8db8a6 SHA512 98a2940911ce482ee1b5ba46ced315b1163cc0bdfe3bcd4db7db86bf2105e29a3876d657e2ff69909dd35ea413a3582e9af8a207d8cb63e24610473fabb2308a WHIRLPOOL 52f26e4fb02f65e0d08b4e774ceb98fb8bf58ab3a99ad95757820d9a4057151d6a2f6202e9373e3d5867dc3ac008df404ede5f4590ac6e87fe023f5bf22ac0ec
+MISC ChangeLog-2015 4732 SHA256 40033f4414e21ae1dbe89444060c73d59264ad910aef5ee7005311f7defe734e SHA512 8018f69a3c3130fd9ee4bf98efa1138b5cebcc87ec369b238b103ea7e1dd4ce09e495a7e5cf0e744326e3f9e1a48980c18d1feb7dd4b1b9a25c72c3fdb51f0d0 WHIRLPOOL 64313dfae17ca84f9ae1c400f134f4a48c8af8c5e4a0b2d3b894756fd4674e46464fef91c87f9dafa42b7c436bf374ec105686fdf8e70826308d4d85af6080f0
+MISC metadata.xml 255 SHA256 3e7137870fc49956d79719e3dfe029775cbaaa097e85748c139713c46fcd1798 SHA512 b7bc93530a1726c2d4dfbc71ae29cfbb57712fd9fdd2e76fd52f35ab4368cba0497b50145d1527a3b79e465d459a380821bb1371a01c2e915dc9adc6c7fafd5f WHIRLPOOL 392188d7e069f1720be9329edfb31b11b176bf0c411023b2ceeaeabef1cacf842d70657a2a14ac2ddabbdad70a304275f3b587e9bcdfe77be63a0092e370252c
diff --git a/media-libs/urt/files/gentoo-config b/media-libs/urt/files/gentoo-config
new file mode 100644
index 000000000000..3ad38b961166
--- /dev/null
+++ b/media-libs/urt/files/gentoo-config
@@ -0,0 +1,53 @@
+#define ABEKASA60
+##define ABEKASA62 bug #455970
+#define ALIAS
+##define CGM
+#define CUBICOMP
+##define DVIRLE
+#define GRAYFILES
+#define MACPAINT
+##define PBMPLUS
+##define SUNRASTER
+#define TARGA
+#define VICAR
+#define WASATCH
+#define WAVEFRONT
+
+#define GCC
+
+#define CONST_DECL
+#define NO_MAKE_MAKEFILE
+#define USE_TIME_H
+#define SYS_V_SETPGRP
+#define USE_PROTOTYPES
+#define USE_RANDOM
+#define USE_STDARG
+#define USE_STDLIB_H
+#define USE_UNISTD_H
+#define USE_STRING_H
+#define VOID_STAR
+#define USE_XLIBINT_H
+#define X_SHARED_MEMORY
+
+#defpath DEST bin
+#defpath MAN_DEST man-dest
+#defpath RI include
+#defpath RL lib
+
+ROFF = nroff
+ROFFOPT = -man
+ROFFPIPE = | lpr
+
+INCTIFF =
+LIBTIFF = -ltiff
+INCX11 =
+LIBX11 = -lX11
+
+# Most people have migrated X11 to /usr/lib, but just in case ...
+check_x11=$(shell \
+ echo 'int main(){}' > test.c ; \
+ if ! $(CC) test.c -lX11 -o .urt-x11-test 2>/dev/null ; then \
+ echo "-L/usr/X11R6/lib" ; \
+ fi ; \
+ rm -f .urt-x11-test test.c)
+LIBX11 += $(call check_x11)
diff --git a/media-libs/urt/files/urt-3.1b-build-fixes.patch b/media-libs/urt/files/urt-3.1b-build-fixes.patch
new file mode 100644
index 000000000000..28da6b9b66d9
--- /dev/null
+++ b/media-libs/urt/files/urt-3.1b-build-fixes.patch
@@ -0,0 +1,151 @@
+some hosts are more anal about ar usage than others
+http://bugs.gentoo.org/107428
+
+respect user LDFLAGS
+http://bugs.gentoo.org/126872
+
+--- urt/lib/makefile.src
++++ urt/lib/makefile.src
+@@ -181,8 +181,7 @@
+ # Rebuild the library from all the .o files.
+ buildlib: $(OBJS)
+ -rm -f $(LIBNAME)
+- ar rc $(LIBNAME)
+- ar q $(LIBNAME) $(OBJS)
++ ar rc $(LIBNAME) $(OBJS)
+ #ifndef NO_RANLIB
+ ranlib $(LIBNAME)
+ #endif
+--- urt/tools/clock/makefile.src
++++ urt/tools/clock/makefile.src
+@@ -6,7 +6,7 @@ install: rleClock
+ mv rleClock ../rleClock.out
+
+ rleClock:rleClock.o font.o
+- ${CC} ${CFLAGS} rleClock.o font.o -lm ${LIBS} -o rleClock
++ ${CC} ${CFLAGS} ${LDFLAGS} rleClock.o font.o ${LIBS} -o rleClock -lm
+
+ font.c:font.src makeFont
+ chmod +x makeFont
+--- urt/tools/makefile.src
++++ urt/tools/makefile.src
+@@ -62,21 +62,21 @@ applymap.out rlebg.out: $(RI)/rle_raw.h
+ pyrlib.o: pyrlib.c $(RI)/pyramid.h $(RI)/rle.h $(RI)/rle_config.h
+ $(CC) $(CFLAGS) pyrlib.c -c
+ pyrmask.out: pyrlib.o pyrmask.c $(RI)/pyramid.h
+- $(CC) $(CFLAGS) -I$(RI) pyrmask.c pyrlib.o $(LIBS) -lm -o pyrmask.new
++ $(CC) $(LDFLAGS) $(CFLAGS) -I$(RI) pyrmask.c pyrlib.o $(LIBS) -lm -o pyrmask.new
+ mv pyrmask.new pyrmask.out
+
+ fant.out: fant.o mallocNd.o
+- $(CC) $(CFLAGS) -I$(RI) fant.o mallocNd.o $(LIBS) -lm -o fant.new
++ $(CC) $(LDFLAGS) $(CFLAGS) -I$(RI) fant.o mallocNd.o $(LIBS) -lm -o fant.new
+ mv fant.new fant.out
+
+ # rlebox and crop use some common code.
+ rle_box.o: $(RI)/rle.h $(RI)/rle_config.h $(RI)/rle_raw.h
+
+ crop.out: crop.c rle_box.o
+- ${CC} ${CFLAGS} crop.c rle_box.o ${LIBS} -o crop.new
++ ${CC} ${LDFLAGS} ${CFLAGS} crop.c rle_box.o ${LIBS} -o crop.new
+ mv crop.new crop.out
+ rlebox.out: rlebox.c rle_box.o
+- ${CC} ${CFLAGS} rlebox.c rle_box.o ${LIBS} -o rlebox.new
++ ${CC} ${LDFLAGS} ${CFLAGS} rlebox.c rle_box.o ${LIBS} -o rlebox.new
+ mv rlebox.new rlebox.out
+
+ # rleClock has it's own directory, must be built special
+@@ -100,7 +100,7 @@ clean: clean-pgm
+ .SUFFIXES:
+ .SUFFIXES: .out .c .o
+ .c.out:
+- $(CC) $(CFLAGS) $< $(LIBS) -lm -o $*.new
++ $(CC) $(LDFLAGS) $(CFLAGS) $< $(LIBS) -lm -o $*.new
+ mv $*.new $@
+
+ .c.o:
+--- urt/cnv/makefile.src
++++ urt/cnv/makefile.src
+@@ -76,13 +76,13 @@ PBMDIR =
+ # ppmtorle - ppm format to RLE
+ # rletoppm - RLE to ppm format
+ pgmtorle.out: pgmtorle.c
+- $(CC) $(CFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
++ $(CC) $(CFLAGS) $(LDFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
+ mv $*.new $@
+ ppmtorle.out: ppmtorle.c
+- $(CC) $(CFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
++ $(CC) $(CFLAGS) $(LDFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
+ mv $*.new $@
+ rletoppm.out: rletoppm.c
+- $(CC) $(CFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
++ $(CC) $(CFLAGS) $(LDFLAGS) $(INCPBMPLUS) $*.c $(LIBS) $(LIBPBMPLUS) -o $*.new
+ mv $*.new $@
+ #endif
+
+@@ -95,10 +95,10 @@ rletoppm.out: rletoppm.c
+ # iristorle/rletoiris - Convert between RLE and SGI image format.
+ #
+ iristorle.out: iristorle.c
+- $(CC) $(CFLAGS) -I/usr/include/gl $*.c $(LIBS) -limage -o $*.new
++ $(CC) $(CFLAGS) $(LDFLAGS) -I/usr/include/gl $*.c $(LIBS) -limage -o $*.new
+ mv $*.new $@
+ rletoiris.out: rletoiris.c
+- $(CC) $(CFLAGS) -I/usr/include/gl $*.c $(LIBS) -limage -o $*.new
++ $(CC) $(CFLAGS) $(LDFLAGS) -I/usr/include/gl $*.c $(LIBS) -limage -o $*.new
+ mv $*.new $@
+ #endif
+
+@@ -108,10 +108,10 @@ TIFFDIR =
+ # tifftorle - Convert TIFF images to RLE
+ # rletotiff - Convert RLE images to TIFF
+ rletotiff.out: rletotiff.c
+- $(CC) $(CFLAGS) $(INCTIFF) $*.c $(LIBS) $(LIBTIFF) -lm -o $*.new
++ $(CC) $(CFLAGS) $(LDFLAGS) $(INCTIFF) $*.c $(LIBS) $(LIBTIFF) -lm -o $*.new
+ mv $*.new $@
+ tifftorle.out: tifftorle.c
+- $(CC) $(CFLAGS) $(INCTIFF) $*.c $(LIBS) $(LIBTIFF) -lm -o $*.new
++ $(CC) $(CFLAGS) $(LDFLAGS) $(INCTIFF) $*.c $(LIBS) $(LIBTIFF) -lm -o $*.new
+ mv $*.new $@
+ #endif
+
+@@ -125,7 +125,7 @@ tifftorle.out: tifftorle.c
+ # Will build with the default rule.
+ # rletorla - RLE to Wavefront RLA
+ rletorla.out: rletorla.c
+- $(CC) $(CFLAGS) $*.c $(LIBS) $(LIBWAVEFRONT) -lm -o $*.new
++ $(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBS) $(LIBWAVEFRONT) -lm -o $*.new
+ mv $*.new $@
+ #endif WAVEFRONT
+
+@@ -144,7 +144,7 @@ pristine: pristine-pgm
+ .SUFFIXES:
+ .SUFFIXES: .out .c
+ .c.out:
+- $(CC) $(CFLAGS) $*.c $(LIBS) -lm -o $*.new
++ $(CC) $(CFLAGS) $(LDFLAGS) $*.c $(LIBS) -lm -o $*.new
+ mv $*.new $@
+
+ # Dependency lines. Make sure to #ifdef them.
+--- urt/cnv/rletoabA62/makefile.src
++++ urt/cnv/rletoabA62/makefile.src
+@@ -15,7 +15,7 @@ all : $(PGMS)
+ # Executables. The .out will be stripped off in the install action.
+
+ rletoabA62.out : rletoabA62.o rle.o
+- $(CC) $(CFLAGS) -o rletoabA62.new \
++ $(CC) $(CFLAGS) $(LDFLAGS) -o rletoabA62.new \
+ rletoabA62.o rle.o $(LIBS)
+ mv rletoabA62.new rletoabA62.out
+
+--- urt/cnv/rletogif/makefile.src
++++ urt/cnv/rletogif/makefile.src
+@@ -15,7 +15,7 @@ all: $(PGMS)
+ # The executable. The ".out" will be stripped off in the install action.
+
+ rletogif.out: ${OBJ}
+- ${CC} ${CFLAGS} ${OBJ} ${LIBS} -o rletogif.new
++ ${CC} ${CFLAGS} ${LDFLAGS} ${OBJ} ${LIBS} -o rletogif.new
+ mv rletogif.new rletogif.out
+
+ # Incremental install, copies executable to DEST dir.
diff --git a/media-libs/urt/files/urt-3.1b-compile-updates.patch b/media-libs/urt/files/urt-3.1b-compile-updates.patch
new file mode 100644
index 000000000000..105f7c41f6a7
--- /dev/null
+++ b/media-libs/urt/files/urt-3.1b-compile-updates.patch
@@ -0,0 +1,141 @@
+--- get/getx11/XGetHClrs.c
++++ get/getx11/XGetHClrs.c
+@@ -1,5 +1,4 @@
+ #ifndef XLIBINT_H_NOT_AVAILABLE
+-#include <X11/copyright.h>
+
+ /* $XConsortium: XGetHClrs.c,v 11.10 88/09/06 16:07:50 martin Exp $ */
+ /* Copyright Massachusetts Institute of Technology 1986 */
+--- tools/mallocNd.c
++++ tools/mallocNd.c
+@@ -67,7 +67,7 @@
+
+ /* Imports */
+ #include <stdio.h>
+-extern char *malloc();
++#include <string.h>
+
+ /* Forward declarations */
+ char *BuildIndirectionTable();
+--- tools/into.c
++++ tools/into.c
+@@ -40,8 +40,8 @@
+ static char buf[MAXPATHLEN+1];
+ short forceflg; /* overwrite an unwritable file? */
+
+-extern int errno;
+-extern char *sys_errlist[];
++#include <errno.h>
++#include <string.h>
+
+ void
+ main(argc, argv)
+@@ -103,7 +103,7 @@
+ if (ferror(outf))
+ {
+ fprintf(stderr, "into: %s, \"%s\" not modified\n",
+- sys_errlist[errno], argv[1]);
++ strerror(errno), argv[1]);
+ unlink(buf);
+ exit(1);
+ }
+--- cnv/tex/dvirle2.c
++++ cnv/tex/dvirle2.c
+@@ -55,7 +55,6 @@
+ void DumpTopOfBand(), MoveDown(), WriteBuf(), WriteBlanks();
+
+ char *ProgName;
+-extern int errno;
+ extern char *optarg;
+ extern int optind;
+
+--- cnv/wasatchrle.c
++++ cnv/wasatchrle.c
+@@ -32,7 +32,6 @@
+ #include <errno.h>
+ #include "rle.h"
+
+-extern int errno;
+
+ /* "short" in our world is 16 bits. Beware of swyte-bopping. */
+
+--- get/getx11/x11_stuff.c
++++ get/getx11/x11_stuff.c
+@@ -155,7 +155,6 @@
+ IPC_CREAT|0777 );
+ if ( img->shm_img.shmid < 0 )
+ {
+- extern int errno;
+ if ( errno == ENOSPC )
+ {
+ if ( !no_shared_space )
+@@ -361,7 +360,6 @@ Boolean reallocate;
+ XDestroyImage( image );
+ if ( img->shm_pix.shmid < 0 )
+ {
+- extern int errno;
+ if ( errno == ENOSPC )
+ {
+ if ( !no_shared_space )
+--- get/qcr/qcr.h
++++ get/qcr/qcr.h
+@@ -6,8 +6,6 @@
+ #define GREEN 1
+ #define BLUE 2
+
+-extern int errno;
+-
+ /* Command defs for QCR-Z Film Recorder */
+
+ /* These are for 8 bit Look Up Tables */
+--- get/gettaac.c
++++ get/gettaac.c
+@@ -24,6 +24,7 @@
+ * Send bug fixes and improvements to: ksp@maxwell.nde.swri.edu
+ */
+
++#include <errno.h>
+ #include <stdio.h>
+ #include <strings.h>
+ #include <signal.h>
+@@ -459,7 +460,6 @@ char *template;
+ char nonUnique;
+ char twiddleUserCompletion;
+
+- extern int errno;
+ struct direct *nameEntry;
+ DIR *dirChan;
+ struct passwd *pwdEntry;
+--- tools/clock/rleClock.c
++++ tools/clock/rleClock.c
+@@ -598,7 +598,7 @@
+ { TRUE, "-tf", STRING, "Text area format string", (char *)&FormatString },
+ { FALSE, "-Xm", BOOL, "Output the alpha channel on RGB", (char *)&DebugAlpha },
+ { FALSE, "-D", BOOL, "Turn on debugging", (char *)&Debug },
+- NULL
++ { FALSE, NULL }
+ };
+
+ void
+--- tools/to8.c
++++ tools/to8.c
+@@ -175,7 +175,7 @@
+ * Give it a background color of black, since the real background
+ * will be dithered anyway.
+ */
+- if ( in_hdr.background != NULL )
++ if ( in_hdr.background != 0 )
+ {
+ out_hdr.bg_color = (int *)malloc( sizeof( int ) );
+ RLE_CHECK_ALLOC( cmd_name( argv ), out_hdr.bg_color, 0 );
+--- cnv/rletoabA62/rletoabA62.c
++++ cnv/rletoabA62/rletoabA62.c
+@@ -157,7 +157,7 @@
+ exit(1);
+ }
+ if (optind < argc) {
+- if ((file = open(argv[optind], 0)) == NULL) {
++ if ((file = open(argv[optind], 0)) == -1) {
+ perror(argv[optind]);
+ exit(1);
+ }
diff --git a/media-libs/urt/files/urt-3.1b-make.patch b/media-libs/urt/files/urt-3.1b-make.patch
new file mode 100644
index 000000000000..d8f6c74cd890
--- /dev/null
+++ b/media-libs/urt/files/urt-3.1b-make.patch
@@ -0,0 +1,75 @@
+Index: urt/makefile.src
+===================================================================
+--- urt.orig/makefile.src
++++ urt/makefile.src
+@@ -17,7 +17,7 @@ all: default
+ # clean deletes all but source, pristine (below) deletes installed stuff, too
+ default clean: doit
+ @for d in $(DIRS) ; do \
+- ( cd $$d ; echo make $@ on $$d ; make $(MFLAGS) $@ ) ; \
++ ( cd $$d ; echo $(MAKE) $@ on $$d ; $(MAKE) $(MFLAGS) $@ ) ; \
+ done
+
+ # install puts library, binaries and documentation into global location
+@@ -29,7 +29,7 @@ MAKE_TARGET =
+
+ install $(MAKE_TARGET) pristine depend:: doit
+ @for d in $(ALLDIRS) ; do \
+- ( cd $$d ; echo make $@ on $$d ; make $(MFLAGS) $@ ) ; \
++ ( cd $$d ; echo $(MAKE) $@ on $$d ; $(MAKE) $(MFLAGS) $@ ) ; \
+ done
+
+
+Index: urt/tools/makefile.src
+===================================================================
+--- urt.orig/tools/makefile.src
++++ urt/tools/makefile.src
+@@ -82,7 +82,7 @@ rlebox.out: rlebox.c rle_box.o
+ # rleClock has it's own directory, must be built special
+
+ rleClock.out: clock/font.c clock/font.h clock/font.src clock/rleClock.c
+- (cd clock ; make)
++ (cd clock ; $(MAKE))
+
+ # Incremental install, copies everything ("$?") since last install to DEST dir.
+ install: $(PGMS) install-pgm
+Index: urt/makefile.tlr
+===================================================================
+--- urt.orig/makefile.tlr
++++ urt/makefile.tlr
+@@ -7,7 +7,7 @@ subdirs:
+ @sh -c "if test 'x$(DIRS)' != x ; then eval \
+ 'set -e ; for dir in $(DIRS) ; do \
+ (cd \$$dir ; echo Make ${HERE}\$$dir ; \
+- make $(MFLAGS) $(DIRMFLAGS) ) ; \
++ $(MAKE) $(MFLAGS) $(DIRMFLAGS) ) ; \
+ done' ; \
+ else \
+ true ; \
+@@ -46,7 +46,7 @@ install-subdirs: subdirs
+ @sh -c "if test 'x$(DIRS)' != x ; then eval \
+ 'for dir in $(DIRS) ; do \
+ (cd \$$dir ; echo Install ${HERE}\$$dir ; \
+- make $(MFLAGS) $(DIRMFLAGS) install) ; \
++ $(MAKE) $(MFLAGS) $(DIRMFLAGS) install) ; \
+ done' ; \
+ else \
+ true ; \
+@@ -105,7 +105,7 @@ pristine-pgm: clean-pgm
+ 'for dir in $(ALLDIRS); do \
+ if test -d $$dir ; then \
+ (cd $$dir; echo Make ${HERE}$$dir pristine ; \
+- make $(MFLAGS) pristine); \
++ $(MAKE) $(MFLAGS) pristine); \
+ else \
+ true; \
+ fi; \
+@@ -124,7 +124,7 @@ clean-pgm:
+ 'for dir in $(ALLDIRS); do \
+ if test -d $$dir ; then \
+ (cd $$dir; echo Clean ${HERE}$$dir ; \
+- make $(MFLAGS) clean); \
++ $(MAKE) $(MFLAGS) clean); \
+ else \
+ true; \
+ fi; \
diff --git a/media-libs/urt/files/urt-3.1b-rle-fixes.patch b/media-libs/urt/files/urt-3.1b-rle-fixes.patch
new file mode 100644
index 000000000000..3720806960fe
--- /dev/null
+++ b/media-libs/urt/files/urt-3.1b-rle-fixes.patch
@@ -0,0 +1,203 @@
+Fixes taken from netpbm
+
+--- lib/rle_global.c
++++ lib/rle_global.c
+@@ -76,7 +76,7 @@ rle_hdr rle_dflt_hdr = {
+ 8, /* cmaplen (log2 of length of color map) */
+ NULL, /* pointer to color map */
+ NULL, /* pointer to comment strings */
+- stdout, /* output file */
++ NULL, /* output file -- must be set dynamically */
+ { 7 }, /* RGB channels only */
+ 0L, /* Can't free name and file fields. */
+ "Urt", /* Default "program name". */
+--- lib/rle_hdr.c
++++ lib/rle_hdr.c
+@@ -269,6 +273,9 @@
+ {
+ rle_hdr *ret_hdr;
+
++ rle_dflt_hdr.rle_file = stdout;
++ /* The rest of rle_dflt_hdr is set by the loader's data initialization */
++
+ if ( the_hdr == &rle_dflt_hdr )
+ return the_hdr;
+
+--- lib/dither.c
++++ lib/dither.c
+@@ -38,10 +38,10 @@ void make_square();
+ #endif
+
+ static int magic4x4[4][4] = {
+- 0, 14, 3, 13,
+- 11, 5, 8, 6,
+- 12, 2, 15, 1,
+- 7, 9, 4, 10
++{ 0, 14, 3, 13},
++{ 11, 5, 8, 6},
++{ 12, 2, 15, 1},
++{ 7, 9, 4, 10}
+ };
+
+ /* basic dithering macro */
+--- lib/rle_open_f.c
++++ lib/rle_open_f.c
+@@ -9,7 +9,11 @@
+ */
+
+ #include "rle_config.h"
++#define _XOPEN_SOURCE /* Make sure fdopen() is in stdio.h */
++
+ #include <stdio.h>
++#include <unistd.h>
++#include <fcntl.h>
+
+ #ifndef NO_OPEN_PIPES
+ /* Need to have a SIGCLD signal catcher. */
+@@ -260,7 +260,6 @@
+ int pipefd[2];
+ int i;
+ char *argv[4];
+- extern int errno;
+
+ /* Check args. */
+ if ( *mode != 'r' && *mode != 'w' )
+--- lib/rle_getcom.c
++++ lib/rle_getcom.c
+@@ -53,11 +53,12 @@
+ {
+ for ( ; *n != '\0' && *n != '=' && *n == *v; n++, v++ )
+ ;
+- if (*n == '\0' || *n == '=')
++ if (*n == '\0' || *n == '=') {
+ if ( *v == '\0' )
+ return v;
+ else if ( *v == '=' )
+ return ++v;
++ }
+
+ return NULL;
+ }
+--- lib/scanargs.c
++++ lib/scanargs.c
+@@ -128,10 +130,10 @@
+ va_list argl;
+ {
+
+- register check; /* check counter to be sure all argvs
++ int check; /* check counter to be sure all argvs
+ are processed */
+ register CONST_DECL char *cp;
+- register cnt;
++ int cnt;
+ int optarg = 0; /* where optional args start */
+ int nopt = 0;
+ char tmpflg, /* temp flag */
+@@ -375,11 +377,12 @@
+ if ( optarg > 0 ) /* end optional args? */
+ {
+ /* Eat the arg, too, if necessary */
+- if ( list_cnt == 0 )
++ if ( list_cnt == 0 ) {
+ if ( typchr == 's' )
+ (void)va_arg( argl, char * );
+ else
+ (void)va_arg( argl, ptr );
++ }
+ break;
+ }
+ else
+@@ -567,7 +570,7 @@
+ * Do conversion for n and N types
+ */
+ tmpflg = typchr;
+- if (typchr == 'n' || typchr == 'N' )
++ if (typchr == 'n' || typchr == 'N' ) {
+ if (*argp != '0')
+ tmpflg = 'd';
+ else if (*(argp+1) == 'x' ||
+@@ -578,6 +581,7 @@
+ }
+ else
+ tmpflg = 'o';
++ }
+ if (typchr == 'N')
+ tmpflg = toupper( tmpflg );
+
+--- lib/inv_cmap.c
++++ lib/inv_cmap.c
+@@ -42,7 +42,7 @@
+ static long cbinc, cginc, crinc;
+ static unsigned long *gdp, *rdp, *cdp;
+ static unsigned char *grgbp, *rrgbp, *crgbp;
+-static gstride, rstride;
++static long gstride, rstride;
+ static long x, xsqr, colormax;
+ static int cindex;
+ #ifdef INSTRUMENT_IT
+--- lib/rle_getrow.c
++++ lib/rle_getrow.c
+@@ -351,7 +351,7 @@
+ bzero( (char *)scanline[-1] + the_hdr->xmin,
+ the_hdr->xmax - the_hdr->xmin + 1 );
+ for ( nc = 0; nc < the_hdr->ncolors; nc++ )
+- if ( RLE_BIT( *the_hdr, nc ) )
++ if ( RLE_BIT( *the_hdr, nc ) ) {
+ /* Unless bg color given explicitly, use 0. */
+ if ( the_hdr->background != 2 || the_hdr->bg_color[nc] == 0 )
+ bzero( (char *)scanline[nc] + the_hdr->xmin,
+@@ -360,6 +360,7 @@
+ bfill( (char *)scanline[nc] + the_hdr->xmin,
+ the_hdr->xmax - the_hdr->xmin + 1,
+ the_hdr->bg_color[nc] );
++ }
+ }
+
+ /* If skipping, then just return */
+@@ -367,7 +368,7 @@
+ {
+ the_hdr->priv.get.vert_skip--;
+ the_hdr->priv.get.scan_y++;
+- if ( the_hdr->priv.get.vert_skip > 0 )
++ if ( the_hdr->priv.get.vert_skip > 0 ) {
+ if ( the_hdr->priv.get.scan_y >= the_hdr->ymax )
+ {
+ int y = the_hdr->priv.get.scan_y;
+@@ -377,6 +378,7 @@
+ }
+ else
+ return the_hdr->priv.get.scan_y;
++ }
+ }
+
+ /* If EOF has been encountered, return also */
+@@ -457,11 +459,12 @@
+ else
+ nc = DATUM(inst);
+ nc++;
+- if ( debug_f )
++ if ( debug_f ) {
+ if ( RLE_BIT( *the_hdr, channel ) )
+ fprintf( stderr, "Pixel data %d (to %d):", nc, scan_x+nc );
+ else
+ fprintf( stderr, "Pixel data %d (to %d)\n", nc, scan_x+nc);
++ }
+ if ( RLE_BIT( *the_hdr, channel ) )
+ {
+ /* Don't fill past end of scanline! */
+--- lib/rle_putcom.c
++++ lib/rle_putcom.c
+@@ -53,11 +53,12 @@
+ {
+ for ( ; *n != '\0' && *n != '=' && *n == *v; n++, v++ )
+ ;
+- if (*n == '\0' || *n == '=')
++ if (*n == '\0' || *n == '=') {
+ if ( *v == '\0' )
+ return v;
+ else if ( *v == '=' )
+ return ++v;
++ }
+
+ return NULL;
+ }
diff --git a/media-libs/urt/files/urt-3.1b-solaris.patch b/media-libs/urt/files/urt-3.1b-solaris.patch
new file mode 100644
index 000000000000..c1775d7e9783
--- /dev/null
+++ b/media-libs/urt/files/urt-3.1b-solaris.patch
@@ -0,0 +1,14 @@
+usage of errno requires errno.h
+
+Fabian Groffen <grobian@gentoo.org>
+
+--- get/getx11/x11_stuff.c
++++ get/getx11/x11_stuff.c
+@@ -42,6 +42,7 @@
+ #ifdef X_SHARED_MEMORY
+ #include <sys/errno.h>
+ #endif
++#include <errno.h>
+
+ #include "circle.bitmap"
+ #include "circle_mask.bitmap"
diff --git a/media-libs/urt/files/urt-3.1b-tempfile.patch b/media-libs/urt/files/urt-3.1b-tempfile.patch
new file mode 100644
index 000000000000..12acce151b5d
--- /dev/null
+++ b/media-libs/urt/files/urt-3.1b-tempfile.patch
@@ -0,0 +1,19 @@
+--- tools/rlecat.c
++++ tools/rlecat.c
+@@ -110,8 +110,14 @@
+ nflag = 0; /* Not really repeating! */
+ else
+ {
+- mktemp( temp ); /* Make a temporary file name */
+- tmpfile = rle_open_f( cmd_name( argv ), temp, "w+" );
++ /* we dont have to use rle_open_f() because all it does in
++ * this case is run fopen() ... we're creating a file so all
++ * the checks for opening an existing file aren't needed */
++ int fd = mkstemp(temp);
++ if (fd == -1 || (tmpfile = fdopen(fd, "w+")) == NULL) {
++ perror("Unable to open tempfile");
++ exit(-1);
++ }
+ }
+ }
+
diff --git a/media-libs/urt/metadata.xml b/media-libs/urt/metadata.xml
new file mode 100644
index 000000000000..19bf1be2581e
--- /dev/null
+++ b/media-libs/urt/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-libs/urt/urt-3.1b-r1.ebuild b/media-libs/urt/urt-3.1b-r1.ebuild
new file mode 100644
index 000000000000..d25337bcbd08
--- /dev/null
+++ b/media-libs/urt/urt-3.1b-r1.ebuild
@@ -0,0 +1,77 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="5"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="the Utah Raster Toolkit is a library for dealing with raster images"
+HOMEPAGE="http://www.cs.utah.edu/gdc/projects/urt/"
+SRC_URI="ftp://ftp.iastate.edu/pub/utah-raster/${P}.tar.Z"
+
+LICENSE="URT gif? ( free-noncomm )"
+SLOT="0"
+KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x86-macos ~x64-solaris ~x86-solaris"
+IUSE="gif postscript tiff X"
+
+RDEPEND="X? ( x11-libs/libXext )
+ gif? ( media-libs/giflib )
+ tiff? ( media-libs/tiff )
+ postscript? ( app-text/ghostscript-gpl )"
+DEPEND="${RDEPEND}
+ X? ( x11-proto/xextproto )"
+
+S=${WORKDIR}
+
+urt_config() {
+ use $1 && echo "#define $2" || echo "##define $2"
+}
+
+src_prepare() {
+ rm -f bin/README
+
+ epatch "${FILESDIR}"/${P}-rle-fixes.patch
+ epatch "${FILESDIR}"/${P}-compile-updates.patch
+ epatch "${FILESDIR}"/${P}-tempfile.patch
+ epatch "${FILESDIR}"/${P}-build-fixes.patch
+ epatch "${FILESDIR}"/${P}-make.patch
+ epatch "${FILESDIR}"/${P}-solaris.patch
+
+ # punt bogus manpage #109511
+ rm -f man/man1/template.1
+
+ # stupid OS X declares a stack_t type already #107428
+ sed -i -e 's:stack_t:_urt_stack:g' tools/clock/rleClock.c || die
+
+ sed -i -e '/^CFLAGS/s: -O : :' makefile.hdr
+ cp "${FILESDIR}"/gentoo-config config/gentoo
+ cat >> config/gentoo <<-EOF
+ $(urt_config X X11)
+ $(urt_config postscript POSTSCRIPT)
+ $(urt_config tiff TIFF)
+ ExtraCFLAGS = ${CFLAGS}
+ MFLAGS = ${MAKEOPTS}
+ # prevent circular depend #111455
+ $(has_version media-libs/giflib && urt_config gif GIF)
+ EOF
+}
+
+src_configure() {
+ ./Configure config/gentoo || die "config"
+}
+
+src_compile() {
+ emake CC=$(tc-getCC)
+}
+
+src_install() {
+ mkdir -p man-dest/man{1,3,5}
+ # this just installs it into some local dirs
+ make install || die
+ dobin bin/*
+ dolib.a lib/librle.a
+ insinto /usr/include
+ doins include/rle*.h
+ doman man-dest/man?/*.[135]
+ dodoc *-changes CHANGES* README blurb
+}