URI: 
       tptlib-2.10.11.ebuild - parlay - yet another gentoo overlay
  HTML git clone https://git.parazyd.org/parlay
   DIR Log
   DIR Files
   DIR Refs
   DIR README
       ---
       tptlib-2.10.11.ebuild (6278B)
       ---
            1 # Copyright 1999-2017 Gentoo Foundation
            2 # Distributed under the terms of the GNU General Public License v2
            3 
            4 EAPI="5"
            5 
            6 inherit eutils
            7 
            8 DESCRIPTION="Network focused portable C++ class library providing high level functions"
            9 HOMEPAGE="http://www.opalvoip.org/"
           10 SRC_URI="mirror://sourceforge/opalvoip/${P}.tar.bz2
           11         doc? ( mirror://sourceforge/opalvoip/${PN}-2.10.10-htmldoc.tar.bz2 )"
           12 
           13 LICENSE="MPL-1.0"
           14 SLOT="0/${PV}"
           15 KEYWORDS="alpha amd64 ~arm ia64 ppc ppc64 sparc x86"
           16 # default enabled are features from 'minsize', the most used according to ptlib
           17 IUSE="alsa +asn debug doc +dtmf examples ffmpeg ftp +http ipv6
           18 xmpp ldap lua mail odbc oss pch pulseaudio qos remote sasl sdl serial
           19 shmvideo snmp soap socks +sound ssl static-libs +stun telnet tts v4l +video
           20 vxml +wav +xml xmlrpc"
           21 
           22 CDEPEND="
           23         ldap? ( net-nds/openldap )
           24         lua? ( dev-lang/lua )
           25         odbc? ( dev-db/unixODBC )
           26         pulseaudio? ( media-sound/pulseaudio )
           27         sasl? ( dev-libs/cyrus-sasl:2 )
           28         sdl? ( media-libs/libsdl )
           29         sound? ( alsa? ( media-libs/alsa-lib ) )
           30         ssl? ( dev-libs/openssl )
           31         video? ( v4l? ( media-libs/libv4l ) )
           32         xml? ( dev-libs/expat )
           33         !!dev-libs/pwlib"
           34 RDEPEND="${CDEPEND}
           35         ffmpeg? ( virtual/ffmpeg )"
           36 DEPEND="${CDEPEND}
           37         virtual/pkgconfig
           38         sys-devel/bison
           39         sys-devel/flex
           40         video? ( v4l? ( sys-kernel/linux-headers ) )"
           41 
           42 # NOTES:
           43 # media-libs/libdc1394:2 should be supported but headers location have changed
           44 # tools/ directory is ignored
           45 # avc plugin is disabled to fix bug 276514, see upstream bug 2821744
           46 
           47 conditional_use_warn_msg() {
           48         ewarn "To enable ${1} USE flag, you need ${2} USE flag to be enabled"
           49         ewarn "Please, enable ${2} or disable ${1}"
           50 }
           51 
           52 REQUIRED_USE="sdl? ( video )
           53         xmpp? ( xml )
           54         vxml? ( http tts xml )
           55         xmlrpc? ( http xml )
           56         soap? ( http xml )"
           57 
           58 src_prepare() {
           59         epatch "${FILESDIR}/${PN}-2.10.9-svn_revision_override.patch" \
           60                 "${FILESDIR}/${PN}-2.10.9-pkgconfig_ldflags.patch" \
           61                 "${FILESDIR}/${PN}-2.10.9-respect_cxxflags.patch" \
           62                 "${FILESDIR}/${PN}-2.10.10-mga-bison-parameter.patch" \
           63                 "${FILESDIR}/${PN}-2.10.10-respect_cflags_cxxflags.patch" \
           64                 "${FILESDIR}/${P}-gcc6.patch"
           65 
           66         if ! use telnet; then
           67                 epatch "${FILESDIR}/${PN}-2.10.9-disable-telnet-symbols.patch"
           68         fi
           69 
           70         # remove visual studio related files from samples/
           71         if use examples; then
           72                 rm -f samples/*/*.vcproj
           73                 rm -f samples/*/*.sln
           74                 rm -f samples/*/*.dsp
           75                 rm -f samples/*/*.dsw
           76         fi
           77 
           78         if [[ ! -z ${TARGET+set} ]]; then
           79                 ewarn "TARGET variable is set. Removing as it would break the build, bug #465722."
           80                 unset TARGET
           81         fi
           82 }
           83 
           84 src_configure() {
           85         local myconf=""
           86 
           87         # plugins are disabled only if ! sound and ! video
           88         if ! use sound && ! use video; then
           89                 myconf="${myconf} --disable-plugins"
           90         else
           91                 myconf="${myconf} --enable-plugins"
           92         fi
           93 
           94         # minsize: presets of features (overwritten by use flags)
           95         # ansi-bool, atomicity: there is no reason to disable those features
           96         # internalregex: we want to use system one
           97         # sunaudio and bsdvideo are respectively for SunOS and BSD's
           98         # appshare, vfw: only for windows
           99         # samples: no need to build samples
          100         # avc: disabled, bug 276514, upstream bug 2821744
          101         # mlib: SUN mediaLibs. Not in tree.
          102         # pipechan, configfile, resolver, url: force enabling
          103         econf ${myconf} \
          104                 --disable-minsize \
          105                 --enable-ansi-bool \
          106                 --enable-atomicity \
          107                 --disable-internalregex \
          108                 --disable-sunaudio \
          109                 --disable-bsdvideo \
          110                 --disable-appshare \
          111                 --disable-vfw \
          112                 --disable-samples \
          113                 --disable-avc \
          114                 --disable-mlib \
          115                 --enable-configfile \
          116                 --enable-pipechan \
          117                 --enable-resolver \
          118                 --enable-url \
          119                 $(use_enable alsa) \
          120                 $(use_enable asn) \
          121                 $(use_enable debug exceptions) \
          122                 $(use_enable debug memcheck) \
          123                 $(use_enable debug tracing) \
          124                 $(use_enable dtmf) \
          125                 --disable-esd \
          126                 $(use_enable ffmpeg ffvdev) \
          127                 $(use_enable ftp) \
          128                 $(use_enable http) \
          129                 $(use_enable http httpforms) \
          130                 $(use_enable http httpsvc) \
          131                 --disable-dc \
          132                 $(use_enable ipv6) \
          133                 $(use_enable xmpp jabber) \
          134                 $(use_enable ldap openldap) \
          135                 $(use_enable lua) \
          136                 $(use_enable mail pop3smtp) \
          137                 $(use_enable pulseaudio pulse) \
          138                 $(use_enable odbc) \
          139                 $(use_enable oss) \
          140                 $(use_enable pch) \
          141                 $(use_enable qos) \
          142                 $(use_enable remote remconn) \
          143                 $(use_enable sasl) \
          144                 $(use_enable sdl) \
          145                 $(use_enable serial) \
          146                 $(use_enable shmvideo) \
          147                 $(use_enable snmp) \
          148                 $(use_enable soap) \
          149                 $(use_enable socks) \
          150                 $(use_enable sound audio) \
          151                 $(use_enable ssl openssl) \
          152                 $(use_enable stun) \
          153                 $(use_enable telnet) \
          154                 $(use_enable tts) \
          155                 --disable-v4l \
          156                 $(use_enable v4l v4l2) \
          157                 $(use_enable video) $(use_enable video vidfile) \
          158                 $(use_enable vxml) \
          159                 $(use_enable wav wavfile) \
          160                 $(use_enable xml expat) \
          161                 $(use_enable xmlrpc)
          162 }
          163 
          164 src_compile() {
          165         local makeopts=""
          166         tc-env_build
          167 
          168         use debug && makeopts="debug"
          169 
          170         emake ${makeopts} V=1 || die "emake failed"
          171 }
          172 
          173 src_install() {
          174         local makeopts=""
          175 
          176         use debug && makeopts="DEBUG=1"
          177 
          178         emake DESTDIR="${D}" ${makeopts} install || die "emake install failed"
          179 
          180         # Get rid of static libraries if not requested
          181         # There seems to be no easy way to disable this in the build system
          182         if ! use static-libs; then
          183                 rm -v "${D}"/usr/lib*/*.a || die
          184         fi
          185 
          186         if use doc; then
          187                 dohtml -r "${WORKDIR}"/html/* || die "dohtml failed"
          188         fi
          189 
          190         dodoc History.txt ReadMe.txt ReadMe_QOS.txt || die "dodoc failed"
          191 
          192         if use sound || use video; then
          193                 newdoc plugins/ReadMe.txt ReadMe-Plugins.txt || die "newdoc failed"
          194         fi
          195 
          196         if use examples; then
          197                 local exampledir="/usr/share/doc/${PF}/examples"
          198                 local basedir="samples"
          199                 local sampledirs="`ls samples --hide=Makefile`"
          200 
          201                 # first, install Makefile
          202                 insinto ${exampledir}/
          203                 doins ${basedir}/Makefile || die "doins failed"
          204 
          205                 # now, all examples
          206                 for x in ${sampledirs}; do
          207                         insinto ${exampledir}/${x}/
          208                         doins ${basedir}/${x}/* || die "doins failed"
          209                 done
          210         fi
          211 }
          212 
          213 pkg_postinst() {
          214         if use examples; then
          215                 ewarn "All examples have been installed, some of them will not work on your system"
          216                 ewarn "it will depend of the enabled USE flags."
          217                 ewarn "To test examples, you have to run PTLIBDIR=/usr/share/ptlib make"
          218         fi
          219 
          220         if ! use sound || ! use video; then
          221                 ewarn "You have disabled sound or video USE flags."
          222                 ewarn "Most audio/video have been disabled silently even if enabled via USE flags."
          223                 ewarn "Having a feature enabled via use flag but disabled can lead to issues."
          224         fi
          225 }