aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Fabbro <sfabbro@uvic.ca>2012-06-29 13:31:59 -0700
committerSebastien Fabbro <sfabbro@uvic.ca>2012-06-29 13:31:59 -0700
commit26ab7b99ac596bbc38421020666973047d218069 (patch)
tree338bc93035ae6c5d27b3b17bef5e81eb9cde5ce3
parentdev-libs/mathjax: Initial import (diff)
downloadsci-26ab7b99ac596bbc38421020666973047d218069.tar.gz
sci-26ab7b99ac596bbc38421020666973047d218069.tar.bz2
sci-26ab7b99ac596bbc38421020666973047d218069.zip
sci-mathematics/rstudio: initial import
-rw-r--r--sci-mathematics/rstudio/.Rhistory0
-rw-r--r--sci-mathematics/rstudio/ChangeLog12
-rw-r--r--sci-mathematics/rstudio/Manifest4
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.96.316-linker_flags.patch13
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.96.316-paths.patch106
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.96.316-prefs.patch20
-rw-r--r--sci-mathematics/rstudio/files/rstudio-rserver.initd15
-rw-r--r--sci-mathematics/rstudio/metadata.xml13
-rw-r--r--sci-mathematics/rstudio/rstudio-0.96.316.ebuild140
9 files changed, 323 insertions, 0 deletions
diff --git a/sci-mathematics/rstudio/.Rhistory b/sci-mathematics/rstudio/.Rhistory
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/sci-mathematics/rstudio/.Rhistory
diff --git a/sci-mathematics/rstudio/ChangeLog b/sci-mathematics/rstudio/ChangeLog
new file mode 100644
index 000000000..c85d8caf8
--- /dev/null
+++ b/sci-mathematics/rstudio/ChangeLog
@@ -0,0 +1,12 @@
+# ChangeLog for sci-mathematics/rstudio
+# Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2
+# $Header: $
+
+*rstudio-0.96.316 (29 Jun 2012)
+
+ 29 Jun 2012; Sebastien Fabbro <fabbros@gentoo.org> +rstudio-0.96.316.ebuild,
+ +files/rstudio-0.96.316-linker_flags.patch,
+ +files/rstudio-0.96.316-paths.patch, +files/rstudio-0.96.316-prefs.patch,
+ +.Rhistory, +files/rstudio-rserver.initd, +metadata.xml:
+ Initial import. Ebuild inspired from Eric Johnson and others, bug #365595
+
diff --git a/sci-mathematics/rstudio/Manifest b/sci-mathematics/rstudio/Manifest
new file mode 100644
index 000000000..8d21bc68f
--- /dev/null
+++ b/sci-mathematics/rstudio/Manifest
@@ -0,0 +1,4 @@
+DIST core-dictionaries.zip 876339 RMD160 1f9e86729e4d7646ebd221cb0b1480d51a899009 SHA1 c09eba9fe08fc72934058a0add7b8e4ccca38da5 SHA256 4341a9630efb9dcf7f215c324136407f3b3d6003e1c96f2e5e1f9f14d5787494 SHA512 9c5830cc9fed575e223f1c61f02e48c5aea6801bb0cd2586f02437c17fdffdb1d36c396d5a8ecbe02ba01196e73458304345b1f6b92c052bc7a7d05961fac2c9 WHIRLPOOL 316dced8ac46e4216613b0b850c33d4c1e10ef0ecd954d786eb131ea80b34e66ba3d39a0ef25b45230b64ded415737ddabef8f7d68f4d42caea98679cff44ee0
+DIST gin-1.5.zip 1055663 RMD160 cde394d111b3af798935ab5391da79ef3173c8cb SHA1 211a257b78f4ea462d1d5e64641b6776d905b3c7 SHA256 f561f4eb5d5fe1cff95c881e6aed53a86e9f0de8a52863295a8600375f96ab94 SHA512 3f6649565f9600daaca6ddf3fb431925b5a1ce1ada38e6389de64cef617abba9d3f49c555d0a20053fb06f17ccbe4e1141b39966fbe4b2975d7b120377504897 WHIRLPOOL e66d348ed275eb20518369c39592a5a03ee4257422e2947520385377939de65a54d131332818362a47597392026db48ed1332f11ae218e336798498ae5d5b196
+DIST gwt-2.4.0.zip 89734508 RMD160 79d159ba2176a4b96d7cefdfcc557301ebb1d31d SHA1 a91ac20db0ddd5994ac3cbfb0e8061d5bbf66f88 SHA256 27d48a4b6df9de01eaf1bd3ba3971a8f32742886f67041ddc3cd9dbe01787ebf SHA512 7c64e4fdcf2114700112ea8258f91eed3c5c64ce1067100f86a4201eb4a2f9ba2b8d89663a3bd9c45b1a0555bd3d8b1dcabeb2b59b38ffc0ebb429bcad255ec2 WHIRLPOOL 94fa83ab291434e4975f7c526712dc6b0068ea96213d039b5483c8cc6b6bcd7ee7ebab3d00dc3b8202b25db34732d8b9af1a3fe1d02bc6189699baa2c24a6b82
+DIST rstudio-0.96.316.tar.gz 12424635 RMD160 4fa175d59a1ffa6a6847afc597836560b43f20ce SHA1 5a5b21d34a3e1c2f8abd53c95d298db9ed0410ba SHA256 301504831d08ce2efe90a15b0fecd305f0f83d52e6d2b9ea67eb70c99ed280e6 SHA512 51ac9ce01510b3385949d69ebf5b13dacbed2be751c870131def5531cb767e248e03342c69cc6e9e0986024e8f04fba3b0225104145fd05449e00bc795703272 WHIRLPOOL 4a778e7cfaa6acc6a8e972ee8403414055e780006b66576e97071e98e642169ca27a7f656ae406f8a698237fdff9e97f71d402dd88bf3278c6e6269dc1b2ed4e
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
new file mode 100644
index 000000000..e68399d13
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-0.96.316-linker_flags.patch
@@ -0,0 +1,13 @@
+diff --git a/src/cpp/CMakeLists.txt b/src/cpp/CMakeLists.txt
+index 0589ca0..fe5bd5f 100644
+--- a/src/cpp/CMakeLists.txt
++++ b/src/cpp/CMakeLists.txt
+@@ -57,7 +57,7 @@ if(UNIX)
+ add_definitions(-D_FORTIFY_SOURCE=2)
+ add_definitions(-fstack-protector --param ssp-buffer-size=4)
+ add_definitions(-pie -fPIE)
+- set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-z,relro,-z,now")
++ set(CMAKE_EXE_LINKER_FLAGS "-Wl,-z,relro,-z,now ${CMAKE_EXE_LINKER_FLAGS}")
+ endif()
+
+ # Win32 specific global directives
diff --git a/sci-mathematics/rstudio/files/rstudio-0.96.316-paths.patch b/sci-mathematics/rstudio/files/rstudio-0.96.316-paths.patch
new file mode 100644
index 000000000..917e2209d
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-0.96.316-paths.patch
@@ -0,0 +1,106 @@
+diff --git a/CMakeGlobals.txt b/CMakeGlobals.txt
+index da74970..1537bff 100644
+--- a/CMakeGlobals.txt
++++ b/CMakeGlobals.txt
+@@ -103,7 +103,7 @@ else()
+ else()
+ set(RSTUDIO_INSTALL_BIN bin)
+ endif()
+- set(RSTUDIO_INSTALL_SUPPORTING .)
++ set(RSTUDIO_INSTALL_SUPPORTING ${DISTRO_SHARE})
+ endif()
+
+ # if the install prefix is /usr/local then tweak as appropriate
+diff --git a/src/cpp/server/CMakeLists.txt b/src/cpp/server/CMakeLists.txt
+index af4db1c..96b767e 100644
+--- a/src/cpp/server/CMakeLists.txt
++++ b/src/cpp/server/CMakeLists.txt
+@@ -142,7 +142,7 @@ if (UNIX AND NOT APPLE)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_INITD_DEBIAN_SCRIPT}.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_DEBIAN_SCRIPT})
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_DEBIAN_SCRIPT}
+- DESTINATION ${RSERVER_INITD_DEBIAN_DIR})
++ DESTINATION ${DISTRO_SHARE}/${RSERVER_INITD_DEBIAN_DIR})
+
+ # install configured redhat init.d script
+ set(RSERVER_INITD_REDHAT_DIR "extras/init.d/redhat")
+@@ -150,7 +150,7 @@ if (UNIX AND NOT APPLE)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_INITD_REDHAT_SCRIPT}.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_REDHAT_SCRIPT})
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_REDHAT_SCRIPT}
+- DESTINATION ${RSERVER_INITD_REDHAT_DIR})
++ DESTINATION ${DISTRO_SHARE}/${RSERVER_INITD_REDHAT_DIR})
+
+ # install configured suse init.d script
+ set(RSERVER_INITD_SUSE_DIR "extras/init.d/suse")
+@@ -158,13 +158,13 @@ if (UNIX AND NOT APPLE)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_INITD_SUSE_SCRIPT}.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_SUSE_SCRIPT})
+ install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_INITD_SUSE_SCRIPT}
+- DESTINATION ${RSERVER_INITD_SUSE_DIR})
++ DESTINATION ${DISTRO_SHARE}/${RSERVER_INITD_SUSE_DIR})
+
+ # install pam profile
+ set(RSERVER_PAM_DIR "extras/pam")
+ set(RSERVER_PAM_PROFILE "${RSERVER_PAM_DIR}/rstudio")
+ install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_PAM_PROFILE}
+- DESTINATION ${RSERVER_PAM_DIR})
++ DESTINATION ${DISTRO_SHARE}/${RSERVER_PAM_DIR})
+
+ # install configured apparmor profile
+ set(RSERVER_APPARMOR_DIR "extras/apparmor")
+@@ -172,9 +172,9 @@ if (UNIX AND NOT APPLE)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_APPARMOR_PROFILE}.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_APPARMOR_PROFILE})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_APPARMOR_PROFILE}
+- DESTINATION ${RSERVER_APPARMOR_DIR})
++ DESTINATION ${DISTRO_SHARE}/${RSERVER_APPARMOR_DIR})
+ install(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_APPARMOR_DIR}/apparmor-profile-load
+- DESTINATION ${RSERVER_APPARMOR_DIR})
++ DESTINATION ${DISTRO_SHARE}/${RSERVER_APPARMOR_DIR})
+
+ # install configured upstart profile
+ set(RSERVER_UPSTART_DIR "extras/upstart")
+@@ -182,6 +182,6 @@ if (UNIX AND NOT APPLE)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${RSERVER_UPSTART_PROFILE}.in
+ ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_UPSTART_PROFILE})
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${RSERVER_UPSTART_PROFILE}
+- DESTINATION ${RSERVER_UPSTART_DIR})
++ DESTINATION ${DISTRO_SHARE}/${RSERVER_UPSTART_DIR})
+
+ endif()
+diff --git a/src/cpp/server/ServerOptions.cpp b/src/cpp/server/ServerOptions.cpp
+index 77a63f1..f0d25f0 100644
+--- a/src/cpp/server/ServerOptions.cpp
++++ b/src/cpp/server/ServerOptions.cpp
+@@ -201,7 +201,7 @@ ProgramStatus Options::read(int argc, char * const argv[])
+
+ // convert relative paths by completing from the system installation
+ // path (this allows us to be relocatable)
+- resolvePath(installPath, &wwwLocalPath_);
++ resolvePath(installPath.childPath(DISTRO_SHARE), &wwwLocalPath_);
+ resolvePath(installPath, &authPamHelperPath_);
+ resolvePath(installPath, &rsessionPath_);
+ resolvePath(installPath, &rldpathPath_);
+diff --git a/src/cpp/session/SessionOptions.cpp b/src/cpp/session/SessionOptions.cpp
+index 0df1081..777cc6a 100644
+--- a/src/cpp/session/SessionOptions.cpp
++++ b/src/cpp/session/SessionOptions.cpp
+@@ -314,12 +314,12 @@ core::ProgramStatus Options::read(int argc, char * const argv[])
+ }
+
+ // convert relative paths by completing from the app resource path
+- resolvePath(resourcePath, &rResourcesPath_);
++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &rResourcesPath_);
+ resolvePath(resourcePath, &agreementFilePath_);
+- resolvePath(resourcePath, &wwwLocalPath_);
+- resolvePath(resourcePath, &coreRSourcePath_);
+- resolvePath(resourcePath, &modulesRSourcePath_);
+- resolvePath(resourcePath, &sessionPackagesPath_);
++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &wwwLocalPath_);
++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &coreRSourcePath_);
++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &modulesRSourcePath_);
++ resolvePath(resourcePath.childPath(DISTRO_SHARE), &sessionPackagesPath_);
+ resolvePostbackPath(resourcePath, &rpostbackPath_);
+ #ifdef _WIN32
+ resolvePath(resourcePath, &consoleIoPath_);
diff --git a/sci-mathematics/rstudio/files/rstudio-0.96.316-prefs.patch b/sci-mathematics/rstudio/files/rstudio-0.96.316-prefs.patch
new file mode 100644
index 000000000..0d5401cf0
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-0.96.316-prefs.patch
@@ -0,0 +1,20 @@
+diff --git a/src/gwt/build.xml b/src/gwt/build.xml
+index 6581bd9..36eadc1 100644
+--- a/src/gwt/build.xml
++++ b/src/gwt/build.xml
+@@ -26,6 +26,7 @@
+ <property name="gwt.main.module" value="org.rstudio.studio.RStudio"/>
+ <property name="ace.bin" value="src/org/rstudio/studio/client/workbench/views/source/editors/text/ace"/>
+ <property name="json2.bin" value="www/js"/>
++ <property environment="env"/>
+
+ <path id="project.class.path">
+ <pathelement location="bin"/>
+@@ -102,6 +103,7 @@
+ </classpath>
+ <!-- add jvmarg -Xss16M or similar if you see a StackOverflowError -->
+ <jvmarg value="-Xmx1024M"/>
++ <jvmarg value="-Djava.util.prefs.userRoot=${env.T}"/>
+ <arg value="-war"/>
+ <arg value="www"/>
+ <arg value="-localWorkers"/>
diff --git a/sci-mathematics/rstudio/files/rstudio-rserver.initd b/sci-mathematics/rstudio/files/rstudio-rserver.initd
new file mode 100644
index 000000000..a74f240d2
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-rserver.initd
@@ -0,0 +1,15 @@
+#!/sbin/runscript
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+start() {
+ ebegin "Starting RStudio Server"
+ start-stop-daemon --start --quiet --exec /usr/bin/rserver
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping RStudio Server"
+ start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --name /usr/bin/rserver
+ eend $?
+}
diff --git a/sci-mathematics/rstudio/metadata.xml b/sci-mathematics/rstudio/metadata.xml
new file mode 100644
index 000000000..d76a14f70
--- /dev/null
+++ b/sci-mathematics/rstudio/metadata.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>sci-mathematics</herd>
+<longdescription lang="en">
+ RStudio is an integrated development environment (IDE) for R. It can
+ run it on a desktop or even over the web using RStudio Server.
+</longdescription>
+<use>
+ <flag name='desktop'>Build the QT4 desktop interface</flag>
+ <flag name='server'>Build and install the RStudio server</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-mathematics/rstudio/rstudio-0.96.316.ebuild b/sci-mathematics/rstudio/rstudio-0.96.316.ebuild
new file mode 100644
index 000000000..c2f9e78ed
--- /dev/null
+++ b/sci-mathematics/rstudio/rstudio-0.96.316.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2012 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI=4
+
+inherit eutils cmake-utils pam versionator fdo-mime java-pkg-2
+
+# TODO
+# * make sure icon/menu and mime type work
+# * work out server (see package/linux/debian-control/*)
+# * package gin and gwt
+# * use dict from tree, linguas
+# * use java-pkg-2 eclass
+# * do src_test (use junit from tree?)
+# * fix the about/help/menu and get rid of license
+# * desktop flag -> qt4 flag?
+# * more prefix love
+
+GWTVER=2.4.0
+GINVER=1.5
+
+DESCRIPTION="IDE for the R language"
+HOMEPAGE="http://www.rstudio.org"
+SRC_URI="https://github.com/${PN}/${PN}/tarball/v${PV} -> ${P}.tar.gz
+ https://s3.amazonaws.com/${PN}-buildtools/gin-${GINVER}.zip
+ https://s3.amazonaws.com/${PN}-buildtools/gwt-${GWTVER}.zip
+ https://s3.amazonaws.com/${PN}-dictionaries/core-dictionaries.zip"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="+desktop server test"
+
+QTVER=4.8
+RDEPEND="dev-lang/R
+ >=dev-libs/boost-1.42
+ dev-libs/mathjax
+ dev-libs/openssl
+ >=virtual/jre-1.5
+ x11-libs/pango
+ desktop? ( >=x11-libs/qt-core-${QTVER}
+ >=x11-libs/qt-dbus-${QTVER}
+ >=x11-libs/qt-gui-${QTVER}
+ >=x11-libs/qt-webkit-${QTVER}
+ >=x11-libs/qt-xmlpatterns-${QTVER} )
+ server? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ dev-java/ant-core
+ >=virtual/jdk-1.5
+ virtual/pkgconfig"
+# test? ( dev-java/junit:4 )
+
+REQUIRED_USE="!server? ( desktop ) !desktop? ( server )"
+
+src_unpack() {
+ unpack ${P}.tar.gz gwt-${GWTVER}.zip
+ mv rstudio-rstudio-* ${P}
+ cd "${S}"
+ mkdir -p src/gwt/lib/{gin,gwt} dependencies/common/dictionaries || die
+ mv ../gwt-${GWTVER} src/gwt/lib/gwt/${GWTVER}
+ unzip -qd src/gwt/lib/gin/${GINVER} "${DISTDIR}"/gin-${GINVER}.zip || die
+ unzip -qd dependencies/common/dictionaries "${DISTDIR}"/core-dictionaries.zip || die
+}
+
+src_prepare() {
+ find . -name .gitignore -delete
+ # And now we fix src/gwt/build.xml since java's user preference class is
+ # braindead and insists on writing where it is not allowed.
+ # much thanks to http://www.allaboutbalance.com/articles/disableprefs/
+ epatch "${FILESDIR}"/${P}-prefs.patch
+ # change the install path, as by default everything is dumped right under
+ # the prefix. After fixing install paths, now fix the source so the
+ # program can find the moved resources.
+ epatch "${FILESDIR}"/${P}-paths.patch
+ # Some gcc hardening options were added, however since we add
+ # "-Wl,--as-needed" we end up with "-Wl,--as-needed;-Wl,-z,relro" which
+ # leads to linker errors about unknown options, if we make it so the
+ # as-needed option is the last option on the line, everything is fine.
+ epatch "${FILESDIR}"/${P}-linker_flags.patch
+ # Adding -DDISTRO_SHARE=... to append-flags breaks cmake so using
+ # this sed hack for now. ~RMH
+ sed -i \
+ -e "s|DISTRO_SHARE|\"share/${PN}\"|g" \
+ src/cpp/server/ServerOptions.cpp \
+ src/cpp/session/SessionOptions.cpp || die
+ # use mathjax from system
+ ln -s "${EPREFIX}"/usr/share/mathjax dependencies/common/mathjax
+ # make sure icons and mime stuff are with prefix
+ sed -i \
+ -e "s:/usr:${EPREFIX}/usr:g" \
+ CMakeGlobals.txt src/cpp/desktop/CMakeLists.txt || die
+}
+
+src_configure() {
+ export RSTUDIO_VERSION_MAJOR=$(get_version_component_range 1)
+ export RSTUDIO_VERSION_MINOR=$(get_version_component_range 2)
+ export RSTUDIO_VERSION_PATCH=$(get_version_component_range 3)
+ local mycmakeargs=( -DDISTRO_SHARE=share/${PN} )
+ if use server; then
+ if use desktop; then
+ mycmakeargs+=(
+ -DRSTUDIO_INSTALL_FREEDESKTOP=ON
+ -DRSTUDIO_TARGET=All )
+ else
+ mycmakeargs+=( -DRSTUDIO_TARGET=Server )
+ fi
+ else
+ mycmakeargs+=(
+ -DRSTUDIO_INSTALL_FREEDESKTOP=ON
+ -DRSTUDIO_TARGET=Desktop
+ )
+ fi
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ cmake-utils_src_install
+ if use server; then
+ dopamd src/cpp/server/extras/pam/rstudio
+ newinitd "${FILESDIR}"/rstudio-rserver.initd rstudio-rserver
+ fi
+}
+
+pkg_postinst() {
+ use desktop && fdo-mime_mime_database_update
+ if use server; then
+ enewgroup rstudio-server
+ enewuser rstudio-server -1 -1 -1 rstudio-server
+ fi
+}
+
+pkg_postrm() {
+ use desktop && fdo-mime_mime_database_update
+}