rstudio-0.98.953.ebuild 5.0 KB

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