diff options
author | Alexis Ballier <aballier@gentoo.org> | 2017-04-23 16:54:41 +0200 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2017-04-23 16:54:41 +0200 |
commit | 2ad0da5916fb8a6b3fec8b81ee3f4cadf11d575c (patch) | |
tree | 990bc68720e04209763db58af30809dd8c7b64a7 /media-libs/x265 | |
parent | media-libs/x264: Add altivec useflag and disable ppc asm if not enabled, sinc... (diff) | |
download | gentoo-2ad0da5916fb8a6b3fec8b81ee3f4cadf11d575c.tar.gz gentoo-2ad0da5916fb8a6b3fec8b81ee3f4cadf11d575c.tar.bz2 gentoo-2ad0da5916fb8a6b3fec8b81ee3f4cadf11d575c.zip |
media-libs/x265: Bump to 2.4
Package-Manager: Portage-2.3.5, Repoman-2.3.2
Diffstat (limited to 'media-libs/x265')
-rw-r--r-- | media-libs/x265/Manifest | 1 | ||||
-rw-r--r-- | media-libs/x265/x265-2.4.ebuild | 197 | ||||
-rw-r--r-- | media-libs/x265/x265-9999.ebuild | 8 |
3 files changed, 204 insertions, 2 deletions
diff --git a/media-libs/x265/Manifest b/media-libs/x265/Manifest index 567ea94712c6..4b753c9dbe00 100644 --- a/media-libs/x265/Manifest +++ b/media-libs/x265/Manifest @@ -1,2 +1,3 @@ DIST x265_2.2.tar.gz 1203801 SHA256 b872552535e41fbffa03ba7cbcd3479c42c4053868309292e78e147b7773ac4b SHA512 335bb38cf0892f2c4310033b076d51115c0b7faa9596a4f556dde5e3d1378d04f3d0055cb0bf2441eb725b7f84c246174bdc315eeb4ddde61ef9d79469f44eef WHIRLPOOL 6aa6fb3669abbb6e3fd9dd9ffe38f595805a61beedcfccd509606a9c3a19f79037a518269206ddcac7231de45165f000e59c3b0f279921a6aa8de2cb5b38a7ec DIST x265_2.3.tar.gz 1215719 SHA256 47520ac3424790168ea5c2db4a3cf12ca4d55a1790720007916652f07af3e41f SHA512 c863e4bd95323baf5c1ee388c2d9e460749940b947a795e0bce7bffab620258fb7aafbbf2956225491f4532f715392df3d40f19301964e00c3ac2971cd7d8809 WHIRLPOOL c7fa65f74b342ae32ae7b89aed86e6270607ec22479c95b62bd6b3e2cb958635d459e3770fe73e7599e572b01b171d101f5fb50c161139c867bea1ddda217c10 +DIST x265_2.4.tar.gz 1242300 SHA256 9c2aa718d78f6fecdd783f08ab83b98d3169e5f670404da4c16439306907d729 SHA512 40d0e57104839454226cdba928806c12e533eade391a89e9587e1f9c11b8fd70cc54d20136a09a1127784fe7799c80425617280076b29e1a1ffff7ce44f07dbe WHIRLPOOL 63ab1989856912e8922db66862901511e5f7e4f2bd429319b3f419f8267a442374e8f8626065ccf96766c3075750525755d91df6976352b7b59f229aab94ac86 diff --git a/media-libs/x265/x265-2.4.ebuild b/media-libs/x265/x265-2.4.ebuild new file mode 100644 index 000000000000..93bc874c3ee2 --- /dev/null +++ b/media-libs/x265/x265-2.4.ebuild @@ -0,0 +1,197 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=5 + +inherit cmake-utils multilib-minimal multilib multibuild flag-o-matic + +if [[ ${PV} = 9999* ]]; then + inherit mercurial + EHG_REPO_URI="https://bitbucket.org/multicoreware/x265" +else + SRC_URI=" + https://bitbucket.org/multicoreware/x265/downloads/${PN}_${PV}.tar.gz + http://ftp.videolan.org/pub/videolan/x265/${PN}_${PV}.tar.gz" + KEYWORDS="~amd64 ~arm ~hppa ~ppc ~ppc64 ~x86" +fi + +DESCRIPTION="Library for encoding video streams into the H.265/HEVC format" +HOMEPAGE="http://x265.org/" + +LICENSE="GPL-2" +# subslot = libx265 soname +SLOT="0/116" +IUSE="+10bit +12bit neon numa pic power8 test" + +ASM_DEPEND=">=dev-lang/yasm-1.2.0" +RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )" +DEPEND="${RDEPEND} + abi_x86_32? ( ${ASM_DEPEND} ) + abi_x86_64? ( ${ASM_DEPEND} )" + +PATCHES=( + "${FILESDIR}/arm.patch" + "${FILESDIR}/neon.patch" + "${FILESDIR}/ppc64.patch" +) + +src_unpack() { + if [[ ${PV} = 9999* ]]; then + mercurial_src_unpack + # Can't set it at global scope due to mercurial.eclass limitations... + export S=${WORKDIR}/${P}/source + else + unpack ${A} + export S="$(echo "${WORKDIR}/${PN}_"*"/source")" + fi +} + +# By default, the library and the encoder is configured for only one output bit +# depth. Meaning, one has to rebuild libx265 if (s)he wants to produce HEVC +# files with a different bit depth, which is annoying. However, upstream +# supports proper namespacing for 8bits, 10bits & 12bits HEVC and linking all +# that together so that the resulting library can produce all three of them +# instead of only one. +# The API requires the bit depth parameter, so that libx265 can then chose which +# variant of the encoder to use. +# To achieve this, we have to build one (static) library for each non-main +# variant, and link it into the main library. +# Upstream documents using the 8bit variant as main library, hence we do not +# allow disabling it: "main" *MUST* come last in the following list. + +x265_get_variants() { + local variants="" + use 12bit && variants+="main12 " + use 10bit && variants+="main10 " + variants+="main" + echo "${variants}" +} + +x265_variant_src_configure() { + mkdir -p "${BUILD_DIR}" || die + pushd "${BUILD_DIR}" >/dev/null || die + + local mycmakeargs=( "${myabicmakeargs[@]}" ) + case "${MULTIBUILD_VARIANT}" in + "main12") + mycmakeargs+=( + -DHIGH_BIT_DEPTH=ON + -DEXPORT_C_API=OFF + -DENABLE_SHARED=OFF + -DENABLE_CLI=OFF + -DMAIN12=ON + ) + if [[ ${ABI} = x86 ]] ; then + mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) + fi + if [[ ${ABI} = arm ]] ; then + # 589674 + mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) + fi + if [[ ${ABI} = ppc64 ]] ; then + # https://bugs.gentoo.org/show_bug.cgi?id=607802#c5 + mycmakeargs+=( -DENABLE_ASSEMBLY=OFF -DENABLE_ALTIVEC=OFF ) + fi + ;; + "main10") + mycmakeargs+=( + -DHIGH_BIT_DEPTH=ON + -DEXPORT_C_API=OFF + -DENABLE_SHARED=OFF + -DENABLE_CLI=OFF + ) + if [[ ${ABI} = x86 ]] ; then + mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) + fi + if [[ ${ABI} = arm ]] ; then + # 589674 + mycmakeargs+=( -DENABLE_ASSEMBLY=OFF ) + fi + if [[ ${ABI} = ppc64 ]] ; then + # https://bugs.gentoo.org/show_bug.cgi?id=607802#c5 + mycmakeargs+=( -DENABLE_ASSEMBLY=OFF -DENABLE_ALTIVEC=OFF ) + fi + ;; + "main") + if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ; then + local myvariants=( "${MULTIBUILD_VARIANTS[@]}" ) + unset myvariants[${#MULTIBUILD_VARIANTS[@]}-1] + local liblist="" + for v in "${myvariants[@]}" ; do + ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die + liblist+="libx265_${v}.a;" + done + mycmakeargs+=( + -DEXTRA_LIB="${liblist}" + -DEXTRA_LINK_FLAGS=-L. + -DLINKED_10BIT=$(usex 10bit) + -DLINKED_12BIT=$(usex 12bit) + ) + fi + ;; + *) + die "Unknown variant: ${MULTIBUILD_VARIANT}";; + esac + cmake-utils_src_configure + popd >/dev/null || die +} + +multilib_src_configure() { + append-cflags -fPIC + append-cxxflags -fPIC + local myabicmakeargs=( + $(cmake-utils_use_enable test TESTS) + $(multilib_is_native_abi || echo "-DENABLE_CLI=OFF") + -DENABLE_LIBNUMA=$(usex numa ON OFF) + -DCPU_POWER8=$(usex power8 ON OFF) + -DENABLE_ALTIVEC=$(usex power8 ON OFF) + -DLIB_INSTALL_DIR="$(get_libdir)" + ) + + if [[ ${ABI} = x86 ]] ; then + # Bug #528202 + if use pic ; then + ewarn "PIC has been requested but x86 asm is not PIC-safe, disabling it." + myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF ) + fi + elif [[ ${ABI} = x32 ]] ; then + # bug #510890 + myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF ) + elif [[ ${ABI} = arm ]] ; then + myabicmakeargs+=( -DENABLE_ASSEMBLY=$(usex pic OFF $(usex neon ON OFF)) ) + use neon && use pic && ewarn "PIC has been requested but arm neon asm is not PIC-safe, disabling it." + fi + + local MULTIBUILD_VARIANTS=( $(x265_get_variants) ) + multibuild_foreach_variant x265_variant_src_configure +} + +multilib_src_compile() { + local MULTIBUILD_VARIANTS=( $(x265_get_variants) ) + multibuild_foreach_variant cmake-utils_src_compile +} + +x265_variant_src_test() { + if [ -x "${BUILD_DIR}/test/TestBench" ] ; then + "${BUILD_DIR}/test/TestBench" || die + else + einfo "Unit tests check only assembly." + einfo "You do not seem to have any for ABI=${ABI}, x265 variant=${MULTIBUILD_VARIANT}" + einfo "Skipping tests." + fi +} + +multilib_src_test() { + local MULTIBUILD_VARIANTS=( $(x265_get_variants) ) + multibuild_foreach_variant x265_variant_src_test +} + +multilib_src_install() { + # Install only "main" variant since the others are already linked into it. + local MULTIBUILD_VARIANTS=( "main" ) + multibuild_foreach_variant cmake-utils_src_install +} + +multilib_src_install_all() { + dodoc -r "${S}/../doc/"* +} diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-9999.ebuild index 65e1f961e655..93bc874c3ee2 100644 --- a/media-libs/x265/x265-9999.ebuild +++ b/media-libs/x265/x265-9999.ebuild @@ -20,7 +20,7 @@ HOMEPAGE="http://x265.org/" LICENSE="GPL-2" # subslot = libx265 soname -SLOT="0/111" +SLOT="0/116" IUSE="+10bit +12bit neon numa pic power8 test" ASM_DEPEND=">=dev-lang/yasm-1.2.0" @@ -29,7 +29,11 @@ DEPEND="${RDEPEND} abi_x86_32? ( ${ASM_DEPEND} ) abi_x86_64? ( ${ASM_DEPEND} )" -PATCHES=( "${FILESDIR}/arm.patch" "${FILESDIR}/neon.patch" "${FILESDIR}/ppc64.patch" ) +PATCHES=( + "${FILESDIR}/arm.patch" + "${FILESDIR}/neon.patch" + "${FILESDIR}/ppc64.patch" +) src_unpack() { if [[ ${PV} = 9999* ]]; then |