1 # Copyright 1999-2020 Gentoo Authors
2 # Distributed under the terms of the GNU General Public License v2
6 inherit autotools flag-o-matic
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"
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}"
21 "${FILESDIR}"/${P}-ssl-flipflop.patch
22 "${FILESDIR}"/${P}-libressl.patch
25 RDEPEND="alsa? ( media-libs/alsa-lib )
26 oss? ( media-libs/portaudio[oss] )
27 portaudio? ( media-libs/portaudio )
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 )
35 ffmpeg? ( media-video/ffmpeg:= )
36 sdl? ( media-libs/libsdl )
37 openh264? ( media-libs/openh264 )
38 resample? ( media-libs/libsamplerate )
41 !libressl? ( dev-libs/openssl:0= )
42 libressl? ( dev-libs/libressl:0= )
48 !!media-plugins/mediastreamer-bcg729"
50 REQUIRED_USE="?? ( ${SOUND_FLAGS} )"
54 rm configure || die "Unable to remove unwanted wrapper"
55 mv aconfigure.ac configure.ac || die "Unable to rename configure script source"
61 local videnable="--disable-video"
64 use ipv6 && append-cflags -DPJ_HAS_IPV6=1
65 use debug || append-cflags -DNDEBUG=1
67 for t in ${CODEC_FLAGS}; do
68 myconf+=( $(use_enable ${t} ${t}-codec) )
71 for t in ${VIDEO_FLAGS}; do
72 myconf+=( $(use_enable ${t}) )
73 use "${t}" && videnable="--enable-video"
78 --with-external-srtp \
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) \
89 $(use_with portaudio external-pa) \
90 $(use_enable portaudio ext-sound) \
91 $(use_enable amr opencore-amr) \
95 $(use_enable webrtc libwebrtc) \
105 emake DESTDIR="${D}" install
108 dodoc README.txt README-RTEMS
111 if use examples; then
112 insinto "/usr/share/doc/${PF}/examples"
113 doins -r pjsip-apps/src/samples
116 use static-libs || rm "${D}/usr/$(get_libdir)/*.a"