rstudio-0.98.1028.ebuild 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. inherit eutils cmake-utils gnome2-utils 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.3
  15. PACKRAT_VER=0.3.0
  16. RMARKDOWN_VER=0.2.49
  17. DESCRIPTION="IDE for the R language"
  18. HOMEPAGE="
  19. http://www.rstudio.org
  20. https://github.com/rstudio/rstudio/"
  21. SRC_URI="
  22. https://github.com/rstudio/rstudio/archive/v${PV}.tar.gz -> ${P}.tar.gz
  23. https://s3.amazonaws.com/rstudio-buildtools/gin-${GINVER}.zip
  24. https://s3.amazonaws.com/rstudio-buildtools/gwt-${GWTVER}.zip
  25. https://s3.amazonaws.com/rstudio-buildtools/selenium-java-${SELENIUMVER}.zip
  26. https://s3.amazonaws.com/rstudio-buildtools/selenium-server-standalone-${SELENIUMVER}.jar
  27. https://s3.amazonaws.com/rstudio-buildtools/chromedriver-linux
  28. https://s3.amazonaws.com/rstudio-dictionaries/core-dictionaries.zip
  29. https://dev.gentoo.org/~hasufell/distfiles/packrat_${PACKRAT_VER}.tar.gz
  30. https://dev.gentoo.org/~hasufell/distfiles/rmarkdown_${RMARKDOWN_VER}.tar.gz"
  31. LICENSE="AGPL-3"
  32. SLOT="0"
  33. KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
  34. IUSE=""
  35. QTVER=4.8
  36. QTSLOT=4
  37. RDEPEND="
  38. app-text/pandoc
  39. dev-haskell/pandoc-citeproc
  40. >=dev-lang/R-2.11.1
  41. >=dev-libs/boost-1.50
  42. dev-libs/mathjax
  43. dev-libs/openssl:0
  44. sys-apps/util-linux
  45. sys-libs/zlib
  46. >=virtual/jre-1.5:=
  47. x11-libs/pango
  48. >=dev-qt/qtcore-${QTVER}:${QTSLOT}
  49. >=dev-qt/qtdbus-${QTVER}:${QTSLOT}
  50. >=dev-qt/qtgui-${QTVER}:${QTSLOT}
  51. >=dev-qt/qtwebkit-${QTVER}:${QTSLOT}
  52. >=dev-qt/qtxmlpatterns-${QTVER}:${QTSLOT}"
  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}"/${PN}-0.98.932-paths.patch \
  91. "${FILESDIR}"/${PN}-0.98.932-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. -DRSTUDIO_INSTALL_FREEDESKTOP=ON
  117. -DRSTUDIO_TARGET=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. }
  128. pkg_preinst() {
  129. gnome2_icon_savelist
  130. java-pkg-2_pkg_preinst
  131. }
  132. pkg_postinst() {
  133. fdo-mime_desktop_database_update
  134. fdo-mime_mime_database_update
  135. gnome2_icon_cache_update
  136. }
  137. pkg_postrm() {
  138. fdo-mime_desktop_database_update
  139. fdo-mime_mime_database_update
  140. gnome2_icon_cache_update
  141. }