**/Manifest: purge WHIRLPOOL hashes
[booboo.git] / net-libs / pjsip / pjsip-2.7.2.ebuild
blobe832d282f44de34fca072ea0f3c8968c07d0c8ae
1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 EAPI="6"
6 [[ ${PV} = *9999* ]] && VCS_ECLASS="subversion" || VCS_ECLASS=""
8 inherit ${VCS_ECLASS} git-r3
10 DESCRIPTION="Multimedia communication libraries written in C language
11 for building VoIP applications."
12 HOMEPAGE="http://www.pjsip.org/"
13 if [[ ${PV} == *9999* ]]; then
14 ESVN_REPO_URI="http://svn.pjsip.org/repos/pjproject/trunk"
15 KEYWORDS=""
16 else
17 SRC_URI="https://github.com/pjsip/pjproject/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
18 KEYWORDS="~amd64 ~x86"
21 LICENSE="GPL-2"
22 SLOT="0"
23 IUSE="alsa doc epoll examples ext-sound g711 g722 g7221 gsm ilbc l16
24 oss python ring speex ssl"
25 #small-filter large-filter speex-aec
27 DEPEND="alsa? ( media-libs/alsa-lib )
28 gsm? ( media-sound/gsm )
29 ilbc? ( dev-libs/ilbc-rfc3951 )
30 speex? ( media-libs/speex )
31 ring? ( ssl? ( net-libs/gnutls ) )
32 !ring? ( ssl? ( dev-libs/openssl ) )"
33 RDEPEND="${DEPEND}"
35 S="${WORKDIR}/pjproject-${PV}"
37 src_unpack() {
38 [[ ${PV} = *9999* ]] && subversion_src_unpack || default
40 if use ring; then
41 EGIT_REPO_URI="https://gerrit-ring.savoirfairelinux.com/ring-daemon"
42 EGIT_CHECKOUT_DIR=$WORKDIR/ring
43 git-r3_src_unpack
47 src_prepare() {
48 # Fix hardcoded prefix and flags
49 sed -i \
50 -e 's/poll@/poll@\nexport PREFIX := @prefix@\n/g' \
51 -e 's!prefix = /usr/local!prefix = $(PREFIX)!' \
52 Makefile \
53 build.mak.in || die "sed failed."
55 # apply -fPIC globally
56 cp ${FILESDIR}/user.mak ${S}
58 # TODO: remove deps to shipped codecs and libs, use system ones
59 # rm -r third_party
60 # libresample: https://ccrma.stanford.edu/~jos/resample/Free_Resampling_Software.html
62 use ring && {
63 eapply $WORKDIR/ring/contrib/src/pjproject/*.patch $FILESDIR/pjsip-ring-intptr_t.patch
64 sed -i -e 's#/usr/local#/usr#' aconfigure
66 default
69 src_configure() {
70 # Disable through portage available codecs
71 ssl=''
72 if use ring; then
73 use ssl && ssl=--enable-ssl=gnutls
74 conf=./aconfigure
75 else
76 use ssl && ssl=$(use_enable ssl)
77 conf=econf
79 $conf --disable-gsm-codec \
80 --disable-speex-codec \
81 --disable-ilbc-codec \
82 --disable-speex-aec \
83 $ssl \
84 $(use_enable epoll) \
85 $(use_enable alsa sound) \
86 $(use_enable oss) \
87 $(use_enable ext-sound) \
88 $(use_enable g711 g711-codec) \
89 $(use_enable l16 l16-codec) \
90 $(use_enable g722 g722-codec) \
91 $(use_enable g7221 g7221-codec) || die "econf failed."
92 #$(use_enable small-filter) \
93 #$(use_enable large-filter) \
94 #$(use_enable speex-aec) \
97 src_compile() {
98 emake dep || die "emake dep failed."
99 emake -j1 || die "emake failed."
102 src_install() {
103 DESTDIR="${D}" emake install || die "emake install failed."
105 if use python; then
106 pushd pjsip-apps/src/python
107 python setup.py install --prefix="${D}/usr/"
108 popd
111 if use doc; then
112 dodoc README.txt README-RTEMS
115 if use examples; then
116 insinto "/usr/share/doc/${P}/examples"
117 doins "${S}/pjsip-apps/src/samples/"*
120 # Remove files that pjproject should not install
121 rm -r "${D}/usr/lib/libportaudio.a" \
122 "${D}/usr/lib/libsrtp.a"