summaryrefslogtreecommitdiff
path: root/net-libs/sofia-sip/sofia-sip-1.13.17.ebuild
blob: f990c40ee7c8d516823b0185bc10aba280a17bb3 (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
116
117
118
119
120
121
# Copyright 2021-2026 BaldEagleOS Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8

inherit autotools flag-o-matic

DESCRIPTION="RFC3261 compliant SIP User-Agent library"
HOMEPAGE="https://github.com/freeswitch/sofia-sip"
SRC_URI="https://github.com/freeswitch/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.tar.gz"

LICENSE="LGPL-2.1+ BSD public-domain" # See COPYRIGHT
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ppc ~ppc64 ~sparc ~x86"
IUSE="debug doc +glib libressl test"
RESTRICT="!test? ( test )"

RDEPEND="
	!libressl? ( dev-libs/openssl:= )
	libressl? ( dev-libs/libressl:= )
	virtual/zlib:=
	glib? ( dev-libs/glib:2 )
"
DEPEND="${RDEPEND}
	test? ( dev-libs/check )
"
BDEPEND="
	virtual/pkgconfig
	doc? ( app-text/doxygen[dot] )
"

DOCS=(
	AUTHORS
	ChangeLog{,.ext-trees}
	README{,.developers}
	RELEASE
	SECURITY.md
	TODO
	docs/.
)

PATCHES=(
	# fix build with gcc14
	"${FILESDIR}/${P}-gcc14.patch"
)

src_prepare() {
	local -a TESTS_DESELECT=(
		# Avoid tests that make too many assumptions about the
		# networking environment, bug 915904
		libsofia-sip-ua/sresolv:run_test_sresolv
		libsofia-sip-ua/nta:run_test_nta
		libsofia-sip-ua/nta:run_check_nta
		libsofia-sip-ua/nua:check_nua
		libsofia-sip-ua-glib/su-glib:torture_su_glib_timer
		libsofia-sip-ua-glib/su-glib:su_source_test
		tests:check_sofia
		tests:test_nua
	)

	local testname filename
	for deselect in "${TESTS_DESELECT[@]}"; do
		filename="${deselect%%:*}/Makefile.am"
		testname=${deselect#*:}
		sed -i -e "/TESTS/,$ s/\<${testname:?}\>//" "${filename:?}" || die
	done

	default
	eautoreconf
}

src_configure() {
	local myeconfargs=(
		# Makes otherwise working tests fail.
		ac_cv_tagstack=no

		# 'nth' depends on openssl (bug 851546, 880451) and can't be flipped off
		# without breaking API and ABI, so it should always be enabled.
		--enable-nth
		--with-openssl

		# ABI-breaking, cannot be controlled via USE-flags
		--disable-experimental
		--disable-sctp

		$(use_enable !debug ndebug)
		$(use_with doc doxygen)
		$(use_with glib)
	)
	econf "${myeconfargs[@]}"

	SOFIA_MAKEARGS=(
		# Make build logs verbose
		SOFIA_SILENT=
		VERBOSE=1
		# Prevent "/bin/sh /bin/sh" (bug 920903)
		TESTS_ENVIRONMENT=
	)
}

src_compile() {
	append-cflags -Wno-error=incompatible-pointer-types
	append-cxxflags -Wno-error=incompatible-pointer-types
	emake "${SOFIA_MAKEARGS[@]}"

	if use doc; then
		emake -C libsofia-sip-ua "${SOFIA_MAKEARGS[@]}" doxygen
		HTML_DOCS=( libsofia-sip-ua/docs/html/. )
	fi
}

src_test() {
	local -x SOFIA_DEBUG=9
	emake "${SOFIA_MAKEARGS[@]}" check
}

src_install() {
	emake DESTDIR="${D}" "${SOFIA_MAKEARGS[@]}" install
	einstalldocs

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