boinc-7.2.44-r3.ebuild 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. WX_GTK_VER=2.8
  5. inherit autotools eutils linux-info systemd user versionator wxwidgets
  6. MY_PV=$(get_version_component_range 1-2)
  7. DESCRIPTION="The Berkeley Open Infrastructure for Network Computing"
  8. HOMEPAGE="http://boinc.ssl.berkeley.edu/"
  9. SRC_URI="https://github.com/BOINC/boinc/archive/client_release/${MY_PV}/${PV}.tar.gz -> ${P}.tar.gz
  10. X? ( http://boinc.berkeley.edu/logo/boinc_glossy2_512_F.tif -> ${PN}.tif )"
  11. RESTRICT="mirror"
  12. LICENSE="LGPL-2.1"
  13. SLOT="0"
  14. KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~sparc ~x86"
  15. IUSE="X cuda curl_ssl_libressl +curl_ssl_openssl static-libs"
  16. REQUIRED_USE="^^ ( curl_ssl_libressl curl_ssl_openssl ) "
  17. # libcurl must not be using an ssl backend boinc does not support.
  18. # If the libcurl ssl backend changes, boinc should be recompiled.
  19. RDEPEND="
  20. !sci-misc/boinc-bin
  21. !app-admin/quickswitch
  22. >=app-misc/ca-certificates-20080809
  23. net-misc/curl[-curl_ssl_gnutls(-),curl_ssl_libressl(-)=,-curl_ssl_nss(-),curl_ssl_openssl(-)=,-curl_ssl_axtls(-),-curl_ssl_cyassl(-),-curl_ssl_polarssl(-)]
  24. sys-apps/util-linux
  25. sys-libs/zlib
  26. cuda? (
  27. >=dev-util/nvidia-cuda-toolkit-2.1
  28. >=x11-drivers/nvidia-drivers-180.22
  29. )
  30. X? (
  31. dev-db/sqlite:3
  32. media-libs/freeglut
  33. sys-libs/glibc:2.2
  34. virtual/jpeg:0=
  35. x11-libs/gtk+:2
  36. >=x11-libs/libnotify-0.7
  37. x11-libs/wxGTK:${WX_GTK_VER}[X,opengl]
  38. )
  39. "
  40. DEPEND="${RDEPEND}
  41. sys-devel/gettext
  42. app-text/docbook-xml-dtd:4.4
  43. app-text/docbook2X
  44. X? ( virtual/imagemagick-tools[png,tiff] )
  45. "
  46. S="${WORKDIR}/${PN}-client_release-${MY_PV}-${PV}"
  47. pkg_setup() {
  48. # Bug 578750
  49. if use kernel_linux; then
  50. linux-info_pkg_setup
  51. if ! linux_config_exists; then
  52. ewarn "Can't check the linux kernel configuration."
  53. ewarn "You might be missing vsyscall support."
  54. elif kernel_is -ge 4 4 \
  55. && linux_chkconfig_present LEGACY_VSYSCALL_NONE; then
  56. ewarn "You do not have vsyscall emulation enabled."
  57. ewarn "This will prevent some boinc projects from running."
  58. ewarn "Please enable vsyscall emulation:"
  59. ewarn " CONFIG_LEGACY_VSYSCALL_EMULATE=y"
  60. ewarn "in /usr/src/linux/.config, to be found at"
  61. ewarn " Processor type and features --->"
  62. ewarn " vsyscall table for legacy applications (None) --->"
  63. ewarn " (X) Emulate"
  64. ewarn "Alternatively, you can enable CONFIG_LEGACY_VSYSCALL_NATIVE."
  65. ewarn "However, this has security implications and is not recommended."
  66. fi
  67. fi
  68. }
  69. src_prepare() {
  70. default
  71. # prevent bad changes in compile flags, bug 286701
  72. sed -i -e "s:BOINC_SET_COMPILE_FLAGS::" configure.ac || die "sed failed"
  73. eautoreconf
  74. use X && need-wxwidgets unicode
  75. }
  76. src_configure() {
  77. econf --disable-server \
  78. --enable-client \
  79. --enable-dynamic-client-linkage \
  80. --disable-static \
  81. --enable-unicode \
  82. --with-ssl \
  83. $(use_with X x) \
  84. $(use_enable X manager) \
  85. $(usex X --with-wx-config="${WX_CONFIG}" --without-wxdir)
  86. }
  87. src_install() {
  88. default
  89. keepdir /var/lib/${PN}
  90. if use X; then
  91. # Create new icons. bug 593362
  92. local s SIZES=(16 22 24 32 36 48 64 72 96 128 192 256)
  93. for s in "${SIZES[@]}"; do
  94. convert "${DISTDIR}"/${PN}.tif -resize ${s}x${s} "${WORKDIR}"/boinc_${s}.png || die
  95. newicon -s $s "${WORKDIR}"/boinc_${s}.png boinc.png
  96. done
  97. make_desktop_entry boincmgr "${PN}" "${PN}" "Math;Science" "Path=/var/lib/${PN}"
  98. # Rename the desktop file to boincmgr.desktop to (hot)fix bug 599910
  99. mv "${ED%/}"/usr/share/applications/boincmgr{-${PN},}.desktop || \
  100. die "Failed to rename desktop file"
  101. fi
  102. # cleanup cruft
  103. rm -rf "${ED%/}"/etc || die "rm failed"
  104. newinitd "${FILESDIR}"/${PN}.init ${PN}
  105. newconfd "${FILESDIR}"/${PN}.conf ${PN}
  106. systemd_dounit "${FILESDIR}"/${PN}.service
  107. }
  108. pkg_preinst() {
  109. enewgroup ${PN}
  110. # note this works only for first install so we have to
  111. # elog user about the need of being in video group
  112. local groups="${PN}"
  113. if use cuda; then
  114. groups+=",video"
  115. fi
  116. enewuser ${PN} -1 -1 /var/lib/${PN} "${groups}"
  117. }
  118. pkg_postinst() {
  119. elog
  120. elog "You are using the source compiled version of boinc."
  121. use X && elog "The graphical manager can be found at /usr/bin/boincmgr"
  122. elog
  123. elog "You need to attach to a project to do anything useful with boinc."
  124. elog "You can do this by running /etc/init.d/boinc attach"
  125. elog "The howto for configuration is located at:"
  126. elog "http://boinc.berkeley.edu/wiki/Anonymous_platform"
  127. elog
  128. # Add warning about the new password for the client, bug 121896.
  129. if use X; then
  130. elog "If you need to use the graphical manager the password is in:"
  131. elog "/var/lib/boinc/gui_rpc_auth.cfg"
  132. elog "Where /var/lib/ is default RUNTIMEDIR, that can be changed in:"
  133. elog "/etc/conf.d/boinc"
  134. elog "You should change this password to something more memorable (can be even blank)."
  135. elog "Remember to launch init script before using manager. Or changing the password."
  136. elog
  137. fi
  138. if use cuda; then
  139. elog "To be able to use CUDA you should add boinc user to video group."
  140. elog "Run as root:"
  141. elog "gpasswd -a boinc video"
  142. fi
  143. }