retroshare-0.6.2.ebuild 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit eutils gnome2-utils qmake-utils versionator
  5. DESCRIPTION="P2P private sharing application"
  6. HOMEPAGE="http://retroshare.net"
  7. SRC_URI="https://github.com/RetroShare/RetroShare/archive/v${PV}.tar.gz -> ${P}.tar.gz"
  8. # pegmarkdown can also be used with MIT
  9. LICENSE="GPL-2 GPL-3 Apache-2.0 LGPL-2.1"
  10. SLOT="0"
  11. KEYWORDS="~amd64 ~x86"
  12. IUSE="cli feedreader +gui qt4 +qt5 voip"
  13. REQUIRED_USE="
  14. || ( cli gui )
  15. gui? ( ^^ ( qt4 qt5 ) )
  16. cli? ( ^^ ( qt4 qt5 ) )
  17. feedreader? ( gui )
  18. voip? ( gui )"
  19. RDEPEND="
  20. app-arch/bzip2
  21. dev-db/sqlcipher
  22. dev-libs/openssl:0
  23. gnome-base/libgnome-keyring
  24. net-libs/libmicrohttpd
  25. net-libs/libupnp:0
  26. sys-libs/zlib
  27. feedreader? (
  28. dev-libs/libxml2
  29. dev-libs/libxslt
  30. net-misc/curl
  31. )
  32. qt4? (
  33. gui? (
  34. dev-qt/designer:4
  35. dev-qt/qtgui:4
  36. x11-libs/libX11
  37. x11-libs/libXScrnSaver
  38. )
  39. dev-qt/qtcore:4
  40. )
  41. qt5? (
  42. gui? (
  43. dev-qt/designer:5
  44. dev-qt/qtgui:5
  45. dev-qt/qtwidgets:5
  46. dev-qt/qtx11extras:5
  47. x11-libs/libX11
  48. x11-libs/libXScrnSaver
  49. )
  50. dev-qt/qtcore:5
  51. dev-qt/qtmultimedia:5
  52. dev-qt/qtnetwork:5
  53. dev-qt/qtprintsupport:5
  54. dev-qt/qtscript:5
  55. dev-qt/qtxml:5
  56. )
  57. voip? (
  58. qt5? (
  59. media-libs/opencv[-qt4(-)]
  60. )
  61. qt4? (
  62. media-libs/opencv
  63. dev-qt/qt-mobility[multimedia]
  64. )
  65. media-libs/speex
  66. virtual/ffmpeg[encode]
  67. )"
  68. DEPEND="${RDEPEND}
  69. virtual/pkgconfig
  70. "
  71. S="${WORKDIR}/RetroShare-${PV}"
  72. src_prepare() {
  73. local dir
  74. sed -i \
  75. -e "s|/usr/lib/retroshare/extensions6/|/usr/$(get_libdir)/${PN}/extensions6/|" \
  76. libretroshare/src/rsserver/rsinit.cc \
  77. || die "sed on libretroshare/src/rsserver/rsinit.cc failed"
  78. rs_src_dirs="libbitdht/src openpgpsdk/src libresapi/src libretroshare/src supportlibs/pegmarkdown"
  79. use cli && rs_src_dirs="${rs_src_dirs} retroshare-nogui/src"
  80. use feedreader && rs_src_dirs="${rs_src_dirs} plugins/FeedReader"
  81. use gui && rs_src_dirs="${rs_src_dirs} retroshare-gui/src"
  82. use voip && rs_src_dirs="${rs_src_dirs} plugins/VOIP"
  83. # Force linking to sqlcipher ONLY
  84. sed -i \
  85. -e '/isEmpty(SQLCIPHER_OK) {/aerror(libsqlcipher not found)' \
  86. retroshare-gui/src/retroshare-gui.pro \
  87. retroshare-nogui/src/retroshare-nogui.pro || die 'sed on retroshare-gui/src/retroshare-gui.pro failed'
  88. # Avoid openpgpsdk false dependency on qtgui
  89. sed -i '2iQT -= gui' openpgpsdk/src/openpgpsdk.pro
  90. eapply_user
  91. }
  92. src_configure() {
  93. for dir in ${rs_src_dirs} ; do
  94. pushd "${S}/${dir}" >/dev/null || die
  95. use qt4 && eqmake4
  96. use qt5 && eqmake5
  97. popd >/dev/null || die
  98. done
  99. }
  100. src_compile() {
  101. local dir
  102. for dir in ${rs_src_dirs} ; do
  103. emake -C "${dir}"
  104. done
  105. unset rs_src_dirs
  106. }
  107. src_install() {
  108. local i
  109. local extension_dir="/usr/$(get_libdir)/${PN}/extensions6/"
  110. use cli && dobin retroshare-nogui/src/RetroShare06-nogui
  111. use gui && dobin retroshare-gui/src/RetroShare06
  112. exeinto "${extension_dir}"
  113. use feedreader && doexe plugins/FeedReader/*.so*
  114. use voip && doexe plugins/VOIP/*.so*
  115. insinto /usr/share/RetroShare06
  116. doins libbitdht/src/bitdht/bdboot.txt
  117. doins -r libresapi/src/webui
  118. dodoc README.md
  119. make_desktop_entry RetroShare06
  120. for i in 24 48 64 128 ; do
  121. doicon -s ${i} "data/${i}x${i}/apps/retroshare06.png"
  122. done
  123. }
  124. pkg_preinst() {
  125. local ver
  126. for ver in ${REPLACING_VERSIONS}; do
  127. if ! version_is_at_least 0.5.9999 ${ver}; then
  128. elog "You are upgrading from Retroshare 0.5.* to ${PV}"
  129. elog "Version 0.6.* is backward-incompatible with 0.5 branch"
  130. elog "and clients with 0.6.* can not connect to clients that have 0.5.*"
  131. elog "It's recommended to drop all your configuration and either"
  132. elog "generate a new certificate or import existing from a backup"
  133. break
  134. fi
  135. done
  136. gnome2_icon_savelist
  137. }
  138. pkg_postinst() {
  139. gnome2_icon_cache_update
  140. }
  141. pkg_postrm() {
  142. gnome2_icon_cache_update
  143. }