summaryrefslogtreecommitdiff
path: root/media-libs/t1lib
diff options
context:
space:
mode:
Diffstat (limited to 'media-libs/t1lib')
-rw-r--r--media-libs/t1lib/Manifest12
-rw-r--r--media-libs/t1lib/files/t1lib-5.1.1-parallel.patch12
-rw-r--r--media-libs/t1lib/files/t1lib-5.1.2-CVE-2010-2642_2011-0433_2011-5244.patch46
-rw-r--r--media-libs/t1lib/files/t1lib-5.1.2-CVE-2011-0764.patch31
-rw-r--r--media-libs/t1lib/files/t1lib-5.1.2-CVE-2011-1552_1553_1554.patch133
-rw-r--r--media-libs/t1lib/files/t1lib-5.1.2-format-security.patch39
-rw-r--r--media-libs/t1lib/files/t1lib-do-not-install-t1lib_doc-r1.patch19
-rw-r--r--media-libs/t1lib/files/t1lib-do-not-install-t1lib_doc.patch19
-rw-r--r--media-libs/t1lib/metadata.xml8
-rw-r--r--media-libs/t1lib/t1lib-5.1.2-r1.ebuild83
10 files changed, 402 insertions, 0 deletions
diff --git a/media-libs/t1lib/Manifest b/media-libs/t1lib/Manifest
new file mode 100644
index 000000000000..c6c26707e0f3
--- /dev/null
+++ b/media-libs/t1lib/Manifest
@@ -0,0 +1,12 @@
+AUX t1lib-5.1.1-parallel.patch 472 SHA256 ce21f6c0a24e7d59de2d41a517a0c5410b35e42d9677c494fc70701a3c3e8a24 SHA512 845786d73fa384716ab17a37ade8ffba0be7e27bd54918e7c8a2630e867a15e5100efe550c0d896c4bfbb7c14bf1d8655a39de2518a6d666d132a910808e2dd7 WHIRLPOOL 39fcae7135ee0b783aafa49c9836bcc718d0f65686659a15bdd7e46857107878c83e231d92419157741cbc27534ff9c142d3c529fa8d70dc5c490543faa58c86
+AUX t1lib-5.1.2-CVE-2010-2642_2011-0433_2011-5244.patch 1527 SHA256 f5b1cf0ecb7541d25c0d15d4c38037685a020f76a9b7debc30c6f81b8334b038 SHA512 2b61e471b3672731dcc7607ea3087899a0ab9ed663d21ac3db44602f334384d9c625468cfaa4a7bd29115f689aa0eae68f7e88cd663e91cfe68cb07996a3fcaf WHIRLPOOL 41e2b4adf2b1532490a014a9f24efe681843d2802e7d66fd3ba5afa967e1f59c315ef6c344fe1ffe6dabc26a620c01d61f0036d5330927ca3359f0107db80583
+AUX t1lib-5.1.2-CVE-2011-0764.patch 1224 SHA256 f8dff283bcebd636b8abc499ddaed366220b28311822554add4f0eb7c38d4df7 SHA512 a830f39c59af69f9b7d6646fab28108121832e93ec5fcbc323d665ac6457979b333e3797065f3e41f101e75ef82635e4c85c0abd2fd480effda95a0ce6b84dc4 WHIRLPOOL e38439e69f192234ce1d3b97b122ce1d46952a9bab25676f97297b95a6bb1062eb3c1dbb9bd3ab33735b7498791a7455a1990365a9a7224f15084173544cdb7a
+AUX t1lib-5.1.2-CVE-2011-1552_1553_1554.patch 5085 SHA256 06623c7884f2e767ec96cc9eea4f06361e7a03ee7f7c8327a65b60c81e6bc405 SHA512 c7438ca5bc3778a21e2f522870b4af43fb69b04ebe4b0912addebc070fd5bde075f96bb4f6584072aa0a2da2e9d66f56bfa625424f409392eda1fb027298c198 WHIRLPOOL e6262ecb0a009ff7b512109fc4da6c92e80672d7104ec10dc8bf937138bd53e95b71484902ae935a70e620f227a171805124b447071cb06445a7939fda4c43d0
+AUX t1lib-5.1.2-format-security.patch 1357 SHA256 f8304b9dbce8a950245e01b0da22aa570ed7023fe657e6e3ff0ee2ea5092f9fc SHA512 7c7ecc3851c675780b15b185db1b6c0b412fc1eef7505c822b75163ebdf14762ba999486db3238adbefe1571b762e9014669a585a886e537068b8a38bdb85ec1 WHIRLPOOL 46cd1f027ef5ae2e41a13262c3738d007b1b01b0b52a2686641ad6ba6773e9c00461d8c175235c3bee66ac84c0f56a68a43e60a16db44dc2d278c82c733e8b3c
+AUX t1lib-do-not-install-t1lib_doc-r1.patch 522 SHA256 20e4af9c6b3e74eda4d6905d0c7556ebe03bd5c32211b33f7fedc77e3fb40498 SHA512 d77beebb581739f5646137d5c1aa5cf3d9906a010f07e3822040812822782db7712d4d18d6235dc22da6e4531daf81fa891db4c1047ad95ee702da88cb01688b WHIRLPOOL 1a0a566bc9be37afd13dd69692cee5fe6fb677eb09f9d3d884c9ffa801302b6b421e65b0b55b28d9427a5dba096dd1ba322edf259b33642134a3ef1ea17b3971
+AUX t1lib-do-not-install-t1lib_doc.patch 514 SHA256 44c6ce37932e259370ac7c8ddf44b9e6932f69ec94f6fb8c3cfcb31e896119b8 SHA512 9c6301385fcf21d9700a3c8c986d56d6831aead53c99438a473c89b48e7bdec6e95d49118100e9b24c2dc8fd2d53fec55592308c0e8fc703bb4407339e96a099 WHIRLPOOL 1218a1a03786ffddd409fb775e373b33cae495f771c2e6ee5ba722b26d6be298c2ce05565a14c17a4d553723f0eb4fe9b4b26168ffe6e79cc08f2b5530511c33
+DIST t1lib-5.1.2.tar.gz 1872534 SHA256 821328b5054f7890a0d0cd2f52825270705df3641dbd476d58d17e56ed957b59 SHA512 9f424b19c6f35cc4f194ff7351a4c2352216462c7d1b1d9650ad3a05cf48c6e90c89ccbcda5ecc47a4169a39a850cf84a1fcbf88b3b15614860c27364b631ae3 WHIRLPOOL cc819ac6bbef0d961e1d24d29e4fc748b1a9b9549f8409098ab7b01d0a8613b409fc833a5cfe13596e18faac98cb9f1cdc823581442c1d587a1b723aa96d9050
+EBUILD t1lib-5.1.2-r1.ebuild 1878 SHA256 7d2fffbbacfa8026b98d09c26b756c6f08964357f70cd55f50a979aac14d0d66 SHA512 433f75e85787ec7235d9bb191f95ec484578bb96cefbcdefd99c3ea0077ac2be18f111b94512409f2789a705c36dc355744bf383bc13884d0c85c64f9def0b53 WHIRLPOOL 6d62530e9e284e4499b724149c0923d0d197fd9631d7294f852dba743162b8374f960d8dfdf66b44041db1f3ba5b8fcaf0bbb72a92f9c99e0c8f2032bce55f77
+MISC ChangeLog 4159 SHA256 7d01279df2bcc7da425782bfd789cca661bcd72dfaf2e8687ef7d6ab794a4211 SHA512 d178d4c9ebb8adb6f9e1dbe592daf086ec6db70a4a06096052e964f116371880154f6525303e1a7da3eb00b15f3c6163f1ac6921ae268bde6d01835bf870cc69 WHIRLPOOL fd2769ebab4cf1b4e459eddea9251d0babd971d98c6b4a225edb13822af0b3e2eea90774f479a0f11960e64115ca50ac29ff0d27084b3e383bd4fe41d41bfd2e
+MISC ChangeLog-2015 11344 SHA256 4ed5776ccbe8c18590335fcda5e86a132031342e28ee88729b9086487942b44d SHA512 f1248ac33a34d78e5c9b5a4a7574505e11cabaaa2fd31191502f96c32afc04405919140be2bcd3271136fce443888ca3d2f353855b6b5949f2f5cc42e1e39ee6 WHIRLPOOL 3e807706923114dccc48193009b0c0b254e08533c58ed4aa5a02301ef28dfb1c7a9df6b15ec63a2956bc959c7fb1604c4cb3c7fc48452ed4cb8dcf3493edf445
+MISC metadata.xml 234 SHA256 e4848031eef3f8cb5089319b804a2c1cc2aba578c8cf7fc8323b9782c98d04dd SHA512 582b5859e81dd9914f3a2665bcdec86d1ba10026f0b0c8207fa0a6a621eaedd40286fc01250e8fed3d63750a4f39c6c8e4e5d358d360c0113e0904f297624ff5 WHIRLPOOL c11a2368b5137f9ae0226b17808f9d0dbb31821b850bbfc8cb9cb33963e54f33ba9362b0ba39abb48a469c5dc62d1a79686eb401a47a2c02fd73c09dfb6c325e
diff --git a/media-libs/t1lib/files/t1lib-5.1.1-parallel.patch b/media-libs/t1lib/files/t1lib-5.1.1-parallel.patch
new file mode 100644
index 000000000000..d829c9ff1756
--- /dev/null
+++ b/media-libs/t1lib/files/t1lib-5.1.1-parallel.patch
@@ -0,0 +1,12 @@
+diff -Naur t1lib-5.1.1-orig/lib/Makefile.in t1lib-5.1.1/lib/Makefile.in
+--- t1lib-5.1.1-orig/lib/Makefile.in 2006-11-05 17:06:05.000000000 -0600
++++ t1lib-5.1.1/lib/Makefile.in 2007-10-04 21:21:20.000000000 -0600
+@@ -133,7 +133,7 @@
+ cp t1lib/t1lib.h .
+
+
+-libt1x.la: $(T1LIBX_OBJS)
++libt1x.la: $(T1LIBX_OBJS) libt1.la
+ $(LIBTOOL) --mode=link \
+ $(CC) $(LDFLAGS) -o $@ $(T1LIBX_OBJS) \
+ -version-info @T1LIB_LT_CURRENT@:@T1LIB_LT_REVISION@:@T1LIB_LT_AGE@ \
diff --git a/media-libs/t1lib/files/t1lib-5.1.2-CVE-2010-2642_2011-0433_2011-5244.patch b/media-libs/t1lib/files/t1lib-5.1.2-CVE-2010-2642_2011-0433_2011-5244.patch
new file mode 100644
index 000000000000..9d3168c0bfbe
--- /dev/null
+++ b/media-libs/t1lib/files/t1lib-5.1.2-CVE-2010-2642_2011-0433_2011-5244.patch
@@ -0,0 +1,46 @@
+CVE-2010-2642, CVE-2011-0433 and CVE-2011-5244
+
+CVE-2010-2642:
+==============
+Upstream-Bug: https://bugzilla.gnome.org/show_bug.cgi?id=643882
+Upstream-Fix: https://git.gnome.org/browse/evince/commit/?id=efadec4ffcdde3373f6f4ca0eaac98dc963c4fd5
+
+
+CVE-2011-0433:
+==============
+Upstream-Bug: https://bugzilla.gnome.org/show_bug.cgi?id=640923
+Upstream-Fix: https://git.gnome.org/browse/evince/commit/?id=439c5070022eab6cef7266aab47f978058012c72
+
+
+CVE-2011-5244:
+==============
+Upstream-Bug: https://bugzilla.gnome.org/show_bug.cgi?id=643882
+Upstream-Fix: https://git.gnome.org/browse/evince/commit/?id=efadec4ffcdde3373f6f4ca0eaac98dc963c4fd5
+
+
+Origin: https://bugs.debian.org/652996
+
+diff --git a/lib/t1lib/parseAFM.c b/lib/t1lib/parseAFM.c
+index 6a31d7f..ba64541 100644
+--- a/lib/t1lib/parseAFM.c
++++ b/lib/t1lib/parseAFM.c
+@@ -199,7 +199,9 @@ static char *token(stream)
+ idx = 0;
+
+ while (ch != EOF && ch != ' ' && ch != CR && ch != LF &&
+- ch != CTRL_Z && ch != '\t' && ch != ':' && ch != ';'){
++ ch != CTRL_Z && ch != '\t' && ch != ':' && ch != ';'
++ && idx < (MAX_NAME -1))
++ {
+ ident[idx++] = ch;
+ ch = fgetc(stream);
+ } /* while */
+@@ -235,7 +237,7 @@ static char *linetoken(stream)
+ while ((ch = fgetc(stream)) == ' ' || ch == '\t' );
+
+ idx = 0;
+- while (ch != EOF && ch != CR && ch != LF && ch != CTRL_Z)
++ while (ch != EOF && ch != CR && ch != LF && ch != CTRL_Z && idx < (MAX_NAME - 1))
+ {
+ ident[idx++] = ch;
+ ch = fgetc(stream);
diff --git a/media-libs/t1lib/files/t1lib-5.1.2-CVE-2011-0764.patch b/media-libs/t1lib/files/t1lib-5.1.2-CVE-2011-0764.patch
new file mode 100644
index 000000000000..73f94ce5e6b2
--- /dev/null
+++ b/media-libs/t1lib/files/t1lib-5.1.2-CVE-2011-0764.patch
@@ -0,0 +1,31 @@
+CVE-2011-0764
+
+Author: Marc Deslauriers <marc.deslauriers@canonical.com>
+Origin: https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/wily/t1lib/wily/view/head:/debian/patches/CVE-2011-0764.diff
+
+--- t1lib-5.1.2.orig/lib/type1/type1.c 2011-12-13 14:24:14.280965637 -0600
++++ t1lib-5.1.2/lib/type1/type1.c 2011-12-13 14:25:25.893320747 -0600
+@@ -1700,6 +1700,7 @@
+ long pindex = 0;
+
+ /* compute hinting for previous segment! */
++ if (ppoints == NULL) Error0i("RLineTo: No previous point!\n");
+ FindStems( currx, curry, currx-ppoints[numppoints-2].x, curry-ppoints[numppoints-2].y, dx, dy);
+
+ /* Allocate a new path point and pre-setup data */
+@@ -1728,6 +1729,7 @@
+ long pindex = 0;
+
+ /* compute hinting for previous point! */
++ if (ppoints == NULL) Error0i("RRCurveTo: No previous point!\n");
+ FindStems( currx, curry, currx-ppoints[numppoints-2].x, curry-ppoints[numppoints-2].y, dx1, dy1);
+
+ /* Allocate three new path points and pre-setup data */
+@@ -1903,6 +1905,7 @@
+ FindStems( currx, curry, 0, 0, dx, dy);
+ }
+ else {
++ if (ppoints == NULL) Error0i("RMoveTo: No previous point!\n");
+ FindStems( currx, curry, ppoints[numppoints-2].x, ppoints[numppoints-2].y, dx, dy);
+ }
+
diff --git a/media-libs/t1lib/files/t1lib-5.1.2-CVE-2011-1552_1553_1554.patch b/media-libs/t1lib/files/t1lib-5.1.2-CVE-2011-1552_1553_1554.patch
new file mode 100644
index 000000000000..192c91f209fb
--- /dev/null
+++ b/media-libs/t1lib/files/t1lib-5.1.2-CVE-2011-1552_1553_1554.patch
@@ -0,0 +1,133 @@
+CVE-2011-1552, CVE-2011-1553 and CVE-2011-1554
+
+Author: Jaroslav Škarvada <jskarvad@redhat.com>
+Origin: http://bugzilla.redhat.com/show_bug.cgi?id=692909
+
+--- t1lib-5.1.2.orig/lib/type1/lines.c 2007-12-23 09:49:42.000000000 -0600
++++ t1lib-5.1.2/lib/type1/lines.c 2012-01-17 14:15:08.000000000 -0600
+@@ -67,6 +67,10 @@
+ None.
+ */
+
++#define BITS (sizeof(LONG)*8)
++#define HIGHTEST(p) (((p)>>(BITS-2)) != 0) /* includes sign bit */
++#define TOOBIG(xy) ((xy < 0) ? HIGHTEST(-xy) : HIGHTEST(xy))
++
+ /*
+ :h2.StepLine() - Produces Run Ends for a Line After Checks
+
+@@ -84,6 +88,9 @@
+ IfTrace4((LineDebug > 0), ".....StepLine: (%d,%d) to (%d,%d)\n",
+ x1, y1, x2, y2);
+
++ if ( TOOBIG(x1) || TOOBIG(x2) || TOOBIG(y1) || TOOBIG(y2))
++ abort("Lines this big not supported", 49);
++
+ dy = y2 - y1;
+
+ /*
+Index: t1lib-5.1.2/lib/type1/objects.c
+===================================================================
+--- t1lib-5.1.2.orig/lib/type1/objects.c 2007-12-23 09:49:42.000000000 -0600
++++ t1lib-5.1.2/lib/type1/objects.c 2012-01-17 14:15:08.000000000 -0600
+@@ -1137,12 +1137,13 @@
+ "Context: out of them", /* 46 */
+ "MatrixInvert: can't", /* 47 */
+ "xiStub called", /* 48 */
+- "Illegal access type1 abort() message" /* 49 */
++ "Lines this big not supported", /* 49 */
++ "Illegal access type1 abort() message" /* 50 */
+ };
+
+- /* no is valid from 1 to 48 */
+- if ( (number<1)||(number>48))
+- number=49;
++ /* no is valid from 1 to 49 */
++ if ( (number<1)||(number>49))
++ number=50;
+ return( err_msgs[number-1]);
+
+ }
+Index: t1lib-5.1.2/lib/type1/type1.c
+===================================================================
+--- t1lib-5.1.2.orig/lib/type1/type1.c 2012-01-17 14:13:28.000000000 -0600
++++ t1lib-5.1.2/lib/type1/type1.c 2012-01-17 14:19:54.000000000 -0600
+@@ -1012,6 +1012,7 @@
+ double nextdtana = 0.0; /* tangent of post-delta against horizontal line */
+ double nextdtanb = 0.0; /* tangent of post-delta against vertical line */
+
++ if (ppoints == NULL || numppoints < 1) Error0v("FindStems: No previous point!\n");
+
+ /* setup default hinted position */
+ ppoints[numppoints-1].ax = ppoints[numppoints-1].x;
+@@ -1289,7 +1290,7 @@
+ static int DoRead(CodeP)
+ int *CodeP;
+ {
+- if (strindex >= CharStringP->len) return(FALSE); /* end of string */
++ if (!CharStringP || strindex >= CharStringP->len) return(FALSE); /* end of string */
+ /* We handle the non-documented Adobe convention to use lenIV=-1 to
+ suppress charstring encryption. */
+ if (blues->lenIV==-1) {
+@@ -1700,7 +1701,7 @@
+ long pindex = 0;
+
+ /* compute hinting for previous segment! */
+- if (ppoints == NULL) Error0i("RLineTo: No previous point!\n");
++ if (ppoints == NULL || numppoints < 2) Error0i("RLineTo: No previous point!\n");
+ FindStems( currx, curry, currx-ppoints[numppoints-2].x, curry-ppoints[numppoints-2].y, dx, dy);
+
+ /* Allocate a new path point and pre-setup data */
+@@ -1729,7 +1730,7 @@
+ long pindex = 0;
+
+ /* compute hinting for previous point! */
+- if (ppoints == NULL) Error0i("RRCurveTo: No previous point!\n");
++ if (ppoints == NULL || numppoints < 2) Error0i("RRCurveTo: No previous point!\n");
+ FindStems( currx, curry, currx-ppoints[numppoints-2].x, curry-ppoints[numppoints-2].y, dx1, dy1);
+
+ /* Allocate three new path points and pre-setup data */
+@@ -1788,7 +1789,9 @@
+ long tmpind;
+ double deltax = 0.0;
+ double deltay = 0.0;
+-
++
++ if (ppoints == NULL || numppoints < 1) Error0i("DoClosePath: No previous point!");
++
+ /* If this ClosePath command together with the starting point of this
+ path completes to a segment aligned to a stem, we would miss
+ hinting for this point. --> Check and explicitly care for this! */
+@@ -1803,6 +1806,7 @@
+ deltax = ppoints[i].x - ppoints[numppoints-1].x;
+ deltay = ppoints[i].y - ppoints[numppoints-1].y;
+
++ if (ppoints == NULL || numppoints <= i + 1) Error0i("DoClosePath: No previous point!");
+ /* save nummppoints and reset to move point */
+ tmpind = numppoints;
+ numppoints = i + 1;
+@@ -1905,7 +1909,7 @@
+ FindStems( currx, curry, 0, 0, dx, dy);
+ }
+ else {
+- if (ppoints == NULL) Error0i("RMoveTo: No previous point!\n");
++ if (ppoints == NULL || numppoints < 2) Error0i("RMoveTo: No previous point!\n");
+ FindStems( currx, curry, ppoints[numppoints-2].x, ppoints[numppoints-2].y, dx, dy);
+ }
+
+@@ -2155,6 +2159,7 @@
+ DOUBLE cx, cy;
+ DOUBLE ex, ey;
+
++ if (ppoints == NULL || numppoints < 8) Error0v("FlxProc: No previous point!");
+
+ /* Our PPOINT list now contains 7 moveto commands which
+ are about to be consumed by the Flex mechanism. --> Remove these
+@@ -2324,6 +2329,7 @@
+ /* Returns currentpoint on stack */
+ static void FlxProc2()
+ {
++ if (ppoints == NULL || numppoints < 1) Error0v("FlxProc2: No previous point!");
+ /* Push CurrentPoint on fake PostScript stack */
+ PSFakePush( ppoints[numppoints-1].x);
+ PSFakePush( ppoints[numppoints-1].y);
diff --git a/media-libs/t1lib/files/t1lib-5.1.2-format-security.patch b/media-libs/t1lib/files/t1lib-5.1.2-format-security.patch
new file mode 100644
index 000000000000..b97a0e575852
--- /dev/null
+++ b/media-libs/t1lib/files/t1lib-5.1.2-format-security.patch
@@ -0,0 +1,39 @@
+fixes FTBFS with -Werror=format-security by using relevant "%s" format when
+ passing a variable string to a printf()
+
+
+Origin: https://bugs.debian.org/646470
+
+--- a/lib/type1/objects.c
++++ b/lib/type1/objects.c
+@@ -957,7 +957,7 @@
+
+ sprintf(typemsg, "Wrong object type in %s; expected %s, found %s.\n",
+ name, TypeFmt(expect), TypeFmt(obj->type));
+- IfTrace0(TRUE,typemsg);
++ IfTrace1(TRUE, "%s", typemsg);
+
+ ObjectPostMortem(obj);
+
+--- a/lib/t1lib/t1subset.c
++++ b/lib/t1lib/t1subset.c
+@@ -759,7 +759,7 @@
+ tr_len);
+ T1_PrintLog( "T1_SubsetFont()", err_warn_msg_buf,
+ T1LOG_DEBUG);
+- l+=sprintf( &(trailerbuf[l]), linebuf); /* contains the PostScript trailer */
++ l+=sprintf( &(trailerbuf[l]), "%s", linebuf); /* contains the PostScript trailer */
+ }
+
+ /* compute size of output file */
+--- a/lib/type1/objects.h
++++ b/lib/type1/objects.h
+@@ -214,7 +214,7 @@
+ /*SHARED*/
+ /* NDW: personally, I want to see status and error messages! */
+ #define IfTrace0(condition,model) \
+- {if (condition) printf(model);}
++ {if (condition) fputs(model,stdout);}
+ #define IfTrace1(condition,model,arg0) \
+ {if (condition) printf(model,arg0);}
+ #define IfTrace2(condition,model,arg0,arg1) \
diff --git a/media-libs/t1lib/files/t1lib-do-not-install-t1lib_doc-r1.patch b/media-libs/t1lib/files/t1lib-do-not-install-t1lib_doc-r1.patch
new file mode 100644
index 000000000000..c4927730d035
--- /dev/null
+++ b/media-libs/t1lib/files/t1lib-do-not-install-t1lib_doc-r1.patch
@@ -0,0 +1,19 @@
+--- old/doc/Makefile.in.orig 2008-05-04 17:55:52.000000000 +0400
++++ new/doc/Makefile.in 2008-05-04 17:55:58.000000000 +0400
+@@ -89,16 +89,6 @@
+
+
+ install: dummy
+- if (test -f t1lib_doc.ps) \
+- then \
+- $(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+- $(INSTALL_DATA) t1lib_doc.ps $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+- fi;
+- if (test -f t1lib_doc.pdf) \
+- then \
+- $(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+- $(INSTALL_DATA) t1lib_doc.pdf $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+- fi;
+
+
+ uninstall: dummy
diff --git a/media-libs/t1lib/files/t1lib-do-not-install-t1lib_doc.patch b/media-libs/t1lib/files/t1lib-do-not-install-t1lib_doc.patch
new file mode 100644
index 000000000000..e8dc5585e23a
--- /dev/null
+++ b/media-libs/t1lib/files/t1lib-do-not-install-t1lib_doc.patch
@@ -0,0 +1,19 @@
+--- doc/Makefile.in.orig 2008-05-04 17:55:52.000000000 +0400
++++ doc/Makefile.in 2008-05-04 17:55:58.000000000 +0400
+@@ -89,16 +89,6 @@
+
+
+ install: dummy
+- if (test -f t1lib_doc.ps) \
+- then \
+- $(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+- $(INSTALL_DATA) t1lib_doc.ps $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+- fi;
+- if (test -f t1lib_doc.pdf) \
+- then \
+- $(MKINSTALLDIRS) $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+- $(INSTALL_DATA) t1lib_doc.pdf $(DESTDIR)@T1LIB_DATA_DIR@/doc; \
+- fi;
+
+
+ uninstall: dummy
diff --git a/media-libs/t1lib/metadata.xml b/media-libs/t1lib/metadata.xml
new file mode 100644
index 000000000000..13ee79314597
--- /dev/null
+++ b/media-libs/t1lib/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>fonts@gentoo.org</email>
+ <name>Fonts</name>
+</maintainer>
+</pkgmetadata>
diff --git a/media-libs/t1lib/t1lib-5.1.2-r1.ebuild b/media-libs/t1lib/t1lib-5.1.2-r1.ebuild
new file mode 100644
index 000000000000..8be12911e2ed
--- /dev/null
+++ b/media-libs/t1lib/t1lib-5.1.2-r1.ebuild
@@ -0,0 +1,83 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="6"
+
+inherit flag-o-matic libtool toolchain-funcs
+
+DESCRIPTION="A Type 1 Font Rasterizer Library for UNIX/X11"
+HOMEPAGE="ftp://metalab.unc.edu/pub/Linux/libs/graphics/"
+SRC_URI="ftp://sunsite.unc.edu/pub/Linux/libs/graphics/${P}.tar.gz"
+
+LICENSE="LGPL-2 GPL-2"
+SLOT="5"
+KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~mips ppc ppc64 ~s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~x64-solaris ~x86-solaris"
+IUSE="X doc static-libs"
+
+RDEPEND="X? (
+ x11-libs/libXaw
+ x11-libs/libX11
+ x11-libs/libXt
+ )"
+DEPEND="${RDEPEND}
+ doc? ( virtual/latex-base )
+ X? (
+ x11-libs/libXfont
+ x11-proto/xproto
+ x11-proto/fontsproto
+ )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.1.1-parallel.patch
+ "${FILESDIR}"/${PN}-do-not-install-t1lib_doc-r1.patch
+ "${FILESDIR}"/${PN}-5.1.2-format-security.patch
+ "${FILESDIR}"/${PN}-5.1.2-CVE-2010-2642_2011-0433_2011-5244.patch
+ "${FILESDIR}"/${PN}-5.1.2-CVE-2011-0764.patch
+ "${FILESDIR}"/${PN}-5.1.2-CVE-2011-1552_1553_1554.patch
+)
+
+src_prepare() {
+ default
+
+ sed -i -e "s:dvips:#dvips:" "${S}"/doc/Makefile.in
+ sed -i -e "s:\./\(t1lib\.config\):/etc/t1lib/\1:" "${S}"/xglyph/xglyph.c
+ # Needed for sane .so versionning on fbsd. Please don't drop.
+ elibtoolize
+}
+
+src_configure() {
+ econf \
+ --datadir="${EPREFIX}/etc" \
+ $(use_enable static-libs static) \
+ $(use_with X x)
+}
+
+src_compile() {
+ local myopt=""
+ tc-export CC
+
+ use alpha && append-flags -mieee
+
+ if ! use doc; then
+ myopt="without_doc"
+ else
+ VARTEXFONTS=${T}/fonts
+ fi
+
+ emake ${myopt}
+}
+
+src_install() {
+ default
+
+ if ! use static-libs; then
+ find "${ED}"usr/lib* -name '*.la' -o -name '*.a' -delete || die
+ fi
+
+ dodoc Changes README*
+ if use doc; then
+ cd doc
+ insinto /usr/share/doc/${PF}
+ doins *.pdf *.dvi
+ fi
+}