From owner-freebsd-ports-bugs@FreeBSD.ORG Mon Jan 24 21:00:26 2011 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AFA2310656D1 for ; Mon, 24 Jan 2011 21:00:26 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id A436A8FC21 for ; Mon, 24 Jan 2011 21:00:23 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p0OL0NsW013273 for ; Mon, 24 Jan 2011 21:00:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p0OL0NVa013250; Mon, 24 Jan 2011 21:00:23 GMT (envelope-from gnats) Resent-Date: Mon, 24 Jan 2011 21:00:23 GMT Resent-Message-Id: <201101242100.p0OL0NVa013250@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Piotr Smyrak Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4037F106566B for ; Mon, 24 Jan 2011 20:59:31 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0668FC15 for ; Mon, 24 Jan 2011 20:59:31 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p0OKxUDY033945 for ; Mon, 24 Jan 2011 20:59:30 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.4/8.14.4/Submit) id p0OKxUxw033944; Mon, 24 Jan 2011 20:59:30 GMT (envelope-from nobody) Message-Id: <201101242059.p0OKxUxw033944@red.freebsd.org> Date: Mon, 24 Jan 2011 20:59:30 GMT From: Piotr Smyrak To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/154278: [patch] update graphics/potrace to 1.9 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jan 2011 21:00:26 -0000 >Number: 154278 >Category: ports >Synopsis: [patch] update graphics/potrace to 1.9 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: maintainer-update >Submitter-Id: current-users >Arrival-Date: Mon Jan 24 21:00:22 UTC 2011 >Closed-Date: >Last-Modified: >Originator: Piotr Smyrak >Release: >Organization: >Environment: FreeBSD dsk.smyrak.com 8.0-STABLE FreeBSD 8.0-STABLE #0: Sun Mar 14 17:22:16 CET 2010 root@dsk.smyrak.com:/usr/obj/amd64/usr/src/sys/SMYRU amd64 >Description: The attached patch updates graphics/potrace to newly released version 0.9. It removes obsolete patch as well as empty files dir. Converts port to use OPTIONS. >How-To-Repeat: N/A >Fix: Apply the patch Patch attached with submission follows: diff -Naru /usr/ports/graphics/potrace/Makefile ./Makefile --- /usr/ports/graphics/potrace/Makefile 2009-09-04 21:16:23.000000000 +0200 +++ ./Makefile 2011-01-24 21:52:32.000000000 +0100 @@ -6,7 +6,7 @@ # PORTNAME= potrace -PORTVERSION= 1.8 +PORTVERSION= 1.9 CATEGORIES= graphics MASTER_SITES= SF @@ -20,7 +20,10 @@ .endif PLIST_FILES= bin/potrace bin/mkbitmap -.if defined(A4) +OPTIONS= METRIC "Enable use of metric units (centimeters) as default" on \ + A4 "Enable use of A4 as the default papersize" on + +.if defined(WITH_A4) CONFIGURE_ARGS+= --enable-a4 .endif @@ -28,14 +31,6 @@ CONFIGURE_ARGS+= --enable-metric .endif -pre-everything:: - @${ECHO_MSG} "" - @${ECHO_MSG} "You may define the following build options:" - @${ECHO_MSG} "" - @${ECHO_MSG} " WITH_METRIC Enable use of metric units (centimeters) as default" - @${ECHO_MSG} " A4 Enable use of A4 as the default papersize" - @${ECHO_MSG} "" - do-install: ${INSTALL_PROGRAM} ${WRKSRC}/src/potrace ${PREFIX}/bin ${INSTALL_PROGRAM} ${WRKSRC}/src/mkbitmap ${PREFIX}/bin diff -Naru /usr/ports/graphics/potrace/distinfo ./distinfo --- /usr/ports/graphics/potrace/distinfo 2007-06-05 22:07:11.000000000 +0200 +++ ./distinfo 2011-01-24 21:42:02.000000000 +0100 @@ -1,3 +1,2 @@ -MD5 (potrace-1.8.tar.gz) = e73b45565737d64011612704dd4d9f86 -SHA256 (potrace-1.8.tar.gz) = 61ee5acf2cf0363e5c04ccd0a197e31edce002e8d966423f85164155950b3ef5 -SIZE (potrace-1.8.tar.gz) = 347484 +SHA256 (potrace-1.9.tar.gz) = edce2dff19f91e727a4f39e1839b582b83d49ef252af429a0772ddc3626349be +SIZE (potrace-1.9.tar.gz) = 601675 diff -Naru /usr/ports/graphics/potrace/files/patch-backend_xfig.c ./files/patch-backend_xfig.c --- /usr/ports/graphics/potrace/files/patch-backend_xfig.c 2007-10-21 05:58:02.000000000 +0200 +++ ./files/patch-backend_xfig.c 1970-01-01 01:00:00.000000000 +0100 @@ -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; ic[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 */ - >Release-Note: >Audit-Trail: >Unformatted: