summaryrefslogtreecommitdiff
blob: 1ec9553424a2764cf87e2c77db3d332aa9e1d401 (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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

# py3.12 blocked by protobuf-python
PYTHON_COMPAT=( python3_{10..11} )

inherit autotools python-single-r1

DESCRIPTION="Open Lighting Architecture, a framework for lighting control information"
HOMEPAGE="https://www.openlighting.org/ola/"
SRC_URI="https://github.com/OpenLightingProject/${PN}/releases/download/${PV}/${P}.tar.gz"

LICENSE="GPL-2+ LGPL-2.1+"
SLOT="0"
KEYWORDS="~amd64"
IUSE="doc examples ftdi http osc python rdm-tests tcmalloc test usb zeroconf"

REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
	rdm-tests? ( python )"

RESTRICT="!test? ( test )"

RDEPEND="<dev-libs/protobuf-23:=
	sys-apps/util-linux
	sys-libs/ncurses
	ftdi? ( dev-embedded/libftdi:1 )
	http? ( net-libs/libmicrohttpd:= )
	osc? ( media-libs/liblo )
	python? (
		${PYTHON_DEPS}
		$(python_gen_cond_dep '
			dev-python/protobuf-python[${PYTHON_USEDEP}]
		')
	)
	rdm-tests? (
		$(python_gen_cond_dep '
			dev-python/numpy[${PYTHON_USEDEP}]
		')
	)
	tcmalloc? ( dev-util/google-perftools:= )
	usb? ( virtual/libusb:1 )
	zeroconf? ( net-dns/avahi )"
DEPEND="${RDEPEND}
	sys-kernel/linux-headers"
BDEPEND="app-alternatives/yacc
	app-alternatives/lex
	virtual/pkgconfig
	doc? (
		app-doc/doxygen
		media-gfx/graphviz
	)
	test? (
		dev-util/cppunit
		python? (
			${PYTHON_DEPS}
			$(python_gen_cond_dep '
				dev-python/numpy[${PYTHON_USEDEP}]
				dev-python/protobuf-python[${PYTHON_USEDEP}]
			')
		)
	)"

PATCHES=(
	"${FILESDIR}"/${PN}-0.10.9-nullptr.patch
)

src_prepare() {
	default
	# Upstream recommends doing this even for tarball builds
	eautoreconf
}

src_configure() {
	local myeconfargs=(
		--disable-fatal-warnings
		--with-uucp-lock="/run"
		$(use_enable doc doxygen-doc)
		$(use_enable doc doxygen-dot)
		$(use_enable examples)
		$(use_enable ftdi libftdi)
		$(use_enable http)
		$(use_enable osc)
		$(use_enable python python-libs)
		$(use_enable rdm-tests)
		$(use_enable tcmalloc)
		$(use_enable test unittests)
		$(use_enable usb libusb)
	)
	econf "${myeconfargs[@]}"
}

src_compile() {
	default
	use doc && emake doxygen-doc
}

src_install() {
	default

	find "${ED}" -name '*.la' -delete || die

	if use doc; then
		dodoc -r html
		docompress -x /usr/share/doc/${PF}/html
	fi

	if use examples && use python; then
		docinto examples
		python_fix_shebang python/examples/*.py
		dodoc python/examples/*.py
		docompress -x /usr/share/doc/${PF}/examples
	fi
}