summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2010-01-14 19:02:36 +0000
committerPeter Volkov <pva@gentoo.org>2010-01-14 19:02:36 +0000
commit904c2d9099da4736693fdf54c4425b58d08c9126 (patch)
treef910fee863927e55597a6607fd90a1bcf23174f2
parentAdd a die call if DBUS USE flag is enable with DHCP off, this is a workaround... (diff)
downloadgentoo-2-904c2d9099da4736693fdf54c4425b58d08c9126.tar.gz
gentoo-2-904c2d9099da4736693fdf54c4425b58d08c9126.tar.bz2
gentoo-2-904c2d9099da4736693fdf54c4425b58d08c9126.zip
Version bump. Added workaround for printing with cups, fig2mpdf-1.1.2 patch is separated in two parts to ease applying Debian typo fixes into manual.
(Portage version: 2.1.7.16/cvs/Linux x86_64)
-rw-r--r--media-gfx/transfig/ChangeLog15
-rw-r--r--media-gfx/transfig/files/transfig-3.2.5c-avoid_warnings.patch55
-rw-r--r--media-gfx/transfig/files/transfig-3.2.5c-cups_workaround.patch20
-rw-r--r--media-gfx/transfig/files/transfig-3.2.5c-fig2mpdf.patch529
-rw-r--r--media-gfx/transfig/files/transfig-3.2.5c-maxfontsize.patch44
-rw-r--r--media-gfx/transfig/transfig-3.2.5c.ebuild87
6 files changed, 748 insertions, 2 deletions
diff --git a/media-gfx/transfig/ChangeLog b/media-gfx/transfig/ChangeLog
index ac4a6f5d5ae7..6954a98b9482 100644
--- a/media-gfx/transfig/ChangeLog
+++ b/media-gfx/transfig/ChangeLog
@@ -1,6 +1,17 @@
# ChangeLog for media-gfx/transfig
-# Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-gfx/transfig/ChangeLog,v 1.49 2008/12/02 22:58:28 ranger Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/transfig/ChangeLog,v 1.50 2010/01/14 19:02:36 pva Exp $
+
+*transfig-3.2.5c (14 Jan 2010)
+
+ 14 Jan 2010; Peter Volkov <pva@gentoo.org> +transfig-3.2.5c.ebuild,
+ +files/transfig-3.2.5c-avoid_warnings.patch,
+ +files/transfig-3.2.5c-cups_workaround.patch,
+ +files/transfig-3.2.5c-fig2mpdf.patch,
+ +files/transfig-3.2.5c-maxfontsize.patch:
+ Version bump. Added workaround for printing with cups, fig2mpdf-1.1.2
+ patch is separated in two parts to ease applying Debian typo fixes into
+ manual.
02 Dec 2008; Brent Baude <ranger@gentoo.org> transfig-3.2.5-r2.ebuild:
Marking transfig-3.2.5-r2 ppc64 for bug 244957
diff --git a/media-gfx/transfig/files/transfig-3.2.5c-avoid_warnings.patch b/media-gfx/transfig/files/transfig-3.2.5c-avoid_warnings.patch
new file mode 100644
index 000000000000..1743250e43f6
--- /dev/null
+++ b/media-gfx/transfig/files/transfig-3.2.5c-avoid_warnings.patch
@@ -0,0 +1,55 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 07_avoid_warnings.dpatch by Roland Rosenfeld <roland@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Some changes to avoid compiler warnings.
+
+@DPATCH@
+diff -urNad transfig~/fig2dev/dev/genpstex.c transfig/fig2dev/dev/genpstex.c
+--- transfig~/fig2dev/dev/genpstex.c
++++ transfig/fig2dev/dev/genpstex.c
+@@ -167,6 +167,10 @@
+ INCLUDE_TEXT
+ };
+
++extern void genpdf_option();
++extern void genpdf_start();
++extern int genpdf_end();
++
+ struct driver dev_pdftex = {
+ genpdf_option,
+ genpdf_start,
+diff -urNad transfig~/transfig/sys.c transfig/transfig/sys.c
+--- transfig~/transfig/sys.c
++++ transfig/transfig/sys.c
+@@ -15,6 +15,8 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+ #include "transfig.h"
+
+ #define MAXSYS 10000
+diff -urNad transfig~/transfig/transfig.c transfig/transfig/transfig.c
+--- transfig~/transfig/transfig.c
++++ transfig/transfig/transfig.c
+@@ -25,6 +25,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "patchlevel.h"
+ #include "transfig.h"
+
+diff -urNad transfig~/transfig/txfile.c transfig/transfig/txfile.c
+--- transfig~/transfig/txfile.c
++++ transfig/transfig/txfile.c
+@@ -15,6 +15,7 @@
+ */
+
+ #include <stdio.h>
++#include <stdlib.h>
+ #include "transfig.h"
+
+ /*
diff --git a/media-gfx/transfig/files/transfig-3.2.5c-cups_workaround.patch b/media-gfx/transfig/files/transfig-3.2.5c-cups_workaround.patch
new file mode 100644
index 000000000000..d026b98d214d
--- /dev/null
+++ b/media-gfx/transfig/files/transfig-3.2.5c-cups_workaround.patch
@@ -0,0 +1,20 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 19_cups_workaround.dpatch by Roland Rosenfeld <roland@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Change PS magic string from PS-Adobe-2.0 to PS to work around
+## DP: incompatibilities with CUPS (Closes: #443832).
+
+@DPATCH@
+diff -urNad transfig~/fig2dev/dev/genps.c transfig/fig2dev/dev/genps.c
+--- transfig~/fig2dev/dev/genps.c
++++ transfig/fig2dev/dev/genps.c
+@@ -619,7 +619,7 @@
+ if (epsflag)
+ fprintf(tfp, "%%!PS-Adobe-2.0 EPSF-2.0\n"); /* Encapsulated PostScript */
+ else
+- fprintf(tfp, "%%!PS-Adobe-2.0\n"); /* PostScript magic strings */
++ fprintf(tfp, "%%!PS\n"); /* PostScript magic strings */
+
+ #ifdef DISPLAYWHO
+ who = getpwuid(getuid());
diff --git a/media-gfx/transfig/files/transfig-3.2.5c-fig2mpdf.patch b/media-gfx/transfig/files/transfig-3.2.5c-fig2mpdf.patch
new file mode 100644
index 000000000000..fd075cb425af
--- /dev/null
+++ b/media-gfx/transfig/files/transfig-3.2.5c-fig2mpdf.patch
@@ -0,0 +1,529 @@
+Creating multiple PDF or EPS figures for overlaying
+
+http://p3f.gmxhome.de/fig2mpdf/fig2mpdf.html
+
+This patch includes only transfig driver part. For script itself and example
+usage take a look on fig2mpdf-1.1.2.tar.bz2.
+
+=== modified file 'doc/fig2dev.1'
+--- doc/fig2dev.1 2010-01-12 12:50:24 +0000
++++ doc/fig2dev.1 2010-01-12 12:50:38 +0000
+@@ -53,8 +53,8 @@
+ \fBbox, cgm, epic, eepic, eepicemu, emf, eps, gbx (Gerber beta driver), gif, ibmgl, jpeg,
+ latex, map (HTML image map), mf (MetaFont),
+ mp (MetaPost), mmp (Multi-MetaPost),
+-pcx, pdf, pdftex, pdftex_t, pic, pictex, png, ppm, ps,
+-pstex, pstex_t, ptk (Perl/tk),
++pcx, pdf, pdftex, pdftex_t, pdftex_p, pic, pictex, png, ppm, ps,
++pstex, pstex_t, pstex_p, ptk (Perl/tk),
+ shape (LaTeX shaped paragraphs), sld (AutoCad slide format),
+ svg (beta driver), textyl,
+ tiff, tk (tcl/tk), tpic, xbm and
+@@ -880,6 +880,62 @@
+ specifies the name of the PostScript file to be overlaid.
+ If not set or its value is null then no PS file will be inserted.
+
++.SH PSTEX_P and PDFTEX_P OPTIONS
++The \fBpstex_p\fR language has the same intention as
++the combination of \fBpstex\fR and \fBpstex_t\fR.
++The only reason to use \fBpstex_p\fR is that you have partially overlayed texts.
++\fBpstex_p\fR splits the Fig file concerning the depths of existing texts. Because
++of it's necessary to get the resulting size of the figure for the pdf document
++you have to specify the target document format
++(i.e. using \fBpstex_p\fR rsp. \fBpdftex_p\fR).
++.br
++Two files results by using this language:
++.br
++.HP +.3i
++1) A bash script for creating and removing the necessary graphics files.
++Extension: \fB.create\fR
++.HP +.3i
++.HP +.3i
++2) The latex code which includes all graphics files and special texts. Content is
++put to stdout.
++
++.TP
++The \fBpstex_p\fR driver has the following special options:
++
++.TP
++.B \-p basename
++specifies the basename of the files to be created (see (1) above). This option
++is mandatory.
++.TP
++.B "\-d dmag"
++Set a separate magnification for the length of line dashes to
++.I dmag.
++.TP
++.B \-E num
++Set encoding for latex text translation (0 no translation, 1 ISO-8859-1, 2 ISO-8859-2)
++.TP
++.B "\-l lwidth"
++Sets the threshold between LaTeX thin and thick lines to
++.I lwidth
++pixels.
++LaTeX supports only two different line width: \\thinlines and \\thicklines.
++Lines of width greater than
++.I lwidth
++pixels are drawn as \\thicklines.
++Also affects the size of dots in dotted line style.
++The default is 1.
++.TP
++.B \-v
++Verbose mode.
++.TP
++.B \-F
++Don't set the font face, series, and style; only set it's size and the
++baselineskip. By default, fig2dev sets all 5 font parameters when it
++puts some text. The disadvantage is that you can't set the font from your
++LaTeX document. With this option on, you can set the font from your LaTeX
++document (like "\fB\\sfshape \\input picture.eepic\fR").
++
++
+ .SH TK and PTK OPTIONS (tcl/tk and Perl/tk)
+ .TP
+ .B -l dummy_arg
+@@ -925,6 +981,13 @@
+ .PP
+ Rotated text is only supported in the IBM-GL (HP/GL) and PostScript (including eps)
+ languages.
++.PP
++In \fBpdftex_p\fR language \fIfig2dev\fR can not determine the exact sizes of
++the special texts set by pdflatex afterwards. If these texts are bigger than
++expected the calculated bounding box might be too small so that some texts passes
++over the figure boundaries. If this happen you have to put an invisible
++rectangle (line width 0) around the text or the entire figure.
++
+ .SH COPYRIGHT
+ Copyright (c) 1991 Micah Beck
+ .br
+@@ -1005,3 +1068,7 @@
+ The GBX (Gerber) driver was written by
+ .br
+ Edward Grace (ej.grace@imperial.ac.uk).
++.sp
++The PSTEX_P and PDFTEX_P drivers (overlayed LaTeX texts) was written by
++.br
++Michael Pfeiffer (p3f@gmx.de)
+
+=== modified file 'fig2dev/dev/genpstex.c'
+--- fig2dev/dev/genpstex.c 2010-01-12 12:50:24 +0000
++++ fig2dev/dev/genpstex.c 2010-01-12 12:50:38 +0000
+@@ -70,7 +70,307 @@
+ genps_end ();
+
+ static char pstex_file[1000] = "";
+-
++static int iObjectsRead = 0;
++static int iTextRead = 0;
++static int iObjectsFileNumber = 0;
++static int iStartDepth;
++static int iLastDepth;
++static FILE * ptCreateFile;
++static char szFileName[1000];
++static int iLength;
++static int iPdfOutputs = 0;
++
++#ifdef never
++static double unitlength;
++static double dash_mag = 1.0;
++
++static int (*translate_coordinates)() = NULL;
++static int (*translate_coordinates_d)() = NULL;
++#else
++extern double unitlength;
++extern double dash_mag;
++
++extern int (*translate_coordinates)();
++extern int (*translate_coordinates_d)();
++#endif
++
++#define TOP 840
++#define SWAP(x,y) {tmp=x; x=y; y=tmp;}
++#define TRANS(x,y) (*translate_coordinates)(&x,&y)
++#define TRANS2(x1,y1,x2,y2) (*translate_coordinates)(&x1,&y1); \
++ (*translate_coordinates)(&x2,&y2)
++#define TRANSD(x,y) (*translate_coordinates_d)(&x,&y)
++
++static void genpstex_p_finalize_objects(int depth);
++
++/*************************************************************************
++ *************************************************************************/
++static
++translate2(xp, yp)
++ int *xp, *yp;
++{
++ *xp = *xp + 1;
++ *yp = (double)(TOP - *yp -1);
++ }
++
++static
++translate1_d(xp, yp)
++ double *xp, *yp;
++{
++ *xp = *xp + 1.0;
++ *yp = *yp + 1.0;
++ }
++
++static
++translate2_d(xp, yp)
++ double *xp, *yp;
++{
++ *xp = *xp + 1.0;
++ *yp = (double)TOP - *yp -1.0;
++ }
++
++/*************************************************************************
++ *************************************************************************/
++void genpstex_p_option(opt, optarg)
++char opt, *optarg;
++{
++ if (opt == 'p')
++ {
++ strcpy(pstex_file, optarg);
++ }
++ else
++ genlatex_option(opt, optarg);
++}
++
++
++/*************************************************************************
++ *************************************************************************/
++void genpstex_p_start(objects)
++ F_compound *objects;
++{
++ int tmp;
++ struct stat tStat;
++ long lUnitLength;
++
++ if (*pstex_file == '\0')
++ {
++ put_msg("Argument -p is mandatory to pstex_p.");
++ exit(1);
++ }
++
++ strncpy(szFileName, pstex_file, 900);
++ iLength = strlen(szFileName);
++
++ sprintf(szFileName + iLength, ".create");
++ ptCreateFile = fopen (szFileName, "wb");
++
++ if ( ! ptCreateFile)
++ {
++ put_msg("Couldn't open %s for writing", szFileName);
++ exit(1);
++ }
++ fstat(fileno(ptCreateFile), & tStat);
++ fchmod (fileno(ptCreateFile), tStat.st_mode | ((tStat.st_mode & (S_IRUSR | S_IRGRP | S_IROTH)) >> 2));
++ fprintf(ptCreateFile, "#!/bin/bash\n\n", szFileName);
++
++ fprintf(ptCreateFile, "while getopts \"r\" Option\n");
++ fprintf(ptCreateFile, "do\n");
++ fprintf(ptCreateFile, " case $Option in\n");
++ fprintf(ptCreateFile, " r) iOptRemove=1;;\n");
++ fprintf(ptCreateFile, " *) echo \"illegal option -$Option\"\n");
++ fprintf(ptCreateFile, " esac\n");
++ fprintf(ptCreateFile, "done\n");
++ fprintf(ptCreateFile, "shift $(($OPTIND - 1))\n");
++
++ texfontsizes[0] = texfontsizes[1] =
++ TEXFONTSIZE(font_size != 0.0? font_size : DEFAULT_FONT_SIZE);
++
++ unitlength = mag/ppi;
++ dash_mag /= unitlength*80.0;
++
++ translate_coordinates = translate2;
++ translate_coordinates_d = translate2_d;
++
++ TRANS2(llx, lly, urx, ury);
++ if (llx > urx) SWAP(llx, urx)
++ if (lly > ury) SWAP(lly, ury)
++
++ /* LaTeX start */
++
++ /* print any whole-figure comments prefixed with "%" */
++ if (objects->comments) {
++ fprintf(tfp,"%%\n");
++ print_comments("% ",objects->comments, "");
++ fprintf(tfp,"%%\n");
++ }
++
++ lUnitLength = (long) (round(4736286.72*unitlength));
++ fprintf(tfp, "\\setlength{\\unitlength}{%lisp}%%\n",
++ lUnitLength);
++ /* define the SetFigFont macro */
++ define_setfigfont(tfp);
++
++ sprintf(szFileName + iLength, ".size");
++ fprintf(ptCreateFile, "if [ \"$iOptRemove\" == \"\" ]; then\n");
++ if (iPdfOutputs)
++ fprintf(ptCreateFile, " echo \"\\setlength\\pdfpagewidth{%3.2fpt}\\setlength\\pdfpageheight{%3.2fpt}\" > %s\n",
++ (float) lUnitLength / 65536 * (urx - llx), (float) lUnitLength / 65536 * (ury - lly), szFileName);
++ else
++ fprintf(ptCreateFile, "echo -n\"\" > %s\n", szFileName);
++ fprintf(ptCreateFile, "else\n rm -f %s\nfi\n", szFileName);
++}
++
++/*************************************************************************
++ *************************************************************************/
++void genpdftex_p_start(objects)
++ F_compound *objects;
++{
++ iPdfOutputs = 1;
++ genpstex_p_start(objects);
++}
++
++
++/*************************************************************************
++ *************************************************************************/
++int genpstex_p_end()
++{
++ if (iTextRead)
++ {
++ fprintf(tfp, "\\end{picture}%%\n");
++ iTextRead = 0;
++ }
++ if (iObjectsRead)
++ {
++ genpstex_p_finalize_objects(iLastDepth);
++ iObjectsRead = 0;
++ }
++
++ /* LaTeX ending */
++ fprintf(tfp, "\\begin{picture}(%d,%d)\n", urx-llx, ury-lly);
++ fprintf(tfp, "\\end{picture}%%\n");
++
++ fclose(ptCreateFile);
++
++ /* all ok */
++ return 0;
++}
++
++
++/*************************************************************************
++ *************************************************************************/
++void genpstex_p_finalize_objects(depth)
++int depth;
++{
++ char szFileName[1000];
++ int iLength;
++
++ strncpy(szFileName, pstex_file, 900);
++ iLength = strlen(szFileName);
++
++
++ sprintf(szFileName + iLength, "%03d", iObjectsFileNumber++);
++ fprintf(ptCreateFile, "if [ \"$iOptRemove\" == \"\" ]; then\n");
++ if (iPdfOutputs)
++ {
++ fprintf(ptCreateFile, " %s -L pstex -D +%d:%d %s", prog, depth, iStartDepth, from, szFileName);
++ fprintf(ptCreateFile, " | epstopdf -f --outfile %s.pdf\n", szFileName, szFileName);
++ }
++ else
++ fprintf(ptCreateFile, "%s -L pstex -D +%d:%d %s %s.eps\n", prog, depth, iStartDepth, from, szFileName);
++ fprintf(ptCreateFile, "else\n rm -f %s.", szFileName);
++ if (iPdfOutputs)
++ fprintf(ptCreateFile, "pdf");
++ else
++ fprintf(ptCreateFile, "eps");
++ fprintf(ptCreateFile, "\nfi\n");
++
++ fprintf(tfp, "\\begin{picture}(0,0)%%\n");
++/* newer includegraphics directive suggested by Stephen Harker 1/13/99 */
++#if defined(LATEX2E_GRAPHICS)
++# if defined(EPSFIG)
++ fprintf(tfp, "\\epsfig{file=%s.eps}%%\n",szFileName);
++# else
++ fprintf(tfp, "\\includegraphics{%s}%%\n",szFileName);
++# endif
++#else
++ fprintf(tfp, "\\special{psfile=%s.eps}%%\n",szFileName);
++#endif
++ fprintf(tfp, "\\end{picture}%%\n");
++}
++
++/*************************************************************************
++ *************************************************************************/
++void genpstex_p_object(depth)
++int depth;
++{
++ if (iTextRead)
++ {
++ fprintf(tfp, "\\end{picture}%%\n");
++ iTextRead = 0;
++ }
++ if (iObjectsRead == 0)
++ {
++ iStartDepth = depth;
++ iObjectsRead = 1;
++ }
++ iLastDepth = depth;
++
++}
++
++void genpstex_p_arc(obj)
++F_arc *obj;
++{
++ genpstex_p_object(obj->depth);
++}
++
++
++void genpstex_p_ellipse(obj)
++F_ellipse *obj;
++{
++ genpstex_p_object(obj->depth);
++}
++
++void genpstex_p_line(obj)
++F_line *obj;
++{
++ genpstex_p_object(obj->depth);
++}
++
++void genpstex_p_spline(obj)
++F_spline *obj;
++{
++ genpstex_p_object(obj->depth);
++}
++
++
++
++/*************************************************************************
++ *************************************************************************/
++void genpstex_p_text(t)
++F_text *t;
++{
++
++ if (!special_text(t))
++ genpstex_p_object(t->depth);
++ else
++ {
++ if (iObjectsRead)
++ {
++ genpstex_p_finalize_objects(iLastDepth);
++ iObjectsRead = 0;
++ }
++ if (iTextRead == 0)
++ {
++ fprintf(tfp, "\\begin{picture}(0,0)(%d,%d)\n", llx, lly);
++ iTextRead = 1;
++ }
++ genlatex_text(t);
++ }
++
++}
++
++/*************************************************************************
++ *************************************************************************/
+ void genpstex_t_option(opt, optarg)
+ char opt, *optarg;
+ {
+@@ -112,6 +412,8 @@
+ else genlatex_text(t);
+ }
+
++/*************************************************************************
++ *************************************************************************/
+ void genpstex_text(t)
+ F_text *t;
+ {
+@@ -128,6 +430,32 @@
+ genlatex_option(opt, optarg);
+ }
+
++struct driver dev_pstex_p = {
++ genpstex_p_option,
++ genpstex_p_start,
++ gendev_null,
++ genpstex_p_arc,
++ genpstex_p_ellipse,
++ genpstex_p_line,
++ genpstex_p_spline,
++ genpstex_p_text,
++ genpstex_p_end,
++ INCLUDE_TEXT
++};
++
++struct driver dev_pdftex_p = {
++ genpstex_p_option,
++ genpdftex_p_start,
++ gendev_null,
++ genpstex_p_arc,
++ genpstex_p_ellipse,
++ genpstex_p_line,
++ genpstex_p_spline,
++ genpstex_p_text,
++ genpstex_p_end,
++ INCLUDE_TEXT
++};
++
+ struct driver dev_pstex_t = {
+ genpstex_t_option,
+ genpstex_t_start,
+
+=== modified file 'fig2dev/drivers.h'
+--- fig2dev/drivers.h 2010-01-12 12:50:24 +0000
++++ fig2dev/drivers.h 2010-01-12 12:50:38 +0000
+@@ -30,8 +30,10 @@
+ extern struct driver dev_pdf;
+ extern struct driver dev_pdftex;
+ extern struct driver dev_pdftex_t;
++extern struct driver dev_pdftex_p;
+ extern struct driver dev_pstex;
+ extern struct driver dev_pstex_t;
++extern struct driver dev_pstex_p;
+ extern struct driver dev_textyl;
+ extern struct driver dev_tk;
+ extern struct driver dev_ptk;
+@@ -74,6 +76,7 @@
+ {"pdf", &dev_pdf},
+ {"pdftex", &dev_pdftex},
+ {"pdftex_t", &dev_pdftex_t},
++ {"pdftex_p", &dev_pdftex_p},
+ {"pic", &dev_pic},
+ {"pictex", &dev_pictex},
+ {"png", &dev_bitmaps},
+@@ -81,6 +84,7 @@
+ {"ps", &dev_ps},
+ {"pstex", &dev_pstex},
+ {"pstex_t", &dev_pstex_t},
++ {"pstex_p", &dev_pstex_p},
+ {"ptk", &dev_ptk},
+ {"shape", &dev_shape},
+ {"sld", &dev_bitmaps},
+
+=== modified file 'fig2dev/fig2dev.c'
+--- fig2dev/fig2dev.c 2010-01-12 12:50:24 +0000
++++ fig2dev/fig2dev.c 2010-01-12 12:50:38 +0000
+@@ -614,6 +614,18 @@
+ #endif /* NFSS */
+ printf(" -p name name of the PostScript file to be overlaid\n");
+
++ printf("PSTEX_P and PDFTEX_P Options:\n");
++ printf(" -p name basename of the files to be created\n");
++#ifdef NFSS
++ printf(" -F don't set font family/series/shape, so you can\n");
++ printf(" set it from latex\n");
++#endif /* NFSS */
++ printf(" -d dmag set separate magnification for length of line dashes to dmag\n");
++ printf(" -E num set encoding for text translation (0 no translation,\n");
++ printf(" 1 ISO-8859-1, 2 ISO-8859-2)\n");
++ printf(" -l lwidth set threshold between thin and thick lines to lwidth\n");
++ printf(" -v verbose mode\n");
++
+ printf("SHAPE (ShapePar driver) Options:\n");
+ printf(" -n name Set basename of the macro (e.g. \"face\" gives faceshape and facepar)\n");
+ printf("Tcl/Tk (tk) and Perl/Tk (ptk) Options:\n");
+@@ -741,6 +753,12 @@
+ int rec_comp(r1, r2)
+ struct obj_rec *r1, *r2;
+ {
++ if (r2->depth == r1->depth)
++ {
++ if ((r1->gendev == dev->text) ^ (r2->gendev == dev->text))
++ return ((r1->gendev == dev->text) * 2 - 1);
++ return (0);
++ }
+ return (r2->depth - r1->depth);
+ }
+
+
diff --git a/media-gfx/transfig/files/transfig-3.2.5c-maxfontsize.patch b/media-gfx/transfig/files/transfig-3.2.5c-maxfontsize.patch
new file mode 100644
index 000000000000..9ce105fe9355
--- /dev/null
+++ b/media-gfx/transfig/files/transfig-3.2.5c-maxfontsize.patch
@@ -0,0 +1,44 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## 09_maxfontsize.dpatch by Roland Rosenfeld <roland@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: For fonts >=42pt use the given font size in TeX instead of
+## DP: restricting this to 42pt. This allows to create posters using
+## DP: \usepackage{type1cm}. See
+## DP: http://linuxgazette.vlsm.org/issue96/artime.html and Bug#343139
+
+@DPATCH@
+diff -urNad transfig~/LATEX.AND.XFIG transfig/LATEX.AND.XFIG
+--- transfig~/LATEX.AND.XFIG
++++ transfig/LATEX.AND.XFIG
+@@ -55,7 +55,7 @@
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LaTeX Preamble %%%%%%%%%%%%%%%%%%%%%%%%%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+-\documentstyle[12pt,bezier,amstex]{article} % include bezier curves
++\documentclass[12pt,bezier,amstex]{article} % include bezier curves
+ \renewcommand\baselinestretch{1.0} % single space
+ \pagestyle{empty} % no headers and page numbers
+ \oddsidemargin -10 true pt % Left margin on odd-numbered pages.
+@@ -72,7 +72,9 @@
+ \usepackage{epsfig}
+
+ \usepackage{graphicx} % Graphics package
+-
++
++\usepackage{type1cm} % Necessary for fonts bigger than 42pt
++
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Document Beginning %%%%%%%%%%%%%%%%%%%%%
+ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+diff -urNad transfig~/fig2dev/dev/texfonts.h transfig/fig2dev/dev/texfonts.h
+--- transfig~/fig2dev/dev/texfonts.h
++++ transfig/fig2dev/dev/texfonts.h
+@@ -86,6 +86,7 @@
+
+ #define TEXFONTSIZE(S) (texfontsizes[((S) <= MAXFONTSIZE) ? (int)(round(S))\
+ : (MAXFONTSIZE-1)])
++#define TEXFONTSIZE(S) (((S) <= MAXFONTSIZE) ? texfontsizes[(int)(round(S))] : (S))
+ #define TEXFONTMAG(T) TEXFONTSIZE(T->size*(rigid_text(T) ? 1.0 : fontmag))
+
+ void setfigfont( F_text *text ); /* genepic.c */
diff --git a/media-gfx/transfig/transfig-3.2.5c.ebuild b/media-gfx/transfig/transfig-3.2.5c.ebuild
new file mode 100644
index 000000000000..f4d690fc99b8
--- /dev/null
+++ b/media-gfx/transfig/transfig-3.2.5c.ebuild
@@ -0,0 +1,87 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/transfig/transfig-3.2.5c.ebuild,v 1.1 2010/01/14 19:02:36 pva Exp $
+
+EAPI="2"
+inherit toolchain-funcs eutils flag-o-matic
+
+MY_P=${PN}.${PV}
+
+DESCRIPTION="A set of tools for creating TeX documents with graphics"
+HOMEPAGE="http://www.xfig.org/"
+SRC_URI="http://xfig.org/software/xfig/${PV/[a-z]}/${MY_P}.tar.gz
+ mirror://gentoo/fig2mpdf-1.1.2.tar.bz2"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+RDEPEND="x11-libs/libXpm
+ >=media-libs/jpeg-6
+ media-libs/libpng
+ x11-apps/rgb"
+DEPEND="${RDEPEND}
+ x11-misc/imake
+ app-text/rman"
+
+S=${WORKDIR}/${MY_P}
+
+sed_Imakefile() {
+ # see fig2dev/Imakefile for details
+ vars2subs="BINDIR=/usr/bin
+ MANDIR=/usr/share/man/man\$\(MANSUFFIX\)
+ XFIGLIBDIR=/usr/share/xfig
+ USEINLINE=-DUSE_INLINE
+ RGB=/usr/share/X11/rgb.txt
+ FIG2DEV_LIBDIR=/usr/share/fig2dev"
+
+ for variable in ${vars2subs} ; do
+ varname=${variable%%=*}
+ varval=${variable##*=}
+ sed -i "s:^\(XCOMM\)*[[:space:]]*${varname}[[:space:]]*=.*$:${varname} = ${varval}:" "$@"
+ done
+}
+
+src_prepare() {
+ find . -type f -exec chmod a-x '{}' \;
+ find . -name Makefile -delete
+ epatch "${FILESDIR}"/${P}-cups_workaround.patch
+ epatch "${FILESDIR}"/${P}-avoid_warnings.patch
+ epatch "${FILESDIR}"/${P}-fig2mpdf.patch
+ epatch "${FILESDIR}"/${P}-maxfontsize.patch
+ sed -e 's:-L$(ZLIBDIR) -lz::' \
+ -e 's: -lX11::' \
+ -i fig2dev/Imakefile || die
+ sed_Imakefile fig2dev/Imakefile fig2dev/dev/Imakefile
+}
+
+src_compile() {
+ xmkmf || die "xmkmf failed"
+ emake Makefiles || die "make Makefiles failed"
+
+ emake CC="$(tc-getCC)" LOCAL_LDFLAGS="${LDFLAGS}" CDEBUGFLAGS="${CFLAGS}" \
+ USRLIBDIR=/usr/$(get_libdir) || die "emake failed"
+}
+
+src_install() {
+ emake DESTDIR="${D}" \
+ ${transfig_conf} install install.man || die
+
+ dobin "${WORKDIR}/fig2mpdf/fig2mpdf" || die
+ doman "${WORKDIR}/fig2mpdf/fig2mpdf.1" || die
+
+ insinto /usr/share/fig2dev/
+ newins "${FILESDIR}/transfig-ru_RU.CP1251.ps" ru_RU.CP1251.ps || die
+ newins "${FILESDIR}/transfig-ru_RU.KOI8-R.ps" ru_RU.KOI8-R.ps || die
+ newins "${FILESDIR}/transfig-uk_UA.KOI8-U.ps" uk_UA.KOI8-U.ps || die
+
+ dohtml "${WORKDIR}/fig2mpdf/doc/"* || die
+
+ dodoc README CHANGES LATEX.AND.XFIG NOTES || die
+}
+
+pkg_postinst() {
+ elog "Note, that defaults are changed and now if you don't want to ship"
+ elog "personal information into output files, use fig2dev with -a option."
+}