URI:
       topal-3.10.11-r1.ebuild - parlay - yet another gentoo overlay
  HTML git clone https://git.parazyd.org/parlay
   DIR Log
   DIR Files
   DIR Refs
   DIR README
       ---
       topal-3.10.11-r1.ebuild (7154B)
       ---
            1 # Copyright 1999-2017 Gentoo Foundation
            2 # Distributed under the terms of the GNU General Public License v2
            3 
            4 EAPI=6
            5 inherit autotools toolchain-funcs java-pkg-opt-2 flag-o-matic
            6 
            7 DESCRIPTION="C++ class library normalising numerous telephony protocols"
            8 HOMEPAGE="http://www.opalvoip.org/"
            9 SRC_URI="mirror://sourceforge/opalvoip/${P}.tar.bz2
           10         doc? ( mirror://sourceforge/opalvoip/${P}-htmldoc.tar.bz2 )"
           11 
           12 LICENSE="MPL-1.0"
           13 SLOT="0"
           14 KEYWORDS="alpha amd64 ia64 ppc ppc64 sparc x86"
           15 IUSE="celt debug doc +dtmf examples fax ffmpeg h224 h281 h323 iax ilbc
           16 ipv6 ivr java ldap libav lid +plugins sbc +sip +sipim +sound srtp ssl static-libs
           17 stats swig theora +video vpb vxml +wav x264 x264-static +xml"
           18 
           19 REQUIRED_USE="
           20         x264-static? ( x264 )
           21         h281? ( h224 )
           22         sip? ( sipim )
           23 "
           24 
           25 RDEPEND="
           26         >=net-libs/ptlib-2.10.10:=[stun,debug=,dtmf,http,ipv6?,ldap?,sound?,ssl?,video?,vxml?,wav?,xml?]
           27         >=media-libs/speex-1.2_beta
           28         fax? ( net-libs/ptlib[asn] )
           29         h323? ( net-libs/ptlib[asn] )
           30         ivr? ( net-libs/ptlib[http,xml,vxml] )
           31         java? ( >=virtual/jre-1.4:* )
           32         plugins? (
           33                 media-sound/gsm
           34                 celt? ( media-libs/celt:0 )
           35                 ffmpeg? (
           36                         libav? ( media-video/libav:0=[encode] )
           37                         !libav? ( media-video/ffmpeg:0=[encode] ) )
           38                 ilbc? ( dev-libs/ilbc-rfc3951 )
           39                 sbc? ( media-libs/libsamplerate )
           40                 theora? ( media-libs/libtheora )
           41                 x264? (        virtual/ffmpeg
           42                         media-libs/x264 ) )
           43         srtp? ( net-libs/libsrtp:0= )
           44         vxml? ( net-libs/ptlib[http,vxml] )
           45 "
           46 DEPEND="${RDEPEND}
           47         virtual/pkgconfig
           48         java? ( swig? ( dev-lang/swig )
           49                 >=virtual/jdk-1.4 )
           50 "
           51 
           52 # NOTES:
           53 # ffmpeg[encode] is for h263 and mpeg4
           54 # ssl, xml, vxml, ipv6, ldap, sound, wav, and video are use flags
           55 #   herited from ptlib: feature is enabled if ptlib has enabled it
           56 #   however, disabling it if ptlib has it looks hard (coz of buildopts.h)
           57 #   forcing ptlib to disable it for opal is not a solution too
           58 #   atm, accepting the "auto-feature" looks like a good solution
           59 #   (asn is used for fax and config _only_ for examples)
           60 # OPALDIR should not be used anymore but if a package still need it, create it
           61 
           62 pkg_setup() {
           63         # workaround for bug 282838
           64         append-cxxflags "-fno-visibility-inlines-hidden"
           65         append-cxxflags "-fno-strict-aliasing"
           66 
           67         java-pkg-opt-2_pkg_setup
           68 }
           69 
           70 src_prepare() {
           71         default
           72 
           73         # remove visual studio related files from samples/
           74         if use examples; then
           75                 rm -f samples/*/*.vcproj
           76                 rm -f samples/*/*.sln
           77                 rm -f samples/*/*.dsp
           78                 rm -f samples/*/*.dsw
           79         fi
           80 
           81         # LFS ffmpeg2+ fixes.
           82         eapply "${FILESDIR}"/opal-3.10.10-ffmpeg2-1.patch
           83 
           84         if ! use h323; then
           85                 # Without this patch, ekiga wont compile, even with
           86                 # USE=-h323.
           87                 eapply "${FILESDIR}/${PN}-3.10.9-disable-h323-workaround.patch"
           88         fi
           89 
           90         eapply "${FILESDIR}/${PN}-3.10.9-java-ruby-swig-fix.patch"
           91 
           92         sed -i -e "s:\(.*HAS_H224.*\), \[OPAL_H323\]:\1:" configure.ac \
           93                 || die "sed failed"
           94 
           95         # sed fixes for ffmpeg-3.
           96         sed -e 's/CODEC_ID/AV_&/' \
           97                 -e 's/PIX_FMT_/AV_&/' \
           98                 -i plugins/video/H.263-1998/h263-1998.cxx \
           99                    plugins/video/common/dyna.cxx          \
          100                    plugins/video/H.264/h264-x264.cxx      \
          101                    plugins/video/MPEG4-ffmpeg/mpeg4.cxx || die "sed failed"
          102 
          103         eaclocal
          104         eautoconf
          105 
          106         # in plugins
          107         cd plugins/
          108         eaclocal
          109         eautoconf
          110         cd ..
          111 
          112         # disable celt if celt is not enabled (prevent auto magic dep)
          113         # already in repository
          114         if ! use celt; then
          115                 sed -i -e "s/HAVE_CELT=yes/HAVE_CELT=no/" plugins/configure \
          116                         || die "sed failed"
          117         fi
          118 
          119         # fix automatic swig detection, upstream bug 2712521 (upstream reject it)
          120         if ! use swig; then
          121                 sed -i -e "/^SWIG=/d" configure || die "patching configure failed"
          122         fi
          123 
          124         use ilbc || { rm -r plugins/audio/iLBC/ || die "removing iLBC failed"; }
          125 
          126         java-pkg-opt-2_src_prepare
          127 }
          128 
          129 src_configure() {
          130         local forcedconf=""
          131 
          132         # fix bug 277233, upstream bug 2820939
          133         if use fax; then
          134                 forcedconf="${forcedconf} --enable-statistics"
          135         fi
          136 
          137         # --with-libavcodec-source-dir should _not_ be set, it's for trunk sources
          138         # versioncheck: check for ptlib version
          139         # shared: should always be enabled for a lib
          140         # localspeex, localspeexdsp, localgsm, localilbc: never use bundled libs
          141         # samples: only build some samples, useless
          142         # libavcodec-stackalign-hack: prevent hack (default disable by upstream)
          143         # default-to-full-capabilties: default enable by upstream
          144         # aec: atm, only used when bundled speex, so it's painless for us
          145         # zrtp doesn't depend on net-libs/libzrtpcpp but on libzrtp from
          146         #         http://zfoneproject.com/ wich is not in portage
          147         # msrp: highly experimental
          148         # spandsp: doesn't work with newest spandsp, upstream bug 2796047
          149         # g711plc: force enable
          150         # rfc4103: not really used, upstream bug 2795831
          151         # t38, spandsp: merged in fax
          152         # h450, h460, h501: merged in h323 (they are additional features of h323)
          153         econf \
          154                 --enable-versioncheck \
          155                 --enable-shared \
          156                 --disable-zrtp \
          157                 --disable-localspeex \
          158                 --disable-localspeexdsp \
          159                 --disable-localgsm \
          160                 --disable-localilbc \
          161                 --disable-samples \
          162                 --disable-libavcodec-stackalign-hack \
          163                 --enable-default-to-full-capabilties \
          164                 --enable-aec \
          165                 --disable-msrp \
          166                 --disable-spandsp \
          167                 --enable-g711plc \
          168                 --enable-rfc4103 \
          169                 --disable-capi \
          170                 --disable-ixj \
          171                 $(use_enable debug) \
          172                 $(use_enable fax) \
          173                 $(use_enable fax t38) \
          174                 $(use_enable h224) \
          175                 $(use_enable h281) \
          176                 $(use_enable h323) \
          177                 $(use_enable h323 h450) \
          178                 $(use_enable h323 h460) \
          179                 $(use_enable h323 h501) \
          180                 $(use_enable iax) \
          181                 $(use_enable ivr) \
          182                 $(use_enable java) \
          183                 $(use_enable lid) \
          184                 $(use_enable plugins) \
          185                 $(use_enable sbc) \
          186                 $(use_enable sip) \
          187                 $(use_enable sipim) \
          188                 $(use_enable stats statistics) \
          189                 $(use_enable video) $(use_enable video rfc4175) \
          190                 $(use_enable vpb) \
          191                 $(use_enable x264 h264) \
          192                 $(use_enable x264-static x264-link-static) \
          193                 ${forcedconf}
          194 }
          195 
          196 src_compile() {
          197         local makeopts=""
          198 
          199         use debug && makeopts="debug"
          200 
          201         emake ${makeopts}
          202 }
          203 
          204 src_install() {
          205         default
          206 
          207         # Get rid of static libraries if not requested
          208         # There seems to be no easy way to disable this in the build system
          209         if ! use static-libs; then
          210                 rm -v "${D}"/usr/lib*/*.a || die
          211         fi
          212 
          213         if use doc; then
          214                 dohtml -r "${WORKDIR}"/html/* docs/* || die "dohtml failed"
          215         fi
          216 
          217         if use examples; then
          218                 local exampledir="/usr/share/doc/${PF}/examples"
          219                 local basedir="samples"
          220                 local sampledirs="`ls ${basedir} --hide=configure* \
          221                         --hide=opal_samples.mak.in`"
          222 
          223                 # first, install files
          224                 insinto ${exampledir}/
          225                 doins ${basedir}/{configure*,opal_samples*} \
          226                         || die "doins failed"
          227 
          228                 # now, all examples
          229                 for x in ${sampledirs}; do
          230                         insinto ${exampledir}/${x}/
          231                         doins ${basedir}/${x}/* || die "doins failed"
          232                 done
          233 
          234                 # some examples need version.h
          235                 insinto "/usr/share/doc/${PF}/"
          236                 doins version.h || die "doins failed"
          237         fi
          238 }
          239 
          240 pkg_postinst() {
          241         if use examples; then
          242                 ewarn "All examples have been installed, some of them will not work on your system"
          243                 ewarn "it will depend of the enabled USE flags in ptlib and opal"
          244         fi
          245 
          246         if ! use plugins || ! use sound || ! use video; then
          247                 ewarn "You have disabled sound, video or plugins USE flags."
          248                 ewarn "Most audio/video features or plugins have been disabled silently"
          249                 ewarn "even if enabled via USE flags."
          250                 ewarn "Having a feature enabled via USE flag but disabled can lead to issues."
          251         fi
          252 }