From 572f5ae6c54b91e298ce94b7ce31a402891abcca Mon Sep 17 00:00:00 2001 From: Hiroki Sato Date: Sat, 9 Jun 2007 11:59:41 +0000 Subject: - Merge graphics/tgif-nls and graphics/tgif into a single port graphics/tgif. The two ports were almost identical except for NLS support. The graphics/tgif now supports NLS by default and WITHOUT_NLS knob to disable it. - Add WITH_A4SIZE knob to set A4 as the default paper size. - Add a workaround for incorrect width calculation of wide characters. Approved by: maintainer --- graphics/tgif/Makefile | 59 ++++++++++++++++++++++-------- graphics/tgif/files/Tgif.tmpl-freebsdports | 16 ++++++++ graphics/tgif/files/patch-Tgif.tmpl | 8 ++++ graphics/tgif/files/patch-font.c | 41 +++++++++++++++++++++ graphics/tgif/files/patch-po-Po.tmpl | 9 +++++ graphics/tgif/files/patch-tgif.man | 11 ++++++ graphics/tgif/pkg-descr | 2 - graphics/tgif/pkg-plist | 50 +++++++++++++++++++------ 8 files changed, 167 insertions(+), 29 deletions(-) create mode 100644 graphics/tgif/files/Tgif.tmpl-freebsdports create mode 100644 graphics/tgif/files/patch-Tgif.tmpl create mode 100644 graphics/tgif/files/patch-font.c create mode 100644 graphics/tgif/files/patch-po-Po.tmpl create mode 100644 graphics/tgif/files/patch-tgif.man (limited to 'graphics/tgif') diff --git a/graphics/tgif/Makefile b/graphics/tgif/Makefile index 4bb6a87adf53..0c4321f19396 100644 --- a/graphics/tgif/Makefile +++ b/graphics/tgif/Makefile @@ -7,7 +7,7 @@ PORTNAME= tgif PORTVERSION= 4.1.45 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= graphics MASTER_SITES= ftp://bourbon.usc.edu/pub/tgif/ \ http://groups.yahoo.com/group/tgif4-announce/files/ \ @@ -20,25 +20,52 @@ COMMENT= An Xlib-based two-dimensional drawing tool and hyper-object browser RUN_DEPENDS= giftopnm:${PORTSDIR}/graphics/netpbm +OPTIONS= NLS "Enable native language support" on \ + A4SIZE "Set default paper size to A4" off + USE_IMAKE= yes +PORTDOCS= HISTORY README + MAN1= tgif.1 -TGIFDOC= ${PREFIX}/share/doc/tgif -DEMO_FILES= an-sr-flip-flop.obj launch-demo-1.obj \ + +.include + +.if !defined(WITHOUT_NLS) +USE_GETTEXT= yes +IMAKEDEFINES+= WITH_NLS +PLIST_SUB= NLS="" +.else +PLIST_SUB= NLS="@comment " +.endif +.if defined(WITH_A4SIZE) +IMAKEDEFINES+= WITH_A4SIZE +.endif + +EXAMPLES.demo= an-sr-flip-flop.obj launch-demo-1.obj \ fonts.obj launch-demo.obj keys.obj slide-demo.obj example.tex -READMES= Copyright HISTORY README +EXAMPLES.spice= README BZ.mod DN.mod DN.sym MN.mod MN.sym MP.mod MP.sym \ + SN.mod SN.sym SP.mod SP.sym capacitor.sym connection.sym \ + demo.obj gauge.sym ground.sym in.sym out.sym port.sym \ + resistor.0tc.sym resistor.2tc.sym resistor.h.2tc.sym \ + resistor.h.sym resistor.sym post-extract: - ${RM} -f ${WRKDIR}/${DISTNAME}/Tgif.tmpl - ${CP} ${WRKDIR}/${DISTNAME}/Tgif.tmpl-freebsd \ - ${WRKDIR}/${DISTNAME}/Tgif.tmpl -post-patch: - @${REINPLACE_CMD} -e 's|.TH tgif n|.TH tgif 1L|' \ - ${WRKSRC}/tgif.man + ${CP} -f ${WRKDIR}/${DISTNAME}/Tgif.tmpl-freebsd \ + ${WRKSRC}/Tgif.tmpl + ( for D in ${IMAKEDEFINES}; do \ + ${ECHO_CMD} "#define $${D}"; \ + done; \ + ${CAT} ${FILESDIR}/Tgif.tmpl-freebsdports; \ + ) > ${WRKSRC}/Tgif.tmpl-freebsdports post-install: - ${MKDIR} ${TGIFDOC} - (cd ${WRKSRC} ;\ - ${INSTALL_DATA} ${DEMO_FILES} ${TGIFDOC} ;\ - ${INSTALL_DATA} ${READMES} ${TGIFDOC} ;\ - ) +.for D in demo spice + ${MKDIR} ${EXAMPLESDIR}/${D} + cd ${WRKSRC}/${D:S/demo//} \ + && ${INSTALL_DATA} ${EXAMPLES.${D}} ${EXAMPLESDIR}/${D} +.endfor +.if !defined(NOPORTDOCS) + ${MKDIR} ${DOCSDIR} + cd ${WRKSRC} && ${INSTALL_DATA} ${PORTDOCS} ${DOCSDIR} +.endif -.include +.include diff --git a/graphics/tgif/files/Tgif.tmpl-freebsdports b/graphics/tgif/files/Tgif.tmpl-freebsdports new file mode 100644 index 000000000000..912e07e72c65 --- /dev/null +++ b/graphics/tgif/files/Tgif.tmpl-freebsdports @@ -0,0 +1,16 @@ +XCOMM $FreeBSD$ +#ifdef WITH_NLS +#define IHaveSubdirs +SUBDIRS= po + +LOCALEDIR= $(PREFIX)/share/locale +MOREDEFINES= -DUSE_XT_INITIALIZE -DENABLE_NLS + +LOCAL_LIBRARIES= $(XLIB) $(XTOOLLIB) +EXTRA_INCLUDES+= -I$(LOCALBASE)/include +EXTRA_LIBRARIES+= -L$(LOCALBASE)/lib -lintl +#endif /* WITH_NLS */ + +#ifdef WITH_A4SIZE +MOREDEFINES+= -DA4PAPER +#endif /* WITH_A4SIZE */ diff --git a/graphics/tgif/files/patch-Tgif.tmpl b/graphics/tgif/files/patch-Tgif.tmpl new file mode 100644 index 000000000000..4c15ff814036 --- /dev/null +++ b/graphics/tgif/files/patch-Tgif.tmpl @@ -0,0 +1,8 @@ +--- Tgif.tmpl.orig Tue May 22 17:10:16 2007 ++++ Tgif.tmpl Tue May 22 17:13:48 2007 +@@ -59,3 +59,5 @@ + XCOMM LOCAL_LIBRARIES = $(XMULIB) $(XTOOLLIB) $(XLIB) + XCOMM SYS_LIBRARIES = -ldl -lm + SYS_LIBRARIES = -lm ++ ++#include "Tgif.tmpl-freebsdports" diff --git a/graphics/tgif/files/patch-font.c b/graphics/tgif/files/patch-font.c new file mode 100644 index 000000000000..8ada18a9de58 --- /dev/null +++ b/graphics/tgif/files/patch-font.c @@ -0,0 +1,41 @@ +--- font.c.orig Sat Jun 9 20:34:29 2007 ++++ font.c Sat Jun 9 20:36:15 2007 +@@ -869,10 +869,10 @@ + (nOdd || ((*psz)&0x80) == nDoubleByte); + psz++, nSubStrIndex++) { + if (nOdd) { +- gpszTmpStr16[nDoubleByteIndex].byte2 = (unsigned char)(*psz); ++ gpszTmpStr16[nDoubleByteIndex].byte2 = (unsigned char)(*psz) & 0x7f; + nDoubleByteIndex++; + } else { +- gpszTmpStr16[nDoubleByteIndex].byte1 = (unsigned char)(*psz); ++ gpszTmpStr16[nDoubleByteIndex].byte1 = (unsigned char)(*psz) & 0x7f; + } + nOdd = !nOdd; + } +@@ -932,10 +932,10 @@ + (nOdd || ((*psz)&0x80) == nDoubleByte); + psz++, nSubStrIndex++) { + if (nOdd) { +- gpszTmpStr16[nDoubleByteIndex].byte2 = (unsigned char)(*psz); ++ gpszTmpStr16[nDoubleByteIndex].byte2 = (unsigned char)(*psz) & 0x7f; + nDoubleByteIndex++; + } else { +- gpszTmpStr16[nDoubleByteIndex].byte1 = (unsigned char)(*psz); ++ gpszTmpStr16[nDoubleByteIndex].byte1 = (unsigned char)(*psz) & 0x7f; + } + nOdd = !nOdd; + } +@@ -981,10 +981,10 @@ + (nOdd || ((*psz)&0x80) == nDoubleByte); + psz++, nSubStrIndex++) { + if (nOdd) { +- gpszTmpStr16[nDoubleByteIndex].byte2 = (unsigned char)(*psz); ++ gpszTmpStr16[nDoubleByteIndex].byte2 = (unsigned char)(*psz) & 0x7f; + nDoubleByteIndex++; + } else { +- gpszTmpStr16[nDoubleByteIndex].byte1 = (unsigned char)(*psz); ++ gpszTmpStr16[nDoubleByteIndex].byte1 = (unsigned char)(*psz) & 0x7f; + } + nOdd = !nOdd; + } diff --git a/graphics/tgif/files/patch-po-Po.tmpl b/graphics/tgif/files/patch-po-Po.tmpl new file mode 100644 index 000000000000..01fd642f23a7 --- /dev/null +++ b/graphics/tgif/files/patch-po-Po.tmpl @@ -0,0 +1,9 @@ +--- po/Po.tmpl.orig Sat Jun 17 02:35:00 2000 ++++ po/Po.tmpl Sat Jun 17 02:35:26 2000 +@@ -8,5 +8,5 @@ + MKINSTALLDIRS = install -d + + DESTDIR = +-SYSNLSDIR = /usr/share/locale ++SYSNLSDIR = $(PREFIX)/share/locale + NLSDIR = $(DESTDIR)$(SYSNLSDIR) diff --git a/graphics/tgif/files/patch-tgif.man b/graphics/tgif/files/patch-tgif.man new file mode 100644 index 000000000000..6376be445bc6 --- /dev/null +++ b/graphics/tgif/files/patch-tgif.man @@ -0,0 +1,11 @@ +--- tgif.man.orig Wed Jun 14 07:30:00 2006 ++++ tgif.man Tue May 22 17:05:48 2007 +@@ -8,7 +8,7 @@ + .\" + .\" + .\" +-.TH tgif n "Version 4.1 Patchlevel 45 and Above" "Tgif" ++.TH tgif 1L "Version 4.1 Patchlevel 45 and Above" "Tgif" + .\" + .SH NAME + .\" diff --git a/graphics/tgif/pkg-descr b/graphics/tgif/pkg-descr index b11888d9b0a9..6511fd12d18d 100644 --- a/graphics/tgif/pkg-descr +++ b/graphics/tgif/pkg-descr @@ -1,5 +1,3 @@ -Tgif 4.0.41 - Tgif is an interactive drawing tool that allows the user to draw and manipulate objects in the X Window System. It's also a hyper-graphics (or hyper-structured-graphics) browser on the World-Wide-Web. Its hyper-text diff --git a/graphics/tgif/pkg-plist b/graphics/tgif/pkg-plist index 6bfd260187d4..c6efd8a93d33 100644 --- a/graphics/tgif/pkg-plist +++ b/graphics/tgif/pkg-plist @@ -1,3 +1,4 @@ +@comment $FreeBSD$ bin/tgif lib/X11/tgif/Copyright lib/X11/tgif/LICENSE.QPL @@ -14,15 +15,42 @@ lib/X11/tgif/tgificon.xbm lib/X11/tgif/tgificon.xpm lib/X11/tgif/tangram.sym lib/X11/tgif/keys.obj -share/doc/tgif/Copyright -share/doc/tgif/HISTORY -share/doc/tgif/README -share/doc/tgif/an-sr-flip-flop.obj -share/doc/tgif/example.tex -share/doc/tgif/fonts.obj -share/doc/tgif/launch-demo-1.obj -share/doc/tgif/launch-demo.obj -share/doc/tgif/keys.obj -share/doc/tgif/slide-demo.obj -@dirrm share/doc/tgif +%%EXAMPLESDIR%%/demo/an-sr-flip-flop.obj +%%EXAMPLESDIR%%/demo/example.tex +%%EXAMPLESDIR%%/demo/fonts.obj +%%EXAMPLESDIR%%/demo/launch-demo-1.obj +%%EXAMPLESDIR%%/demo/launch-demo.obj +%%EXAMPLESDIR%%/demo/keys.obj +%%EXAMPLESDIR%%/demo/slide-demo.obj +@dirrm %%EXAMPLESDIR%%/demo +%%EXAMPLESDIR%%/spice/BZ.mod +%%EXAMPLESDIR%%/spice/DN.mod +%%EXAMPLESDIR%%/spice/DN.sym +%%EXAMPLESDIR%%/spice/MN.mod +%%EXAMPLESDIR%%/spice/MN.sym +%%EXAMPLESDIR%%/spice/MP.mod +%%EXAMPLESDIR%%/spice/MP.sym +%%EXAMPLESDIR%%/spice/README +%%EXAMPLESDIR%%/spice/SN.mod +%%EXAMPLESDIR%%/spice/SN.sym +%%EXAMPLESDIR%%/spice/SP.mod +%%EXAMPLESDIR%%/spice/SP.sym +%%EXAMPLESDIR%%/spice/capacitor.sym +%%EXAMPLESDIR%%/spice/connection.sym +%%EXAMPLESDIR%%/spice/demo.obj +%%EXAMPLESDIR%%/spice/gauge.sym +%%EXAMPLESDIR%%/spice/ground.sym +%%EXAMPLESDIR%%/spice/in.sym +%%EXAMPLESDIR%%/spice/out.sym +%%EXAMPLESDIR%%/spice/port.sym +%%EXAMPLESDIR%%/spice/resistor.0tc.sym +%%EXAMPLESDIR%%/spice/resistor.2tc.sym +%%EXAMPLESDIR%%/spice/resistor.h.2tc.sym +%%EXAMPLESDIR%%/spice/resistor.h.sym +%%EXAMPLESDIR%%/spice/resistor.sym +@dirrm %%EXAMPLESDIR%%/spice +%%NLS%%share/locale/fr/LC_MESSAGES/tgif.mo +%%NLS%%share/locale/ja/LC_MESSAGES/tgif.mo +%%NLS%%share/locale/ru/LC_MESSAGES/tgif.mo +@dirrm %%EXAMPLESDIR%% @dirrm lib/X11/tgif -- cgit v1.2.3