diff options
author | gahr <gahr@FreeBSD.org> | 2013-11-06 22:50:24 +0800 |
---|---|---|
committer | gahr <gahr@FreeBSD.org> | 2013-11-06 22:50:24 +0800 |
commit | 53bd2801225f4e0b73d49a8ab01e8df8601bcb68 (patch) | |
tree | 1c65d7023a8708c90820b5b5b6ec785434aa348d /math | |
parent | 2abdbe586bf27e61ce4b38eb0405f29cb9110aec (diff) | |
download | freebsd-ports-gnome-53bd2801225f4e0b73d49a8ab01e8df8601bcb68.tar.gz freebsd-ports-gnome-53bd2801225f4e0b73d49a8ab01e8df8601bcb68.tar.zst freebsd-ports-gnome-53bd2801225f4e0b73d49a8ab01e8df8601bcb68.zip |
- Fix build with Tcl 8.6
- Take maintainership (tcltk@FreeBSD.org)
- Add LICENSE
- Switch to USES+=gmake tcl
- Add regression-test target
- STAGE-clean
Diffstat (limited to 'math')
-rw-r--r-- | math/mpexpr/Makefile | 36 | ||||
-rw-r--r-- | math/mpexpr/files/patch-generic_mpexpr.c | 70 | ||||
-rw-r--r-- | math/mpexpr/files/patch-generic_mpparse.c | 28 | ||||
-rw-r--r-- | math/mpexpr/files/patch-unix-Makefile.in | 38 | ||||
-rw-r--r-- | math/mpexpr/files/patch-unix-configure | 41 | ||||
-rw-r--r-- | math/mpexpr/pkg-plist | 3 |
6 files changed, 144 insertions, 72 deletions
diff --git a/math/mpexpr/Makefile b/math/mpexpr/Makefile index 72d2ff98a83a..709c60d54e7f 100644 --- a/math/mpexpr/Makefile +++ b/math/mpexpr/Makefile @@ -6,28 +6,36 @@ PORTVERSION= 1.1 CATEGORIES= math tcl MASTER_SITES= SF -MAINTAINER= ports@FreeBSD.org +MAINTAINER= tcltk@FreeBSD.org COMMENT= Multiple precision math for Tcl +LICENSE= BSD + WRKSRC= ${WRKDIR}/${DISTNAME}/unix PATCH_WRKSRC= ${WRKDIR}/${DISTNAME} -USE_TCL= 84 -USE_TCL_BUILD= 84 +USES+= gmake tcl GNU_CONFIGURE= yes -USE_GMAKE= yes -CONFIGURE_ARGS= --prefix=${PREFIX} -USE_LDCONFIG= yes +CONFIGURE_ARGS= --prefix=${PREFIX} \ + --with-tcl=${TCL_LIBDIR} +CONFIGURE_ENV+= TCL_INC_DIR=${TCL_INCLUDEDIR} \ + TCL_LIB_DIR=${TCL_LIBDIR} PLIST_DIRS= lib/Mpexpr10 -PLIST_FILES= lib/libMpexpr10.so \ - lib/Mpexpr10/pkgIndex.tcl -MANN= mpexpr.n +PLIST_FILES= lib/Mpexpr10/libMpexpr10.so \ + lib/Mpexpr10/pkgIndex.tcl \ + man/mann/mpexpr.n.gz + +post-patch: + ${REINPLACE_CMD} -e 's|\.\.||' ${WRKSRC}/pkgIndex.tcl.in + ${REINPLACE_CMD} -e '/set VERBOSE/s|0|1|' ${WRKSRC}/../tests/defs -NO_STAGE= yes do-install: - ${MKDIR} ${PREFIX}/lib/Mpexpr10 - ${INSTALL_PROGRAM} ${WRKSRC}/libMpexpr10.so ${PREFIX}/lib/ - ${INSTALL_DATA} ${WRKSRC}/pkgIndex.tcl ${PREFIX}/lib/Mpexpr10/ - ${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/mpexpr.man ${PREFIX}/man/mann/mpexpr.n + @${MKDIR} ${STAGEDIR}${PREFIX}/lib/Mpexpr10 + ${INSTALL_PROGRAM} ${WRKSRC}/libMpexpr10.so ${STAGEDIR}${PREFIX}/lib/Mpexpr10 + ${INSTALL_DATA} ${WRKSRC}/pkgIndex.tcl ${STAGEDIR}${PREFIX}/lib/Mpexpr10 + ${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/doc/mpexpr.man ${STAGEDIR}${PREFIX}/man/mann/mpexpr.n + +regression-test: build + cd ${WRKSRC} && ${GMAKE} test .include <bsd.port.mk> diff --git a/math/mpexpr/files/patch-generic_mpexpr.c b/math/mpexpr/files/patch-generic_mpexpr.c new file mode 100644 index 000000000000..5f1cbd9b6851 --- /dev/null +++ b/math/mpexpr/files/patch-generic_mpexpr.c @@ -0,0 +1,70 @@ +--- generic/mpexpr.c.orig 2013-11-06 15:23:00.000000000 +0100 ++++ generic/mpexpr.c 2013-11-06 15:29:26.000000000 +0100 +@@ -1242,7 +1242,7 @@ + */ + + default: +- interp->result = "unknown operator in expression"; ++ Tcl_SetObjResult(interp, Tcl_NewStringObj("unknown operator in expression", -1)); + result = TCL_ERROR; + goto done; + } +@@ -1272,9 +1272,8 @@ + + if (ziszero(value2.intValue)) { + divideByZero: +- interp->result = "divide by zero"; +- Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", +- interp->result, (char *) NULL); ++ Tcl_SetObjResult(interp, Tcl_NewStringObj("divide by zero", -1)); ++ Tcl_SetErrorCode(interp, "ARITH", "DIVZERO", "divide by zero", (char *) NULL); + result = TCL_ERROR; + goto done; + } +@@ -1637,7 +1636,7 @@ + break; + + case COLON: +- interp->result = "can't have : operator without ? first"; ++ Tcl_SetObjResult(interp, Tcl_NewStringObj("can't have : operator without ? first", -1)); + result = TCL_ERROR; + goto done; + } +@@ -1930,8 +1929,7 @@ + ckfree(math_io); + } else { + if (value.pv.buffer != value.staticSpace) { +- interp->result = value.pv.buffer; +- interp->freeProc = TCL_DYNAMIC; ++ Tcl_SetResult(interp, value.pv.buffer, TCL_DYNAMIC); + value.pv.buffer = value.staticSpace; + } else { + Tcl_SetResult(interp, value.pv.buffer, TCL_VOLATILE); +@@ -2133,8 +2131,7 @@ + ExprFreeMathArgs(args); + zfree(funcResult.intValue); + Qfree(funcResult.doubleValue); +- interp->result = +- "argument to math function didn't have numeric value"; ++ Tcl_SetObjResult(interp, Tcl_NewStringObj("argument to math function didn't have numeric value", -1)); + return TCL_ERROR; + } + +@@ -2177,7 +2174,7 @@ + break; + } + if (infoPtr->token == COMMA) { +- interp->result = "too many arguments for math function"; ++ Tcl_SetObjResult(interp, Tcl_NewStringObj("too many arguments for math function", -1)); + ExprFreeMathArgs(args); + zfree(funcResult.intValue); + Qfree(funcResult.doubleValue); +@@ -2188,7 +2185,7 @@ + } + if (infoPtr->token != COMMA) { + if (infoPtr->token == CLOSE_PAREN) { +- interp->result = "too few arguments for math function"; ++ Tcl_SetObjResult(interp, Tcl_NewStringObj("too few arguments for math function", -1)); + ExprFreeMathArgs(args); + zfree(funcResult.intValue); + Qfree(funcResult.doubleValue); diff --git a/math/mpexpr/files/patch-generic_mpparse.c b/math/mpexpr/files/patch-generic_mpparse.c new file mode 100644 index 000000000000..56140eb42a12 --- /dev/null +++ b/math/mpexpr/files/patch-generic_mpparse.c @@ -0,0 +1,28 @@ +--- generic/mpparse.c.orig 2013-11-06 15:29:52.000000000 +0100 ++++ generic/mpparse.c 2013-11-06 15:36:11.000000000 +0100 +@@ -283,7 +283,9 @@ + continue; + } else if (c == '\0') { + Tcl_ResetResult(interp); +- sprintf(interp->result, "missing %c", termChar); ++ char buf[10]; ++ sprintf(buf, "missing %c", termChar); ++ Tcl_SetObjResult(interp, Tcl_NewStringObj(buf, -1)); + *termPtr = string-1; + return TCL_ERROR; + } else { +@@ -349,12 +351,12 @@ + if (result != TCL_OK) { + return result; + } +- length = strlen(interp->result); ++ length = strlen(Tcl_GetStringResult(interp)); + shortfall = length + 1 - (pvPtr->end - pvPtr->next); + if (shortfall > 0) { + (*pvPtr->expandProc)(pvPtr, shortfall); + } +- strcpy(pvPtr->next, interp->result); ++ strcpy(pvPtr->next, Tcl_GetStringResult(interp)); + pvPtr->next += length; + Tcl_ResetResult(interp); + } else { diff --git a/math/mpexpr/files/patch-unix-Makefile.in b/math/mpexpr/files/patch-unix-Makefile.in index 3c659b2b734f..f0c76ee1d615 100644 --- a/math/mpexpr/files/patch-unix-Makefile.in +++ b/math/mpexpr/files/patch-unix-Makefile.in @@ -1,21 +1,5 @@ ---- unix/Makefile.in.orig Tue Jun 8 04:16:40 2004 -+++ unix/Makefile.in Thu Mar 15 03:28:30 2007 -@@ -92,13 +92,13 @@ - #------------------------------------------------------------------------------ - # define names for Mpexpr tclsh/tcl executable - --TCL_EXEC = tclsh -+TCL_EXEC = tclsh8.4 - TCLX_EXEC = tcl - - #------------------------------------------------------------------------------ - # define name for Mpexpr wish/wishx executable - --WISH_EXEC = wish -+WISH_EXEC = wish8.4 - WISHX_EXEC = wishx - - #------------------------------------------------------------------------------ +--- unix/Makefile.in.orig 2004-06-08 04:16:40.000000000 +0200 ++++ unix/Makefile.in 2013-11-06 15:14:48.000000000 +0100 @@ -219,17 +219,17 @@ # a make clobber and try LITTLE_ENDIAN. If that fails, ask a wizard # for help. @@ -38,21 +22,3 @@ #LONG_BITS= 64 -@@ -402,14 +402,15 @@ - #------------------------------------------------------------------------------ - # install targets - --install: @INSTALL_TARGET@ install-man install-tools -+#install: @INSTALL_TARGET@ install-man install-tools -+install: @INSTALL_TARGET@ install-man - - install-shared: $(LIB_SH_MPEXPR) - @echo installing $(LIB_SH_MPEXPR) - $(INSTALL_PROGRAM) $(LIB_SH_MPEXPR) $(LIB_DIR)/$(LIB_SH_MPEXPR) - @echo installing pkgIndex.tcl - -mkdir $(LIB_DIR)/Mpexpr$(MPEXPR_LIBVER) -- $(INSTALL_PROGRAM) pkgIndex.tcl $(LIB_DIR)/Mpexpr$(MPEXPR_LIBVER)/pkgIndex.tcl -+ $(INSTALL_DATA) pkgIndex.tcl $(LIB_DIR)/Mpexpr$(MPEXPR_LIBVER)/pkgIndex.tcl - - install-static: @PROGS@ $(LIB_MPEXPR) - @for f in $(T_EXEC) $(W_EXEC) ; do \ diff --git a/math/mpexpr/files/patch-unix-configure b/math/mpexpr/files/patch-unix-configure index 8bcd02d0bb1e..0fed1a1ef362 100644 --- a/math/mpexpr/files/patch-unix-configure +++ b/math/mpexpr/files/patch-unix-configure @@ -1,5 +1,5 @@ ---- unix/configure.orig Thu Mar 15 03:26:26 2007 -+++ unix/configure Thu Mar 15 03:25:16 2007 +--- unix/configure.orig 2013-11-06 15:39:52.000000000 +0100 ++++ unix/configure 2013-11-06 15:39:52.000000000 +0100 @@ -23,6 +23,8 @@ # Initialize some variables set by options. # The variables have the same names as the options, with @@ -9,25 +9,28 @@ build=NONE cache_file=./config.cache exec_prefix=NONE -@@ -735,8 +737,8 @@ +@@ -733,24 +735,6 @@ + fi - # find include/tcl.h - for f in $with_tclpath $prefix_locations ; do + +-# find include/tcl.h +-for f in $with_tclpath $prefix_locations ; do - if test -r "$f/include/tcl.h"; then - TCL_INC_DIR=$f/include -+ if test -r "$f/include/tcl8.4/tcl.h"; then -+ TCL_INC_DIR=$f/include/tcl8.4 - echo "$ac_t""setting TCL_INC_DIR to $TCL_INC_DIR" 1>&6 - break - fi -@@ -744,8 +746,8 @@ - - # find lib/tclConfig.sh - for f in $with_tclpath $exec_prefix_locations ; do +- echo "$ac_t""setting TCL_INC_DIR to $TCL_INC_DIR" 1>&6 +- break +- fi +-done +- +-# find lib/tclConfig.sh +-for f in $with_tclpath $exec_prefix_locations ; do - if test -r "$f/lib/tclConfig.sh"; then - TCL_LIB_DIR=$f/lib -+ if test -r "$f/lib/tcl8.4/tclConfig.sh"; then -+ TCL_LIB_DIR=$f/lib/tcl8.4 - echo "$ac_t""setting TCL_LIB_DIR to $TCL_LIB_DIR" 1>&6 - break - fi +- echo "$ac_t""setting TCL_LIB_DIR to $TCL_LIB_DIR" 1>&6 +- break +- fi +-done +- + if test -z "$TCL_INC_DIR" ; then + { echo "configure: error: could not find include/tcl.h in $prefix_locations" 1>&2; exit 1; } + fi diff --git a/math/mpexpr/pkg-plist b/math/mpexpr/pkg-plist deleted file mode 100644 index fa2d7e4faece..000000000000 --- a/math/mpexpr/pkg-plist +++ /dev/null @@ -1,3 +0,0 @@ -lib/libMpexpr10.so -lib/Mpexpr10/pkgIndex.tcl -@dirrm lib/Mpexpr10 |