ptlib-2.10.11.ebuild 6.1 KB

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