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

EAPI=8

inherit meson-multilib

DESCRIPTION="Open-source implementation of the Secure Real-time Transport Protocol (SRTP)"
HOMEPAGE="https://github.com/cisco/libsrtp"
SRC_URI="https://github.com/cisco/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="BSD"
SLOT="2/1"
KEYWORDS="~alpha amd64 arm arm64 ~hppa ~ia64 ~loong ppc ppc64 ~riscv -sparc x86 ~ppc-macos ~x64-macos"
IUSE="debug doc nss openssl static-libs test"
RESTRICT="!test? ( test )"

REQUIRED_USE="?? ( nss openssl )"

RDEPEND="
	openssl? ( dev-libs/openssl:0=[${MULTILIB_USEDEP}] )
	nss? ( >=dev-libs/nss-3.52[${MULTILIB_USEDEP}] )
"
DEPEND="${RDEPEND}"

BDEPEND="
	doc? ( app-text/doxygen )
	virtual/pkgconfig
"

PATCHES=( "${FILESDIR}"/libsrtp-2.4.2-doc.patch )

multilib_src_configure() {
	local crypto_lib="none"
	use openssl && crypto_lib="openssl"
	use nss && crypto_lib="nss"

	# stdout: default error output for messages in debug
	# openssl-kdf: OpenSSL 1.1.0+
	local emesonargs=(
		-Dcrypto-library=${crypto_lib}
		-Dcrypto-library-kdf=disabled
		-Dfuzzer=disabled
		-Dlog-stdout=true
		-Dpcap-tests=disabled
		-Ddefault_library=$(usex static-libs both shared)

		$(meson_feature test tests)
		$(meson_native_use_feature doc)
		$(meson_use debug debug-logging)
	)
	meson_src_configure
}

multilib_src_compile() {
	meson_src_compile
	if multilib_is_native_abi && use doc; then
		meson_src_compile doc/html
	fi
}

multilib_src_install() {
	if multilib_is_native_abi && use doc; then
		dodoc -r html
	fi
	meson_src_install
}

multilib_src_install_all() {
	local DOCS=( CHANGES )
	einstalldocs
}