summaryrefslogtreecommitdiff
path: root/dev-libs/argtable3/argtable3-3.3.1.ebuild
blob: 5f8477c12b8e21c09c6bcc0bd7d507f4491b9ba1 (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
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

inherit cmake

DESCRIPTION="ANSI C command-line parsing library based on getopt"
HOMEPAGE="https://www.argtable.org/"
SRC_URI="https://github.com/argtable/${PN}/releases/download/v${PV}/argtable-v${PV}.tar.gz"
S="${WORKDIR}/argtable-v${PV}"

# Their LICENSE file is a concatenation; thus is our variable:
#
#   * argtable3 itself: BSD
#   * FreeBSD getopt: BSD-2
#   * TCL/TK: tcltk
#   * Hash table: BSD
#   * Better string: BSD
#
LICENSE="BSD BSD-2 tcltk"

SLOT="0"
KEYWORDS="~amd64 ~riscv"
IUSE="examples test"
RESTRICT="!test? ( test )"

src_prepare() {
	# Don't append -Werror to CFLAGS.
	sed -e '/set(CMAKE_C_FLAGS.*-Werror/d' -i src/CMakeLists.txt || die
	cmake_src_prepare
}

src_configure() {
	local mycmakeargs=(
		-DARGTABLE3_ENABLE_TESTS=$(usex test)
		-DARGTABLE3_ENABLE_EXAMPLES=OFF  # don't _build_ the examples
	)
	cmake_src_configure
}

src_install() {
	cmake_src_install

	if use examples; then
		docinto examples
		dodoc examples/*.c
		dodoc -r examples/multicmd
	fi
}