rstudio-0.98.932.ebuild 4.9 KB

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