net-libs/ldns: Remove py2.7
[gentoo.git] / net-libs / pjproject / pjproject-2.7.2-r2.ebuild
1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
3
4 EAPI=6
5
6 inherit autotools flag-o-matic
7
8 DESCRIPTION="Open source SIP, Media, and NAT Traversal Library"
9 HOMEPAGE="https://www.pjsip.org/"
10 SRC_URI="https://www.pjsip.org/release/${PV}/${P}.tar.bz2"
11 KEYWORDS="amd64 ~ppc x86"
12
13 LICENSE="GPL-2"
14 SLOT="0"
15 CODEC_FLAGS="g711 g722 g7221 gsm ilbc speex l16"
16 VIDEO_FLAGS="sdl ffmpeg v4l2 openh264 libyuv"
17 SOUND_FLAGS="alsa oss portaudio"
18 IUSE="amr debug doc epoll examples ipv6 libressl opus resample silk ssl static-libs webrtc ${CODEC_FLAGS} ${VIDEO_FLAGS} ${SOUND_FLAGS}"
19
20 PATCHES=(
21         "${FILESDIR}"/${P}-ssl-flipflop.patch
22         "${FILESDIR}"/${P}-libressl.patch
23 )
24
25 RDEPEND="alsa? ( media-libs/alsa-lib )
26         oss? ( media-libs/portaudio[oss] )
27         portaudio? ( media-libs/portaudio )
28
29         amr? ( media-libs/opencore-amr )
30         gsm? ( media-sound/gsm )
31         ilbc? ( media-libs/libilbc )
32         opus? ( media-libs/opus )
33         speex? ( media-libs/speexdsp )
34
35         ffmpeg? ( media-video/ffmpeg:= )
36         sdl? ( media-libs/libsdl )
37         openh264? ( media-libs/openh264 )
38         resample? ( media-libs/libsamplerate )
39
40         ssl? (
41                 !libressl? ( dev-libs/openssl:0= )
42                 libressl? ( dev-libs/libressl:0= )
43         )
44
45         net-libs/libsrtp:0"
46 DEPEND="${RDEPEND}
47         virtual/pkgconfig
48         !!media-plugins/mediastreamer-bcg729"
49
50 REQUIRED_USE="?? ( ${SOUND_FLAGS} )"
51
52 src_prepare() {
53         default
54         rm configure || die "Unable to remove unwanted wrapper"
55         mv aconfigure.ac configure.ac || die "Unable to rename configure script source"
56         eautoreconf
57 }
58
59 src_configure() {
60         local myconf=()
61         local videnable="--disable-video"
62         local t
63
64         use ipv6 && append-cflags -DPJ_HAS_IPV6=1
65         use debug || append-cflags -DNDEBUG=1
66
67         for t in ${CODEC_FLAGS}; do
68                 myconf+=( $(use_enable ${t} ${t}-codec) )
69         done
70
71         for t in ${VIDEO_FLAGS}; do
72                 myconf+=( $(use_enable ${t}) )
73                 use "${t}" && videnable="--enable-video"
74         done
75
76         econf \
77                 --enable-shared \
78                 --with-external-srtp \
79                 ${videnable} \
80                 $(use_enable epoll) \
81                 $(use_with gsm external-gsm) \
82                 $(use_with speex external-speex) \
83                 $(use_enable speex speex-aec) \
84                 $(use_enable resample) \
85                 $(use_enable resample libsamplerate) \
86                 $(use_enable resample resample-dll) \
87                 $(use_enable alsa sound) \
88                 $(use_enable oss) \
89                 $(use_with portaudio external-pa) \
90                 $(use_enable portaudio ext-sound) \
91                 $(use_enable amr opencore-amr) \
92                 $(use_enable silk) \
93                 $(use_enable opus) \
94                 $(use_enable ssl) \
95                 $(use_enable webrtc libwebrtc) \
96                 "${myconf[@]}"
97 }
98
99 src_compile() {
100         emake dep
101         emake
102 }
103
104 src_install() {
105         emake DESTDIR="${D}" install
106
107         if use doc; then
108                 dodoc README.txt README-RTEMS
109         fi
110
111         if use examples; then
112                 insinto "/usr/share/doc/${PF}/examples"
113                 doins -r pjsip-apps/src/samples
114         fi
115
116         use static-libs || rm "${D}/usr/$(get_libdir)/*.a"
117 }