gnuradio-3.7.10.1.ebuild 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. # Copyright 1999-2017 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=5
  4. PYTHON_COMPAT=( python2_7 )
  5. CMAKE_BUILD_TYPE="None"
  6. inherit cmake-utils fdo-mime gnome2-utils python-single-r1 eutils
  7. DESCRIPTION="Toolkit that provides signal processing blocks to implement software radios"
  8. HOMEPAGE="http://gnuradio.org/"
  9. LICENSE="GPL-3"
  10. SLOT="0/${PV}"
  11. if [[ ${PV} == "9999" ]] ; then
  12. EGIT_REPO_URI="http://gnuradio.org/git/gnuradio.git"
  13. inherit git-r3
  14. KEYWORDS=""
  15. else
  16. SRC_URI="http://gnuradio.org/releases/gnuradio/${P}.tar.gz"
  17. KEYWORDS="~amd64 ~arm ~x86"
  18. fi
  19. IUSE="+audio +alsa atsc +analog +digital channels doc dtv examples fcd fec +filter grc jack log noaa oss pager performance-counters portaudio +qt4 sdl test trellis uhd vocoder +utils wavelet wxwidgets zeromq"
  20. REQUIRED_USE="${PYTHON_REQUIRED_USE}
  21. audio? ( || ( alsa oss jack portaudio ) )
  22. alsa? ( audio )
  23. oss? ( audio )
  24. jack? ( audio )
  25. portaudio? ( audio )
  26. analog? ( filter )
  27. digital? ( filter analog )
  28. dtv? ( fec )
  29. pager? ( filter analog )
  30. qt4? ( filter )
  31. uhd? ( filter analog )
  32. fcd? ( || ( alsa oss ) )
  33. wavelet? ( analog )
  34. wxwidgets? ( filter analog )"
  35. # bug #348206
  36. # comedi? ( >=sci-electronics/comedilib-0.8 )
  37. # boost-1.52.0 is blacklisted, bug #461578, upstream #513, boost #7669
  38. RDEPEND="${PYTHON_DEPS}
  39. >=dev-lang/orc-0.4.12
  40. dev-libs/boost:0=[${PYTHON_USEDEP}]
  41. !<=dev-libs/boost-1.52.0-r6:0/1.52
  42. dev-python/numpy[${PYTHON_USEDEP}]
  43. sci-libs/fftw:3.0=
  44. alsa? (
  45. media-libs/alsa-lib[${PYTHON_USEDEP}]
  46. )
  47. fcd? ( virtual/libusb:1 )
  48. filter? ( sci-libs/scipy )
  49. grc? (
  50. dev-python/cheetah[${PYTHON_USEDEP}]
  51. dev-python/lxml[${PYTHON_USEDEP}]
  52. >=dev-python/pygtk-2.10:2[${PYTHON_USEDEP}]
  53. )
  54. jack? (
  55. media-sound/jack-audio-connection-kit
  56. )
  57. log? ( dev-libs/log4cpp )
  58. portaudio? (
  59. >=media-libs/portaudio-19_pre
  60. )
  61. qt4? (
  62. >=dev-python/PyQt4-4.4[X,opengl,${PYTHON_USEDEP}]
  63. >=dev-python/pyqwt-5.2:5[${PYTHON_USEDEP}]
  64. >=dev-qt/qtcore-4.4:4
  65. >=dev-qt/qtgui-4.4:4
  66. x11-libs/qwt:6[qt4(+)]
  67. )
  68. sdl? ( >=media-libs/libsdl-1.2.0 )
  69. uhd? ( >=net-wireless/uhd-3.4.3-r1:=[${PYTHON_USEDEP}] )
  70. utils? ( dev-python/matplotlib[${PYTHON_USEDEP}] )
  71. vocoder? ( media-sound/gsm )
  72. wavelet? (
  73. >=sci-libs/gsl-1.10
  74. )
  75. wxwidgets? (
  76. dev-python/lxml[${PYTHON_USEDEP}]
  77. dev-python/numpy[${PYTHON_USEDEP}]
  78. dev-python/wxpython:2.8[${PYTHON_USEDEP}]
  79. )
  80. zeromq? ( >=net-libs/zeromq-2.1.11 )
  81. "
  82. DEPEND="${RDEPEND}
  83. >=dev-lang/swig-3.0.5
  84. dev-python/cheetah[${PYTHON_USEDEP}]
  85. virtual/pkgconfig
  86. doc? (
  87. >=app-doc/doxygen-1.5.7.1
  88. dev-python/sphinx[${PYTHON_USEDEP}]
  89. )
  90. grc? ( x11-misc/xdg-utils )
  91. oss? ( virtual/os-headers )
  92. test? ( >=dev-util/cppunit-1.9.14 )
  93. zeromq? ( net-libs/cppzmq )
  94. "
  95. src_prepare() {
  96. gnome2_environment_reset #534582
  97. # Useless UI element would require qt3support, bug #365019
  98. sed -i '/qPixmapFromMimeSource/d' "${S}"/gr-qtgui/lib/spectrumdisplayform.ui || die
  99. epatch_user
  100. }
  101. src_configure() {
  102. # SYSCONFDIR/GR_PREFSDIR default to install below CMAKE_INSTALL_PREFIX
  103. #audio provider is still automagic
  104. #zeromq missing deps isn't fatal
  105. mycmakeargs=(
  106. -DENABLE_DEFAULT=OFF
  107. -DENABLE_GNURADIO_RUNTIME=ON
  108. -DENABLE_VOLK=ON
  109. -DENABLE_PYTHON=ON
  110. -DENABLE_GR_BLOCKS=ON
  111. -DENABLE_GR_FFT=ON
  112. -DENABLE_GR_AUDIO=ON
  113. $(cmake-utils_use_enable alsa GR_AUDIO_ALSA) \
  114. $(cmake-utils_use_enable analog GR_ANALOG) \
  115. $(cmake-utils_use_enable atsc GR_ATSC) \
  116. $(cmake-utils_use_enable channels GR_CHANNELS) \
  117. $(cmake-utils_use_enable digital GR_DIGITAL) \
  118. $(cmake-utils_use_enable doc DOXYGEN) \
  119. $(cmake-utils_use_enable doc SPHINX) \
  120. $(cmake-utils_use_enable dtv GR_DTV) \
  121. $(cmake-utils_use_enable fcd GR_FCD) \
  122. $(cmake-utils_use_enable fec GR_FEC) \
  123. $(cmake-utils_use_enable filter GR_FILTER) \
  124. $(cmake-utils_use_enable grc GRC) \
  125. $(cmake-utils_use_enable jack GR_AUDIO_JACK) \
  126. $(cmake-utils_use_enable log GR_LOG) \
  127. $(cmake-utils_use_enable noaa GR_NOAA) \
  128. $(cmake-utils_use_enable oss GR_AUDIO_OSS) \
  129. $(cmake-utils_use_enable pager GR_PAGER) \
  130. $(cmake-utils_use_enable performance-counters ENABLE_PERFORMANCE_COUNTERS) \
  131. $(cmake-utils_use_enable portaudio GR_AUDIO_PORTAUDIO) \
  132. $(cmake-utils_use_enable test TESTING) \
  133. $(cmake-utils_use_enable trellis GR_TRELLIS) \
  134. $(cmake-utils_use_enable uhd GR_UHD) \
  135. $(cmake-utils_use_enable utils GR_UTILS) \
  136. $(cmake-utils_use_enable vocoder GR_VOCODER) \
  137. $(cmake-utils_use_enable wavelet GR_WAVELET) \
  138. $(cmake-utils_use_enable wxwidgets GR_WXGUI) \
  139. $(cmake-utils_use_enable qt4 GR_QTGUI) \
  140. $(cmake-utils_use_enable sdl GR_VIDEO_SDL) \
  141. $(cmake-utils_use_enable zeromq GR_ZEROMQ) \
  142. -DENABLE_GR_CORE=ON \
  143. -DSYSCONFDIR="${EPREFIX}"/etc \
  144. -DPYTHON_EXECUTABLE="${PYTHON}"
  145. -DGR_PKG_DOC_DIR="${EPREFIX}/usr/share/doc/${PF}"
  146. )
  147. use vocoder && mycmakeargs+=( -DGR_USE_SYSTEM_LIBGSM=TRUE )
  148. cmake-utils_src_configure
  149. }
  150. src_install() {
  151. cmake-utils_src_install
  152. if use examples ; then
  153. dodir /usr/share/doc/${PF}/
  154. mv "${ED}"/usr/share/${PN}/examples "${ED}"/usr/share/doc/${PF}/ || die
  155. docompress -x /usr/share/doc/${PF}/examples
  156. else
  157. # It seems that the examples are always installed
  158. rm -rf "${ED}"/usr/share/${PN}/examples || die
  159. fi
  160. if use doc || use examples; then
  161. #this doesn't appear useful
  162. rm -rf "${ED}"/usr/share/doc/${PF}/xml || die
  163. fi
  164. # We install the mimetypes to the correct locations from the ebuild
  165. rm -rf "${ED}"/usr/share/${PN}/grc/freedesktop || die
  166. rm -f "${ED}"/usr/libexec/${PN}/grc_setup_freedesktop || die
  167. # Install icons, menu items and mime-types for GRC
  168. if use grc ; then
  169. local fd_path="${S}/grc/scripts/freedesktop"
  170. insinto /usr/share/mime/packages
  171. doins "${fd_path}/${PN}-grc.xml"
  172. domenu "${fd_path}/"*.desktop
  173. doicon "${fd_path}/"*.png
  174. fi
  175. python_fix_shebang "${ED}"
  176. }
  177. src_test()
  178. {
  179. ctest -E qtgui
  180. }
  181. pkg_postinst()
  182. {
  183. local GRC_ICON_SIZES="32 48 64 128 256"
  184. if use grc ; then
  185. fdo-mime_desktop_database_update
  186. fdo-mime_mime_database_update
  187. for size in ${GRC_ICON_SIZES} ; do
  188. xdg-icon-resource install --noupdate --context mimetypes --size ${size} \
  189. "${EROOT}/usr/share/pixmaps/grc-icon-${size}.png" application-gnuradio-grc \
  190. || die "icon resource installation failed"
  191. xdg-icon-resource install --noupdate --context apps --size ${size} \
  192. "${EROOT}/usr/share/pixmaps/grc-icon-${size}.png" gnuradio-grc \
  193. || die "icon resource installation failed"
  194. done
  195. xdg-icon-resource forceupdate
  196. fi
  197. }
  198. pkg_postrm()
  199. {
  200. local GRC_ICON_SIZES="32 48 64 128 256"
  201. if use grc ; then
  202. fdo-mime_desktop_database_update
  203. fdo-mime_mime_database_update
  204. for size in ${GRC_ICON_SIZES} ; do
  205. xdg-icon-resource uninstall --noupdate --context mimetypes --size ${size} \
  206. application-gnuradio-grc || ewarn "icon uninstall failed"
  207. xdg-icon-resource uninstall --noupdate --context apps --size ${size} \
  208. gnuradio-grc || ewarn "icon uninstall failed"
  209. done
  210. xdg-icon-resource forceupdate
  211. fi
  212. }