summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Ospald <hasufell@gentoo.org>2013-02-16 15:39:18 +0000
committerJulian Ospald <hasufell@gentoo.org>2013-02-16 15:39:18 +0000
commit390f73201910fa1ab22857378fc08d748f9026ed (patch)
treebe544d6b2c2b29e1d15a3a9d4e8157bd7a73f001 /sci-mathematics
parentinitial import (diff)
downloadgentoo-2-390f73201910fa1ab22857378fc08d748f9026ed.tar.gz
gentoo-2-390f73201910fa1ab22857378fc08d748f9026ed.tar.bz2
gentoo-2-390f73201910fa1ab22857378fc08d748f9026ed.zip
initial import wrt #365595
(Portage version: 2.2.0_alpha162/cvs/Linux x86_64, signed Manifest commit with key E73C35B3)
Diffstat (limited to 'sci-mathematics')
-rw-r--r--sci-mathematics/rstudio/ChangeLog12
-rw-r--r--sci-mathematics/rstudio/Manifest11
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.318-linker_flags.patch18
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.318-paths.patch110
-rw-r--r--sci-mathematics/rstudio/files/rstudio-0.97.318-prefs.patch24
-rw-r--r--sci-mathematics/rstudio/files/rstudio-rserver.initd15
-rw-r--r--sci-mathematics/rstudio/metadata.xml12
-rw-r--r--sci-mathematics/rstudio/rstudio-0.97.318.ebuild134
8 files changed, 336 insertions, 0 deletions
diff --git a/sci-mathematics/rstudio/ChangeLog b/sci-mathematics/rstudio/ChangeLog
new file mode 100644
index 000000000000..dd7c804b92a0
--- /dev/null
+++ b/sci-mathematics/rstudio/ChangeLog
@@ -0,0 +1,12 @@
+# ChangeLog for sci-mathematics/rstudio
+# Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/rstudio/ChangeLog,v 1.1 2013/02/16 15:39:18 hasufell Exp $
+
+*rstudio-0.97.318 (16 Feb 2013)
+
+ 16 Feb 2013; Julian Ospald <hasufell@gentoo.org> +rstudio-0.97.318.ebuild,
+ +files/rstudio-0.97.318-linker_flags.patch,
+ +files/rstudio-0.97.318-paths.patch, +files/rstudio-0.97.318-prefs.patch,
+ +files/rstudio-rserver.initd, +metadata.xml:
+ initial import wrt #365595
+
diff --git a/sci-mathematics/rstudio/Manifest b/sci-mathematics/rstudio/Manifest
new file mode 100644
index 000000000000..b396e7f6abcf
--- /dev/null
+++ b/sci-mathematics/rstudio/Manifest
@@ -0,0 +1,11 @@
+AUX rstudio-0.97.318-linker_flags.patch 806 SHA256 9fa104ef1fc659aeda8108d2a6418679685ae8d0a19e3f5f97a634ad1d1d05d8 SHA512 2049077768ef72faf502387b5eeef80948d0ec748bc52df7bff6e507dd92a8c52b3a7f7f82eda526ea1289f16720ae51fd40c059bd2d04f5eacd51911b995f06 WHIRLPOOL df36ec2fd3c3e9bced79b6f29ecfbeebde8df6a7873f5de8d46ac0ca7f26c7851426c8b869de12ad302d7c152fa2212af25ed4b52e123f324d92cc7085e6e772
+AUX rstudio-0.97.318-paths.patch 5418 SHA256 6973516ee72f19df412e6b7739fa0d18f337328ca74d009564b5f3e93d3f5470 SHA512 bfe3a0c2903e804773e4325f655de18097ce30534fd6d8cf6ff5a54f976de170b4e37d86eae2d812411131fa96e1eef7f3a3fbd951c35082fab478fd72a4d0fc WHIRLPOOL 50ae21a068b63b644a033fc25dff8599c95bf869b64f1bfd0a200484f61d15f7deba3ac565efd02b09e9fc92e10fb4f429ab28eabb2c3b95dfb3cac8c5b97fb8
+AUX rstudio-0.97.318-prefs.patch 1008 SHA256 ae5bcb603cdd112adb9f5929b9cf15b33db36a9f9efc76bd24fb67855e99150f SHA512 2edd5dee1d59ed2abc64c2f68f354bd0c2d23de649790e956112131988de68d649a09ce9cd893d2715f656e90cabfee8a67f9ef98464b5fc2a6eb17d29e4a50e WHIRLPOOL 83f7f85f2c40a21697db1a5af9f28de80a802005e910a78905b4b45d66accfec03e67fb1c35cc7091eedf9f7d98bcd89e427e200b999edf1b206e1115fe2aac7
+AUX rstudio-rserver.initd 376 SHA256 b35b3807e7748a372b9968ce35d0adf5a72641c7f1c3551af3c8d14f84cfefec SHA512 1ff6fa9078841a885e080cae62d12478cc536333059ab850516cd8de405378188b6d503ce1edf6afaead85cf96466d71befb239cf4691d6f103fc4fcc88d47de WHIRLPOOL 464346a10ac2843c1b75145793fafc4fe5432d9dc254c94964d0c2486edfbf462f9a5901af4a48a04075262037d182faa9d6aba18f0099e618fa983c4ea5255b
+DIST core-dictionaries.zip 876339 SHA256 4341a9630efb9dcf7f215c324136407f3b3d6003e1c96f2e5e1f9f14d5787494 SHA512 9c5830cc9fed575e223f1c61f02e48c5aea6801bb0cd2586f02437c17fdffdb1d36c396d5a8ecbe02ba01196e73458304345b1f6b92c052bc7a7d05961fac2c9 WHIRLPOOL 316dced8ac46e4216613b0b850c33d4c1e10ef0ecd954d786eb131ea80b34e66ba3d39a0ef25b45230b64ded415737ddabef8f7d68f4d42caea98679cff44ee0
+DIST gin-1.5.zip 1055663 SHA256 f561f4eb5d5fe1cff95c881e6aed53a86e9f0de8a52863295a8600375f96ab94 SHA512 3f6649565f9600daaca6ddf3fb431925b5a1ce1ada38e6389de64cef617abba9d3f49c555d0a20053fb06f17ccbe4e1141b39966fbe4b2975d7b120377504897 WHIRLPOOL e66d348ed275eb20518369c39592a5a03ee4257422e2947520385377939de65a54d131332818362a47597392026db48ed1332f11ae218e336798498ae5d5b196
+DIST gwt-2.5.0.rc1.zip 104156555 SHA256 83a6dec583d1b7f3bf3fd2e321d89c1d95881eed1f81c7ea4056201fc105258b SHA512 c0c4f502b4ca191537eada53eb0458c0d33282661423f6d2648e6107ed8e38465b189377fcd0d9babcbf2c688e16080d33cbd7165ed20dafda7fedc39a74e163 WHIRLPOOL b37f12d1937b6479b97e274a59a1856dcf0c5cc3b767b6a19f65d7807e1f32cc2483358f1414c4c9e427d890eb1e0617fe8af84c6f0dca4a9ded64ae5ffde129
+DIST rstudio-0.97.318.tar.gz 12597967 SHA256 170782aeee1c92e877abbac141b1516d52875f699b4dbfed44fe8f97f831beae SHA512 510e44c569809193cc0bf9b2cbdc80315671e245aa0871941dd93e7c9c435be03a4bf5aa29d2ce14b7cd1da2e67c0ddc8621fb025d3958d2c5ab00713d7c0c2f WHIRLPOOL 33e298ec68ce7600cd622e74801fe1d0a08e97f776aa3f22f4303258b1380b822236f41d99a4cd6956bd6cef07ab5a03b8a16ed7d09e9342745ebfc38c510eee
+EBUILD rstudio-0.97.318.ebuild 3571 SHA256 bcd91e3987d08b9581bcf62e993527129415d750e7898ef70bb55e7cd265a969 SHA512 76cf6af0224f85aa750b1bad7d3815690679d7a76c8455d023f3b81d1ae2c463434d5f1c59d54c6c4bb14237039b6c2ec06264eccb26efb0eaa50917b71f6a56 WHIRLPOOL a4a3e4f0258792fe6c940d6afcab723c0dc4c68dcaf8ec6c57298ee65cf812b0ae7bc93e95727bd1543631bdf26d623607e1133ffc1cac001fd1b0f992387595
+MISC ChangeLog 433 SHA256 a3416bb505d682f7e768335a1b153a7607db6c7b708b98fd1ecab9ddf74fdd6b SHA512 cc49cbb246f4e0ac6a531a8884604fdda1b6c26f410503d9b4f62661b7dd8517ce1bfb4b4809214e402d0d27e12e5a0be13d30e193f15d7da3a62c3d4ce08f4f WHIRLPOOL 8d078f586456ed03d6565bbc9149d72c7824c9a30d40c3f690c8eb1201adfecdf2cc78d2628d57768174b226cbc775609f39a53c2cf75196d377ed8315608ab2
+MISC metadata.xml 430 SHA256 61f8638cafeca0d069c78ff09631bf562cb57d014ec584755ca1952bffb08da3 SHA512 0e453df0f6e3c3ecc22ede56fe08f1a0deb37f05d958dac81541037cf5e2be0a5dd6080cf3ff559099192c86ad5de54a8856212be7d361eb43de886323383ff4 WHIRLPOOL 8471df38079716c1125ca176507b6f282707f472399998eaa8a70cf2571c0fa2334174d0020093642bf5d02b995a0fd55c6b1b67ec4854124c21450279da33c5
diff --git a/sci-mathematics/rstudio/files/rstudio-0.97.318-linker_flags.patch b/sci-mathematics/rstudio/files/rstudio-0.97.318-linker_flags.patch
new file mode 100644
index 000000000000..a336fccbc981
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-0.97.318-linker_flags.patch
@@ -0,0 +1,18 @@
+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.
+
+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.97.318-paths.patch b/sci-mathematics/rstudio/files/rstudio-0.97.318-paths.patch
new file mode 100644
index 000000000000..26f11f5bfac5
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-0.97.318-paths.patch
@@ -0,0 +1,110 @@
+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.
+
+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.97.318-prefs.patch b/sci-mathematics/rstudio/files/rstudio-0.97.318-prefs.patch
new file mode 100644
index 000000000000..3175d47235ab
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-0.97.318-prefs.patch
@@ -0,0 +1,24 @@
+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/
+
+diff --git a/src/gwt/build.xml b/src/gwt/build.xml
+index e7d2418..ae3a331 100644
+--- a/src/gwt/build.xml
++++ b/src/gwt/build.xml
+@@ -25,6 +25,7 @@
+ <property name="gwt.extra.args" value=""/>
+ <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 environment="env"/>
+
+ <path id="project.class.path">
+ <pathelement location="bin"/>
+@@ -109,6 +110,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 000000000000..37a684cdd76f
--- /dev/null
+++ b/sci-mathematics/rstudio/files/rstudio-rserver.initd
@@ -0,0 +1,15 @@
+#!/sbin/runscript
+# Copyright 1999-2013 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 000000000000..9d47eb22c762
--- /dev/null
+++ b/sci-mathematics/rstudio/metadata.xml
@@ -0,0 +1,12 @@
+<?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='server'>Build and install the RStudio server</flag>
+</use>
+</pkgmetadata>
diff --git a/sci-mathematics/rstudio/rstudio-0.97.318.ebuild b/sci-mathematics/rstudio/rstudio-0.97.318.ebuild
new file mode 100644
index 000000000000..241b0a9ec59d
--- /dev/null
+++ b/sci-mathematics/rstudio/rstudio-0.97.318.ebuild
@@ -0,0 +1,134 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sci-mathematics/rstudio/rstudio-0.97.318.ebuild,v 1.1 2013/02/16 15:39:18 hasufell Exp $
+
+EAPI=5
+
+inherit eutils user cmake-utils gnome2-utils pam versionator fdo-mime java-pkg-2
+
+# TODO
+# * package gin and gwt
+# * use dict from tree, linguas
+# * do src_test (use junit from tree?)
+# * fix the about/help/menu and get rid of license
+
+GWTVER=2.5.0.rc1
+GINVER=1.5
+
+DESCRIPTION="IDE for the R language"
+HOMEPAGE="http://www.rstudio.org"
+SRC_URI="https://github.com/rstudio/rstudio/archive/v${PV}.tar.gz -> ${P}.tar.gz
+ https://s3.amazonaws.com/rstudio-buildtools/gin-${GINVER}.zip
+ https://s3.amazonaws.com/rstudio-buildtools/gwt-${GWTVER}.zip
+ https://s3.amazonaws.com/rstudio-dictionaries/core-dictionaries.zip"
+
+LICENSE="AGPL-3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="dedicated server"
+
+QTVER=4.8
+QTSLOT=4
+RDEPEND=">=dev-lang/R-2.11.1
+ >=dev-libs/boost-1.50
+ dev-libs/mathjax
+ dev-libs/openssl
+ >=virtual/jre-1.5
+ x11-libs/pango
+ !dedicated? (
+ >=x11-libs/qt-core-${QTVER}:${QTSLOT}
+ >=x11-libs/qt-dbus-${QTVER}:${QTSLOT}
+ >=x11-libs/qt-gui-${QTVER}:${QTSLOT}
+ >=x11-libs/qt-webkit-${QTVER}:${QTSLOT}
+ >=x11-libs/qt-xmlpatterns-${QTVER}:${QTSLOT}
+ server? ( virtual/pam )
+ )
+ dedicated? ( virtual/pam )"
+DEPEND="${RDEPEND}
+ app-arch/unzip
+ dev-java/ant-core
+ >=virtual/jdk-1.5
+ virtual/pkgconfig"
+# test? ( dev-java/junit:4 )
+
+src_unpack() {
+ unpack ${P}.tar.gz gwt-${GWTVER}.zip
+ cd "${S}" || die
+ mkdir -p src/gwt/lib/{gin,gwt} dependencies/common/dictionaries || die
+ mv ../gwt-${GWTVER} src/gwt/lib/gwt/${GWTVER} || die
+ unzip -qd src/gwt/lib/gin/${GINVER} "${DISTDIR}"/gin-${GINVER}.zip || die
+ unzip -qd dependencies/common/dictionaries "${DISTDIR}"/core-dictionaries.zip || die
+}
+
+src_prepare() {
+ java-pkg-2_src_prepare
+
+ find . -name .gitignore -delete || die
+
+ epatch "${FILESDIR}"/${P}-prefs.patch \
+ "${FILESDIR}"/${P}-paths.patch \
+ "${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 -sf "${EPREFIX}"/usr/share/mathjax dependencies/common/mathjax || die
+
+ # 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}
+ $(cmake-utils_use !dedicated RSTUDIO_INSTALL_FREEDESKTOP)
+ -DRSTUDIO_TARGET=$(usex dedicated "Server" "$(usex server "All" "Desktop")")
+ )
+
+ cmake-utils_src_configure
+}
+
+src_compile() {
+ cmake-utils_src_compile
+}
+
+src_install() {
+ cmake-utils_src_install
+ if use dedicated || use server; then
+ dopamd src/cpp/server/extras/pam/rstudio
+ newinitd "${FILESDIR}"/rstudio-rserver.initd rstudio-rserver
+ fi
+}
+
+pkg_preinst() {
+ use dedicated || gnome2_icon_savelist
+ java-pkg-2_pkg_preinst
+}
+
+pkg_postinst() {
+ use dedicated || { fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+ gnome2_icon_cache_update ;}
+
+ if use dedicated || use server; then
+ enewgroup rstudio-server
+ enewuser rstudio-server -1 -1 -1 rstudio-server
+ fi
+}
+
+pkg_postrm() {
+ use dedicated || { fdo-mime_desktop_database_update
+ fdo-mime_mime_database_update
+ gnome2_icon_cache_update ;}
+}