diff options
author | dmcmahill <dmcmahill@pkgsrc.org> | 2001-07-15 03:29:22 +0000 |
---|---|---|
committer | dmcmahill <dmcmahill@pkgsrc.org> | 2001-07-15 03:29:22 +0000 |
commit | 82ca96d3de9250a6a2b3d6475d7a6b6a29176350 (patch) | |
tree | 110837c3ffa87746589e17d7f45846de701b8061 /graphics | |
parent | c5e0a72b27965ebb607d6426d0ce536e0cdd9dae (diff) | |
download | pkgsrc-82ca96d3de9250a6a2b3d6475d7a6b6a29176350.tar.gz |
add a patch from Bill Cheng to fix the -exec command.
also add missing USE_X11 to make this link with the new buildlink
stuff in place.
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/tgif/Makefile | 4 | ||||
-rw-r--r-- | graphics/tgif/distinfo | 3 | ||||
-rw-r--r-- | graphics/tgif/patches/patch-aa | 202 |
3 files changed, 207 insertions, 2 deletions
diff --git a/graphics/tgif/Makefile b/graphics/tgif/Makefile index d584089de0a..da65c047a29 100644 --- a/graphics/tgif/Makefile +++ b/graphics/tgif/Makefile @@ -1,7 +1,8 @@ -# $NetBSD: Makefile,v 1.30 2001/06/30 11:47:00 zuntum Exp $ +# $NetBSD: Makefile,v 1.31 2001/07/15 03:29:22 dmcmahill Exp $ # DISTNAME= tgif-4.1.40 +PKGNAME= tgif-4.1.40nb1 CATEGORIES= graphics MASTER_SITES= ftp://bourbon.cs.umd.edu/pub/tgif/ \ ftp://ftp.cs.ucla.edu/pub/tgif/ @@ -12,6 +13,7 @@ COMMENT= Fully-featured X11 drawing program USE_BUILDLINK_ONLY= yes USE_IMAKE= yes +USE_X11= yes post-patch:: @${RM} -f ${WRKSRC}/Tgif.tmpl diff --git a/graphics/tgif/distinfo b/graphics/tgif/distinfo index 5c0defa0d50..b86ef77c2f6 100644 --- a/graphics/tgif/distinfo +++ b/graphics/tgif/distinfo @@ -1,4 +1,5 @@ -$NetBSD: distinfo,v 1.2 2001/04/21 09:54:27 wiz Exp $ +$NetBSD: distinfo,v 1.3 2001/07/15 03:29:22 dmcmahill Exp $ SHA1 (tgif-4.1.40.tar.gz) = 478d24a338d71f20649d03fe6b888d733baca82e Size (tgif-4.1.40.tar.gz) = 1436655 bytes +SHA1 (patch-aa) = 585096ebe834f47dc4091eeeec63fcb5510fc123 diff --git a/graphics/tgif/patches/patch-aa b/graphics/tgif/patches/patch-aa new file mode 100644 index 00000000000..a8c0aac76d6 --- /dev/null +++ b/graphics/tgif/patches/patch-aa @@ -0,0 +1,202 @@ +$NetBSD: patch-aa,v 1.5 2001/07/15 03:29:23 dmcmahill Exp $ + +fix a bug in running tgif scripts via the -exec flag. Patch provided +by the tgif author: +Bill Cheng // william@cs.umd.edu <URL:http://www.cs.umd.edu/~william/> + +*** exec.c.orig 2000/11/09 00:07:26 +--- exec.c 2001/03/19 22:08:19 +*************** +*** 71,74 **** +--- 71,75 ---- + #include "obj.e" + #include "oval.e" ++ #include "page.e" + #include "pattern.e" + #include "poly.e" +*************** +*** 1404,1408 **** + /* obj_ptr better be a top-level object */ + { +! int count=0, need_to_change=FALSE; + struct StrRec *str_ptr=NULL; + MiniLineInfo *pMiniLine=NULL; +--- 1405,1409 ---- + /* obj_ptr better be a top-level object */ + { +! int count=0, need_to_change=TRUE; + struct StrRec *str_ptr=NULL; + MiniLineInfo *pMiniLine=NULL; +*************** +*** 1411,1439 **** + count++; + } +! if (count != attr_ptr->obj->detail.t->lines) { +! need_to_change = TRUE; +! } else { +! for (str_ptr=(*ppTopStr), +! pMiniLine=attr_ptr->obj->detail.t->minilines.first; +! str_ptr != NULL; +! str_ptr=str_ptr->next, pMiniLine=pMiniLine->next) { +! if (pMiniLine == NULL) { +! need_to_change = TRUE; +! break; +! } else { +! if (pMiniLine == attr_ptr->obj->detail.t->minilines.first) { +! if (strcmp(attr_ptr->attr_value.s, str_ptr->dyn_str.s) != 0) { +! need_to_change = TRUE; +! break; +! } +! } else { +! if (strcmp(str_ptr->dyn_str.s, str_ptr->dyn_str.s) != 0) { +! need_to_change = TRUE; +! break; +! } +! } +! } +! } +! } + if (need_to_change) { + int ltx, lty, rbx, rby, switch_selected=FALSE; +--- 1412,1442 ---- + count++; + } +! /* +! * if (count != attr_ptr->obj->detail.t->lines) { +! * need_to_change = TRUE; +! * } else { +! * for (str_ptr=(*ppTopStr), +! * pMiniLine=attr_ptr->obj->detail.t->minilines.first; +! * str_ptr != NULL; +! * str_ptr=str_ptr->next, pMiniLine=pMiniLine->next) { +! * if (pMiniLine == NULL) { +! * need_to_change = TRUE; +! * break; +! * } else { +! * if (pMiniLine == attr_ptr->obj->detail.t->minilines.first) { +! * if (strcmp(attr_ptr->attr_value.s, str_ptr->dyn_str.s) != 0) { +! * need_to_change = TRUE; +! * break; +! * } +! * } else { +! * if (strcmp(str_ptr->dyn_str.s, str_ptr->dyn_str.s) != 0) { +! * need_to_change = TRUE; +! * break; +! * } +! * } +! * } +! * } +! * } +! */ + if (need_to_change) { + int ltx, lty, rbx, rby, switch_selected=FALSE; +*************** +*** 8392,8395 **** +--- 8395,8423 ---- + } + ++ static ++ int DoExecSelectEachObjAndExec(attr_name) ++ char *attr_name; ++ { ++ struct ObjRec *optr=NULL; ++ int rc=TRUE; ++ ++ for (optr=botObj; rc && optr != NULL; optr=optr->prev) { ++ struct AttrRec *attr_ptr=NULL; ++ ++ attr_ptr = FindAttrWithName(optr, attr_name, NULL); ++ if (attr_ptr != NULL) { ++ struct SelRec *sel_ptr=SelectThisObject(optr); ++ ++ AddSel(NULL, topSel, sel_ptr); ++ UpdSelBBox(); ++ if (!DoExec(attr_ptr, optr)) { ++ rc = FALSE; ++ } ++ RemoveAllSel(); ++ } ++ } ++ return rc; ++ } ++ + int ExecSelectEachObjAndExec(argv, obj_ptr, orig_cmd) + char **argv, *orig_cmd; +*************** +*** 8398,8420 **** + { + char *attr_name_to_exec=argv[0]; +- struct ObjRec *optr=NULL; +- struct AttrRec *attr_ptr=NULL; + int rc=TRUE; + + UtilRemoveQuotes(attr_name_to_exec); +- sprintf(execDummyStr, "%s=", attr_name_to_exec); +- attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, NULL); +- if (attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); + +! MakeQuiescent(); +! for (optr=botObj; rc && optr != NULL; optr=optr->prev) { +! struct SelRec *sel_ptr=SelectThisObject(optr); + +! AddSel(NULL, topSel, sel_ptr); +! UpdSelBBox(); +! if (!DoExec(attr_ptr, optr)) { +! rc = FALSE; + } +! RemoveAllSel(); + } + return rc; +--- 8426,8477 ---- + { + char *attr_name_to_exec=argv[0]; + int rc=TRUE; + + UtilRemoveQuotes(attr_name_to_exec); + +! if (topSel != NULL) { +! struct AttrRec *attr_ptr=NULL; + +! sprintf(execDummyStr, "%s=", attr_name_to_exec); +! attr_ptr = FindAttrWithName(obj_ptr, execDummyStr, NULL); +! if (attr_ptr == NULL) return BadAttr(execDummyStr, orig_cmd); +! +! rc = DoExecSelectEachObjAndExec(execDummyStr); +! } else { +! char *attr_name=(char*)malloc(strlen(attr_name_to_exec)+2); +! +! if (attr_name == NULL) FailAllocMessage(); +! sprintf(attr_name, "%s=", attr_name_to_exec); +! +! MakeQuiescent(); +! StartCompositeCmd(); +! if (lastPageNum == 1) { +! rc = DoExecSelectEachObjAndExec(attr_name); +! } else { +! int saved_cur_page_num=curPageNum, prev_page_num=curPageNum; +! +! for (curPageNum=1; rc && curPageNum <= lastPageNum; curPageNum++) { +! if (prev_page_num != curPageNum) { +! PrepareToRecord(CMD_GOTO_PAGE, NULL, NULL, prev_page_num); +! GotoPageNum(curPageNum); +! RedrawPageWindow(); +! RecordCmd(CMD_GOTO_PAGE, NULL, NULL, NULL, curPageNum); +! ClearAndRedrawDrawWindow(); +! prev_page_num = curPageNum; +! } +! rc = DoExecSelectEachObjAndExec(attr_name); +! } +! if (prev_page_num != curPageNum) { +! PrepareToRecord(CMD_GOTO_PAGE, NULL, NULL, prev_page_num); +! GotoPageNum(saved_cur_page_num); +! RedrawPageWindow(); +! RecordCmd(CMD_GOTO_PAGE, NULL, NULL, NULL, saved_cur_page_num); +! ClearAndRedrawDrawWindow(); +! prev_page_num = curPageNum; +! } + } +! EndCompositeCmd(); +! +! UtilFree(attr_name); + } + return rc; |