libvpx-1.5.0.ebuild 3.9 KB

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