summaryrefslogtreecommitdiff
blob: 63f9fafa352e46ff83d15e80803b92af1e319bfa (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
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit autotools linux-info

DESCRIPTION="C library and tools for interacting with the linux GPIO character device"
HOMEPAGE="https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/"
SRC_URI="https://mirrors.edge.kernel.org/pub/software/libs/libgpiod/${P}.tar.xz"

LICENSE="LGPL-2.1"
# Reflects the ABI of libgpiod.so
SLOT="0/3"
KEYWORDS="~amd64 ~arm ~arm64 ~riscv ~x86"
IUSE="+tools cxx python test"
RESTRICT="!test? ( test )"

#  --enable-tests          enable libgpiod tests [default=no]
#  --enable-bindings-cxx   enable C++ bindings [default=no]
#  --enable-bindings-python
#  --enable-bindings-rust
DEPEND="
	test? (
		>=dev-libs/glib-2.50
		>=sys-apps/kmod-18
		>=sys-apps/util-linux-2.33.1
		>=virtual/libudev-215
		cxx? ( <dev-cpp/catch-3.5:0 )
	)
"

pkg_setup() {
	CONFIG_CHECK="~GPIO_CDEV_V1"
	linux-info_pkg_setup
}

src_prepare() {
	default
	eautoreconf
}

src_configure() {
	local myconf=(
		$(use_enable tools)
		$(use_enable cxx bindings-cxx)
		$(use_enable test tests)
		$(use_enable python bindings-python)
		--enable-examples
		--disable-profiling
		--disable-bindings-rust
	)

	econf "${myconf[@]}"
}

src_install() {
	default

	find "${D}" -name '*.la' -type f -delete || die
	find "${D}" -name "*.a" -delete || die
}