summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Volkov <pva@gentoo.org>2011-11-06 06:39:07 +0000
committerPeter Volkov <pva@gentoo.org>2011-11-06 06:39:07 +0000
commit4a7456bec69ff586f2f84999044147c4a862fa61 (patch)
tree5176507c35bbccbed2133eb7f027b24d44cb3c10 /media-gfx/xfig
parentFix ChangeLog typo (s/3.2.1/3.2.0/). (diff)
downloadgentoo-2-4a7456bec69ff586f2f84999044147c4a862fa61.tar.gz
gentoo-2-4a7456bec69ff586f2f84999044147c4a862fa61.tar.bz2
gentoo-2-4a7456bec69ff586f2f84999044147c4a862fa61.zip
Fix eps importing.
(Portage version: 2.1.10.32/cvs/Linux x86_64)
Diffstat (limited to 'media-gfx/xfig')
-rw-r--r--media-gfx/xfig/ChangeLog8
-rw-r--r--media-gfx/xfig/files/xfig-3.2.5b-fix-eps-reading.patch46
-rw-r--r--media-gfx/xfig/xfig-3.2.5b-r2.ebuild99
3 files changed, 152 insertions, 1 deletions
diff --git a/media-gfx/xfig/ChangeLog b/media-gfx/xfig/ChangeLog
index 1ac03d95366f..0d91adc507fb 100644
--- a/media-gfx/xfig/ChangeLog
+++ b/media-gfx/xfig/ChangeLog
@@ -1,6 +1,12 @@
# ChangeLog for media-gfx/xfig
# Copyright 1999-2011 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-gfx/xfig/ChangeLog,v 1.75 2011/08/02 05:48:12 mattst88 Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/xfig/ChangeLog,v 1.76 2011/11/06 06:39:07 pva Exp $
+
+*xfig-3.2.5b-r2 (06 Nov 2011)
+
+ 06 Nov 2011; Peter Volkov <pva@gentoo.org> +xfig-3.2.5b-r2.ebuild,
+ +files/xfig-3.2.5b-fix-eps-reading.patch:
+ Fix eps importing.
02 Aug 2011; Matt Turner <mattst88@gentoo.org> xfig-3.2.5b-r1.ebuild:
Renamed x11-libs/Xaw3d to x11-libs/libXaw3d.
diff --git a/media-gfx/xfig/files/xfig-3.2.5b-fix-eps-reading.patch b/media-gfx/xfig/files/xfig-3.2.5b-fix-eps-reading.patch
new file mode 100644
index 000000000000..7601d20eae31
--- /dev/null
+++ b/media-gfx/xfig/files/xfig-3.2.5b-fix-eps-reading.patch
@@ -0,0 +1,46 @@
+diff -ur xfig.3.2.5b/f_readeps.c xfig.3.2.5b.new/f_readeps.c
+--- xfig.3.2.5b/f_readeps.c 2009-03-30 17:52:18.000000000 +0200
++++ xfig.3.2.5b.new/f_readeps.c 2010-11-25 16:53:54.328247928 +0100
+@@ -252,12 +252,13 @@
+ {
+ char buf[300];
+ FILE *tmpfp, *pixfile, *gsfile;
+- char *psnam, *driver;
++ char *driver;
+ int status, wid, ht, nbitmap, fd;
+ char tmpfile[PATH_MAX],
+ pixnam[PATH_MAX],
+ errnam[PATH_MAX],
+- gscom[2 * PATH_MAX];
++ gscom[2 * PATH_MAX],
++ psnam[PATH_MAX];
+
+ wid = urx - llx;
+ ht = ury - lly;
+@@ -307,19 +308,14 @@
+ /* for color, use pcx */
+ driver = "pcx256";
+ }
+- /* avoid absolute paths (for Cygwin with gswin32) by changing directory */
+- if (tmpfile[0] == '/') {
+- psnam = strrchr(tmpfile, '/');
+- *psnam = 0;
+- sprintf(gscom, "cd \"%s/\";", tmpfile);
+- *psnam++ = '/'; /* Restore name for unlink() below */
+- } else {
+- psnam = tmpfile;
+- gscom[0] = '\0';
++ /* Canonicalize the eps file filename, needed to "defeat" -dSAFER */
++ if (!realpath(tmpfile, psnam)) {
++ file_msg("Cannot canonicalize %s: %s\n", tmpfile, strerror(errno));
++ return False;
+ }
+- sprintf(&gscom[strlen(gscom)],
+- "%s -r72x72 -dSAFER -sDEVICE=%s -g%dx%d -sOutputFile=%s -q - > %s 2>&1",
+- appres.ghostscript, driver, wid, ht, pixnam, errnam);
++ sprintf(gscom,
++ "%s -r72x72 -sDEVICE=%s -g%dx%d -sOutputFile=%s -dDELAYSAFER -c '<< /PermitFileReading [ (%s)] >> setuserparams .locksafe' -dSAFER -q - > %s 2>&1",
++ appres.ghostscript, driver, wid, ht, pixnam, psnam, errnam);
+ if (appres.DEBUG)
+ fprintf(stderr,"calling: %s\n",gscom);
+ if ((gsfile = popen(gscom, "w")) == 0) {
diff --git a/media-gfx/xfig/xfig-3.2.5b-r2.ebuild b/media-gfx/xfig/xfig-3.2.5b-r2.ebuild
new file mode 100644
index 000000000000..85e6d4a04268
--- /dev/null
+++ b/media-gfx/xfig/xfig-3.2.5b-r2.ebuild
@@ -0,0 +1,99 @@
+# Copyright 1999-2011 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/xfig/xfig-3.2.5b-r2.ebuild,v 1.1 2011/11/06 06:39:07 pva Exp $
+
+EAPI="2"
+inherit eutils multilib
+
+MY_P=${PN}.${PV}
+
+DESCRIPTION="A menu-driven tool to draw and manipulate objects interactively in an X window."
+HOMEPAGE="http://www.xfig.org"
+SRC_URI="mirror://sourceforge/mcj/${MY_P}.full.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~hppa ~ppc ~ppc64 ~sparc ~x86"
+IUSE=""
+
+RDEPEND="x11-libs/libXaw
+ x11-libs/libXp
+ x11-libs/libXaw3d
+ x11-libs/libXi
+ virtual/jpeg
+ media-libs/libpng
+ media-fonts/font-misc-misc
+ media-fonts/urw-fonts
+ >=media-gfx/transfig-3.2.5-r1
+ media-libs/netpbm"
+DEPEND="${RDEPEND}
+ x11-misc/imake
+ x11-proto/xproto
+ x11-proto/inputproto"
+
+S=${WORKDIR}/${MY_P}
+
+sed_Imakefile() {
+ # see Imakefile for details
+ vars2subs=( BINDIR=/usr/bin
+ PNGINC=-I/usr/include
+ JPEGLIBDIR="/usr/$(get_libdir)"
+ JPEGINC=-I/usr/include
+ XPMLIBDIR="/usr/$(get_libdir)"
+ XPMINC=-I/usr/include/X11
+ "USEINLINE = -DUSE_INLINE"
+ XFIGLIBDIR=/usr/share/xfig
+ XFIGDOCDIR="/usr/share/doc/${PF}"
+ MANDIR="/usr/share/man/man\$\(MANSUFFIX\)"
+ "CC=$(tc-getCC)" )
+
+ for variable in "${vars2subs[@]}" ; do
+ varname=${variable%%=*}
+ varval=${variable##*=}
+ sed -i "s:^\(XCOMM\)*[[:space:]]*${varname}[[:space:]]*=.*$:${varname} = ${varval}:" "$@"
+ done
+ sed -i "s:^\(XCOMM\)*[[:space:]]*\(#define I18N\).*$:\2:" "$@"
+ if has_version '>=x11-libs/libXaw3d-1.5e'; then
+ einfo "x11-libs/libXaw3d 1.5e and abover installed"
+ sed -i "s:^\(XCOMM\)*[[:space:]]*\(#define XAW3D1_5E\).*$:\2:" "$@"
+ fi
+}
+
+src_prepare() {
+ # Permissions are really crazy here
+ chmod -R go+rX .
+ find . -type f -exec chmod a-x '{}' \;
+ epatch "${FILESDIR}/${P}-figparserstack.patch" #297379
+ epatch "${FILESDIR}/${P}-spelling.patch"
+ epatch "${FILESDIR}/${P}-papersize_b1.patch"
+ epatch "${FILESDIR}/${P}-pdfimport_mediabox.patch"
+ epatch "${FILESDIR}/${P}-network_images.patch"
+ epatch "${FILESDIR}/${P}-app-defaults.patch"
+ epatch "${FILESDIR}/${P}-zoom-during-edit.patch"
+ epatch "${FILESDIR}/${P}-urwfonts.patch"
+ epatch "${FILESDIR}/${P}-mkstemp.patch" #264575
+ epatch "${FILESDIR}/${P}-CVE-2010-4262.patch" #348344
+ epatch "${FILESDIR}/${P}-libpng-1.5.patch" #356753
+ #https://bugzilla.redhat.com/show_bug.cgi?id=657290
+ epatch "${FILESDIR}/xfig-3.2.5b-fix-eps-reading.patch"
+
+ sed_Imakefile Imakefile
+ sed -e "s:/usr/lib/X11/xfig:/usr/share/doc/${PF}:" \
+ -i Doc/xfig.man -i Doc/xfig_man.html || die
+}
+
+src_compile() {
+ xmkmf || die
+ emake CC="$(tc-getCC)" LOCAL_LDFLAGS="${LDFLAGS}" CDEBUGFLAGS="${CFLAGS}" \
+ USRLIBDIR=/usr/$(get_libdir) || die
+}
+
+src_install() {
+ emake -j1 DESTDIR="${D}" install.all || die
+
+ insinto /usr/share/doc/${PF}
+ doins README FIGAPPS CHANGES LATEX.AND.XFIG
+
+ doicon xfig.png
+ make_desktop_entry xfig Xfig xfig
+}