aboutsummaryrefslogtreecommitdiffstats
path: root/science
diff options
context:
space:
mode:
authorgahr <gahr@FreeBSD.org>2013-06-04 17:33:05 +0800
committergahr <gahr@FreeBSD.org>2013-06-04 17:33:05 +0800
commit3719c843bb6ee0e907a6d9a5b93e343db519c5d6 (patch)
tree0a51c9cd494ac22c00470206922128d78cddab76 /science
parent8fcaaa211f364511bc74225b343b1e7f31491a4a (diff)
downloadfreebsd-ports-gnome-3719c843bb6ee0e907a6d9a5b93e343db519c5d6.tar.gz
freebsd-ports-gnome-3719c843bb6ee0e907a6d9a5b93e343db519c5d6.tar.zst
freebsd-ports-gnome-3719c843bb6ee0e907a6d9a5b93e343db519c5d6.zip
- Fix build with Tcl/Tk 8.6
Reported by: miwi (Tcl/Tk 8.6 exp-run late comers) Approved by: maintainer (via private email)
Diffstat (limited to 'science')
-rw-r--r--science/cgnslib/Makefile2
-rw-r--r--science/cgnslib/files/patch-tcl8678
2 files changed, 79 insertions, 1 deletions
diff --git a/science/cgnslib/Makefile b/science/cgnslib/Makefile
index 91e22b14e505..63a119c6b436 100644
--- a/science/cgnslib/Makefile
+++ b/science/cgnslib/Makefile
@@ -49,7 +49,7 @@ TESTSBIN= cgwrite cgread test_partial
.endif
.if ${PORT_OPTIONS:MTOOLS}
-USE_TK= 85
+USE_TK= yes
USE_GL= gl glu
USE_XORG= xmu
CMAKE_ARGS+= -DBUILD_CGNSTOOLS:BOOL=TRUE \
diff --git a/science/cgnslib/files/patch-tcl86 b/science/cgnslib/files/patch-tcl86
new file mode 100644
index 000000000000..2ee2e188b436
--- /dev/null
+++ b/science/cgnslib/files/patch-tcl86
@@ -0,0 +1,78 @@
+--- src/cgnstools/tkogl/tkogl.c.orig 2011-02-12 23:43:48.000000000 +0100
++++ src/cgnstools/tkogl/tkogl.c 2013-06-03 18:10:06.000000000 +0200
+@@ -641,7 +641,7 @@
+ ARRANGE_REDRAW(glxwinPtr);
+ GetAbsXY (glxwinPtr);
+
+- interp->result = Tk_PathName(glxwinPtr->tkwin);
++ Tcl_SetObjResult(interp, Tcl_NewStringObj(Tk_PathName(glxwinPtr->tkwin), -1));
+ return TCL_OK;
+ }
+
+@@ -998,7 +998,7 @@
+ argv += narg;
+ }
+ glEndList();
+- if (result == TCL_OK) sprintf (interp->result, "%d", newlist);
++ if (result == TCL_OK) Tcl_SetObjResult(interp, Tcl_NewIntObj(newlist));
+ }
+ else if ((c == 'e') && (strncmp(argv[1], "eval", length) == 0)) {
+ /* sends the gl commands directly */
+@@ -1090,7 +1090,13 @@
+ viewport, &x, &y, &z);
+ }
+ if (retval) {
++#if TCL_MAJOR_VERSION < 8 || (TCL_MAJOR_VERSION == 8 && TCL_MINOR_VERSION < 5)
+ sprintf (interp->result, "%f %f %f", x, y, z);
++#else
++ Tcl_Obj *obj = Tcl_NewObj ();
++ Tcl_AppendPrintfToObj (obj, "%f %f %f", x, y, z);
++ Tcl_SetObjResult (interp, obj);
++#endif
+ }
+ }
+ else if ((c == 'r') && (strncmp(argv[1], "redraw", length) == 0)) {
+--- src/cgnstools/tkogl/nurbs.c.orig 2013-06-03 18:05:02.000000000 +0200
++++ src/cgnstools/tkogl/nurbs.c 2013-06-03 18:05:31.000000000 +0200
+@@ -280,7 +280,7 @@
+ DestroyFloatArray (cPoint);
+
+ if (result == TCL_OK) {
+- sprintf (interp->result, "%d", dlist);
++ Tcl_SetObjResult (interp, Tcl_NewIntObj(dlist));
+ }
+
+ return result;
+--- src/cgnstools/tkogl/quadric.c.orig 2013-06-03 18:06:04.000000000 +0200
++++ src/cgnstools/tkogl/quadric.c 2013-06-03 18:06:28.000000000 +0200
+@@ -147,7 +147,7 @@
+ if (dlist != 0) glEndList(); else return result;
+
+ if (result == TCL_OK) {
+- sprintf (interp->result, "%d", dlist);
++ Tcl_SetObjResult (interp, Tcl_NewIntObj (dlist));
+ }
+ else {
+ glDeleteLists (dlist, 1);
+--- src/cgnstools/tkogl/tess.c.orig 2013-06-03 18:06:51.000000000 +0200
++++ src/cgnstools/tkogl/tess.c 2013-06-03 18:07:20.000000000 +0200
+@@ -122,7 +122,7 @@
+ }
+
+ if (dlist != 0) {
+- sprintf (interp->result, "%d", dlist);
++ Tcl_SetObjResult (interp, Tcl_NewIntObj (dlist));
+ }
+ return TCL_OK;
+ }
+--- src/cgnstools/tkogl/printstr.c.orig 2013-06-03 18:07:44.000000000 +0200
++++ src/cgnstools/tkogl/printstr.c 2013-06-03 18:08:14.000000000 +0200
+@@ -131,7 +131,7 @@
+ return TCL_ERROR;
+ }
+
+- sprintf (interp->result, "%d", fontOffset);
++ Tcl_SetObjResult (interp, Tcl_NewIntObj (fontOffset));
+ return TCL_OK;
+ }
+