1 |
commit: d6cbaf2df3b45b5a470ecca8cd7fedf56b074413 |
2 |
Author: Mark Wright <gienah <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 24 05:03:52 2020 +0000 |
4 |
Commit: Mark Wright <gienah <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 24 05:03:52 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d6cbaf2d |
7 |
|
8 |
sci-mathematics/rstudio: Fix build with R 4.0.0 |
9 |
|
10 |
Thanks to Francois Valenduc for reporting. |
11 |
|
12 |
Closes: https://bugs.gentoo.org/722850 |
13 |
Package-Manager: Portage-2.3.99, Repoman-2.3.22 |
14 |
Signed-off-by: Mark Wright <gienah <AT> gentoo.org> |
15 |
|
16 |
.../rstudio/files/rstudio-1.2.5042-R-4.0.0.patch | 106 +++++++++++++++++++++ |
17 |
sci-mathematics/rstudio/rstudio-1.2.5033.ebuild | 1 + |
18 |
sci-mathematics/rstudio/rstudio-1.2.5042.ebuild | 1 + |
19 |
3 files changed, 108 insertions(+) |
20 |
|
21 |
diff --git a/sci-mathematics/rstudio/files/rstudio-1.2.5042-R-4.0.0.patch b/sci-mathematics/rstudio/files/rstudio-1.2.5042-R-4.0.0.patch |
22 |
new file mode 100644 |
23 |
index 00000000000..87ec83a7d4a |
24 |
--- /dev/null |
25 |
+++ b/sci-mathematics/rstudio/files/rstudio-1.2.5042-R-4.0.0.patch |
26 |
@@ -0,0 +1,106 @@ |
27 |
+From 71b1a935762efd24a79de193662450de5a89f67e Mon Sep 17 00:00:00 2001 |
28 |
+From: Jonathan McPherson <jonathan@×××××××.com> |
29 |
+Date: Tue, 14 Jan 2020 12:53:20 -0800 |
30 |
+Subject: [PATCH] use R_NoSave over R_Slave for R 4.0+ |
31 |
+ |
32 |
+--- |
33 |
+ src/cpp/r/CMakeLists.txt | 12 ++++++++++++ |
34 |
+ src/cpp/r/config.h.in | 8 +++++++- |
35 |
+ src/cpp/r/session/REmbeddedPosix.cpp | 20 ++++++++++++++------ |
36 |
+ 3 files changed, 33 insertions(+), 7 deletions(-) |
37 |
+ |
38 |
+diff --git a/src/cpp/r/CMakeLists.txt b/src/cpp/r/CMakeLists.txt |
39 |
+index 6984ae309c..29784b8b67 100644 |
40 |
+--- a/src/cpp/r/CMakeLists.txt |
41 |
++++ b/src/cpp/r/CMakeLists.txt |
42 |
+@@ -15,6 +15,18 @@ |
43 |
+ |
44 |
+ project (R) |
45 |
+ |
46 |
++# find the version of R in play |
47 |
++find_package(LibR REQUIRED) |
48 |
++execute_process( |
49 |
++ COMMAND "${LIBR_EXECUTABLE}" "--vanilla" "--slave" "-e" "cat(as.character(getRversion()))" |
50 |
++ OUTPUT_VARIABLE LIBR_VERSION) |
51 |
++ |
52 |
++# parse and save the R version to a variable |
53 |
++string(REPLACE "." ";" R_VERSION_LIST "${LIBR_VERSION}") |
54 |
++list(GET R_VERSION_LIST 0 R_VERSION_MAJOR) |
55 |
++list(GET R_VERSION_LIST 1 R_VERSION_MINOR) |
56 |
++list(GET R_VERSION_LIST 2 R_VERSION_PATCH) |
57 |
++ |
58 |
+ # include files |
59 |
+ file(GLOB_RECURSE R_HEADER_FILES "*.h*") |
60 |
+ |
61 |
+diff --git a/src/cpp/r/config.h.in b/src/cpp/r/config.h.in |
62 |
+index 6ba67c8e09..00bc8b6191 100644 |
63 |
+--- a/src/cpp/r/config.h.in |
64 |
++++ b/src/cpp/r/config.h.in |
65 |
+@@ -1,7 +1,7 @@ |
66 |
+ /* |
67 |
+ * config.h.in |
68 |
+ * |
69 |
+- * Copyright (C) 2009-12 by RStudio, Inc. |
70 |
++ * Copyright (C) 2009-20 by RStudio, Inc. |
71 |
+ * |
72 |
+ * Unless you have received this program directly from RStudio pursuant |
73 |
+ * to the terms of a commercial license agreement with RStudio, then |
74 |
+@@ -16,4 +16,10 @@ |
75 |
+ |
76 |
+ #cmakedefine PANGO_CAIRO_FOUND |
77 |
+ |
78 |
++// Important: These variables represent the version of R found during |
79 |
++// compile/link time, NOT the version of R present at runtime. |
80 |
++#define R_VERSION_MAJOR ${R_VERSION_MAJOR} |
81 |
++#define R_VERSION_MINOR ${R_VERSION_MINOR} |
82 |
++#define R_VERSION_PATCH ${R_VERSION_PATCH} |
83 |
++ |
84 |
+ |
85 |
+diff --git a/src/cpp/r/session/REmbeddedPosix.cpp b/src/cpp/r/session/REmbeddedPosix.cpp |
86 |
+index ac71b94522..73e2e2ce7f 100644 |
87 |
+--- a/src/cpp/r/session/REmbeddedPosix.cpp |
88 |
++++ b/src/cpp/r/session/REmbeddedPosix.cpp |
89 |
+@@ -1,7 +1,7 @@ |
90 |
+ /* |
91 |
+ * REmbeddedPosix.cpp |
92 |
+ * |
93 |
+- * Copyright (C) 2009-12 by RStudio, Inc. |
94 |
++ * Copyright (C) 2009-20 by RStudio, Inc. |
95 |
+ * |
96 |
+ * Unless you have received this program directly from RStudio pursuant |
97 |
+ * to the terms of a commercial license agreement with RStudio, then |
98 |
+@@ -38,6 +38,8 @@ extern "C" void (*ptr_R_ProcessEvents)(void); |
99 |
+ extern "C" typedef void (*ptr_QuartzCocoa_SetupEventLoop)(int, unsigned long); |
100 |
+ #endif |
101 |
+ |
102 |
++#include "config.h" |
103 |
++ |
104 |
+ extern int R_running_as_main_program; // from unix/system.c |
105 |
+ |
106 |
+ using namespace rstudio::core; |
107 |
+@@ -103,14 +105,20 @@ void runEmbeddedR(const core::FilePath& /*rHome*/, // ignored on posix |
108 |
+ // |
109 |
+ structRstart rp; |
110 |
+ Rstart Rp = &rp; |
111 |
+- R_DefParams(Rp) ; |
112 |
+- Rp->R_Slave = FALSE ; |
113 |
++ R_DefParams(Rp); |
114 |
++#if R_VERSION_MAJOR > 3 |
115 |
++ // R 4.0 and above use --no-echo to suppress output |
116 |
++ Rp->R_NoEcho = FALSE; |
117 |
++#else |
118 |
++ // R 3.x and below use --slave |
119 |
++ Rp->R_Slave = FALSE; |
120 |
++#endif |
121 |
+ Rp->R_Quiet = quiet ? TRUE : FALSE; |
122 |
+- Rp->R_Interactive = TRUE ; |
123 |
+- Rp->SaveAction = defaultSaveAction ; |
124 |
++ Rp->R_Interactive = TRUE; |
125 |
++ Rp->SaveAction = defaultSaveAction; |
126 |
+ Rp->RestoreAction = SA_NORESTORE; // handled within initialize() |
127 |
+ Rp->LoadInitFile = loadInitFile ? TRUE : FALSE; |
128 |
+- R_SetParams(Rp) ; |
129 |
++ R_SetParams(Rp); |
130 |
+ |
131 |
+ // redirect console |
132 |
+ R_Interactive = TRUE; // should have also been set by call to Rf_initialize_R |
133 |
|
134 |
diff --git a/sci-mathematics/rstudio/rstudio-1.2.5033.ebuild b/sci-mathematics/rstudio/rstudio-1.2.5033.ebuild |
135 |
index 77f9349a116..09ff6e9c516 100644 |
136 |
--- a/sci-mathematics/rstudio/rstudio-1.2.5033.ebuild |
137 |
+++ b/sci-mathematics/rstudio/rstudio-1.2.5033.ebuild |
138 |
@@ -100,6 +100,7 @@ PATCHES=( |
139 |
"${FILESDIR}"/${PN}-1.2.1335-boost-1.70.0_p1.patch |
140 |
"${FILESDIR}"/${PN}-1.2.1335-boost-1.70.0_p2.patch |
141 |
"${FILESDIR}"/${PN}-1.2.5042-boost-1.73.0.patch |
142 |
+ "${FILESDIR}"/${PN}-1.2.5042-R-4.0.0.patch |
143 |
) |
144 |
|
145 |
src_unpack() { |
146 |
|
147 |
diff --git a/sci-mathematics/rstudio/rstudio-1.2.5042.ebuild b/sci-mathematics/rstudio/rstudio-1.2.5042.ebuild |
148 |
index 4fadf59d2d1..6c4943d4513 100644 |
149 |
--- a/sci-mathematics/rstudio/rstudio-1.2.5042.ebuild |
150 |
+++ b/sci-mathematics/rstudio/rstudio-1.2.5042.ebuild |
151 |
@@ -100,6 +100,7 @@ PATCHES=( |
152 |
"${FILESDIR}"/${PN}-1.2.1335-boost-1.70.0_p1.patch |
153 |
"${FILESDIR}"/${PN}-1.2.1335-boost-1.70.0_p2.patch |
154 |
"${FILESDIR}"/${PN}-1.2.5042-boost-1.73.0.patch |
155 |
+ "${FILESDIR}"/${PN}-1.2.5042-R-4.0.0.patch |
156 |
) |
157 |
|
158 |
src_unpack() { |