rstudio-0.98.490-r1.ebuild 3.2 KB

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