libvpx-1.6.0-r1.ebuild 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. # Copyright 1999-2016 Gentoo Foundation
  2. # Distributed under the terms of the GNU General Public License v2
  3. EAPI=6
  4. inherit toolchain-funcs multilib-minimal
  5. LIBVPX_TESTDATA_VER=1.6.0
  6. DESCRIPTION="WebM VP8 and VP9 Codec SDK"
  7. HOMEPAGE="http://www.webmproject.org"
  8. SRC_URI="http://storage.googleapis.com/downloads.webmproject.org/releases/webm/${P}.tar.bz2
  9. test? ( mirror://gentoo/${PN}-testdata-${LIBVPX_TESTDATA_VER}.tar.bz2 )"
  10. LICENSE="BSD"
  11. SLOT="0/4"
  12. KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux"
  13. IUSE="cpu_flags_x86_avx cpu_flags_x86_avx2 doc cpu_flags_x86_mmx postproc cpu_flags_x86_sse cpu_flags_x86_sse2 cpu_flags_x86_sse3 cpu_flags_x86_ssse3 cpu_flags_x86_sse4_1 +highbitdepth static-libs svc test +threads"
  14. RDEPEND="abi_x86_32? ( !app-emulation/emul-linux-x86-medialibs[-abi_x86_32(-)] )"
  15. DEPEND="abi_x86_32? ( dev-lang/yasm )
  16. abi_x86_64? ( dev-lang/yasm )
  17. abi_x86_x32? ( dev-lang/yasm )
  18. x86-fbsd? ( dev-lang/yasm )
  19. amd64-fbsd? ( dev-lang/yasm )
  20. doc? (
  21. app-doc/doxygen
  22. dev-lang/php
  23. )
  24. "
  25. REQUIRED_USE="
  26. cpu_flags_x86_sse2? ( cpu_flags_x86_mmx )
  27. cpu_flags_x86_ssse3? ( cpu_flags_x86_sse2 )
  28. "
  29. PATCHES=(
  30. "${FILESDIR}/libvpx-1.3.0-sparc-configure.patch" # 501010
  31. )
  32. src_configure() {
  33. # https://bugs.gentoo.org/show_bug.cgi?id=384585
  34. # https://bugs.gentoo.org/show_bug.cgi?id=465988
  35. # copied from php-pear-r1.eclass
  36. addpredict /usr/share/snmp/mibs/.index
  37. addpredict /var/lib/net-snmp/
  38. addpredict /var/lib/net-snmp/mib_indexes
  39. addpredict /session_mm_cli0.sem
  40. multilib-minimal_src_configure
  41. }
  42. multilib_src_configure() {
  43. unset CODECS #357487
  44. # let the build system decide which AS to use (it honours $AS but
  45. # then feeds it with yasm flags without checking...) #345161
  46. tc-export AS
  47. case "${CHOST}" in
  48. i?86*) export AS=yasm;;
  49. x86_64*) export AS=yasm;;
  50. esac
  51. # Build with correct toolchain.
  52. tc-export CC CXX AR NM
  53. # Link with gcc by default, the build system should override this if needed.
  54. export LD="${CC}"
  55. local myconf
  56. if multilib_is_native_abi; then
  57. myconf+=" $(use_enable doc install-docs) $(use_enable doc docs)"
  58. else
  59. # not needed for multilib and will be overwritten anyway.
  60. myconf+=" --disable-examples --disable-install-docs --disable-docs"
  61. fi
  62. # #498364: sse doesn't work without sse2 enabled,
  63. "${S}/configure" \
  64. --prefix="${EPREFIX}"/usr \
  65. --libdir="${EPREFIX}"/usr/$(get_libdir) \
  66. --enable-pic \
  67. --enable-vp8 \
  68. --enable-vp9 \
  69. --enable-shared \
  70. --extra-cflags="${CFLAGS}" \
  71. $(use_enable cpu_flags_x86_avx avx) \
  72. $(use_enable cpu_flags_x86_avx2 avx2) \
  73. $(use_enable cpu_flags_x86_mmx mmx) \
  74. $(use_enable postproc) \
  75. $(use cpu_flags_x86_sse2 && use_enable cpu_flags_x86_sse sse || echo --disable-sse) \
  76. $(use_enable cpu_flags_x86_sse2 sse2) \
  77. $(use_enable cpu_flags_x86_sse3 sse3) \
  78. $(use_enable cpu_flags_x86_sse4_1 sse4_1) \
  79. $(use_enable cpu_flags_x86_ssse3 ssse3) \
  80. $(use_enable svc experimental) $(use_enable svc spatial-svc) \
  81. $(use_enable static-libs static) \
  82. $(use_enable test unit-tests) \
  83. $(use_enable threads multithread) \
  84. $(use_enable highbitdepth vp9-highbitdepth) \
  85. ${myconf} \
  86. || die
  87. }
  88. multilib_src_compile() {
  89. # build verbose by default and do not build examples that will not be installed
  90. emake verbose=yes GEN_EXAMPLES=
  91. }
  92. multilib_src_test() {
  93. LD_LIBRARY_PATH="${BUILD_DIR}:${LD_LIBRARY_PATH}" \
  94. emake verbose=yes GEN_EXAMPLES= LIBVPX_TEST_DATA_PATH="${WORKDIR}/${PN}-testdata" test
  95. }
  96. multilib_src_install() {
  97. emake verbose=yes GEN_EXAMPLES= DESTDIR="${D}" install
  98. multilib_is_native_abi && use doc && dodoc -r docs/html
  99. }