rstudio-0.98.1091.ebuild 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils user cmake-utils gnome2-utils pam versionator fdo-mime java-pkg-2 pax-utils
  5. # TODO
  6. # * package gin and gwt
  7. # * use dict from tree, linguas
  8. # * do src_test (use junit from tree?)
  9. # update from scripts in dependencies/common
  10. GWTVER=2.6.0
  11. GINVER=1.5
  12. SELENIUMVER=2.37.0
  13. CHROMEDRIVER_VER=2.7
  14. PANDOC_VER=1.12.4.2
  15. PACKRAT_VER=0.98.1000
  16. RMARKDOWN_VER=0.98.1000
  17. SHINYAPPS_VER=0.98.1000
  18. DESCRIPTION="IDE for the R language"
  19. HOMEPAGE="
  20. http://www.rstudio.org
  21. https://github.com/rstudio/rstudio/"
  22. SRC_URI="
  23. https://github.com/rstudio/rstudio/archive/v${PV}.tar.gz -> ${P}.tar.gz
  24. https://s3.amazonaws.com/rstudio-buildtools/gin-${GINVER}.zip
  25. https://s3.amazonaws.com/rstudio-buildtools/gwt-${GWTVER}.zip
  26. https://s3.amazonaws.com/rstudio-buildtools/selenium-java-${SELENIUMVER}.zip
  27. https://s3.amazonaws.com/rstudio-buildtools/selenium-server-standalone-${SELENIUMVER}.jar
  28. https://s3.amazonaws.com/rstudio-buildtools/chromedriver-linux
  29. https://s3.amazonaws.com/rstudio-dictionaries/core-dictionaries.zip
  30. https://dev.gentoo.org/~gienah/distfiles/packrat-${PACKRAT_VER}.tar.gz
  31. https://dev.gentoo.org/~gienah/distfiles/rmarkdown-${RMARKDOWN_VER}.tar.gz
  32. https://dev.gentoo.org/~gienah/distfiles/shinyapps-${SHINYAPPS_VER}.tar.gz"
  33. LICENSE="AGPL-3"
  34. SLOT="0"
  35. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
  36. IUSE="dedicated server"
  37. QTVER=4.8
  38. QTSLOT=4
  39. RDEPEND="
  40. app-text/pandoc
  41. dev-haskell/pandoc-citeproc
  42. >=dev-lang/R-2.11.1
  43. >=dev-libs/boost-1.50:=
  44. >=dev-libs/mathjax-2.3
  45. dev-libs/openssl:0
  46. sys-apps/util-linux
  47. sys-libs/zlib
  48. >=virtual/jre-1.5:=
  49. x11-libs/pango
  50. !dedicated? (
  51. >=dev-qt/qtcore-${QTVER}:${QTSLOT}
  52. >=dev-qt/qtdbus-${QTVER}:${QTSLOT}
  53. >=dev-qt/qtgui-${QTVER}:${QTSLOT}
  54. >=dev-qt/qtwebkit-${QTVER}:${QTSLOT}
  55. >=dev-qt/qtxmlpatterns-${QTVER}:${QTSLOT}
  56. server? ( virtual/pam )
  57. )
  58. dedicated? ( virtual/pam )"
  59. DEPEND="${RDEPEND}
  60. app-arch/unzip
  61. dev-java/ant-core
  62. >=virtual/jdk-1.5
  63. virtual/pkgconfig"
  64. # test? ( dev-java/junit:4 )
  65. src_unpack() {
  66. unpack ${P}.tar.gz gwt-${GWTVER}.zip
  67. cd "${S}" || die
  68. mkdir -p src/gwt/lib/{gin,gwt} \
  69. dependencies/common/dictionaries \
  70. src/gwt/lib/selenium/${SELENIUMVER} \
  71. src/gwt/lib/selenium/chromedriver/${CHROMEDRIVER_VER} || die
  72. mv ../gwt-${GWTVER} src/gwt/lib/gwt/${GWTVER} || die
  73. unzip -qd src/gwt/lib/gin/${GINVER} \
  74. "${DISTDIR}"/gin-${GINVER}.zip || die
  75. unzip -qd dependencies/common/dictionaries \
  76. "${DISTDIR}"/core-dictionaries.zip || die
  77. unzip -qd src/gwt/lib/selenium/${SELENIUMVER} \
  78. "${DISTDIR}"/selenium-java-${SELENIUMVER}.zip || die
  79. cp "${DISTDIR}"/selenium-server-standalone-${SELENIUMVER}.jar \
  80. src/gwt/lib/selenium/${SELENIUMVER}/ || die
  81. cp "${DISTDIR}"/chromedriver-linux \
  82. src/gwt/lib/selenium/chromedriver/${CHROMEDRIVER_VER}/ || die
  83. cd dependencies/common || die
  84. unpack packrat-${PACKRAT_VER}.tar.gz
  85. unpack rmarkdown-${RMARKDOWN_VER}.tar.gz
  86. unpack shinyapps-${RMARKDOWN_VER}.tar.gz
  87. cp "${DISTDIR}"/rmarkdown-${RMARKDOWN_VER}.tar.gz \
  88. . || die
  89. cp "${DISTDIR}"/packrat-${PACKRAT_VER}.tar.gz \
  90. . || die
  91. cp "${DISTDIR}"/shinyapps-${SHINYAPPS_VER}.tar.gz \
  92. . || die
  93. }
  94. src_prepare() {
  95. java-pkg-2_src_prepare
  96. egit_clean
  97. epatch \
  98. "${FILESDIR}"/${PN}-0.98.490-prefs.patch \
  99. "${FILESDIR}"/${PN}-0.98.932-paths.patch \
  100. "${FILESDIR}"/${PN}-0.98.1091-pandoc.patch \
  101. "${FILESDIR}"/${PN}-0.98.490-linker_flags.patch \
  102. "${FILESDIR}"/${PN}-0.98.1091-boost-1.57.patch
  103. # Adding -DDISTRO_SHARE=... to append-flags breaks cmake so using
  104. # this sed hack for now. ~RMH
  105. sed -i \
  106. -e "s|DISTRO_SHARE|\"share/${PN}\"|g" \
  107. src/cpp/server/ServerOptions.cpp \
  108. src/cpp/session/SessionOptions.cpp || die
  109. # use mathjax from system
  110. ln -sf "${EPREFIX}"/usr/share/mathjax dependencies/common/mathjax-23 || die
  111. # make sure icons and mime stuff are with prefix
  112. sed -i \
  113. -e "s:/usr:${EPREFIX}/usr:g" \
  114. CMakeGlobals.txt src/cpp/desktop/CMakeLists.txt || die
  115. # specify that namespace core the is in the global namespace and not
  116. # relative to some other namespace (like its ::core not ::boost::core)
  117. find . \( -name *.cpp -or -name *.hpp \) -exec sed \
  118. -e 's@<core::@< ::core::@g' -e 's@\([^:]\)core::@\1::core::@g' -i {} \;
  119. # On Gentoo the rstudio-server configuration file is /etc/conf.d/rstudio-server.conf
  120. sed -e "s@/etc/rstudio/rserver.conf@${EROOT}etc/conf.d/rstudio-server.conf@" \
  121. -i src/cpp/server/ServerOptions.cpp \
  122. || die
  123. # Set the rsession.conf file location for Gentoo prefix
  124. sed -e "s@/etc/rstudio/rsession.conf@${EROOT}etc/rstudio/rsession.conf@" \
  125. -i src/cpp/session/SessionOptions.cpp \
  126. || die
  127. }
  128. src_configure() {
  129. export RSTUDIO_VERSION_MAJOR=$(get_version_component_range 1)
  130. export RSTUDIO_VERSION_MINOR=$(get_version_component_range 2)
  131. export RSTUDIO_VERSION_PATCH=$(get_version_component_range 3)
  132. local mycmakeargs=(
  133. -DDISTRO_SHARE=share/${PN}
  134. $(cmake-utils_use !dedicated RSTUDIO_INSTALL_FREEDESKTOP)
  135. -DRSTUDIO_TARGET=$(usex dedicated "Server" "$(usex server "Development" "Desktop")")
  136. )
  137. cmake-utils_src_configure
  138. }
  139. src_compile() {
  140. cmake-utils_src_compile
  141. }
  142. src_install() {
  143. cmake-utils_src_install
  144. pax-mark m "${ED}usr/bin/rstudio"
  145. doconfd "${FILESDIR}"/rstudio-server.conf
  146. dodir /etc/rstudio
  147. insinto /etc/rstudio
  148. doins "${FILESDIR}"/rsession.conf
  149. dosym /etc/conf.d/rstudio-server.conf /etc/rstudio/rserver.conf
  150. if use dedicated || use server; then
  151. dopamd src/cpp/server/extras/pam/rstudio
  152. newinitd "${FILESDIR}"/rstudio-server.initd rstudio-server
  153. fi
  154. }
  155. pkg_preinst() {
  156. use dedicated || gnome2_icon_savelist
  157. java-pkg-2_pkg_preinst
  158. }
  159. pkg_postinst() {
  160. use dedicated || { fdo-mime_desktop_database_update
  161. fdo-mime_mime_database_update
  162. gnome2_icon_cache_update ;}
  163. if use dedicated || use server; then
  164. enewgroup rstudio-server
  165. enewuser rstudio-server -1 -1 -1 rstudio-server
  166. fi
  167. }
  168. pkg_postrm() {
  169. use dedicated || { fdo-mime_desktop_database_update
  170. fdo-mime_mime_database_update
  171. gnome2_icon_cache_update ;}
  172. }