Gentoo Archives: gentoo-commits

From: Sebastien Fabbro <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/sci:master commit in: sci-mathematics/rstudio/, sci-mathematics/rstudio/files/
Date: Fri, 29 Jun 2012 20:34:43
Message-Id: 1341001919.26ab7b99ac596bbc38421020666973047d218069.bicatali@gentoo
1 commit: 26ab7b99ac596bbc38421020666973047d218069
2 Author: Sebastien Fabbro <sfabbro <AT> uvic <DOT> ca>
3 AuthorDate: Fri Jun 29 20:31:59 2012 +0000
4 Commit: Sebastien Fabbro <bicatali <AT> gentoo <DOT> org>
5 CommitDate: Fri Jun 29 20:31:59 2012 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/sci.git;a=commit;h=26ab7b99
7
8 sci-mathematics/rstudio: initial import
9
10 ---
11 sci-mathematics/rstudio/ChangeLog | 12 ++
12 .../files/rstudio-0.96.316-linker_flags.patch | 13 ++
13 .../rstudio/files/rstudio-0.96.316-paths.patch | 106 +++++++++++++++
14 .../rstudio/files/rstudio-0.96.316-prefs.patch | 20 +++
15 .../rstudio/files/rstudio-rserver.initd | 15 ++
16 sci-mathematics/rstudio/metadata.xml | 13 ++
17 sci-mathematics/rstudio/rstudio-0.96.316.ebuild | 140 ++++++++++++++++++++
18 7 files changed, 319 insertions(+), 0 deletions(-)
19
20 diff --git a/sci-mathematics/rstudio/.Rhistory b/sci-mathematics/rstudio/.Rhistory
21 new file mode 100644
22 index 0000000..e69de29
23
24 diff --git a/sci-mathematics/rstudio/ChangeLog b/sci-mathematics/rstudio/ChangeLog
25 new file mode 100644
26 index 0000000..c85d8ca
27 --- /dev/null
28 +++ b/sci-mathematics/rstudio/ChangeLog
29 @@ -0,0 +1,12 @@
30 +# ChangeLog for sci-mathematics/rstudio
31 +# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
32 +# $Header: $
33 +
34 +*rstudio-0.96.316 (29 Jun 2012)
35 +
36 + 29 Jun 2012; Sebastien Fabbro <fabbros@g.o> +rstudio-0.96.316.ebuild,
37 + +files/rstudio-0.96.316-linker_flags.patch,
38 + +files/rstudio-0.96.316-paths.patch, +files/rstudio-0.96.316-prefs.patch,
39 + +.Rhistory, +files/rstudio-rserver.initd, +metadata.xml:
40 + Initial import. Ebuild inspired from Eric Johnson and others, bug #365595
41 +
42
43 diff --git a/sci-mathematics/rstudio/files/rstudio-0.96.316-linker_flags.patch b/sci-mathematics/rstudio/files/rstudio-0.96.316-linker_flags.patch
44 new file mode 100644
45 index 0000000..e68399d
46 --- /dev/null
47 +++ b/sci-mathematics/rstudio/files/rstudio-0.96.316-linker_flags.patch
48 @@ -0,0 +1,13 @@
49 +diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
50 +index 0589ca0..fe5bd5f 100644
51 +--- a/src/cpp/CMakeLists.txt
52 ++++ b/src/cpp/CMakeLists.txt
53 +@@ -57,7 +57,7 @@ if(UNIX)
54 + add_definitions(-D_FORTIFY_SOURCE=2)
55 + add_definitions(-fstack-protector --param ssp-buffer-size=4)
56 + add_definitions(-pie -fPIE)
57 +- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro,-z,now")
58 ++ set(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,relro,-z,now ${CMAKE_EXE_LINKER_FLAGS}")
59 + endif()
60 +
61 + # Win32 specific global directives
62
63 diff --git a/sci-mathematics/rstudio/files/rstudio-0.96.316-paths.patch b/sci-mathematics/rstudio/files/rstudio-0.96.316-paths.patch
64 new file mode 100644
65 index 0000000..917e220
66 --- /dev/null
67 +++ b/sci-mathematics/rstudio/files/rstudio-0.96.316-paths.patch
68 @@ -0,0 +1,106 @@
69 +diff --git a/CMakeGlobals.txt b/CMakeGlobals.txt
70 +index da74970..1537bff 100644
71 +--- a/CMakeGlobals.txt
72 ++++ b/CMakeGlobals.txt
73 +@@ -103,7 +103,7 @@ else()
74 + else()
75 + set(RSTUDIO_INSTALL_BIN bin)
76 + endif()
77 +- set(RSTUDIO_INSTALL_SUPPORTING .)
78 ++ set(RSTUDIO_INSTALL_SUPPORTING ${DISTRO_SHARE})
79 + endif()
80 +
81 + # if the install prefix is /usr/local then tweak as appropriate
82 +diff --git a/src/cpp/server/CMakeLists.txt b/src/cpp/server/CMakeLists.txt
83 +index af4db1c..96b767e 100644
84 +--- a/src/cpp/server/CMakeLists.txt
85 ++++ b/src/cpp/server/CMakeLists.txt
86 +@@ -142,7 +142,7 @@ if (UNIX AND NOT APPLE)
87 + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_INITD_DEBIAN_SCRIPT}.in
88 + ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_DEBIAN_SCRIPT})
89 + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_DEBIAN_SCRIPT}
90 +- DESTINATION ${RSERVER_INITD_DEBIAN_DIR})
91 ++ DESTINATION ${DISTRO_SHARE}/${RSERVER_INITD_DEBIAN_DIR})
92 +
93 + # install configured redhat init.d script
94 + set(RSERVER_INITD_REDHAT_DIR "extras/init.d/redhat")
95 +@@ -150,7 +150,7 @@ if (UNIX AND NOT APPLE)
96 + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_INITD_REDHAT_SCRIPT}.in
97 + ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_REDHAT_SCRIPT})
98 + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_REDHAT_SCRIPT}
99 +- DESTINATION ${RSERVER_INITD_REDHAT_DIR})
100 ++ DESTINATION ${DISTRO_SHARE}/${RSERVER_INITD_REDHAT_DIR})
101 +
102 + # install configured suse init.d script
103 + set(RSERVER_INITD_SUSE_DIR "extras/init.d/suse")
104 +@@ -158,13 +158,13 @@ if (UNIX AND NOT APPLE)
105 + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_INITD_SUSE_SCRIPT}.in
106 + ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_SUSE_SCRIPT})
107 + install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_SUSE_SCRIPT}
108 +- DESTINATION ${RSERVER_INITD_SUSE_DIR})
109 ++ DESTINATION ${DISTRO_SHARE}/${RSERVER_INITD_SUSE_DIR})
110 +
111 + # install pam profile
112 + set(RSERVER_PAM_DIR "extras/pam")
113 + set(RSERVER_PAM_PROFILE "${RSERVER_PAM_DIR}/rstudio")
114 + install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_PAM_PROFILE}
115 +- DESTINATION ${RSERVER_PAM_DIR})
116 ++ DESTINATION ${DISTRO_SHARE}/${RSERVER_PAM_DIR})
117 +
118 + # install configured apparmor profile
119 + set(RSERVER_APPARMOR_DIR "extras/apparmor")
120 +@@ -172,9 +172,9 @@ if (UNIX AND NOT APPLE)
121 + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_APPARMOR_PROFILE}.in
122 + ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_APPARMOR_PROFILE})
123 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_APPARMOR_PROFILE}
124 +- DESTINATION ${RSERVER_APPARMOR_DIR})
125 ++ DESTINATION ${DISTRO_SHARE}/${RSERVER_APPARMOR_DIR})
126 + install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_APPARMOR_DIR}/apparmor-profile-load
127 +- DESTINATION ${RSERVER_APPARMOR_DIR})
128 ++ DESTINATION ${DISTRO_SHARE}/${RSERVER_APPARMOR_DIR})
129 +
130 + # install configured upstart profile
131 + set(RSERVER_UPSTART_DIR "extras/upstart")
132 +@@ -182,6 +182,6 @@ if (UNIX AND NOT APPLE)
133 + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_UPSTART_PROFILE}.in
134 + ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_UPSTART_PROFILE})
135 + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_UPSTART_PROFILE}
136 +- DESTINATION ${RSERVER_UPSTART_DIR})
137 ++ DESTINATION ${DISTRO_SHARE}/${RSERVER_UPSTART_DIR})
138 +
139 + endif()
140 +diff --git a/src/cpp/server/ServerOptions.cpp b/src/cpp/server/ServerOptions.cpp
141 +index 77a63f1..f0d25f0 100644
142 +--- a/src/cpp/server/ServerOptions.cpp
143 ++++ b/src/cpp/server/ServerOptions.cpp
144 +@@ -201,7 +201,7 @@ ProgramStatus Options::read(int argc, char * const argv[])
145 +
146 + // convert relative paths by completing from the system installation
147 + // path (this allows us to be relocatable)
148 +- resolvePath(installPath, &wwwLocalPath_);
149 ++ resolvePath(installPath.childPath(DISTRO_SHARE), &wwwLocalPath_);
150 + resolvePath(installPath, &authPamHelperPath_);
151 + resolvePath(installPath, &rsessionPath_);
152 + resolvePath(installPath, &rldpathPath_);
153 +diff --git a/src/cpp/session/SessionOptions.cpp b/src/cpp/session/SessionOptions.cpp
154 +index 0df1081..777cc6a 100644
155 +--- a/src/cpp/session/SessionOptions.cpp
156 ++++ b/src/cpp/session/SessionOptions.cpp
157 +@@ -314,12 +314,12 @@ core::ProgramStatus Options::read(int argc, char * const argv[])
158 + }
159 +
160 + // convert relative paths by completing from the app resource path
161 +- resolvePath(resourcePath, &rResourcesPath_);
162 ++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &rResourcesPath_);
163 + resolvePath(resourcePath, &agreementFilePath_);
164 +- resolvePath(resourcePath, &wwwLocalPath_);
165 +- resolvePath(resourcePath, &coreRSourcePath_);
166 +- resolvePath(resourcePath, &modulesRSourcePath_);
167 +- resolvePath(resourcePath, &sessionPackagesPath_);
168 ++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &wwwLocalPath_);
169 ++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &coreRSourcePath_);
170 ++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &modulesRSourcePath_);
171 ++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &sessionPackagesPath_);
172 + resolvePostbackPath(resourcePath, &rpostbackPath_);
173 + #ifdef _WIN32
174 + resolvePath(resourcePath, &consoleIoPath_);
175
176 diff --git a/sci-mathematics/rstudio/files/rstudio-0.96.316-prefs.patch b/sci-mathematics/rstudio/files/rstudio-0.96.316-prefs.patch
177 new file mode 100644
178 index 0000000..0d5401c
179 --- /dev/null
180 +++ b/sci-mathematics/rstudio/files/rstudio-0.96.316-prefs.patch
181 @@ -0,0 +1,20 @@
182 +diff --git a/src/gwt/build.xml b/src/gwt/build.xml
183 +index 6581bd9..36eadc1 100644
184 +--- a/src/gwt/build.xml
185 ++++ b/src/gwt/build.xml
186 +@@ -26,6 +26,7 @@
187 + <property name="gwt.main.module" value="org.rstudio.studio.RStudio"/>
188 + <property name="ace.bin" value="src/org/rstudio/studio/client/workbench/views/source/editors/text/ace"/>
189 + <property name="json2.bin" value="www/js"/>
190 ++ <property environment="env"/>
191 +
192 + <path id="project.class.path">
193 + <pathelement location="bin"/>
194 +@@ -102,6 +103,7 @@
195 + </classpath>
196 + <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
197 + <jvmarg value="-Xmx1024M"/>
198 ++ <jvmarg value="-Djava.util.prefs.userRoot=${env.T}"/>
199 + <arg value="-war"/>
200 + <arg value="www"/>
201 + <arg value="-localWorkers"/>
202
203 diff --git a/sci-mathematics/rstudio/files/rstudio-rserver.initd b/sci-mathematics/rstudio/files/rstudio-rserver.initd
204 new file mode 100644
205 index 0000000..a74f240
206 --- /dev/null
207 +++ b/sci-mathematics/rstudio/files/rstudio-rserver.initd
208 @@ -0,0 +1,15 @@
209 +#!/sbin/runscript
210 +# Copyright 1999-2012 Gentoo Foundation
211 +# Distributed under the terms of the GNU General Public License v2
212 +
213 +start() {
214 + ebegin "Starting RStudio Server"
215 + start-stop-daemon --start --quiet --exec /usr/bin/rserver
216 + eend $?
217 +}
218 +
219 +stop() {
220 + ebegin "Stopping RStudio Server"
221 + start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name /usr/bin/rserver
222 + eend $?
223 +}
224
225 diff --git a/sci-mathematics/rstudio/metadata.xml b/sci-mathematics/rstudio/metadata.xml
226 new file mode 100644
227 index 0000000..d76a14f
228 --- /dev/null
229 +++ b/sci-mathematics/rstudio/metadata.xml
230 @@ -0,0 +1,13 @@
231 +<?xml version="1.0" encoding="UTF-8"?>
232 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
233 +<pkgmetadata>
234 +<herd>sci-mathematics</herd>
235 +<longdescription lang="en">
236 + RStudio is an integrated development environment (IDE) for R. It can
237 + run it on a desktop or even over the web using RStudio Server.
238 +</longdescription>
239 +<use>
240 + <flag name='desktop'>Build the QT4 desktop interface</flag>
241 + <flag name='server'>Build and install the RStudio server</flag>
242 +</use>
243 +</pkgmetadata>
244
245 diff --git a/sci-mathematics/rstudio/rstudio-0.96.316.ebuild b/sci-mathematics/rstudio/rstudio-0.96.316.ebuild
246 new file mode 100644
247 index 0000000..c2f9e78
248 --- /dev/null
249 +++ b/sci-mathematics/rstudio/rstudio-0.96.316.ebuild
250 @@ -0,0 +1,140 @@
251 +# Copyright 1999-2012 Gentoo Foundation
252 +# Distributed under the terms of the GNU General Public License v2
253 +# $Header: $
254 +
255 +EAPI=4
256 +
257 +inherit eutils cmake-utils pam versionator fdo-mime java-pkg-2
258 +
259 +# TODO
260 +# * make sure icon/menu and mime type work
261 +# * work out server (see package/linux/debian-control/*)
262 +# * package gin and gwt
263 +# * use dict from tree, linguas
264 +# * use java-pkg-2 eclass
265 +# * do src_test (use junit from tree?)
266 +# * fix the about/help/menu and get rid of license
267 +# * desktop flag -> qt4 flag?
268 +# * more prefix love
269 +
270 +GWTVER=2.4.0
271 +GINVER=1.5
272 +
273 +DESCRIPTION="IDE for the R language"
274 +HOMEPAGE="http://www.rstudio.org"
275 +SRC_URI="https://github.com/${PN}/${PN}/tarball/v${PV} -> ${P}.tar.gz
276 + https://s3.amazonaws.com/${PN}-buildtools/gin-${GINVER}.zip
277 + https://s3.amazonaws.com/${PN}-buildtools/gwt-${GWTVER}.zip
278 + https://s3.amazonaws.com/${PN}-dictionaries/core-dictionaries.zip"
279 +
280 +LICENSE="AGPL-3"
281 +SLOT="0"
282 +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
283 +IUSE="+desktop server test"
284 +
285 +QTVER=4.8
286 +RDEPEND="dev-lang/R
287 + >=dev-libs/boost-1.42
288 + dev-libs/mathjax
289 + dev-libs/openssl
290 + >=virtual/jre-1.5
291 + x11-libs/pango
292 + desktop? ( >=x11-libs/qt-core-${QTVER}
293 + >=x11-libs/qt-dbus-${QTVER}
294 + >=x11-libs/qt-gui-${QTVER}
295 + >=x11-libs/qt-webkit-${QTVER}
296 + >=x11-libs/qt-xmlpatterns-${QTVER} )
297 + server? ( virtual/pam )"
298 +DEPEND="${RDEPEND}
299 + app-arch/unzip
300 + dev-java/ant-core
301 + >=virtual/jdk-1.5
302 + virtual/pkgconfig"
303 +# test? ( dev-java/junit:4 )
304 +
305 +REQUIRED_USE="!server? ( desktop ) !desktop? ( server )"
306 +
307 +src_unpack() {
308 + unpack ${P}.tar.gz gwt-${GWTVER}.zip
309 + mv rstudio-rstudio-* ${P}
310 + cd "${S}"
311 + mkdir -p src/gwt/lib/{gin,gwt} dependencies/common/dictionaries || die
312 + mv ../gwt-${GWTVER} src/gwt/lib/gwt/${GWTVER}
313 + unzip -qd src/gwt/lib/gin/${GINVER} "${DISTDIR}"/gin-${GINVER}.zip || die
314 + unzip -qd dependencies/common/dictionaries "${DISTDIR}"/core-dictionaries.zip || die
315 +}
316 +
317 +src_prepare() {
318 + find . -name .gitignore -delete
319 + # And now we fix src/gwt/build.xml since java's user preference class is
320 + # braindead and insists on writing where it is not allowed.
321 + # much thanks to http://www.allaboutbalance.com/articles/disableprefs/
322 + epatch "${FILESDIR}"/${P}-prefs.patch
323 + # change the install path, as by default everything is dumped right under
324 + # the prefix. After fixing install paths, now fix the source so the
325 + # program can find the moved resources.
326 + epatch "${FILESDIR}"/${P}-paths.patch
327 + # Some gcc hardening options were added, however since we add
328 + # "-Wl,--as-needed" we end up with "-Wl,--as-needed;-Wl,-z,relro" which
329 + # leads to linker errors about unknown options, if we make it so the
330 + # as-needed option is the last option on the line, everything is fine.
331 + epatch "${FILESDIR}"/${P}-linker_flags.patch
332 + # Adding -DDISTRO_SHARE=... to append-flags breaks cmake so using
333 + # this sed hack for now. ~RMH
334 + sed -i \
335 + -e "s|DISTRO_SHARE|\"share/${PN}\"|g" \
336 + src/cpp/server/ServerOptions.cpp \
337 + src/cpp/session/SessionOptions.cpp || die
338 + # use mathjax from system
339 + ln -s "${EPREFIX}"/usr/share/mathjax dependencies/common/mathjax
340 + # make sure icons and mime stuff are with prefix
341 + sed -i \
342 + -e "s:/usr:${EPREFIX}/usr:g" \
343 + CMakeGlobals.txt src/cpp/desktop/CMakeLists.txt || die
344 +}
345 +
346 +src_configure() {
347 + export RSTUDIO_VERSION_MAJOR=$(get_version_component_range 1)
348 + export RSTUDIO_VERSION_MINOR=$(get_version_component_range 2)
349 + export RSTUDIO_VERSION_PATCH=$(get_version_component_range 3)
350 + local mycmakeargs=( -DDISTRO_SHARE=share/${PN} )
351 + if use server; then
352 + if use desktop; then
353 + mycmakeargs+=(
354 + -DRSTUDIO_INSTALL_FREEDESKTOP=ON
355 + -DRSTUDIO_TARGET=All )
356 + else
357 + mycmakeargs+=( -DRSTUDIO_TARGET=Server )
358 + fi
359 + else
360 + mycmakeargs+=(
361 + -DRSTUDIO_INSTALL_FREEDESKTOP=ON
362 + -DRSTUDIO_TARGET=Desktop
363 + )
364 + fi
365 + cmake-utils_src_configure
366 +}
367 +
368 +src_compile() {
369 + cmake-utils_src_compile
370 +}
371 +
372 +src_install() {
373 + cmake-utils_src_install
374 + if use server; then
375 + dopamd src/cpp/server/extras/pam/rstudio
376 + newinitd "${FILESDIR}"/rstudio-rserver.initd rstudio-rserver
377 + fi
378 +}
379 +
380 +pkg_postinst() {
381 + use desktop && fdo-mime_mime_database_update
382 + if use server; then
383 + enewgroup rstudio-server
384 + enewuser rstudio-server -1 -1 -1 rstudio-server
385 + fi
386 +}
387 +
388 +pkg_postrm() {
389 + use desktop && fdo-mime_mime_database_update
390 +}