| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/net-wireless/gnuradio/gnuradio-3.6.1-r1.ebuild,v 1.3 2012/07/27 18:19:18 kensington Exp $ |
| 4 |
|
| 5 |
EAPI=4 |
| 6 |
PYTHON_DEPEND="2" |
| 7 |
|
| 8 |
inherit base cmake-utils fdo-mime python |
| 9 |
|
| 10 |
DESCRIPTION="Toolkit that provides signal processing blocks to implement software radios" |
| 11 |
HOMEPAGE="http://gnuradio.org/" |
| 12 |
SRC_URI="http://gnuradio.org/redmine/attachments/download/389/${P}.tar.gz" |
| 13 |
|
| 14 |
LICENSE="GPL-3" |
| 15 |
SLOT="0" |
| 16 |
KEYWORDS="~amd64 ~x86" |
| 17 |
IUSE="alsa doc examples fcd grc jack oss portaudio qt4 sdl utils wavelet wxwidgets" |
| 18 |
|
| 19 |
# bug #348206 |
| 20 |
# comedi? ( >=sci-electronics/comedilib-0.7 ) |
| 21 |
# uhd? ( dev-libs/uhd ) |
| 22 |
RDEPEND=">=dev-lang/orc-0.4.12 |
| 23 |
dev-libs/boost |
| 24 |
dev-python/cheetah |
| 25 |
dev-util/cppunit |
| 26 |
sci-libs/fftw:3.0 |
| 27 |
fcd? ( virtual/libusb:1 ) |
| 28 |
alsa? ( |
| 29 |
media-libs/alsa-lib |
| 30 |
) |
| 31 |
grc? ( |
| 32 |
dev-python/lxml |
| 33 |
dev-python/numpy |
| 34 |
dev-python/pygtk:2 |
| 35 |
) |
| 36 |
jack? ( |
| 37 |
media-sound/jack-audio-connection-kit |
| 38 |
) |
| 39 |
portaudio? ( |
| 40 |
>=media-libs/portaudio-19_pre |
| 41 |
) |
| 42 |
qt4? ( |
| 43 |
dev-python/PyQt4[X,opengl] |
| 44 |
dev-python/pyqwt:5 |
| 45 |
x11-libs/qt-gui:4 |
| 46 |
) |
| 47 |
sdl? ( media-libs/libsdl ) |
| 48 |
wavelet? ( |
| 49 |
sci-libs/gsl |
| 50 |
) |
| 51 |
wxwidgets? ( |
| 52 |
dev-python/wxpython:2.8 |
| 53 |
dev-python/numpy |
| 54 |
) |
| 55 |
" |
| 56 |
DEPEND="${RDEPEND} |
| 57 |
dev-lang/swig |
| 58 |
virtual/pkgconfig |
| 59 |
doc? ( |
| 60 |
>=app-doc/doxygen-1.5.7.1 |
| 61 |
dev-python/sphinx |
| 62 |
) |
| 63 |
grc? ( |
| 64 |
x11-misc/xdg-utils |
| 65 |
) |
| 66 |
oss? ( |
| 67 |
virtual/os-headers |
| 68 |
) |
| 69 |
" |
| 70 |
|
| 71 |
# Add support for custom SYSCONFDIR, upstream bug #492 |
| 72 |
PATCHES=( |
| 73 |
"${FILESDIR}"/${PN}-3.6.0-cmake-sysconfdir.patch |
| 74 |
"${FILESDIR}"/${PN}-3.6.1-automagic-audio.patch |
| 75 |
) |
| 76 |
|
| 77 |
pkg_setup() { |
| 78 |
python_set_active_version 2 |
| 79 |
python_pkg_setup |
| 80 |
} |
| 81 |
|
| 82 |
src_prepare() { |
| 83 |
python_convert_shebangs -q -r 2 "${S}" |
| 84 |
# Useless UI element would require qt3support, bug #365019 |
| 85 |
sed -i '/qPixmapFromMimeSource/d' "${S}"/gr-qtgui/lib/spectrumdisplayform.ui || die |
| 86 |
base_src_prepare |
| 87 |
} |
| 88 |
|
| 89 |
src_configure() { |
| 90 |
# TODO: docs are installed to /usr/share/doc/${PN} not /usr/share/doc/${PF} |
| 91 |
# SYSCONFDIR/GR_PREFSDIR default to install below CMAKE_INSTALL_PREFIX |
| 92 |
mycmakeargs=( |
| 93 |
$(cmake-utils_use_enable alsa GR_AUDIO_ALSA) |
| 94 |
$(cmake-utils_use_enable doc DOXYGEN) \ |
| 95 |
$(cmake-utils_use_enable doc SPHINX) \ |
| 96 |
$(cmake-utils_use_enable fcd GR_FCD) \ |
| 97 |
$(cmake-utils_use_enable grc GRC) \ |
| 98 |
$(cmake-utils_use_enable jack GR_AUDIO_JACK) |
| 99 |
$(cmake-utils_use_enable oss GR_AUDIO_OSS) |
| 100 |
$(cmake-utils_use_enable portaudio GR_AUDIO_PORTAUDIO) |
| 101 |
$(cmake-utils_use_enable utils GR_UTILS) \ |
| 102 |
$(cmake-utils_use_enable wavelet GR_WAVELET) \ |
| 103 |
$(cmake-utils_use_enable wxwidgets GR_WXGUI) \ |
| 104 |
$(cmake-utils_use_enable qt4 GR_QTGUI) \ |
| 105 |
$(cmake-utils_use_enable sdl GR_VIDEO_SDL) \ |
| 106 |
-DENABLE_GR_CORE=ON |
| 107 |
-DQWT_INCLUDE_DIRS="${EPREFIX}"/usr/include/qwt5 |
| 108 |
-DSYSCONFDIR="${EPREFIX}"/etc |
| 109 |
) |
| 110 |
cmake-utils_src_configure |
| 111 |
} |
| 112 |
|
| 113 |
src_install() { |
| 114 |
cmake-utils_src_install |
| 115 |
|
| 116 |
python_clean_installation_image -q |
| 117 |
|
| 118 |
# Remove bad shebangs that creep back in during install |
| 119 |
sed -i '\|#!/usr/bin/python|d' "${ED}"/usr/bin/* || die |
| 120 |
|
| 121 |
# Install examples to /usr/share/doc/$PF |
| 122 |
if use examples ; then |
| 123 |
dodir /usr/share/doc/${PF}/ |
| 124 |
mv "${ED}"/usr/share/${PN}/examples "${ED}"/usr/share/doc/${PF}/ || die |
| 125 |
else |
| 126 |
# It seems that the examples are always installed |
| 127 |
rm -rf "${ED}"/usr/share/${PN}/examples || die |
| 128 |
fi |
| 129 |
|
| 130 |
# We install the mimetypes to the correct locations from the ebuild |
| 131 |
rm -rf "${ED}"/usr/share/${PN}/grc/freedesktop || die |
| 132 |
rm -f "${ED}"/usr/libexec/${PN}/grc_setup_freedesktop || die |
| 133 |
|
| 134 |
# Install icons, menu items and mime-types for GRC |
| 135 |
if use grc ; then |
| 136 |
local fd_path="${S}/grc/freedesktop" |
| 137 |
insinto /usr/share/mime/packages |
| 138 |
doins "${fd_path}/${PN}-grc.xml" |
| 139 |
|
| 140 |
domenu "${fd_path}/"*.desktop |
| 141 |
doicon "${fd_path}/"*.png |
| 142 |
fi |
| 143 |
} |
| 144 |
|
| 145 |
pkg_postinst() |
| 146 |
{ |
| 147 |
local GRC_ICON_SIZES="32 48 64 128 256" |
| 148 |
python_mod_optimize gnuradio |
| 149 |
|
| 150 |
if use grc ; then |
| 151 |
fdo-mime_desktop_database_update |
| 152 |
fdo-mime_mime_database_update |
| 153 |
for size in ${GRC_ICON_SIZES} ; do |
| 154 |
xdg-icon-resource install --noupdate --context mimetypes --size ${size} \ |
| 155 |
"${EROOT}/usr/share/pixmaps/grc-icon-${size}.png" application-gnuradio-grc \ |
| 156 |
|| die "icon resource installation failed" |
| 157 |
xdg-icon-resource install --noupdate --context apps --size ${size} \ |
| 158 |
"${EROOT}/usr/share/pixmaps/grc-icon-${size}.png" gnuradio-grc \ |
| 159 |
|| die "icon resource installation failed" |
| 160 |
done |
| 161 |
xdg-icon-resource forceupdate |
| 162 |
fi |
| 163 |
} |
| 164 |
|
| 165 |
pkg_postrm() |
| 166 |
{ |
| 167 |
local GRC_ICON_SIZES="32 48 64 128 256" |
| 168 |
python_mod_cleanup gnuradio |
| 169 |
|
| 170 |
if use grc ; then |
| 171 |
fdo-mime_desktop_database_update |
| 172 |
fdo-mime_mime_database_update |
| 173 |
for size in ${GRC_ICON_SIZES} ; do |
| 174 |
xdg-icon-resource uninstall --noupdate --context mimetypes --size ${size} \ |
| 175 |
application-gnuradio-grc || ewarn "icon uninstall failed" |
| 176 |
xdg-icon-resource uninstall --noupdate --context apps --size ${size} \ |
| 177 |
gnuradio-grc || ewarn "icon uninstall failed" |
| 178 |
|
| 179 |
done |
| 180 |
xdg-icon-resource forceupdate |
| 181 |
fi |
| 182 |
} |