1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
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"
17 SRC_URI
="https://github.com/pjsip/pjproject/archive/refs/tags/${PV}.tar.gz -> ${P}.tar.gz"
18 KEYWORDS
="~amd64 ~x86"
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 ) )"
35 S
="${WORKDIR}/pjproject-${PV}"
38 [[ ${PV} = *9999* ]] && subversion_src_unpack || default
41 EGIT_REPO_URI
="https://gerrit-ring.savoirfairelinux.com/ring-daemon"
42 EGIT_CHECKOUT_DIR
=$WORKDIR/ring
48 # Fix hardcoded prefix and flags
50 -e 's/poll@/poll@\nexport PREFIX := @prefix@\n/g' \
51 -e 's!prefix = /usr/local!prefix = $(PREFIX)!' \
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
60 # libresample: https://ccrma.stanford.edu/~jos/resample/Free_Resampling_Software.html
63 eapply
$WORKDIR/ring
/contrib
/src
/pjproject
/*.
patch $FILESDIR/pjsip-ring-intptr_t.
patch
64 sed -i -e 's#/usr/local#/usr#' aconfigure
70 # Disable through portage available codecs
73 use ssl
&& ssl
=--enable-ssl=gnutls
76 use ssl
&& ssl
=$
(use_enable ssl
)
79 $conf --disable-gsm-codec \
80 --disable-speex-codec \
81 --disable-ilbc-codec \
85 $
(use_enable alsa sound
) \
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) \
98 emake dep || die
"emake dep failed."
99 emake
-j1 || die
"emake failed."
103 DESTDIR
="${D}" emake
install || die
"emake install failed."
106 pushd pjsip-apps
/src
/python
107 python setup.py
install --prefix="${D}/usr/"
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"