summaryrefslogtreecommitdiff
path: root/net-analyzer/gr-fosphor/gr-fosphor-9999.ebuild
blob: 16483e3713f7346100d918c8e968e983a5c08749 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

PYTHON_COMPAT=( python3_{13..14} )

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"
	EGIT_REPO_URI="https://github.com/ZeroChaos-/${PN}.git"
else
	COMMIT="662577bb1969fdd9363ff6a574c47af54f1bb607"
	#SRC_URI="https://github.com/osmocom/gr-fosphor/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
	SRC_URI="https://github.com/ZeroChaos-/${PN}/archive/${COMMIT}.tar.gz -> ${P}.gh.tar.gz"
	S="${WORKDIR}/${PN}-${COMMIT}"
	KEYWORDS="~amd64 ~x86"
fi

LICENSE="GPL-3+"
SLOT="0"
IUSE="doc +glfw"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

# libfmt:= because the spdlog symbols we link against embed fmt's ABI
RDEPEND="${PYTHON_DEPS}
	dev-libs/boost:=
	dev-libs/libfmt:=
	dev-libs/spdlog:=
	media-libs/freetype
	media-libs/libglvnd[X]
	>=net-wireless/gnuradio-3.9:0=[${PYTHON_SINGLE_USEDEP}]
	virtual/opencl
	$(python_gen_cond_dep 'dev-python/numpy[${PYTHON_USEDEP}]')
	glfw? ( >=media-libs/glfw-3 )
"
DEPEND="${RDEPEND}
	dev-libs/gmp
	dev-util/opencl-headers
	sci-libs/volk
"
BDEPEND="
	${PYTHON_DEPS}
	$(python_gen_cond_dep 'dev-python/pybind11[${PYTHON_USEDEP}]')
	virtual/pkgconfig
	doc? ( app-text/doxygen )
"

src_prepare() {
	cmake_src_prepare

	# adapt python bindings to use flags
	use glfw || sed -i -e "s#bind_glfw_sink_c(m)##" \
		python/bindings/python_bindings.cc || die
	sed -i -e "s#bind_qt_sink_c(m)##" \
		python/bindings/python_bindings.cc || die
}

src_configure() {
	# tries to run OpenCL test program, but failing doesn't hurt
	addpredict /dev/dri

	local mycmakeargs=(
		-DENABLE_DEFAULT=OFF
		-DENABLE_DOXYGEN="$(usex doc)"
		-DENABLE_GLFW="$(usex glfw)"
		-DENABLE_QT=OFF # bug #961742
		-DENABLE_PYTHON=ON
	)
	cmake_src_configure
}

src_install() {
	cmake_src_install
	find "${D}" -name '*.py[oc]' -delete || die
	python_optimize
}