Gentoo Archives: gentoo-commits

From: Thomas Beierlein <tomjbe@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-wireless/gnuradio/
Date: Wed, 31 Aug 2022 05:27:11
Message-Id: 1661923551.9afc85ebe835c4e23622ca27a2f88338511ca55a.tomjbe@gentoo
1 commit: 9afc85ebe835c4e23622ca27a2f88338511ca55a
2 Author: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
3 AuthorDate: Wed Aug 31 05:25:51 2022 +0000
4 Commit: Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 31 05:25:51 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9afc85eb
7
8 net-wireless/gnuradio: Add missing support for PDU (protocol data units)
9
10 Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org>
11
12 net-wireless/gnuradio/gnuradio-3.10.3.0-r1.ebuild | 246 ++++++++++++++++++++++
13 1 file changed, 246 insertions(+)
14
15 diff --git a/net-wireless/gnuradio/gnuradio-3.10.3.0-r1.ebuild b/net-wireless/gnuradio/gnuradio-3.10.3.0-r1.ebuild
16 new file mode 100644
17 index 000000000000..2c481b350cf3
18 --- /dev/null
19 +++ b/net-wireless/gnuradio/gnuradio-3.10.3.0-r1.ebuild
20 @@ -0,0 +1,246 @@
21 +# Copyright 1999-2022 Gentoo Authors
22 +# Distributed under the terms of the GNU General Public License v2
23 +
24 +EAPI=8
25 +PYTHON_COMPAT=( python3_{8..10} )
26 +
27 +CMAKE_BUILD_TYPE="None"
28 +inherit cmake python-single-r1 virtualx xdg-utils
29 +
30 +DESCRIPTION="Toolkit that provides signal processing blocks to implement software radios"
31 +HOMEPAGE="https://www.gnuradio.org/"
32 +LICENSE="GPL-3"
33 +SLOT="0/${PV}"
34 +
35 +if [[ ${PV} =~ "9999" ]]; then
36 + EGIT_REPO_URI="https://github.com/gnuradio/gnuradio.git"
37 + EGIT_BRANCH="maint-3.10"
38 + inherit git-r3
39 +else
40 + SRC_URI="https://github.com/gnuradio/gnuradio/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"
41 + KEYWORDS="~amd64 ~x86"
42 +fi
43 +
44 +IUSE="+audio +alsa +analog +digital channels ctrlport doc dtv examples fec +filter grc iio jack modtool network oss performance-counters portaudio +qt5 sdl soapy test trellis uhd vocoder +utils wavelet zeromq"
45 +
46 +#RESTRICT="!test? ( test )"
47 +#Tests are known broken right now
48 +RESTRICT="test"
49 +
50 +REQUIRED_USE="${PYTHON_REQUIRED_USE}
51 + audio? ( || ( alsa oss jack portaudio ) )
52 + alsa? ( audio )
53 + jack? ( audio )
54 + oss? ( audio )
55 + portaudio? ( audio )
56 + analog? ( filter )
57 + channels? ( filter analog qt5 )
58 + digital? ( filter analog )
59 + dtv? ( filter analog fec )
60 + modtool? ( utils )
61 + qt5? ( filter )
62 + trellis? ( analog digital )
63 + uhd? ( filter analog )
64 + vocoder? ( filter analog )
65 + wavelet? ( analog )
66 +"
67 +
68 +RDEPEND="${PYTHON_DEPS}
69 + $(python_gen_cond_dep 'dev-libs/boost:0=[python,${PYTHON_USEDEP}]')
70 + dev-libs/log4cpp:=
71 + $(python_gen_cond_dep 'dev-python/six[${PYTHON_USEDEP}]')
72 + $(python_gen_cond_dep 'dev-python/jsonschema[${PYTHON_USEDEP}]')
73 + sci-libs/fftw:3.0=
74 + sci-libs/mpir:=
75 + sci-libs/volk:=
76 + media-libs/libsndfile
77 + sys-libs/libunwind
78 + alsa? ( media-libs/alsa-lib:= )
79 + ctrlport? (
80 + $(python_gen_cond_dep 'dev-python/thrift[${PYTHON_USEDEP}]')
81 + )
82 + fec? (
83 + sci-libs/gsl:=
84 + dev-python/scipy
85 + )
86 + filter? (
87 + dev-python/scipy
88 + $(python_gen_cond_dep 'dev-python/pyqtgraph[${PYTHON_USEDEP}]')
89 + )
90 + grc? (
91 + $(python_gen_cond_dep 'dev-python/mako[${PYTHON_USEDEP}]
92 + dev-python/numpy[${PYTHON_USEDEP}]
93 + dev-python/pygobject:3[${PYTHON_USEDEP}]
94 + dev-python/pyyaml[${PYTHON_USEDEP}]')
95 + x11-libs/gtk+:3[introspection]
96 + x11-libs/pango[introspection]
97 + )
98 + iio? (
99 + net-libs/libiio:=
100 + net-libs/libad9361-iio:=
101 + )
102 + jack? ( virtual/jack )
103 + portaudio? ( >=media-libs/portaudio-19_pre )
104 + qt5? (
105 + $(python_gen_cond_dep 'dev-python/PyQt5[opengl,${PYTHON_USEDEP}]')
106 + dev-qt/qtcore:5
107 + dev-qt/qtgui:5
108 + x11-libs/qwt:6[qt5(+)]
109 + dev-qt/qtwidgets:5
110 + )
111 + soapy? (
112 + $(python_gen_cond_dep 'net-wireless/soapysdr[${PYTHON_USEDEP}]')
113 + )
114 + sdl? ( >=media-libs/libsdl-1.2.0 )
115 + trellis? ( dev-python/scipy )
116 + uhd? (
117 + $(python_gen_cond_dep '>=net-wireless/uhd-3.9.6:=[${PYTHON_SINGLE_USEDEP}]')
118 + )
119 + utils? (
120 + $(python_gen_cond_dep 'dev-python/click[${PYTHON_USEDEP}]
121 + dev-python/click-plugins[${PYTHON_USEDEP}]
122 + dev-python/mako[${PYTHON_USEDEP}]
123 + dev-python/matplotlib[${PYTHON_USEDEP}]')
124 + )
125 + vocoder? (
126 + media-sound/gsm
127 + >=media-libs/codec2-0.8.1:=
128 + )
129 + wavelet? (
130 + sci-libs/gsl:=
131 + dev-libs/gmp:=
132 + sci-libs/lapack
133 + )
134 + zeromq? ( >=net-libs/zeromq-2.1.11:= )
135 +"
136 +
137 +DEPEND="${RDEPEND}
138 + app-text/docbook-xml-dtd:4.2
139 + $(python_gen_cond_dep 'dev-python/pybind11[${PYTHON_USEDEP}]')
140 + $(python_gen_cond_dep 'dev-python/pygccxml[${PYTHON_USEDEP}]')
141 + dev-libs/spdlog
142 + virtual/pkgconfig
143 + doc? (
144 + >=app-doc/doxygen-1.5.7.1
145 + dev-libs/mathjax
146 + )
147 + grc? ( x11-misc/xdg-utils )
148 + oss? ( virtual/os-headers )
149 + test? ( >=dev-util/cppunit-1.9.14 )
150 + zeromq? ( net-libs/cppzmq )
151 +"
152 +
153 +PATCHES=(
154 + "${FILESDIR}/${PN}-3.10.3.0-fix-fmt-v9.patch" #858659
155 + "${FILESDIR}/${PN}-3.10.3.0-fix-gcc12.patch" #858665
156 +)
157 +
158 +src_prepare() {
159 + xdg_environment_reset #534582
160 +
161 + use !alsa && sed -i 's#version.h#version-nonexistent.h#' cmake/Modules/FindALSA.cmake
162 + use !jack && sed -i 's#jack.h#jack-nonexistent.h#' cmake/Modules/FindJACK.cmake
163 + use !oss && sed -i 's#soundcard.h#oss-nonexistent.h#g' cmake/Modules/FindOSS.cmake
164 + use !portaudio && sed -i 's#portaudio.h#portaudio-nonexistent.h#g' cmake/Modules/FindPORTAUDIO.cmake
165 +
166 + cmake_src_prepare
167 +}
168 +
169 +src_configure() {
170 + mycmakeargs=(
171 + -DENABLE_DEFAULT=OFF
172 + -DENABLE_GNURADIO_RUNTIME=ON
173 + -DENABLE_PYTHON=ON
174 + -DENABLE_GR_BLOCKS=ON
175 + -DENABLE_GR_ANALOG="$(usex analog)"
176 + -DENABLE_GR_AUDIO=ON
177 + -DENABLE_GR_CHANNELS="$(usex channels)"
178 + -DENABLE_GR_CTRLPORT="$(usex ctrlport)"
179 + -DENABLE_GR_DIGITAL="$(usex digital)"
180 + -DENABLE_DOXYGEN="$(usex doc)"
181 + -DENABLE_GR_DTV="$(usex dtv)"
182 + -DENABLE_GR_FEC="$(usex fec)"
183 + -DENABLE_GR_FFT=ON
184 + -DENABLE_GR_FILTER="$(usex filter)"
185 + -DENABLE_GRC="$(usex grc)"
186 + -DENABLE_GR_IIO="$(usex iio)"
187 + -DENABLE_GR_MODTOOL="$(usex modtool)"
188 + -DENABLE_GR_BLOCKTOOL="$(usex modtool)"
189 + -DENABLE_GR_NETWORK="$(usex network)"
190 + -DENABLE_GR_PDU=ON
191 + -DENABLE_PERFORMANCE_COUNTERS="$(usex performance-counters)"
192 + -DENABLE_TESTING="$(usex test)"
193 + -DENABLE_GR_QTGUI="$(usex qt5)"
194 + -DENABLE_GR_SOAPY="$(usex soapy)"
195 + -DENABLE_GR_TRELLIS="$(usex trellis)"
196 + -DENABLE_GR_UHD="$(usex uhd)"
197 + -DENABLE_GR_UTILS="$(usex utils)"
198 + -DENABLE_GR_VIDEO_SDL="$(usex sdl)"
199 + -DENABLE_GR_VOCODER="$(usex vocoder)"
200 + -DENABLE_GR_WAVELET="$(usex wavelet)"
201 + -DENABLE_GR_ZEROMQ="$(usex zeromq)"
202 + -DSYSCONFDIR="${EPREFIX}"/etc
203 + -DPYTHON_EXECUTABLE="${PYTHON}"
204 + -DGR_PYTHON_DIR="$(python_get_sitedir)"
205 + -DGR_PKG_DOC_DIR="${EPREFIX}/usr/share/doc/${PF}"
206 + -DMATHJAX2_ROOT="${EPREFIX}/usr/share/mathjax"
207 + )
208 + cmake_src_configure
209 +}
210 +
211 +src_install() {
212 + cmake_src_install
213 +
214 + if use examples ; then
215 + dodir /usr/share/doc/${PF}/
216 + mv "${ED}"/usr/share/${PN}/examples "${ED}"/usr/share/doc/${PF}/ || die
217 + docompress -x /usr/share/doc/${PF}/examples
218 + else
219 + # It seems that the examples are always installed
220 + rm -rf "${ED}"/usr/share/${PN}/examples || die
221 + fi
222 +
223 + if use doc || use examples; then
224 + #this doesn't appear useful
225 + rm -rf "${ED}"/usr/share/doc/${PF}/xml || die
226 + fi
227 +
228 + # Remove duplicated icons, MIME and desktop files and installation script
229 + rm -rf "${ED}"/usr/share/${PN}/grc/freedesktop || die
230 + rm -f "${ED}"/usr/libexec/${PN}/grc_setup_freedesktop || die
231 +
232 + # Install icons, menu items and mime-types for GRC
233 + #if use grc ; then
234 + # local fd_path="${S}/grc/scripts/freedesktop"
235 + # insinto /usr/share/mime/packages
236 + # doins "${fd_path}/${PN}-grc.xml"
237 +
238 + # domenu "${fd_path}/"*.desktop
239 + # doicon "${fd_path}/"*.png
240 + #fi
241 +
242 + python_fix_shebang "${ED}"
243 + # Remove incorrectly byte-compiled Python files and replace
244 + find "${ED}"/usr/lib* -name "*.py[co]" -exec rm {} \; || die
245 + python_optimize
246 +}
247 +
248 +src_test() {
249 + virtx cmake_src_test
250 +}
251 +
252 +pkg_postinst() {
253 + if use grc ; then
254 + xdg_desktop_database_update
255 + xdg_icon_cache_update
256 + xdg_mimeinfo_database_update
257 + fi
258 +}
259 +
260 +pkg_postrm() {
261 + if use grc ; then
262 + xdg_desktop_database_update
263 + xdg_icon_cache_update
264 + xdg_mimeinfo_database_update
265 + fi
266 +}