[rkward/frameworks] macports: macports: removed old patches, added new KF5 portfile (binary bundles)

m.eik michalke null at kde.org
Tue Mar 27 18:44:19 UTC 2018


Git commit d590c30e101bfc73932493c2aee6d78ff60c44a2 by m.eik michalke.
Committed on 27/03/2018 at 17:02.
Pushed by meikm into branch 'frameworks'.

macports: removed old patches, added new KF5 portfile (binary bundles)

D  +0    -47   macports/kde/rkward-devel/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff
D  +0    -47   macports/kde/rkward/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff
A  +128  -0    macports/kf5/kf5-rkward-binary/Portfile
A  +10   -0    macports/kf5/kf5-rkward-binary/files/rkward.rbackend.sh

https://commits.kde.org/rkward/d590c30e101bfc73932493c2aee6d78ff60c44a2

diff --git a/macports/kde/rkward-devel/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff b/macports/kde/rkward-devel/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff
deleted file mode 100644
index d2437839..00000000
--- a/macports/kde/rkward-devel/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff
+++ /dev/null
@@ -1,47 +0,0 @@
-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);
diff --git a/macports/kde/rkward/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff b/macports/kde/rkward/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff
deleted file mode 100644
index d2437839..00000000
--- a/macports/kde/rkward/files/patch-rkward-rbackend-rkstructuregetter.cpp.diff
+++ /dev/null
@@ -1,47 +0,0 @@
-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);
diff --git a/macports/kf5/kf5-rkward-binary/Portfile b/macports/kf5/kf5-rkward-binary/Portfile
new file mode 100755
index 00000000..516d2222
--- /dev/null
+++ b/macports/kf5/kf5-rkward-binary/Portfile
@@ -0,0 +1,128 @@
+# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
+# $Id$
+# Copyright (c) 2015, 2016 R.J.V. Bertin
+
+PortSystem          1.0
+
+set kf5.project     rkward-binary
+set kf5.virtualPath applications
+set kf5.category    education
+PortGroup           kf5 1.1
+# kf5.use_latest      applications-not-yet
+
+maintainers         hhu.de:meik.michalke gmail.com:rjvbertin mk openmaintainer
+
+fetch.type          git
+git.url             https://anongit.kde.org/rkward.git
+worksrcdir          ${kf5.project}-5
+
+installs_libs       no
+
+description         KF5 extensible IDE/GUI for the R statistics language
+long_description    RKWard is an easy to use and easily extensible IDE/GUI for R. \
+                    It aims to combine the power of the R-language with the ease of use of commercial statistics tools.
+conflicts           port:rkward rkward-devel rkward-binary rkward-devel-binary kf5-rkward
+
+homepage            https://rkward.kde.org/
+
+subport ${name}-devel {
+    description     ${description} This port follows git/frameworks
+    long_description \
+                    ${long_description} This port follows git/frameworks
+}
+
+############
+# configure R to use Mac binaries by default
+# you must first install the OS X packages of CRAN R, as we'll link against them
+if {${subport} eq "${name}-devel"} {
+    conflicts-append \
+                    ${name}
+    fetch.type      git
+#    git.url         git://anongit.kde.org/rkward
+#     v0.6.5-201-g9585a62
+    git.branch      frameworks
+    version         0.6.9z
+    distname        ${kf5.project}-5
+} else {
+############
+# stable release, subport used for binary bundles
+    conflicts-append \
+                    ${name}-devel
+    description     ${description} This port doesn't have a release version yet.
+    long_description \
+                    ${long_description} This port doesn't have a release version yet.
+    use_xz          yes
+    pre-fetch {
+        ui_error "This port doesn't have a release version yet."
+        return -code error "This port doesn't have a release version yet."
+    }
+    checksums       rmd160  0 \
+                    sha256  0
+    version             0.7.0
+    git.url             http://anongit.kde.org/rkward.git
+    git.branch          releases/0.7.0
+}
+
+configure.args-delete \
+        -DR_EXECUTABLE=${frameworks_dir}/R.framework/Resources/R
+
+configure.args-append \
+        -DNO_R_XML=1 \
+        -DRKVERSION_NUMBER=${version} \
+        -DUSE_BINARY_PACKAGES=1 \
+        -DR_EXECUTABLE=/Library/Frameworks/R.framework/Resources/R \
+        -DR_LIBDIR=${frameworks_dir}/R.framework/Resources/library \
+        -DR_EXECUTABLE=${frameworks_dir}/R.framework/Resources/R
+#        -DBUNDLE_INSTALL_DIR=${applications_dir} \
+
+# create libdir if it doesn't exist
+file mkdir ${frameworks_dir}/R.framework/Resources/library
+
+kf5.depends_qt5_components \
+                    qtscript qtwebkit
+kf5.depends_frameworks \
+                    kconfig kcoreaddons kcrash kdewebkit \
+                    kdoctools ki18n knotifications kparts \
+                    ktexteditor kwidgetsaddons kwindowsystem kxmlgui
+
+depends_lib-append \
+                    port:gettext
+
+depends_lib-delete \
+                    port:R
+
+depends_run-append  ${kf5::osx-integration_dep}
+
+kf5.allow_apidocs_generation no
+
+patch.pre_args      -Np1
+
+post-extract {
+        file mkdir ${worksrcpath}/build
+        # need to fetch the plugin translations first
+        if [file exists ${worksrcpath}/i18n/po] {
+            system "cd ${worksrcpath}/i18n/po && git pull --rebase"
+        } else {
+            system "cd ${worksrcpath}/i18n && git clone http://anongit.kde.org/scratch/tfry/rkward-po-export po"
+        }
+}
+
+configure.dir       ${worksrcpath}/build
+
+configure.post_args ..
+
+build.dir           ${worksrcpath}/build
+
+post-destroot {
+    kf5.add_app_wrapper rkward5 rkward
+    platform linux {
+        file rename ${destroot}${kf5.libexec_dir}/rkward.rbackend ${destroot}${kf5.libexec_dir}/rkward.rbackend.bin
+        xinstall -m 755 ${filespath}/rkward.rbackend.sh ${destroot}${kf5.libexec_dir}/rkward.rbackend
+        reinplace "s|@QTLIBDIR@|${qt_libs_dir}|g" ${destroot}${kf5.libexec_dir}/rkward.rbackend
+    }
+}
+
+pre-pkg {
+        file copy -force -- ${worksrcpath}/macports/postinstall ${package.scripts}/postinstall
+        file attributes ${package.scripts}/postinstall -permissions 0755
+}
diff --git a/macports/kf5/kf5-rkward-binary/files/rkward.rbackend.sh b/macports/kf5/kf5-rkward-binary/files/rkward.rbackend.sh
new file mode 100755
index 00000000..4b17482d
--- /dev/null
+++ b/macports/kf5/kf5-rkward-binary/files/rkward.rbackend.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+if [ "${LD_LIBRARY_PATH}" != "" ] ;then
+	# make sure that our Qt5 rpath is not masked by one from the host
+	# R tends to mess this up so we have to clean up behind it
+	export LD_LIBRARY_PATH="@QTLIBDIR@:${LD_LIBRARY_PATH}"
+	printenv 1>&2
+fi
+
+exec ${0}.bin "$@"



More information about the rkward-tracker mailing list