rstudio-0.97.336.ebuild 3.8 KB

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