diff options
author | Kyle Guinn <elyk03@gmail.com> | 2011-01-17 23:57:23 -0600 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2011-01-30 09:13:22 -0600 |
commit | 8d7600bdc344ee382ee72d0876ab58b033d0a59f (patch) | |
tree | 4163653524354f79ed22941aeb401f70fdd6f67f /graphics | |
parent | 8f296a37ecb54c4a7fdcb42793b1e1599c1b2178 (diff) |
graphics/potrace: Updated for version 1.9.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/potrace/potrace-1.8-xfig.patch | 114 | ||||
-rw-r--r-- | graphics/potrace/potrace.SlackBuild | 39 | ||||
-rw-r--r-- | graphics/potrace/potrace.info | 8 |
3 files changed, 23 insertions, 138 deletions
diff --git a/graphics/potrace/potrace-1.8-xfig.patch b/graphics/potrace/potrace-1.8-xfig.patch deleted file mode 100644 index 8c5bf4a86619d..0000000000000 --- a/graphics/potrace/potrace-1.8-xfig.patch +++ /dev/null @@ -1,114 +0,0 @@ -Index: ChangeLog -=================================================================== ---- ChangeLog (revision 153) -+++ ChangeLog (revision 154) -@@ -1,5 +1,9 @@ - ChangeLog - -+ (2007/05/22) PS1 - xfig backend: added depth to opaque components -+ to avoid them floating to the background. Suggested by Rafael -+ Laboissiere. -+ - v1.8 2007/04/09 - (2007/04/08) PS1 - portability: use 'test' instead of '[' in shell - scripts. -Index: src/backend_xfig.c -=================================================================== ---- src/backend_xfig.c (revision 153) -+++ src/backend_xfig.c (revision 154) -@@ -124,13 +124,13 @@ - return n; - } - --/* do one path. First should be 1 on the very first path, else 0. */ --static int xfig_path(FILE *fout, potrace_curve_t *curve, trans_t t, int sign) { -+/* do one path. */ -+static void xfig_path(FILE *fout, potrace_curve_t *curve, trans_t t, int sign, int depth) { - int i; - dpoint_t *c; - int m = curve->n; - -- fprintf(fout, "3 1 0 0 0 %d 50 0 20 0.000 0 0 0 %d\n", sign=='+' ? 32 : 33, npoints(curve, m)); -+ fprintf(fout, "3 1 0 0 0 %d %d 0 20 0.000 0 0 0 %d\n", sign=='+' ? 32 : 33, depth, npoints(curve, m)); - - for (i=0; i<m; i++) { - c = curve->c[i]; -@@ -154,15 +154,43 @@ - break; - } - } -- return 0; - } - -+/* render a whole tree */ -+static void xfig_write_paths(FILE *fout, potrace_path_t *plist, trans_t t, int depth) { -+ potrace_path_t *p, *q; -+ -+ for (p=plist; p; p=p->sibling) { -+ xfig_path(fout, &p->curve, t, p->sign, depth); -+ for (q=p->childlist; q; q=q->sibling) { -+ xfig_path(fout, &q->curve, t, q->sign, depth >= 1 ? depth-1 : 0); -+ } -+ for (q=p->childlist; q; q=q->sibling) { -+ xfig_write_paths(fout, q->childlist, t, depth >= 2 ? depth-2 : 0); -+ } -+ } -+} -+ -+/* calculate the depth of a tree. Call with d=0. */ -+static int xfig_get_depth(potrace_path_t *plist) { -+ potrace_path_t *p; -+ int max =0; -+ int d; -+ -+ for (p=plist; p; p=p->sibling) { -+ d = xfig_get_depth(p->childlist); -+ if (d > max) { -+ max = d; -+ } -+ } -+ return max + 1; -+} -+ - /* ---------------------------------------------------------------------- */ - /* Backend. */ - - /* public interface for XFIG */ - int page_xfig(FILE *fout, potrace_path_t *plist, imginfo_t *imginfo) { -- potrace_path_t *p; - trans_t t; - double si, co; - double origx = imginfo->trans.orig[0] + imginfo->lmar; -@@ -174,6 +202,7 @@ - pageformat_t *f; - int i; - int x0, y0, x1, y1; /* in xfig's coordinates */ -+ int depth; - - si = sin(info.angle/180*M_PI); - co = cos(info.angle/180*M_PI); -@@ -220,11 +249,21 @@ - fprintf(fout, "0 33 #%06x\n", info.fillcolor); - fprintf(fout, "6 %d %d %d %d\n", x0-75, y1-35, x1+75, y0+35); /* bounding box */ - -+ /* determine depth of the tree */ -+ depth = xfig_get_depth(plist); -+ -+ /* figure out appropriate xfig starting depth. Note: xfig only has 1000 depths available */ -+ if (depth <= 40) { -+ depth = 50; -+ } else if (depth < 990) { -+ depth += 10; -+ } else { -+ depth = 999; -+ } -+ - /* write paths. Note: can never use "opticurve" with this backend - - it just does not approximate Bezier curves closely enough. */ -- list_forall (p, plist) { -- xfig_path(fout, &p->curve, t, p->sign); -- } -+ xfig_write_paths(fout, plist, t, depth); - - fprintf(fout, "-6\n"); /* end bounding box */ - diff --git a/graphics/potrace/potrace.SlackBuild b/graphics/potrace/potrace.SlackBuild index 4582b7f6603c3..93372a24543c1 100644 --- a/graphics/potrace/potrace.SlackBuild +++ b/graphics/potrace/potrace.SlackBuild @@ -4,37 +4,37 @@ # Written by Kyle Guinn PRGNAM=potrace -VERSION=1.8 +VERSION=1.9 BUILD=${BUILD:-1} TAG=${TAG:-_SBo} -# Automatically determine the architecture we're building on: if [ -z "$ARCH" ]; then case "$( uname -m )" in i?86) ARCH=i486 ;; arm*) ARCH=arm ;; - # Unless $ARCH is already set, use uname -m for all other archs: *) ARCH=$( uname -m ) ;; esac fi CWD=$(pwd) TMP=${TMP:-/tmp/SBo} -PKG=$TMP/package-$PRGNAM +PKG=$TMP/package-$PRGNAM-$VERSION OUTPUT=${OUTPUT:-/tmp} +DOCS="AUTHORS COPYING ChangeLog INSTALL NEWS README*" + if [ "$ARCH" = "i486" ]; then - SLKCFLAGS="-O2 -march=i486 -mtune=i686" - LIBDIRSUFFIX="" + SLKCFLAGS="-O2 -march=i486 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "i686" ]; then - SLKCFLAGS="-O2 -march=i686 -mtune=i686" - LIBDIRSUFFIX="" + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" elif [ "$ARCH" = "x86_64" ]; then - SLKCFLAGS="-O2 -fPIC" - LIBDIRSUFFIX="64" + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" else - SLKCFLAGS="-O2" - LIBDIRSUFFIX="" + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" fi set -e @@ -46,10 +46,7 @@ rm -rf $PRGNAM-$VERSION tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . -chmod -R u+w,go+r-w,a-s . - -# Apply the xfig patch -patch -p0 < $CWD/potrace-1.8-xfig.patch +chmod -R u+w,go+r-w,a-st . # For metric units and papersizes, use the following flags to configure: # --enable-metric Use metric units (centimeters) as default @@ -58,10 +55,13 @@ patch -p0 < $CWD/potrace-1.8-xfig.patch CFLAGS="$SLKCFLAGS" \ ./configure \ --prefix=/usr \ - --libdir=/usr/lib$LIBDIRSUFFIX \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ --sysconfdir=/etc \ --localstatedir=/var \ - --build=$ARCH-slackware-linux + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux \ + --with-libpotrace make make install-strip DESTDIR=$PKG @@ -69,8 +69,7 @@ make install-strip DESTDIR=$PKG find $PKG/usr/man -type f -exec gzip -9 {} \; mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION -cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README \ - $PKG/usr/doc/$PRGNAM-$VERSION +cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install diff --git a/graphics/potrace/potrace.info b/graphics/potrace/potrace.info index 335f9c7e0b005..b75e5266e909a 100644 --- a/graphics/potrace/potrace.info +++ b/graphics/potrace/potrace.info @@ -1,10 +1,10 @@ PRGNAM="potrace" -VERSION="1.8" +VERSION="1.9" HOMEPAGE="http://potrace.sourceforge.net/" -DOWNLOAD="http://downloads.sourceforge.net/potrace/potrace-1.8.tar.gz" -MD5SUM="e73b45565737d64011612704dd4d9f86" +DOWNLOAD="http://downloads.sourceforge.net/potrace/potrace-1.9.tar.gz" +MD5SUM="ef973e7ec9c2e5b3e19e8dfeaa7524c3" DOWNLOAD_x86_64="" MD5SUM_x86_64="" MAINTAINER="Kyle Guinn" EMAIL="elyk03@gmail.com" -APPROVED="alien" +APPROVED="rworkman" |