commit:     cd094227a6f4228d2eafcd9623ed06f465057a47
Author:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
AuthorDate: Tue Aug 23 13:59:53 2022 +0000
Commit:     Thomas Beierlein <tomjbe <AT> gentoo <DOT> org>
CommitDate: Tue Aug 23 14:01:25 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cd094227

net-analyzer/gr-fosphor: add 0.0_p20210108

Signed-off-by: Thomas Beierlein <tomjbe <AT> gentoo.org>

 net-analyzer/gr-fosphor/Manifest                   |  1 +
 .../files/gr-fosphor-0.0_p20210108-fix-use.patch   | 18 +++++
 .../gr-fosphor/gr-fosphor-0.0_p20210108.ebuild     | 79 ++++++++++++++++++++++
 3 files changed, 98 insertions(+)

diff --git a/net-analyzer/gr-fosphor/Manifest b/net-analyzer/gr-fosphor/Manifest
index 7e83ff32c097..10e1e37143da 100644
--- a/net-analyzer/gr-fosphor/Manifest
+++ b/net-analyzer/gr-fosphor/Manifest
@@ -1 +1,2 @@
 DIST gr-fosphor-0.0_p20200131.tar.gz 244685 BLAKE2B 
db01b9df87f377db2adaaca3d1542f99eaca9f73303c71ea9add1845307704817c8930736d44462191476b4cb935a18401b7012a1ea6465bdb5cf3624c182f2c
 SHA512 
7bf2758f98ae7d088256060878fbf33966880ddbb7fb132da00f9c2530d84b91a6385eabbf61ff40d3002d3a42eadf5e2d78b8c797bc93501cafaf8a7bdde7ae
+DIST gr-fosphor-0.0_p20210108.tar.gz 223873 BLAKE2B 
4c44ea026760a12fbc9f50c439f47b9af3956270d8f0a05c951fb19cc4f23a7064476a0a111d39e79183d52e8c6e686d17bf17f76df92e052f81d8940df588fe
 SHA512 
fa2e4c28f8910eb82de42c76f2c00e8b832c023844f1d61aedb5ef3b0fafa7f3f7f26ab535a936d4ad8a42bedb380e71fe6c03f5e1b767afe731d70e080d241e

diff --git 
a/net-analyzer/gr-fosphor/files/gr-fosphor-0.0_p20210108-fix-use.patch 
b/net-analyzer/gr-fosphor/files/gr-fosphor-0.0_p20210108-fix-use.patch
new file mode 100644
index 000000000000..da3287f35496
--- /dev/null
+++ b/net-analyzer/gr-fosphor/files/gr-fosphor-0.0_p20210108-fix-use.patch
@@ -0,0 +1,18 @@
+diff --git a/python/bindings/CMakeLists.txt b/python/bindings/CMakeLists.txt
+index b7054da..86e5461 100644
+--- a/python/bindings/CMakeLists.txt
++++ b/python/bindings/CMakeLists.txt
+@@ -54,10 +54,11 @@ endmacro(GR_PYBIND_MAKE)
+ 
+ list(APPEND fosphor_python_files
+     base_sink_c_python.cc
+-    glfw_sink_c_python.cc
+-    qt_sink_c_python.cc
+     python_bindings.cc)
+ 
++list_cond_append(ENABLE_GLFW fosphor_python_files glfw_sink_c_python.cc)
++list_cond_append(ENABLE_QT   fosphor_python_files qt_sink_c_python.cc)
++
+ GR_PYBIND_MAKE(fosphor
+    ../..
+    gr::fosphor

diff --git a/net-analyzer/gr-fosphor/gr-fosphor-0.0_p20210108.ebuild 
b/net-analyzer/gr-fosphor/gr-fosphor-0.0_p20210108.ebuild
new file mode 100644
index 000000000000..0ec8b0bdf894
--- /dev/null
+++ b/net-analyzer/gr-fosphor/gr-fosphor-0.0_p20210108.ebuild
@@ -0,0 +1,79 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+
+inherit cmake python-single-r1
+
+DESCRIPTION="gnuradio fosphor block (GPU spectrum display)"
+HOMEPAGE="https://sdr.osmocom.org/trac/wiki/fosphor";
+
+if [[ ${PV} == *9999 ]]; then
+       inherit git-r3
+       EGIT_REPO_URI="https://github.com/osmocom/${PN}.git";
+else
+       COMMIT="974ab2fe54c25e8b6c37aa4de148ba0625eef652"
+       SRC_URI="https://github.com/osmocom/gr-fosphor/archive/${COMMIT}.tar.gz 
-> ${P}.tar.gz"
+       S="${WORKDIR}/${PN}-${COMMIT}"
+       KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="GPL-3+"
+SLOT="0"
+IUSE="glfw qt5"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+RDEPEND="
+       dev-libs/boost:=
+       dev-libs/log4cpp
+       media-libs/freetype
+       >=net-wireless/gnuradio-3.9:0=[qt5,${PYTHON_SINGLE_USEDEP}]
+       $(python_gen_cond_dep 'dev-python/pygccxml[${PYTHON_USEDEP}]')
+       glfw? ( >=media-libs/glfw-3 )
+       virtual/opencl
+       virtual/opengl
+       ${PYTHON_DEPS}
+       qt5? (
+               dev-qt/qtcore:5
+               dev-qt/qtgui:5
+               dev-qt/qtopengl:5
+               dev-qt/qtwidgets:5
+       )"
+DEPEND="${RDEPEND}"
+BDEPEND="$(python_gen_cond_dep 'dev-python/pybind11[${PYTHON_USEDEP}]')"
+
+PATCHES=( "${FILESDIR}"/${PN}-0.0_p20200131-htmldir.patch
+                 "${FILESDIR}"/${P}-fix-use.patch )
+
+src_prepare() {
+       cmake_src_prepare
+
+       # adapt python bindings to use flags
+       use glfw || sed -i -e "s#bind_glfw_sink_c(m)##" \
+                                       
"${S}"/python/bindings/python_bindings.cc ||die
+       use qt5 || sed -i -e "s#bind_qt_sink_c(m)##" \
+                                       
"${S}"/python/bindings/python_bindings.cc ||die
+
+       eapply_user
+}
+
+src_configure() {
+       # tries to run OpenCL test program, but failing doesn't hurt
+       addpredict /dev/dri
+
+       local mycmakeargs=(
+               -DENABLE_DEFAULT=OFF
+               -DENABLE_GLFW="$(usex glfw)"
+               -DENABLE_QT="$(usex qt5)"
+               -DENABLE_PYTHON=ON
+       )
+       cmake_src_configure
+}
+
+src_install() {
+       cmake_src_install
+       find "${D}" -name '*.py[oc]' -delete || die
+       python_optimize
+}

Reply via email to