[rkward-cvs] SF.net SVN: rkward-code:[4788] trunk/rkward/macports/kde/rkward

m-eik at users.sf.net m-eik at users.sf.net
Wed Apr 30 10:46:24 UTC 2014


Revision: 4788
          http://sourceforge.net/p/rkward/code/4788
Author:   m-eik
Date:     2014-04-30 10:46:23 +0000 (Wed, 30 Apr 2014)
Log Message:
-----------
MacPorts: added patch for 0.6.1 release, fixes build problems

Modified Paths:
--------------
    trunk/rkward/macports/kde/rkward/Portfile

Added Paths:
-----------
    trunk/rkward/macports/kde/rkward/files/
    trunk/rkward/macports/kde/rkward/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff

Modified: trunk/rkward/macports/kde/rkward/Portfile
===================================================================
--- trunk/rkward/macports/kde/rkward/Portfile	2014-04-29 20:05:19 UTC (rev 4787)
+++ trunk/rkward/macports/kde/rkward/Portfile	2014-04-30 10:46:23 UTC (rev 4788)
@@ -8,6 +8,7 @@
 version             0.6.1
 svn.url             http://svn.code.sf.net/p/rkward/code/branches/release_branches/rkward_${version}
 svn.revision        4635
+patchfiles          patch-rkward-rbackend-rkstructuregetter.cpp.diff
 worksrcdir          ${name}_${version}
 
 conflicts           rkward-devel

Added: trunk/rkward/macports/kde/rkward/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff
===================================================================
--- trunk/rkward/macports/kde/rkward/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff	                        (rev 0)
+++ trunk/rkward/macports/kde/rkward/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff	2014-04-30 10:46:23 UTC (rev 4788)
@@ -0,0 +1,47 @@
+Index: rkward/rbackend/rkstructuregetter.cpp
+===================================================================
+--- rkward/rbackend/rkstructuregetter.cpp	(revision 4653)
++++ rkward/rbackend/rkstructuregetter.cpp	(revision 4660)
+@@ -193,22 +193,33 @@
+ 
+ 	// get classes
+ 	SEXP classes_s;
++	QStringList classes;
+ 
+ 	if ((TYPEOF (value) == LANGSXP) || (TYPEOF (value) == SYMSXP)) {	// if it's a call, we should NEVER send it through eval
+-		extern SEXP R_data_class (SEXP, Rboolean);
+-		classes_s = R_data_class (value, (Rboolean) 0);
++		// stripped down and adjusted from R_data_class
++		PROTECT (classes_s = Rf_getAttrib (value, R_ClassSymbol));
++		if (Rf_length (classes_s)) classes = RKRSupport::SEXPToStringList(classes_s);
++		UNPROTECT (1);
++		if (classes.isEmpty ()) {
++			if (TYPEOF (value) == LANGSXP) {
++				SEXP symb = PROTECT (CAR (value));
++				QString cl;
++				if (TYPEOF (symb) == SYMSXP) cl = CHAR (PRINTNAME (symb));
++				UNPROTECT (1);
++				if ((cl != "if") && (cl != "while") && (cl != "for") && (cl != "=") && (cl != "<-") && (cl != "(") && (cl != "{")) cl = "call";
++				classes = QStringList (cl);
++			} else {
++				classes = QStringList ("name");
++			}
++		}
+ 
+ 		REPROTECT (value = Rf_coerceVector (value, EXPRSXP), value_index);	// make sure the object is safe for everything to come
+-
+-		PROTECT (classes_s);
+ 	} else {
+-		classes_s = RKRSupport::callSimpleFun (class_fun, value, baseenv);
+-		PROTECT (classes_s);
++		PROTECT (classes_s = RKRSupport::callSimpleFun (class_fun, value, baseenv));
++		classes = RKRSupport::SEXPToStringList (classes_s);
++		UNPROTECT (1);
+ 	}
+ 
+-	QStringList classes = RKRSupport::SEXPToStringList (classes_s);
+-	UNPROTECT (1);	/* classes_s */
+-
+ 	// store classes
+ 	RData *classdata = new RData;
+ 	classdata->setData (classes);





More information about the rkward-tracker mailing list