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