summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Ballier <aballier@gentoo.org>2017-07-16 14:16:53 +0200
committerAlexis Ballier <aballier@gentoo.org>2017-07-16 14:17:01 +0200
commit94fbd1e663d2c463524b700eb372ef0a2e324438 (patch)
tree55c4aede85a2b02e2c2b09978896147eef8cb052 /media-libs/x265
parentdev-ros/opencv_apps: bump to 1.12.0 (diff)
downloadgentoo-94fbd1e663d2c463524b700eb372ef0a2e324438.tar.gz
gentoo-94fbd1e663d2c463524b700eb372ef0a2e324438.tar.bz2
gentoo-94fbd1e663d2c463524b700eb372ef0a2e324438.zip
media-libs/x265: bump to 2.5
Package-Manager: Portage-2.3.6, Repoman-2.3.2
Diffstat (limited to 'media-libs/x265')
-rw-r--r--media-libs/x265/Manifest1
-rw-r--r--media-libs/x265/x265-2.5.ebuild197
-rw-r--r--media-libs/x265/x265-9999.ebuild2
3 files changed, 199 insertions, 1 deletions
diff --git a/media-libs/x265/Manifest b/media-libs/x265/Manifest
index 4b753c9dbe00..dd671134b8e6 100644
--- a/media-libs/x265/Manifest
+++ b/media-libs/x265/Manifest
@@ -1,3 +1,4 @@
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
+DIST x265_2.5.tar.gz 1256678 SHA256 2e53259b504a7edb9b21b9800163b1ff4c90e60c74e23e7001d423c69c5d3d17 SHA512 f39b0b06a9f6ab9ab19fcdc1cba1578ace433e22dc8ec3f549ec3e5eeaaf40d17de6c7d419c12c16717ae795c45d953ef34a2fc9376d7e83eb7e9e74ab19ec93 WHIRLPOOL a5abfbbb533f22b2f243ff2053ab569d758d72b2cd0ec4ffb264688d9c4666b1354b7933d8e2a9197766cb33cda3e25c6771439ad34ad979ffbde361c2ecf0d5
diff --git a/media-libs/x265/x265-2.5.ebuild b/media-libs/x265/x265-2.5.ebuild
new file mode 100644
index 000000000000..1ef57ee3ddc8
--- /dev/null
+++ b/media-libs/x265/x265-2.5.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 ~arm64 ~hppa ~ia64 ~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/130"
+IUSE="+10bit +12bit cpu_flags_arm_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 cpu_flags_arm_neon ON OFF)) )
+ use cpu_flags_arm_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 b7e3fb2f6d94..1ef57ee3ddc8 100644
--- a/media-libs/x265/x265-9999.ebuild
+++ b/media-libs/x265/x265-9999.ebuild
@@ -12,7 +12,7 @@ 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 ~arm64 ~hppa ~ppc ~ppc64 ~x86"
+ KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~ia64 ~ppc ~ppc64 ~x86"
fi
DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"