retroshare-0.6.9999.ebuild 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. EGIT_REPO_URI="https://github.com/RetroShare/RetroShare.git"
  5. inherit eutils git-r3 gnome2-utils qmake-utils versionator
  6. DESCRIPTION="P2P private sharing application"
  7. HOMEPAGE="http://retroshare.net"
  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=""
  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. src_prepare() {
  71. local dir
  72. sed -i \
  73. -e "s|/usr/lib/retroshare/extensions6/|/usr/$(get_libdir)/${PN}/extensions6/|" \
  74. libretroshare/src/rsserver/rsinit.cc \
  75. || die "sed on libretroshare/src/rsserver/rsinit.cc failed"
  76. rs_src_dirs="libbitdht/src openpgpsdk/src libresapi/src libretroshare/src supportlibs/pegmarkdown"
  77. use cli && rs_src_dirs="${rs_src_dirs} retroshare-nogui/src"
  78. use feedreader && rs_src_dirs="${rs_src_dirs} plugins/FeedReader"
  79. use gui && rs_src_dirs="${rs_src_dirs} retroshare-gui/src"
  80. use voip && rs_src_dirs="${rs_src_dirs} plugins/VOIP"
  81. # Force linking to sqlcipher ONLY
  82. sed -i \
  83. -e '/isEmpty(SQLCIPHER_OK) {/aerror(libsqlcipher not found)' \
  84. retroshare-gui/src/retroshare-gui.pro \
  85. retroshare-nogui/src/retroshare-nogui.pro || die 'sed on retroshare-gui/src/retroshare-gui.pro failed'
  86. # Avoid openpgpsdk false dependency on qtgui
  87. sed -i '2iQT -= gui' openpgpsdk/src/openpgpsdk.pro
  88. eapply_user
  89. }
  90. src_configure() {
  91. for dir in ${rs_src_dirs} ; do
  92. pushd "${S}/${dir}" >/dev/null || die
  93. use qt4 && eqmake4
  94. use qt5 && eqmake5
  95. popd >/dev/null || die
  96. done
  97. }
  98. src_compile() {
  99. local dir
  100. for dir in ${rs_src_dirs} ; do
  101. emake -C "${dir}"
  102. done
  103. unset rs_src_dirs
  104. }
  105. src_install() {
  106. local i
  107. local extension_dir="/usr/$(get_libdir)/${PN}/extensions6/"
  108. use cli && dobin retroshare-nogui/src/RetroShare06-nogui
  109. use gui && dobin retroshare-gui/src/RetroShare06
  110. exeinto "${extension_dir}"
  111. use feedreader && doexe plugins/FeedReader/*.so*
  112. use voip && doexe plugins/VOIP/*.so*
  113. insinto /usr/share/RetroShare06
  114. doins libbitdht/src/bitdht/bdboot.txt
  115. doins -r libresapi/src/webui
  116. dodoc README.md
  117. make_desktop_entry RetroShare06
  118. for i in 24 48 64 128 ; do
  119. doicon -s ${i} "data/${i}x${i}/apps/retroshare06.png"
  120. done
  121. }
  122. pkg_preinst() {
  123. local ver
  124. for ver in ${REPLACING_VERSIONS}; do
  125. if ! version_is_at_least 0.5.9999 ${ver}; then
  126. elog "You are upgrading from Retroshare 0.5.* to ${PV}"
  127. elog "Version 0.6.* is backward-incompatible with 0.5 branch"
  128. elog "and clients with 0.6.* can not connect to clients that have 0.5.*"
  129. elog "It's recommended to drop all your configuration and either"
  130. elog "generate a new certificate or import existing from a backup"
  131. break
  132. fi
  133. done
  134. gnome2_icon_savelist
  135. }
  136. pkg_postinst() {
  137. gnome2_icon_cache_update
  138. }
  139. pkg_postrm() {
  140. gnome2_icon_cache_update
  141. }