aboutsummaryrefslogtreecommitdiffstats
path: root/chinese/hanzim
diff options
context:
space:
mode:
Diffstat (limited to 'chinese/hanzim')
-rw-r--r--chinese/hanzim/Makefile4
-rw-r--r--chinese/hanzim/files/patch-Makefile13
-rw-r--r--chinese/hanzim/files/patch-hanzim.c27
3 files changed, 37 insertions, 7 deletions
diff --git a/chinese/hanzim/Makefile b/chinese/hanzim/Makefile
index 6d1e638a38bc..76e7f4f744cc 100644
--- a/chinese/hanzim/Makefile
+++ b/chinese/hanzim/Makefile
@@ -21,7 +21,11 @@ RUN_DEPENDS+= wish8.3:${PORTSDIR}/x11-toolkits/tk83
WRKSRC= ${WRKDIR}/Hanzim
ALL_TARGET= # empty
+USE_REINPLACE= yes
MAN1= hanzim.1
+post-patch:
+ ${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' ${WRKSRC}/hanzim.c
+
.include <bsd.port.mk>
diff --git a/chinese/hanzim/files/patch-Makefile b/chinese/hanzim/files/patch-Makefile
index 33314557841d..15a547e8933d 100644
--- a/chinese/hanzim/files/patch-Makefile
+++ b/chinese/hanzim/files/patch-Makefile
@@ -1,5 +1,5 @@
---- Makefile.orig Tue Apr 3 13:41:51 2001
-+++ Makefile Sat Apr 14 21:38:55 2001
+--- Makefile.orig Wed Mar 20 00:59:19 2002
++++ Makefile Sat Jun 14 09:21:10 2003
@@ -6,11 +6,11 @@
# set INSTALLROOT to the installation base; it is used to set the
@@ -52,3 +52,12 @@
#CFLAGS = -O2 -Wall -pedantic -ansi $(DEFINES)
LFLAGS = $(LIBS) -s
+@@ -96,7 +95,7 @@
+ $(INSTALL) -m 0644 hanwin.tcl fonts.unix fonts.windows \
+ zidianf.gb zidianfl.b5 bushou.gb \
+ cidianf.gb sanzicidianf.gb parts.gb $(LIBDIR)
+- $(BINDIR)/hanzim -buildDB
++ $(BINDIR)/hanzim -port-install
+
+ uninstall :
+ $(RM) $(BINDIR)/hanzim
diff --git a/chinese/hanzim/files/patch-hanzim.c b/chinese/hanzim/files/patch-hanzim.c
index 33d60180bf1e..29043d038048 100644
--- a/chinese/hanzim/files/patch-hanzim.c
+++ b/chinese/hanzim/files/patch-hanzim.c
@@ -1,6 +1,23 @@
---- hanzim.c.orig Sat Apr 14 21:23:42 2001
-+++ hanzim.c Sat Apr 14 21:29:54 2001
-@@ -440,10 +440,14 @@
+--- hanzim.c.orig Wed Mar 20 01:34:31 2002
++++ hanzim.c Sat Jun 14 09:20:04 2003
+@@ -204,6 +204,16 @@
+ main(int argc, char *argv[]) {
+ Tcl_Interp *interp;
+
++/* hanzim need a running XFree to do its initial setup, rectify */
++ if (!(strcmp(argv[1], "-port-install")))
++ {
++ char *portdatadir = PREFIX"/lib/hanzim";
++ init_vars(portdatadir);
++ kanzi(portdatadir);
++ kanhe(portdatadir);
++ exit(0);
++ }
++
+ /* do an initial parse of the command-line options so that help message */
+ /* can be printed and we can set some global flags */
+ interp = Tcl_CreateInterp();
+@@ -460,10 +470,14 @@
struct _timeb tp;
_ftime(&tp);
#else
@@ -14,5 +31,5 @@
- srand(tp.millitm);
+ srand(t);
- printf("\n\nWelcome to Hanzi Master, where YOU will master the hanzi.\n\n");
- printf("Please use \"Ctrl-h\" or \"Alt-h\" for help.\n");
+ if (!quiet) {
+ printf("\n\nWelcome to Hanzi Master, where YOU will master the hanzi.\n");