summaryrefslogtreecommitdiff
path: root/dev-embedded/raspberrypi-utils/raspberrypi-utils-0_p20261026.ebuild
blob: f50d079c525e8ab57c573d26171fc10a4611b842 (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
# 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 optfeature python-single-r1

COMMIT="b8961eb9a689a3c0465db108176d0ee425379730"

DESCRIPTION="Raspberry Pi userspace utilities"
HOMEPAGE="https://github.com/raspberrypi/utils"
SRC_URI="https://github.com/raspberrypi/utils/archive/${COMMIT}.tar.gz -> ${P}.tar.gz"
S="${WORKDIR}/utils-${COMMIT}"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~arm ~arm64"
REQUIRED_USE="${PYTHON_REQUIRED_USE}"

DEPEND="
	sys-apps/dtc
"

RDEPEND="
	${DEPEND}
	${PYTHON_DEPS}
	!media-libs/raspberrypi-userland
	!media-libs/raspberrypi-userland-bin
"

PATCHES=(
	"${FILESDIR}"/${PN}-silence-kms-missing-message.patch
	"${FILESDIR}"/${PN}-silence-sections-with-missing-commands.patch
	"${FILESDIR}"/${PN}-use-emerge-for-package-versions.patch
)

src_test() {
	# There are no upstream tests as this package is very hardware-focused, but
	# we can at least check that the Python utilities successfully run --help.
	find -type f -exec awk '/^#!.*python/ {print FILENAME} {nextfile}' {} + | xargs -ti "${PYTHON}" {} -h >/dev/null
}

src_install() {
	cmake_src_install
	python_fix_shebang "${ED}"/usr/bin
}

pkg_postinst() {
	optfeature "Sound status in raspinfo" media-sound/alsa-utils
	optfeature "USB status in raspinfo" sys-apps/usbutils
}