Advertisement
Guest User

Untitled

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