public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2015-10-14 21:08 Michał Górny
  0 siblings, 0 replies; 10+ messages in thread
From: Michał Górny @ 2015-10-14 21:08 UTC (permalink / raw
  To: gentoo-commits

commit:     5658f1dc7a9c128630e2c4b0b843ecfd14cbf592
Author:     Bertrand Jacquin <bertrand <AT> jacquin <DOT> bzh>
AuthorDate: Mon Jul 28 18:12:43 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Tue Oct 13 23:26:19 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5658f1dc

media-libs/x265: Fix x32 build, bug #510890

x32 arch as defined on https://sites.google.com/site/x32abi is neither
X86 nor X64, then forcing -march=i686 leads to build failure as wrong
-march is used.

Forcing -march, -mfloat-abi and -mfpu for ARM is also wrong
As a global sanity sake, disable all forced -march in CMakeLists

Upstream report: https://bitbucket.org/multicoreware/x265/pull-requests/21/build-disable-march-selection-from/diff

Package-Manager: portage-2.2.20.1

 ...sable-march-selection-from-CMakeLists.txt.patch | 35 ++++++++++++++++++++++
 media-libs/x265/x265-1.8.ebuild                    |  9 +++++-
 media-libs/x265/x265-9999.ebuild                   |  5 +++-
 3 files changed, 47 insertions(+), 2 deletions(-)

diff --git a/media-libs/x265/files/1.8-build-Disable-march-selection-from-CMakeLists.txt.patch b/media-libs/x265/files/1.8-build-Disable-march-selection-from-CMakeLists.txt.patch
new file mode 100644
index 0000000..33ee254
--- /dev/null
+++ b/media-libs/x265/files/1.8-build-Disable-march-selection-from-CMakeLists.txt.patch
@@ -0,0 +1,35 @@
+From e89069148db716d30fb81c798d0cfd83250a9f5a Mon Sep 17 00:00:00 2001
+From: Bertrand Jacquin <bertrand@jacquin.bzh>
+Date: Sat, 10 Oct 2015 00:05:41 +0100
+Subject: [PATCH] build: Disable -march selection from CMakeLists.txt
+
+x32 arch as defined on https://sites.google.com/site/x32abi is neither
+X86 nor X64, then forcing -march=i686 leads to build failure as wrong
+-march is used.
+
+Forcing -march, -mfloat-abi and -mfpu for ARM is also wrong
+
+As a global sanity sake, disable all forced -march in CMakeLists
+---
+ source/CMakeLists.txt | 7 -------
+ 1 file changed, 7 deletions(-)
+
+diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
+index 764d5f2..fbc0d49 100644
+--- a/source/CMakeLists.txt
++++ b/source/CMakeLists.txt
+@@ -167,14 +167,7 @@ if(GCC)
+     if(NATIVE_BUILD)
+         if(INTEL_CXX)
+             add_definitions(-xhost)
+-        else()
+-            add_definitions(-march=native)
+         endif()
+-    elseif(X86 AND NOT X64)
+-        add_definitions(-march=i686)
+-    endif()
+-    if(ARM)
+-        add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
+     endif()
+     if(FPROFILE_GENERATE)
+         if(INTEL_CXX)

diff --git a/media-libs/x265/x265-1.8.ebuild b/media-libs/x265/x265-1.8.ebuild
index ee4a32f..8138afc 100644
--- a/media-libs/x265/x265-1.8.ebuild
+++ b/media-libs/x265/x265-1.8.ebuild
@@ -41,6 +41,10 @@ src_unpack() {
 	fi
 }
 
+src_prepare() {
+	epatch "${FILESDIR}/${PV}-build-Disable-march-selection-from-CMakeLists.txt.patch"	# bug #510890
+}
+
 multilib_src_configure() {
 	append-cflags -fPIC
 	append-cxxflags -fPIC
@@ -51,9 +55,12 @@ multilib_src_configure() {
 		-DLIB_INSTALL_DIR="$(get_libdir)"
 	)
 
-	if [ "${ABI}" = x86 ] ; then
+	if [[ ${ABI} = x86 ]] ; then
 		use 10bit && ewarn "Disabling 10bit support on x86 as it does not build (or requires to disable assembly optimizations)"
 		mycmakeargs+=( -DHIGH_BIT_DEPTH=OFF )
+	elif [[ ${ABI} = x32 ]] ; then
+		# bug #510890
+		mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
 	fi
 
 	cmake-utils_src_configure

diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-9999.ebuild
index 8a3e36f..5b0348c 100644
--- a/media-libs/x265/x265-9999.ebuild
+++ b/media-libs/x265/x265-9999.ebuild
@@ -51,9 +51,12 @@ multilib_src_configure() {
 		-DLIB_INSTALL_DIR="$(get_libdir)"
 	)
 
-	if [ "${ABI}" = x86 ] ; then
+	if [[ ${ABI} = x86 ]] ; then
 		use 10bit && ewarn "Disabling 10bit support on x86 as it does not build (or requires to disable assembly optimizations)"
 		mycmakeargs+=( -DHIGH_BIT_DEPTH=OFF )
+	elif [[ ${ABI} = x32 ]] ; then
+		# bug #510890
+		mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
 	fi
 
 	cmake-utils_src_configure


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2017-02-24  9:00 Alexis Ballier
  0 siblings, 0 replies; 10+ messages in thread
From: Alexis Ballier @ 2017-02-24  9:00 UTC (permalink / raw
  To: gentoo-commits

commit:     14baa3374376db3e76f3cb8573d967c1dd416680
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Fri Feb 24 08:55:07 2017 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Fri Feb 24 08:59:34 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14baa337

media-libs/x265: remove old

Package-Manager: Portage-2.3.3, Repoman-2.3.1

 media-libs/x265/Manifest                           |   1 -
 ...sable-march-selection-from-CMakeLists.txt.patch |  37 -----
 media-libs/x265/files/1.8-extralibs_order.patch    |  29 ----
 media-libs/x265/x265-1.8-r3.ebuild                 | 176 ---------------------
 4 files changed, 243 deletions(-)

diff --git a/media-libs/x265/Manifest b/media-libs/x265/Manifest
index 24b12f1ef6..567ea94712 100644
--- a/media-libs/x265/Manifest
+++ b/media-libs/x265/Manifest
@@ -1,3 +1,2 @@
-DIST x265_1.8.tar.gz 918469 SHA256 760e6280c688f1ea90c492d19fc6d4084ca1c4b0ea9b2e3c736d32565c30d857 SHA512 498c25ff6e5c68849db11d1509cc6f7e96d3a2e6594542589ac5b9f6d65a09ab3af590dcc3357f985f218f8d54af364c998cfedfbe95644747835c059214935c WHIRLPOOL ef5c1a31e8ab45c2918e24e97c09809eda735df354d9000e3935b054ca01fd60ef1d1afad6c161c7c62b8b016c2a80155665448a18e4037fab8c56a841488eeb
 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

diff --git a/media-libs/x265/files/1.8-build-Disable-march-selection-from-CMakeLists.txt.patch b/media-libs/x265/files/1.8-build-Disable-march-selection-from-CMakeLists.txt.patch
deleted file mode 100644
index a2e8f0d047..0000000000
--- a/media-libs/x265/files/1.8-build-Disable-march-selection-from-CMakeLists.txt.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-https://bitbucket.org/multicoreware/x265/pull-requests/21
-
-From e89069148db716d30fb81c798d0cfd83250a9f5a Mon Sep 17 00:00:00 2001
-From: Bertrand Jacquin <bertrand@jacquin.bzh>
-Date: Sat, 10 Oct 2015 00:05:41 +0100
-Subject: [PATCH] build: Disable -march selection from CMakeLists.txt
-
-x32 arch as defined on https://sites.google.com/site/x32abi is neither
-X86 nor X64, then forcing -march=i686 leads to build failure as wrong
--march is used.
-
-Forcing -march, -mfloat-abi and -mfpu for ARM is also wrong
-
-As a global sanity sake, disable all forced -march in CMakeLists
----
- source/CMakeLists.txt | 7 -------
- 1 file changed, 7 deletions(-)
-
-diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
-index 764d5f2..fbc0d49 100644
---- a/source/CMakeLists.txt
-+++ b/source/CMakeLists.txt
-@@ -167,14 +167,7 @@ if(GCC)
-     if(NATIVE_BUILD)
-         if(INTEL_CXX)
-             add_definitions(-xhost)
--        else()
--            add_definitions(-march=native)
-         endif()
--    elseif(X86 AND NOT X64)
--        add_definitions(-march=i686)
--    endif()
--    if(ARM)
--        add_definitions(-march=armv6 -mfloat-abi=hard -mfpu=vfp)
-     endif()
-     if(FPROFILE_GENERATE)
-         if(INTEL_CXX)

diff --git a/media-libs/x265/files/1.8-extralibs_order.patch b/media-libs/x265/files/1.8-extralibs_order.patch
deleted file mode 100644
index e30c0f9657..0000000000
--- a/media-libs/x265/files/1.8-extralibs_order.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-https://bitbucket.org/multicoreware/x265/pull-requests/22
-
-Link EXTRA_LIB before PLATFORM_LIBS since they're static libraries and as-needed
-might drop required libraries if they come after.
-
-Index: x265_11047/source/CMakeLists.txt
-===================================================================
---- x265_11047.orig/source/CMakeLists.txt
-+++ x265_11047/source/CMakeLists.txt
-@@ -455,6 +455,9 @@ option(ENABLE_SHARED "Build shared libra
- if(ENABLE_SHARED)
-     add_library(x265-shared SHARED "${PROJECT_BINARY_DIR}/x265.def" ${YASM_OBJS}
-                 ${X265_RC_FILE} $<TARGET_OBJECTS:encoder> $<TARGET_OBJECTS:common>)
-+    if(EXTRA_LIB)
-+        target_link_libraries(x265-shared ${EXTRA_LIB})
-+    endif()
-     target_link_libraries(x265-shared ${PLATFORM_LIBS})
-     if(MSVC)
-         set_target_properties(x265-shared PROPERTIES OUTPUT_NAME libx265)
-@@ -480,9 +483,6 @@ if(ENABLE_SHARED)
-                 ARCHIVE DESTINATION ${LIB_INSTALL_DIR}
-                 RUNTIME DESTINATION ${BIN_INSTALL_DIR})
-     endif()
--    if(EXTRA_LIB)
--        target_link_libraries(x265-shared ${EXTRA_LIB})
--    endif()
-     if(LINKER_OPTIONS)
-         # set_target_properties can't do list expansion
-         string(REPLACE ";" " " LINKER_OPTION_STR "${LINKER_OPTIONS}")

diff --git a/media-libs/x265/x265-1.8-r3.ebuild b/media-libs/x265/x265-1.8-r3.ebuild
deleted file mode 100644
index f855da1688..0000000000
--- a/media-libs/x265/x265-1.8-r3.ebuild
+++ /dev/null
@@ -1,176 +0,0 @@
-# Copyright 1999-2017 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Id$
-
-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/68"
-IUSE="+10bit 12bit numa pic 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} )"
-
-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
-}
-
-src_prepare() {
-	epatch "${FILESDIR}/${PV}-build-Disable-march-selection-from-CMakeLists.txt.patch"	# bug #510890
-	epatch "${FILESDIR}/1.8-extralibs_order.patch"
-}
-
-# 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
-			;;
-		"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
-			;;
-		"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")
-		-DCMAKE_DISABLE_FIND_PACKAGE_Numa=$(usex numa OFF ON)
-		-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 )
-	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/"*
-}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2018-06-29  7:39 Alexis Ballier
  0 siblings, 0 replies; 10+ messages in thread
From: Alexis Ballier @ 2018-06-29  7:39 UTC (permalink / raw
  To: gentoo-commits

commit:     47c0313dd95bf0284fd9eef981f742124f1d2d01
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Fri Jun 29 07:39:06 2018 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Fri Jun 29 07:39:16 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=47c0313d

media-libs/x265: backport upstream patch to fix build error

Package-Manager: Portage-2.3.41, Repoman-2.3.9

 media-libs/x265/files/non_x86.patch | 20 ++++++++++++++++++++
 media-libs/x265/x265-2.8.ebuild     |  1 +
 2 files changed, 21 insertions(+)

diff --git a/media-libs/x265/files/non_x86.patch b/media-libs/x265/files/non_x86.patch
new file mode 100644
index 00000000000..3c7e389329a
--- /dev/null
+++ b/media-libs/x265/files/non_x86.patch
@@ -0,0 +1,20 @@
+# HG changeset patch
+# User Jayashree <jayashree.c@multicorewareinc.com>
+# Date 1527224165 -19800
+#      Fri May 25 10:26:05 2018 +0530
+# Node ID 4504219210793536d921ee4e0b3058698c630bf4
+# Parent  cc2c5e46f3c87d27e3602af30b06ba6a0fbe2704
+Fix build error on on ppc64le
+
+diff -r cc2c5e46f3c8 -r 450421921079 source/common/param.cpp
+--- a/source/common/param.cpp	Mon May 21 18:42:29 2018 +0530
++++ b/source/common/param.cpp	Fri May 25 10:26:05 2018 +0530
+@@ -633,7 +633,7 @@
+         if (bValueWasNull)
+             p->cpuid = atobool(value);
+         else
+-            p->cpuid = parseCpuName(value, bError);
++            p->cpuid = parseCpuName(value, bError, false);
+ #endif
+     }
+     OPT("fps")

diff --git a/media-libs/x265/x265-2.8.ebuild b/media-libs/x265/x265-2.8.ebuild
index b7f4c3f2050..7f60a7f1134 100644
--- a/media-libs/x265/x265-2.8.ebuild
+++ b/media-libs/x265/x265-2.8.ebuild
@@ -31,6 +31,7 @@ PATCHES=(
 	"${FILESDIR}/arm.patch"
 	"${FILESDIR}/neon.patch"
 	"${FILESDIR}/ppc64.patch"
+	"${FILESDIR}/non_x86.patch"
 )
 
 src_unpack() {


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2018-10-17 12:48 Jeroen Roovers
  0 siblings, 0 replies; 10+ messages in thread
From: Jeroen Roovers @ 2018-10-17 12:48 UTC (permalink / raw
  To: gentoo-commits

commit:     432f45bd8ece2a10ea64b7b07f951d0ac6aa0666
Author:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 17 12:40:22 2018 +0000
Commit:     Jeroen Roovers <jer <AT> gentoo <DOT> org>
CommitDate: Wed Oct 17 12:48:21 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=432f45bd

media-libs/x265: Let everybody have detect512

Upstream commit d55132eb4201 introduced detect512() but the function is
defined only when X265_ARCH_X86 so the linker fails with non x86
targets:

libx265.so.165: undefined reference to `x265_12bit::detect512()'
libx265.so.165: undefined reference to `x265_10bit::detect512()'
libx265.so.165: undefined reference to `x265::detect512()'

Fix it by defining the function unconditionally.

Package-Manager: Portage-2.3.51, Repoman-2.3.11
Signed-off-by: Jeroen Roovers <jer <AT> gentoo.org>

 media-libs/x265/files/x265-2.9-detect512.patch | 25 +++++++++++++++++++++++++
 media-libs/x265/x265-2.9.ebuild                |  1 +
 2 files changed, 26 insertions(+)

diff --git a/media-libs/x265/files/x265-2.9-detect512.patch b/media-libs/x265/files/x265-2.9-detect512.patch
new file mode 100644
index 00000000000..8437ed09b88
--- /dev/null
+++ b/media-libs/x265/files/x265-2.9-detect512.patch
@@ -0,0 +1,25 @@
+--- a/source/common/cpu.cpp
++++ b/source/common/cpu.cpp
+@@ -110,6 +110,11 @@
+     { "", 0 },
+ };
+ 
++bool detect512()
++{
++    return(enable512);
++}
++
+ #if X265_ARCH_X86
+ 
+ extern "C" {
+@@ -123,10 +128,6 @@
+ #pragma warning(disable: 4309) // truncation of constant value
+ #endif
+ 
+-bool detect512()
+-{
+-    return(enable512);
+-}
+ uint32_t cpu_detect(bool benableavx512 )
+ {
+ 

diff --git a/media-libs/x265/x265-2.9.ebuild b/media-libs/x265/x265-2.9.ebuild
index b62476a545d..38316ce55ea 100644
--- a/media-libs/x265/x265-2.9.ebuild
+++ b/media-libs/x265/x265-2.9.ebuild
@@ -31,6 +31,7 @@ PATCHES=(
 	"${FILESDIR}/arm.patch"
 	"${FILESDIR}/neon.patch"
 	"${FILESDIR}/ppc64.patch"
+	"${FILESDIR}"/${PN}-2.9-detect512.patch
 )
 
 src_unpack() {


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2018-11-11 22:10 Andreas Sturmlechner
  0 siblings, 0 replies; 10+ messages in thread
From: Andreas Sturmlechner @ 2018-11-11 22:10 UTC (permalink / raw
  To: gentoo-commits

commit:     6ffd5fa657a7fa35f4ac561d294f5722c9dc1a50
Author:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 11 09:14:05 2018 +0000
Commit:     Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Sun Nov 11 21:34:48 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6ffd5fa6

media-libs/x265: Drop old

Package-Manager: Portage-2.3.51, Repoman-2.3.12
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>

 media-libs/x265/Manifest            |   4 -
 media-libs/x265/files/non_x86.patch |  20 ----
 media-libs/x265/x265-2.2.ebuild     | 193 -----------------------------------
 media-libs/x265/x265-2.6.ebuild     | 195 -----------------------------------
 media-libs/x265/x265-2.7.ebuild     | 195 -----------------------------------
 media-libs/x265/x265-2.8.ebuild     | 196 ------------------------------------
 6 files changed, 803 deletions(-)

diff --git a/media-libs/x265/Manifest b/media-libs/x265/Manifest
index 7740dc8a147..922e51a3e7e 100644
--- a/media-libs/x265/Manifest
+++ b/media-libs/x265/Manifest
@@ -1,5 +1 @@
-DIST x265_2.2.tar.gz 1203801 BLAKE2B 239b34c45b07c5bea83f0555d2d8f44322bd8fb3164264ff10f3887bb244ce7e605a82c2cb0a2f2ae4f2749e009baac19407109996e599dc41bc970a610ed086 SHA512 335bb38cf0892f2c4310033b076d51115c0b7faa9596a4f556dde5e3d1378d04f3d0055cb0bf2441eb725b7f84c246174bdc315eeb4ddde61ef9d79469f44eef
-DIST x265_2.6.tar.gz 1271976 BLAKE2B f649c47209af0f1cfff7ff736b9f43f20c9eaaf14e8428f6eff4fd9e3ce925de6e1ecde1be55b5d654321614fc245837d0bc603b72a92c41b92c729dc20f5cb6 SHA512 35c3716313e3dfd1555dd725b60f2b3b00a615d8b8d8267439722b52021d47e34eebf94b837b92a92d40c7ffab7b3198d6391365d62672b257c0a87d1db8a736
-DIST x265_2.7.tar.gz 1282742 BLAKE2B 5f7290a71009f1ba177b2a653c48b62d8067930e8e53e4f9dd149037d3cbc69acbcae9c5364d46e6cc127f7d70e2acaaed2abf3ef065ecae303088132f341757 SHA512 58582ff5c282a8ca6213a98495b95fa941f323fa454924e4751dde6d2a0e87a08d6e8d98012164a3d83523f2b004e7a1420b60b64719fe30f460dd10ec075094
-DIST x265_2.8.tar.gz 1379551 BLAKE2B c124864a08492739cdde89e44d72c84ad94a0b236d2c59d995e53a26d1a5fb9ec1557a03640a3065a727be69bfb0c0633b50351dc875c9706a1550f488c8ee24 SHA512 c2a8eaec64aa022badcbcd2a96304a9abd9d08489300b6a9c4c9d76066f3d9848e6948238c84ae16ea91bff0b2fac528a67ee29950d94dcd0ea7c0e9e7baa714
 DIST x265_2.9.tar.gz 1385848 BLAKE2B ff14eba55cea0646ad0ffc12f9032c9033d23c9d805939fc3a049911ebae459eee097349f074dcd224bef97d6140dbc37ee9bd3db54c5473b158e135784d2179 SHA512 270818c7fd84947fde371e32bef225c1880cfb0bcd95378d95b51f50577a134d7cd585fcdfa43b103a24d76c5ad826b09509a07eb9e208e8f2b56f2f77365cf3

diff --git a/media-libs/x265/files/non_x86.patch b/media-libs/x265/files/non_x86.patch
deleted file mode 100644
index 3c7e389329a..00000000000
--- a/media-libs/x265/files/non_x86.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-# HG changeset patch
-# User Jayashree <jayashree.c@multicorewareinc.com>
-# Date 1527224165 -19800
-#      Fri May 25 10:26:05 2018 +0530
-# Node ID 4504219210793536d921ee4e0b3058698c630bf4
-# Parent  cc2c5e46f3c87d27e3602af30b06ba6a0fbe2704
-Fix build error on on ppc64le
-
-diff -r cc2c5e46f3c8 -r 450421921079 source/common/param.cpp
---- a/source/common/param.cpp	Mon May 21 18:42:29 2018 +0530
-+++ b/source/common/param.cpp	Fri May 25 10:26:05 2018 +0530
-@@ -633,7 +633,7 @@
-         if (bValueWasNull)
-             p->cpuid = atobool(value);
-         else
--            p->cpuid = parseCpuName(value, bError);
-+            p->cpuid = parseCpuName(value, bError, false);
- #endif
-     }
-     OPT("fps")

diff --git a/media-libs/x265/x265-2.2.ebuild b/media-libs/x265/x265-2.2.ebuild
deleted file mode 100644
index 9ca662332ee..00000000000
--- a/media-libs/x265/x265-2.2.ebuild
+++ /dev/null
@@ -1,193 +0,0 @@
-# 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
-		https://downloads.videolan.org/pub/videolan/x265/${PN}_${PV}.tar.gz"
-	KEYWORDS="amd64 arm 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/102"
-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-2.6.ebuild b/media-libs/x265/x265-2.6.ebuild
deleted file mode 100644
index 9c3a49a4aea..00000000000
--- a/media-libs/x265/x265-2.6.ebuild
+++ /dev/null
@@ -1,195 +0,0 @@
-# Copyright 1999-2018 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"
-	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/146"
-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-2.7.ebuild b/media-libs/x265/x265-2.7.ebuild
deleted file mode 100644
index 8515b0a5613..00000000000
--- a/media-libs/x265/x265-2.7.ebuild
+++ /dev/null
@@ -1,195 +0,0 @@
-# Copyright 1999-2018 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"
-	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/151"
-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-2.8.ebuild b/media-libs/x265/x265-2.8.ebuild
deleted file mode 100644
index c60b19162d5..00000000000
--- a/media-libs/x265/x265-2.8.ebuild
+++ /dev/null
@@ -1,196 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# 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"
-	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/160"
-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"
-	"${FILESDIR}/non_x86.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/"*
-}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2020-05-24 20:25 Thomas Deutschmann
  0 siblings, 0 replies; 10+ messages in thread
From: Thomas Deutschmann @ 2020-05-24 20:25 UTC (permalink / raw
  To: gentoo-commits

commit:     e2661dbb76e81cc081c1220350c11e0a82401dd4
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Sun May 24 14:58:19 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Sun May 24 20:23:49 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2661dbb

media-libs/x265: migrate to EAPI=7

Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 media-libs/x265/files/x265-3.3-arm.patch   | 34 ++++++++++++++++++++++++++
 media-libs/x265/files/x265-3.3-neon.patch  | 16 ++++++++++++
 media-libs/x265/files/x265-3.3-ppc64.patch | 15 ++++++++++++
 media-libs/x265/x265-3.3.ebuild            | 39 +++++++++++++++++-------------
 4 files changed, 87 insertions(+), 17 deletions(-)

diff --git a/media-libs/x265/files/x265-3.3-arm.patch b/media-libs/x265/files/x265-3.3-arm.patch
new file mode 100644
index 00000000000..7e7c8c58b72
--- /dev/null
+++ b/media-libs/x265/files/x265-3.3-arm.patch
@@ -0,0 +1,34 @@
+More aliases for ARM.
+Do not force CFLAGS for ARM.
+
+Index: source/CMakeLists.txt
+===================================================================
+--- old/CMakeLists.txt
++++ new/CMakeLists.txt
+@@ -41,7 +41,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_
+ # System architecture detection
+ string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
+ set(X86_ALIASES x86 i386 i686 x86_64 amd64)
+-set(ARM_ALIASES armv6l armv7l)
++set(ARM_ALIASES armv6l armv6j armv7l armv7a)
+ list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
+ list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
+ set(POWER_ALIASES ppc64 ppc64le)
+@@ -208,15 +208,11 @@ if(GCC)
+             endif()
+         endif()
+     endif()
+-    if(ARM AND CROSS_COMPILE_ARM)
+-        set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
+-    elseif(ARM)
++    if(ARM)
+         find_package(Neon)
+         if(CPU_HAS_NEON)
+-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
++            set(ARM_ARGS -mfpu=neon)
+             add_definitions(-DHAVE_NEON)
+-        else()
+-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
+         endif()
+     endif()
+     add_definitions(${ARM_ARGS})

diff --git a/media-libs/x265/files/x265-3.3-neon.patch b/media-libs/x265/files/x265-3.3-neon.patch
new file mode 100644
index 00000000000..316e670febe
--- /dev/null
+++ b/media-libs/x265/files/x265-3.3-neon.patch
@@ -0,0 +1,16 @@
+These functions are only built when enabling assembly on ARM; use proper check
+to avoid undefined symbols.
+
+Index: source/common/primitives.cpp
+===================================================================
+--- old/common/primitives.cpp
++++ new/common/primitives.cpp
+@@ -270,7 +270,7 @@ void PFX(cpu_emms)(void) {}
+ void PFX(cpu_cpuid)(uint32_t, uint32_t *eax, uint32_t *, uint32_t *, uint32_t *) { *eax = 0; }
+ void PFX(cpu_xgetbv)(uint32_t, uint32_t *, uint32_t *) {}
+ 
+-#if X265_ARCH_ARM == 0
++#if X265_ARCH_ARM == 0 || !defined(ENABLE_ASSEMBLY)
+ void PFX(cpu_neon_test)(void) {}
+ int PFX(cpu_fast_neon_mrc_test)(void) { return 0; }
+ #endif // X265_ARCH_ARM

diff --git a/media-libs/x265/files/x265-3.3-ppc64.patch b/media-libs/x265/files/x265-3.3-ppc64.patch
new file mode 100644
index 00000000000..8e739e3fab1
--- /dev/null
+++ b/media-libs/x265/files/x265-3.3-ppc64.patch
@@ -0,0 +1,15 @@
+More complete ppc64 matches.
+
+Index: x265_2.2/source/CMakeLists.txt
+===================================================================
+--- old/CMakeLists.txt
++++ new/CMakeLists.txt
+@@ -44,7 +44,7 @@ set(X86_ALIASES x86 i386 i686 x86_64 amd
+ set(ARM_ALIASES armv6l armv6j armv7l armv7a)
+ list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
+ list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
+-set(POWER_ALIASES ppc64 ppc64le)
++set(POWER_ALIASES ppc64 ppc64le powerpc64 powerpc64le)
+ list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH)
+ if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1")
+     set(X86 1)

diff --git a/media-libs/x265/x265-3.3.ebuild b/media-libs/x265/x265-3.3.ebuild
index 41f53bc131e..9fc0159bc00 100644
--- a/media-libs/x265/x265-3.3.ebuild
+++ b/media-libs/x265/x265-3.3.ebuild
@@ -1,7 +1,7 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=5
+EAPI="7"
 
 inherit cmake-utils multilib-minimal multilib multibuild flag-o-matic
 
@@ -25,19 +25,22 @@ IUSE="+10bit +12bit cpu_flags_arm_neon numa pic power8 test"
 RESTRICT="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} )
+
+BDEPEND="abi_x86_32? ( ${ASM_DEPEND} )
 	abi_x86_64? ( ${ASM_DEPEND} )"
 
+RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
+
+DEPEND="${RDEPEND}"
+
 PATCHES=(
-	"${FILESDIR}/arm.patch"
-	"${FILESDIR}/neon.patch"
-	"${FILESDIR}/ppc64.patch"
+	"${FILESDIR}"/${PN}-3.3-arm.patch
+	"${FILESDIR}"/${PN}-3.3-neon.patch
+	"${FILESDIR}"/${PN}-3.3-ppc64.patch
 )
 
 src_unpack() {
-	if [[ ${PV} = 9999* ]]; then
+	if [[ ${PV} = 9999* ]] ; then
 		mercurial_src_unpack
 		# Can't set it at global scope due to mercurial.eclass limitations...
 		export S=${WORKDIR}/${P}/source
@@ -61,11 +64,11 @@ src_unpack() {
 # 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}"
+	local -a variants=()
+	use 12bit && variants+=( main12 )
+	use 10bit && variants+=( main10 )
+	variants+=( main )
+	echo "${variants[@]}"
 }
 
 x265_variant_src_configure() {
@@ -117,9 +120,9 @@ x265_variant_src_configure() {
 			if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ; then
 				local myvariants=( "${MULTIBUILD_VARIANTS[@]}" )
 				unset myvariants[${#MULTIBUILD_VARIANTS[@]}-1]
-				local liblist=""
+				local liblist="" v=
 				for v in "${myvariants[@]}" ; do
-					ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" ||	die
+					ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die
 					liblist+="libx265_${v}.a;"
 				done
 				mycmakeargs+=(
@@ -133,6 +136,7 @@ x265_variant_src_configure() {
 		*)
 			die "Unknown variant: ${MULTIBUILD_VARIANT}";;
 	esac
+
 	cmake-utils_src_configure
 	popd >/dev/null || die
 }
@@ -140,8 +144,9 @@ x265_variant_src_configure() {
 multilib_src_configure() {
 	append-cflags -fPIC
 	append-cxxflags -fPIC
+
 	local myabicmakeargs=(
-		$(cmake-utils_use_enable test TESTS)
+		-DENABLE_TESTS=$(usex test ON OFF)
 		$(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
 		-DENABLE_LIBNUMA=$(usex numa ON OFF)
 		-DCPU_POWER8=$(usex power8 ON OFF)
@@ -173,7 +178,7 @@ multilib_src_compile() {
 }
 
 x265_variant_src_test() {
-	if [ -x "${BUILD_DIR}/test/TestBench" ] ; then
+	if [[ -x "${BUILD_DIR}/test/TestBench" ]] ; then
 		"${BUILD_DIR}/test/TestBench" || die
 	else
 		einfo "Unit tests check only assembly."


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2020-06-05 15:21 Alexis Ballier
  0 siblings, 0 replies; 10+ messages in thread
From: Alexis Ballier @ 2020-06-05 15:21 UTC (permalink / raw
  To: gentoo-commits

commit:     3c02fc3caa35538b36de5d96aa7de5ef804a404b
Author:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Fri Jun  5 14:30:05 2020 +0000
Commit:     Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Fri Jun  5 15:19:54 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3c02fc3c

media-libs/x265: restore previous behavior wrt asm. bump to 3.4.

Fix tests properly.

Package-Manager: Portage-2.3.100, Repoman-2.3.22
Signed-off-by: Alexis Ballier <aballier <AT> gentoo.org>

 media-libs/x265/Manifest                           |   1 +
 media-libs/x265/files/arm-r1.patch                 |  42 +++
 media-libs/x265/files/test-ns.patch                | 295 +++++++++++++++++++++
 media-libs/x265/files/tests.patch                  |  16 ++
 .../x265/{x265-9999.ebuild => x265-3.4.ebuild}     | 127 ++++-----
 media-libs/x265/x265-9999.ebuild                   | 127 ++++-----
 6 files changed, 464 insertions(+), 144 deletions(-)

diff --git a/media-libs/x265/Manifest b/media-libs/x265/Manifest
index 7fdf4137f63..0d4b2ec0e0c 100644
--- a/media-libs/x265/Manifest
+++ b/media-libs/x265/Manifest
@@ -6,3 +6,4 @@ DIST x265_3.1.tar.gz 1419649 BLAKE2B b9151f136fdc6c0512f481af6c8d4d575ce4c75ef88
 DIST x265_3.2.1.tar.gz 1426255 BLAKE2B 4184cfa290b36f497c5f3a5e3b597bf44e52dd20ba6af21c665d98709c9b984122a339d93aae572756a94549c0c1a293ee195c6c1d34902d298664ecf016f896 SHA512 5cb29b9d4475c1f686f6e31e47ccddde3db1639d5dcf9c058513389a9fdeb35a83b14e30e59498a76dec74bb0b410b6d8f5b1b45d18927be9811bb6a40d8d568
 DIST x265_3.2.tar.gz 1425689 BLAKE2B 58da4aa52381ec89b0aea1dc896fef92d9ec9fc781fd279acd0a338cd872f52482c81c558dde749c1205dbc13341a9851c381d01e2f312f5e2b4712d2242b7d3 SHA512 08c779026fe4c03797efef9d6a898b16c308355311e167c81b976345eb78039725a31294c77a60b76b4ef648d8720e16b2d6524e7108755531a5375231f5313e
 DIST x265_3.3.tar.gz 1438685 BLAKE2B 43806915c3b22fabff71c307dc53e9a3408262528f8ec01bf81168826eee26b468b0e68c738e3c0371f6de6121a3ac090bfaeed0cbfca0a3b8c57710d7f25ad0 SHA512 3d56900ecd58e83d2ecc93d956524e3b0e622dbe3c74a137c7b21f98599245547403401e9ec7f679996fd09fca788aa10272bf17e58a68fce449c8cb555ad7c0
+DIST x265_3.4.tar.gz 1469365 BLAKE2B 1021d9d62779d0cecddea56496b4e46bd8ccfd91fdf292efe412dc82b3c974095a5f9bd095057aa08e77b164555adc594549dea6aef7fbc0c025ae7295df721e SHA512 576b18711935e7da8433b2170d24ed159eb12ff1a18399360afa1b2132db33b463145c65ed918f667528ee954bbdfb5c69e5480f1c1df801515cefc592f3206e

diff --git a/media-libs/x265/files/arm-r1.patch b/media-libs/x265/files/arm-r1.patch
new file mode 100644
index 00000000000..8a8102dd258
--- /dev/null
+++ b/media-libs/x265/files/arm-r1.patch
@@ -0,0 +1,42 @@
+More aliases for ARM.
+Do not force CFLAGS for ARM.
+
+Index: source/CMakeLists.txt
+===================================================================
+--- source.orig/CMakeLists.txt
++++ source/CMakeLists.txt
+@@ -40,7 +40,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_
+ # System architecture detection
+ string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC)
+ set(X86_ALIASES x86 i386 i686 x86_64 amd64)
+-set(ARM_ALIASES armv6l armv7l aarch64)
++set(ARM_ALIASES armv6l armv6l armv7l armv7a aarch64)
+ list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
+ list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
+ set(POWER_ALIASES ppc64 ppc64le)
+@@ -239,11 +239,7 @@ if(GCC)
+         endif()
+     endif()
+     if(ARM AND CROSS_COMPILE_ARM)
+-        if(ARM64)
+-            set(ARM_ARGS -fPIC)
+-        else()
+-            set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
+-        endif()
++        set(ARM_ARGS -fPIC)
+         message(STATUS "cross compile arm")
+     elseif(ARM)
+         if(ARM64)
+@@ -252,10 +248,10 @@ if(GCC)
+         else()
+             find_package(Neon)
+             if(CPU_HAS_NEON)
+-                set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
++                set(ARM_ARGS -mfpu=neon -fPIC)
+                 add_definitions(-DHAVE_NEON)
+             else()
+-                set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
++	        set(ARM_ARGS -fPIC)
+             endif()
+         endif()
+     endif()

diff --git a/media-libs/x265/files/test-ns.patch b/media-libs/x265/files/test-ns.patch
new file mode 100644
index 00000000000..898751a7ae2
--- /dev/null
+++ b/media-libs/x265/files/test-ns.patch
@@ -0,0 +1,295 @@
+Namespace functions for multi-bitdepth builds so that libraries are self-contained.
+
+Index: source/common/param.h
+===================================================================
+--- source.orig/common/param.h
++++ source/common/param.h
+@@ -53,6 +53,18 @@ int x265_param_default_preset(x265_param
+ int x265_param_apply_profile(x265_param *, const char *profile);
+ int x265_param_parse(x265_param *p, const char *name, const char *value);
+ int x265_zone_param_parse(x265_param* p, const char* name, const char* value);
++void x265_free_analysis_data(x265_param *param, x265_analysis_data* analysis);
++void x265_alloc_analysis_data(x265_param *param, x265_analysis_data* analysis);
++void x265_picture_free(x265_picture *);
++x265_zone *x265_zone_alloc(int zoneCount, int isZoneFile);
++void x265_zone_free(x265_param *param);
++FILE* x265_csvlog_open(const x265_param *);
++void x265_csvlog_frame(const x265_param *, const x265_picture *);
++void x265_csvlog_encode(const x265_param*, const x265_stats *, int padx, int pady, int argc, char** argv);
++void x265_dither_image(x265_picture *, int picWidth, int picHeight, int16_t *errorBuf, int bitDepth);
++int x265_encoder_reconfig(x265_encoder *, x265_param *);
++x265_picture *x265_picture_alloc(void);
++void x265_picture_init(x265_param *param, x265_picture *pic);
+ #define PARAM_NS X265_NS
+ #endif
+ }
+Index: source/encoder/api.cpp
+===================================================================
+--- source.orig/encoder/api.cpp
++++ source/encoder/api.cpp
+@@ -106,9 +106,9 @@ x265_encoder *x265_encoder_open(x265_par
+     if (p->rc.zoneCount || p->rc.zonefileCount)
+     {
+         int zoneCount = p->rc.zonefileCount ? p->rc.zonefileCount : p->rc.zoneCount;
+-        param->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+-        latestParam->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+-        zoneParam->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
++        param->rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
++        latestParam->rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
++        zoneParam->rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+     }
+ 
+     x265_copy_params(param, p);
+@@ -216,7 +216,7 @@ x265_encoder *x265_encoder_open(x265_par
+     /* Try to open CSV file handle */
+     if (encoder->m_param->csvfn)
+     {
+-        encoder->m_param->csvfpt = x265_csvlog_open(encoder->m_param);
++        encoder->m_param->csvfpt = PARAM_NS::x265_csvlog_open(encoder->m_param);
+         if (!encoder->m_param->csvfpt)
+         {
+             x265_log(encoder->m_param, X265_LOG_ERROR, "Unable to open CSV log file <%s>, aborting\n", encoder->m_param->csvfn);
+@@ -321,7 +321,7 @@ int x265_encoder_reconfig(x265_encoder*
+     if (encoder->m_latestParam->rc.zoneCount || encoder->m_latestParam->rc.zonefileCount)
+     {
+         int zoneCount = encoder->m_latestParam->rc.zonefileCount ? encoder->m_latestParam->rc.zonefileCount : encoder->m_latestParam->rc.zoneCount;
+-        save.rc.zones = x265_zone_alloc(zoneCount, !!encoder->m_latestParam->rc.zonefileCount);
++        save.rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!encoder->m_latestParam->rc.zonefileCount);
+     }
+     x265_copy_params(&save, encoder->m_latestParam);
+     int ret = encoder->reconfigureParam(encoder->m_latestParam, param_in);
+@@ -604,7 +604,7 @@ fail:
+         *pi_nal = 0;
+ 
+     if (numEncoded && encoder->m_param->csvLogLevel && encoder->m_outputCount >= encoder->m_latestParam->chunkStart)
+-        x265_csvlog_frame(encoder->m_param, pic_out);
++        PARAM_NS::x265_csvlog_frame(encoder->m_param, pic_out);
+ 
+     if (numEncoded < 0)
+         encoder->m_aborted = true;
+@@ -637,7 +637,7 @@ void x265_vmaf_encoder_log(x265_encoder*
+         encoder->fetchStats(&stats, sizeof(stats));
+         int padx = encoder->m_sps.conformanceWindow.rightOffset;
+         int pady = encoder->m_sps.conformanceWindow.bottomOffset;
+-        x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
++        PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
+     }
+ }
+ #endif
+@@ -651,7 +651,7 @@ void x265_encoder_log(x265_encoder* enc,
+         encoder->fetchStats(&stats, sizeof(stats));
+         int padx = encoder->m_sps.conformanceWindow.rightOffset;
+         int pady = encoder->m_sps.conformanceWindow.bottomOffset;
+-        x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
++        PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
+     }
+ }
+ 
+@@ -872,7 +872,7 @@ void x265_alloc_analysis_data(x265_param
+     return;
+ 
+ fail:
+-    x265_free_analysis_data(param, analysis);
++    PARAM_NS::x265_free_analysis_data(param, analysis);
+ }
+ 
+ void x265_free_analysis_data(x265_param *param, x265_analysis_data* analysis)
+Index: source/encoder/encoder.cpp
+===================================================================
+--- source.orig/encoder/encoder.cpp
++++ source/encoder/encoder.cpp
+@@ -186,8 +186,8 @@ void Encoder::create()
+         {
+             m_dupBuffer[i] = (AdaptiveFrameDuplication*)x265_malloc(sizeof(AdaptiveFrameDuplication));
+             m_dupBuffer[i]->dupPic = NULL;
+-            m_dupBuffer[i]->dupPic = x265_picture_alloc();
+-            x265_picture_init(p, m_dupBuffer[i]->dupPic);
++            m_dupBuffer[i]->dupPic = PARAM_NS::x265_picture_alloc();
++            PARAM_NS::x265_picture_init(p, m_dupBuffer[i]->dupPic);
+             m_dupBuffer[i]->dupPlane = NULL;
+             m_dupBuffer[i]->dupPlane = X265_MALLOC(char, framesize);
+             m_dupBuffer[i]->dupPic->planes[0] = m_dupBuffer[i]->dupPlane;
+@@ -756,7 +756,7 @@ int Encoder::setAnalysisData(x265_analys
+         curFrame->m_analysisData = (*analysis_data);
+         curFrame->m_analysisData.numCUsInFrame = widthInCU * heightInCU;
+         curFrame->m_analysisData.numPartitions = m_param->num4x4Partitions;
+-        x265_alloc_analysis_data(m_param, &curFrame->m_analysisData);
++        PARAM_NS::x265_alloc_analysis_data(m_param, &curFrame->m_analysisData);
+         if (m_param->maxCUSize == 16)
+         {
+             if (analysis_data->sliceType == X265_TYPE_IDR || analysis_data->sliceType == X265_TYPE_I)
+@@ -860,7 +860,7 @@ void Encoder::destroy()
+         for (uint32_t i = 0; i < DUP_BUFFER; i++)
+         {
+             X265_FREE(m_dupBuffer[i]->dupPlane);
+-            x265_picture_free(m_dupBuffer[i]->dupPic);
++            PARAM_NS::x265_picture_free(m_dupBuffer[i]->dupPic);
+             X265_FREE(m_dupBuffer[i]);
+         }
+ 
+@@ -1592,7 +1592,7 @@ int Encoder::encode(const x265_picture*
+     if (m_exportedPic)
+     {
+         if (!m_param->bUseAnalysisFile && m_param->analysisSave)
+-            x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
++            PARAM_NS::x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
+         ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
+         m_exportedPic = NULL;
+         m_dpb->recycleUnreferenced();
+@@ -1968,7 +1968,7 @@ int Encoder::encode(const x265_picture*
+ 
+             /* Free up inputPic->analysisData since it has already been used */
+             if ((m_param->analysisLoad && !m_param->analysisSave) || ((m_param->bAnalysisType == AVC_INFO) && slice->m_sliceType != I_SLICE))
+-                x265_free_analysis_data(m_param, &outFrame->m_analysisData);
++                PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
+ 
+             if (pic_out)
+             {
+@@ -2046,7 +2046,7 @@ int Encoder::encode(const x265_picture*
+                     writeAnalysisFile(&pic_out->analysisData, *outFrame->m_encData);
+                     pic_out->analysisData.saveParam = pic_out->analysisData.saveParam;
+                     if (m_param->bUseAnalysisFile)
+-                        x265_free_analysis_data(m_param, &pic_out->analysisData);
++                        PARAM_NS::x265_free_analysis_data(m_param, &pic_out->analysisData);
+                 }
+             }
+             if (m_param->rc.bStatWrite && (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion))
+@@ -2061,7 +2061,7 @@ int Encoder::encode(const x265_picture*
+                 writeAnalysisFileRefine(&outFrame->m_analysisData, *outFrame->m_encData);
+             }
+             if (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion)
+-                x265_free_analysis_data(m_param, &outFrame->m_analysisData);
++                PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
+             if (m_param->internalCsp == X265_CSP_I400)
+             {
+                 if (slice->m_sliceType == P_SLICE)
+@@ -2199,7 +2199,7 @@ int Encoder::encode(const x265_picture*
+                 uint32_t heightInCU = (m_param->sourceHeight + m_param->maxCUSize - 1) >> m_param->maxLog2CUSize;
+                 frameEnc->m_analysisData.numCUsInFrame = widthInCU * heightInCU;
+                 frameEnc->m_analysisData.numPartitions = m_param->num4x4Partitions;
+-                x265_alloc_analysis_data(m_param, &frameEnc->m_analysisData);
++                PARAM_NS::x265_alloc_analysis_data(m_param, &frameEnc->m_analysisData);
+                 frameEnc->m_analysisData.poc = frameEnc->m_poc;
+                 if (m_param->rc.bStatRead)
+                     readAnalysisFile(&frameEnc->m_analysisData, frameEnc->m_poc, frameEnc->m_lowres.sliceType);
+@@ -2210,7 +2210,7 @@ int Encoder::encode(const x265_picture*
+                 for (int i = 0; i < m_param->rc.zonefileCount; i++)
+                 {
+                     if (m_param->rc.zones[i].startFrame == frameEnc->m_poc)
+-                        x265_encoder_reconfig(this, m_param->rc.zones[i].zoneParam);
++                        PARAM_NS::x265_encoder_reconfig(this, m_param->rc.zones[i].zoneParam);
+                 }
+             }
+ 
+@@ -2353,7 +2353,7 @@ int Encoder::encode(const x265_picture*
+                 analysis->numCUsInFrame  = numCUsInFrame;
+                 analysis->numCuInHeight = heightInCU;
+                 analysis->numPartitions  = m_param->num4x4Partitions;
+-                x265_alloc_analysis_data(m_param, analysis);
++                PARAM_NS::x265_alloc_analysis_data(m_param, analysis);
+             }
+             /* determine references, setup RPS, etc */
+             m_dpb->prepareEncode(frameEnc);
+@@ -4264,7 +4264,7 @@ void Encoder::readAnalysisFile(x265_anal
+         else if (fread(val, size, readSize, fileOffset) != readSize)\
+     {\
+         x265_log(NULL, X265_LOG_ERROR, "Error reading analysis data\n");\
+-        x265_free_analysis_data(m_param, analysis);\
++        PARAM_NS::x265_free_analysis_data(m_param, analysis);\
+         m_aborted = true;\
+         return;\
+     }\
+@@ -4300,7 +4300,7 @@ void Encoder::readAnalysisFile(x265_anal
+         if (poc != curPoc || feof(m_analysisFileIn))
+         {
+             x265_log(NULL, X265_LOG_WARNING, "Error reading analysis data: Cannot find POC %d\n", curPoc);
+-            x265_free_analysis_data(m_param, analysis);
++            PARAM_NS::x265_free_analysis_data(m_param, analysis);
+             return;
+         }
+     }
+@@ -4334,7 +4334,7 @@ void Encoder::readAnalysisFile(x265_anal
+     if (m_param->scaleFactor)
+         analysis->numPartitions *= factor;
+     /* Memory is allocated for inter and intra analysis data based on the slicetype */
+-    x265_alloc_analysis_data(m_param, analysis);
++    PARAM_NS::x265_alloc_analysis_data(m_param, analysis);
+ 
+     if (m_param->ctuDistortionRefine == CTU_DISTORTION_INTERNAL)
+     {
+@@ -4587,7 +4587,7 @@ void Encoder::readAnalysisFile(x265_anal
+     else if (fread(val, size, readSize, fileOffset) != readSize)\
+     {\
+         x265_log(NULL, X265_LOG_ERROR, "Error reading analysis data\n");\
+-        x265_free_analysis_data(m_param, analysis);\
++        PARAM_NS::x265_free_analysis_data(m_param, analysis);\
+         m_aborted = true;\
+         return;\
+     }\
+@@ -4624,7 +4624,7 @@ void Encoder::readAnalysisFile(x265_anal
+         if (poc != curPoc || feof(m_analysisFileIn))
+         {
+             x265_log(NULL, X265_LOG_WARNING, "Error reading analysis data: Cannot find POC %d\n", curPoc);
+-            x265_free_analysis_data(m_param, analysis);
++            PARAM_NS::x265_free_analysis_data(m_param, analysis);
+             return;
+         }
+     }
+@@ -4655,7 +4655,7 @@ void Encoder::readAnalysisFile(x265_anal
+     analysis->numCuInHeight = cuLoc.heightInCU;
+ 
+     /* Memory is allocated for inter and intra analysis data based on the slicetype */
+-    x265_alloc_analysis_data(m_param, analysis);
++    PARAM_NS::x265_alloc_analysis_data(m_param, analysis);
+ 
+     if (m_param->ctuDistortionRefine == CTU_DISTORTION_INTERNAL)
+     {
+@@ -5257,7 +5257,7 @@ void Encoder::readAnalysisFile(x265_anal
+     if (fread(val, size, readSize, fileOffset) != readSize)\
+     {\
+     x265_log(NULL, X265_LOG_ERROR, "Error reading analysis 2 pass data\n"); \
+-    x265_alloc_analysis_data(m_param, analysis); \
++    PARAM_NS::x265_alloc_analysis_data(m_param, analysis); \
+     m_aborted = true; \
+     return; \
+ }\
+@@ -5271,7 +5271,7 @@ void Encoder::readAnalysisFile(x265_anal
+     if (poc != curPoc || feof(m_analysisFileIn))
+     {
+         x265_log(NULL, X265_LOG_WARNING, "Error reading analysis 2 pass data: Cannot find POC %d\n", curPoc);
+-        x265_free_analysis_data(m_param, analysis);
++        PARAM_NS::x265_free_analysis_data(m_param, analysis);
+         return;
+     }
+     /* Now arrived at the right frame, read the record */
+@@ -5378,7 +5378,7 @@ void Encoder::writeAnalysisFile(x265_ana
+     if (fwrite(val, size, writeSize, fileOffset) < writeSize)\
+     {\
+         x265_log(NULL, X265_LOG_ERROR, "Error writing analysis data\n");\
+-        x265_free_analysis_data(m_param, analysis);\
++        PARAM_NS::x265_free_analysis_data(m_param, analysis);\
+         m_aborted = true;\
+         return;\
+     }\
+@@ -5600,7 +5600,7 @@ void Encoder::writeAnalysisFileRefine(x2
+     if (fwrite(val, size, writeSize, fileOffset) < writeSize)\
+     {\
+     x265_log(NULL, X265_LOG_ERROR, "Error writing analysis 2 pass data\n"); \
+-    x265_free_analysis_data(m_param, analysis); \
++    PARAM_NS::x265_free_analysis_data(m_param, analysis); \
+     m_aborted = true; \
+     return; \
+ }\
+Index: source/common/param.cpp
+===================================================================
+--- source.orig/common/param.cpp
++++ source/common/param.cpp
+@@ -102,7 +102,7 @@ x265_param *x265_param_alloc()
+ 
+ void x265_param_free(x265_param* p)
+ {
+-    x265_zone_free(p);
++    PARAM_NS::x265_zone_free(p);
+ #ifdef SVT_HEVC
+      x265_free(p->svtHevcParam);
+ #endif

diff --git a/media-libs/x265/files/tests.patch b/media-libs/x265/files/tests.patch
new file mode 100644
index 00000000000..6c85829ee22
--- /dev/null
+++ b/media-libs/x265/files/tests.patch
@@ -0,0 +1,16 @@
+Tests run against static library (upstream build system):
+We build main as both shared & static, main10 & 12 are static only and linked into main.
+All need PLATFORM_LIBS, so instruct cmake to also link them.
+
+Index: source/CMakeLists.txt
+===================================================================
+--- source.orig/CMakeLists.txt
++++ source/CMakeLists.txt
+@@ -578,6 +578,7 @@ endif()
+ if(SVTHEVC_FOUND)
+     target_link_libraries(x265-static ${SVT_HEVC_LIBRARY})
+ endif()
++target_link_libraries(x265-static ${PLATFORM_LIBS})
+ install(TARGETS x265-static
+     LIBRARY DESTINATION ${LIB_INSTALL_DIR}
+     ARCHIVE DESTINATION ${LIB_INSTALL_DIR})

diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-3.4.ebuild
similarity index 67%
copy from media-libs/x265/x265-9999.ebuild
copy to media-libs/x265/x265-3.4.ebuild
index 736bea15bb8..f973a0196a7 100644
--- a/media-libs/x265/x265-9999.ebuild
+++ b/media-libs/x265/x265-3.4.ebuild
@@ -1,10 +1,9 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="7"
+EAPI=7
 
-CMAKE_ECLASS=cmake
-inherit flag-o-matic multibuild cmake-multilib
+inherit cmake multilib-minimal multilib multibuild flag-o-matic
 
 if [[ ${PV} = 9999* ]]; then
 	inherit mercurial
@@ -19,31 +18,27 @@ HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265/wiki/Home"
 
 LICENSE="GPL-2"
 # subslot = libx265 soname
-SLOT="0/188"
-IUSE="+asm +10bit +12bit cpu_flags_arm_neon cpu_flags_ppc_altivec numa power8 test"
-
-# Test suite requires assembly support and is known to be broken
-RESTRICT="test"
-
-ASM_DEPEND=">=dev-lang/nasm-2.13"
-
-BDEPEND="asm? (
-		abi_x86_32? ( ${ASM_DEPEND} )
-		abi_x86_64? ( ${ASM_DEPEND} )
-	)"
+SLOT="0/192"
+IUSE="+10bit +12bit cpu_flags_arm_neon numa pic power8 test"
+RESTRICT="!test? ( test )"
 
 RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
-
 DEPEND="${RDEPEND}"
+ASM_DEPEND=">=dev-lang/nasm-2.13"
+BDEPEND="
+	abi_x86_32? ( ${ASM_DEPEND} )
+	abi_x86_64? ( ${ASM_DEPEND} )"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-3.3-arm.patch
-	"${FILESDIR}"/${PN}-3.3-neon.patch
-	"${FILESDIR}"/${PN}-3.3-ppc64.patch
+	"${FILESDIR}/arm-r1.patch"
+	"${FILESDIR}/neon.patch"
+	"${FILESDIR}/x265-3.3-ppc64.patch"
+	"${FILESDIR}/tests.patch"
+	"${FILESDIR}/test-ns.patch"
 )
 
 src_unpack() {
-	if [[ ${PV} = 9999* ]] ; then
+	if [[ ${PV} = 9999* ]]; then
 		mercurial_src_unpack
 		# Can't set it at global scope due to mercurial.eclass limitations...
 		export S=${WORKDIR}/${P}/source
@@ -67,11 +62,11 @@ src_unpack() {
 # allow disabling it: "main" *MUST* come last in the following list.
 
 x265_get_variants() {
-	local -a variants=()
-	use 12bit && variants+=( main12 )
-	use 10bit && variants+=( main10 )
-	variants+=( main )
-	echo "${variants[@]}"
+	local variants=""
+	use 12bit && variants+="main12 "
+	use 10bit && variants+="main10 "
+	variants+="main"
+	echo "${variants}"
 }
 
 x265_variant_src_configure() {
@@ -88,8 +83,17 @@ x265_variant_src_configure() {
 				-DENABLE_CLI=OFF
 				-DMAIN12=ON
 			)
-			# disable altivec for 12bit build #607802#c5
-			[[ ${ABI} = ppc* ]] && mycmakeargs+=( -DENABLE_ALTIVEC=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
 			;;
 		"main10")
 			mycmakeargs+=(
@@ -98,8 +102,17 @@ x265_variant_src_configure() {
 				-DENABLE_SHARED=OFF
 				-DENABLE_CLI=OFF
 			)
-			# disable altivec for 10bit build #607802#c5
-			[[ ${ABI} = ppc* ]] && mycmakeargs+=( -DENABLE_ALTIVEC=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
@@ -107,7 +120,7 @@ x265_variant_src_configure() {
 				unset myvariants[${#MULTIBUILD_VARIANTS[@]}-1]
 				local liblist="" v=
 				for v in "${myvariants[@]}" ; do
-					ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die
+					ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" ||	die
 					liblist+="libx265_${v}.a;"
 				done
 				mycmakeargs+=(
@@ -116,68 +129,38 @@ x265_variant_src_configure() {
 					-DLINKED_10BIT=$(usex 10bit)
 					-DLINKED_12BIT=$(usex 12bit)
 				)
-				# we have to handle ppc here and not in multilib_src_configure
-				# because we want those flags apply ONLY to "main" variant
-				if [[ ${ABI} = ppc* ]] ; then
-					myabicmakeargs+=(
-						-DCPU_POWER8=$(usex power8 ON OFF)
-						-DENABLE_ALTIVEC=$(usex cpu_flags_ppc_altivec ON OFF)
-					)
-				fi
 			fi
 			;;
 		*)
 			die "Unknown variant: ${MULTIBUILD_VARIANT}";;
 	esac
-
 	cmake_src_configure
 	popd >/dev/null || die
 }
 
 multilib_src_configure() {
 	local myabicmakeargs=(
+		-DENABLE_TESTS=$(usex test ON OFF)
 		$(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
 		-DENABLE_PIC=ON
 		-DENABLE_LIBNUMA=$(usex numa ON OFF)
+		-DCPU_POWER8=$(usex power8 ON OFF)
+		-DENABLE_ALTIVEC=$(usex power8 ON OFF)
 		-DLIB_INSTALL_DIR="$(get_libdir)"
 	)
 
-	local supports_asm=yes
-
 	if [[ ${ABI} = x86 ]] ; then
-		if use asm ; then
-			# Bug #528202
-			ewarn "x86 asm is not PIC-safe, disabling it."
-			supports_asm=no
+		# 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
-		if use asm ; then
-			# bug #510890
-			ewarn "x32 ABI doesn't support asm"
-			supports_asm=no
-		fi
-	elif [[ ${ABI} = arm ]] ; then
-		if use asm && use cpu_flags_arm_neon ; then
-			supports_asm=yes
-		elif use asm ; then
-			ewarn "arm asm is not PIC-safe, disabling it."
-			supports_asm=no
-		fi
-	elif [[ ${ABI} = ppc* ]] ; then
-		if use asm ; then
-			ewarn "ppc64 uses altivec instead of asm, disabling it."
-			supports_asm=no
-		fi
-	fi
-
-	if [[ "${supports_asm}" = yes ]] && use asm ; then
-		myabicmakeargs+=( -DENABLE_ASSEMBLY=ON )
-
-		if multilib_is_native_abi ; then
-			myabicmakeargs+=( -DENABLE_TESTS=$(usex test ON OFF) )
-		fi
-	else
+		# 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) )
@@ -190,7 +173,7 @@ multilib_src_compile() {
 }
 
 x265_variant_src_test() {
-	if [[ -x "${BUILD_DIR}/test/TestBench" ]] ; then
+	if [ -x "${BUILD_DIR}/test/TestBench" ] ; then
 		"${BUILD_DIR}/test/TestBench" || die
 	else
 		einfo "Unit tests check only assembly."

diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-9999.ebuild
index 736bea15bb8..f973a0196a7 100644
--- a/media-libs/x265/x265-9999.ebuild
+++ b/media-libs/x265/x265-9999.ebuild
@@ -1,10 +1,9 @@
 # Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI="7"
+EAPI=7
 
-CMAKE_ECLASS=cmake
-inherit flag-o-matic multibuild cmake-multilib
+inherit cmake multilib-minimal multilib multibuild flag-o-matic
 
 if [[ ${PV} = 9999* ]]; then
 	inherit mercurial
@@ -19,31 +18,27 @@ HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265/wiki/Home"
 
 LICENSE="GPL-2"
 # subslot = libx265 soname
-SLOT="0/188"
-IUSE="+asm +10bit +12bit cpu_flags_arm_neon cpu_flags_ppc_altivec numa power8 test"
-
-# Test suite requires assembly support and is known to be broken
-RESTRICT="test"
-
-ASM_DEPEND=">=dev-lang/nasm-2.13"
-
-BDEPEND="asm? (
-		abi_x86_32? ( ${ASM_DEPEND} )
-		abi_x86_64? ( ${ASM_DEPEND} )
-	)"
+SLOT="0/192"
+IUSE="+10bit +12bit cpu_flags_arm_neon numa pic power8 test"
+RESTRICT="!test? ( test )"
 
 RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
-
 DEPEND="${RDEPEND}"
+ASM_DEPEND=">=dev-lang/nasm-2.13"
+BDEPEND="
+	abi_x86_32? ( ${ASM_DEPEND} )
+	abi_x86_64? ( ${ASM_DEPEND} )"
 
 PATCHES=(
-	"${FILESDIR}"/${PN}-3.3-arm.patch
-	"${FILESDIR}"/${PN}-3.3-neon.patch
-	"${FILESDIR}"/${PN}-3.3-ppc64.patch
+	"${FILESDIR}/arm-r1.patch"
+	"${FILESDIR}/neon.patch"
+	"${FILESDIR}/x265-3.3-ppc64.patch"
+	"${FILESDIR}/tests.patch"
+	"${FILESDIR}/test-ns.patch"
 )
 
 src_unpack() {
-	if [[ ${PV} = 9999* ]] ; then
+	if [[ ${PV} = 9999* ]]; then
 		mercurial_src_unpack
 		# Can't set it at global scope due to mercurial.eclass limitations...
 		export S=${WORKDIR}/${P}/source
@@ -67,11 +62,11 @@ src_unpack() {
 # allow disabling it: "main" *MUST* come last in the following list.
 
 x265_get_variants() {
-	local -a variants=()
-	use 12bit && variants+=( main12 )
-	use 10bit && variants+=( main10 )
-	variants+=( main )
-	echo "${variants[@]}"
+	local variants=""
+	use 12bit && variants+="main12 "
+	use 10bit && variants+="main10 "
+	variants+="main"
+	echo "${variants}"
 }
 
 x265_variant_src_configure() {
@@ -88,8 +83,17 @@ x265_variant_src_configure() {
 				-DENABLE_CLI=OFF
 				-DMAIN12=ON
 			)
-			# disable altivec for 12bit build #607802#c5
-			[[ ${ABI} = ppc* ]] && mycmakeargs+=( -DENABLE_ALTIVEC=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
 			;;
 		"main10")
 			mycmakeargs+=(
@@ -98,8 +102,17 @@ x265_variant_src_configure() {
 				-DENABLE_SHARED=OFF
 				-DENABLE_CLI=OFF
 			)
-			# disable altivec for 10bit build #607802#c5
-			[[ ${ABI} = ppc* ]] && mycmakeargs+=( -DENABLE_ALTIVEC=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
@@ -107,7 +120,7 @@ x265_variant_src_configure() {
 				unset myvariants[${#MULTIBUILD_VARIANTS[@]}-1]
 				local liblist="" v=
 				for v in "${myvariants[@]}" ; do
-					ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die
+					ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" ||	die
 					liblist+="libx265_${v}.a;"
 				done
 				mycmakeargs+=(
@@ -116,68 +129,38 @@ x265_variant_src_configure() {
 					-DLINKED_10BIT=$(usex 10bit)
 					-DLINKED_12BIT=$(usex 12bit)
 				)
-				# we have to handle ppc here and not in multilib_src_configure
-				# because we want those flags apply ONLY to "main" variant
-				if [[ ${ABI} = ppc* ]] ; then
-					myabicmakeargs+=(
-						-DCPU_POWER8=$(usex power8 ON OFF)
-						-DENABLE_ALTIVEC=$(usex cpu_flags_ppc_altivec ON OFF)
-					)
-				fi
 			fi
 			;;
 		*)
 			die "Unknown variant: ${MULTIBUILD_VARIANT}";;
 	esac
-
 	cmake_src_configure
 	popd >/dev/null || die
 }
 
 multilib_src_configure() {
 	local myabicmakeargs=(
+		-DENABLE_TESTS=$(usex test ON OFF)
 		$(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
 		-DENABLE_PIC=ON
 		-DENABLE_LIBNUMA=$(usex numa ON OFF)
+		-DCPU_POWER8=$(usex power8 ON OFF)
+		-DENABLE_ALTIVEC=$(usex power8 ON OFF)
 		-DLIB_INSTALL_DIR="$(get_libdir)"
 	)
 
-	local supports_asm=yes
-
 	if [[ ${ABI} = x86 ]] ; then
-		if use asm ; then
-			# Bug #528202
-			ewarn "x86 asm is not PIC-safe, disabling it."
-			supports_asm=no
+		# 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
-		if use asm ; then
-			# bug #510890
-			ewarn "x32 ABI doesn't support asm"
-			supports_asm=no
-		fi
-	elif [[ ${ABI} = arm ]] ; then
-		if use asm && use cpu_flags_arm_neon ; then
-			supports_asm=yes
-		elif use asm ; then
-			ewarn "arm asm is not PIC-safe, disabling it."
-			supports_asm=no
-		fi
-	elif [[ ${ABI} = ppc* ]] ; then
-		if use asm ; then
-			ewarn "ppc64 uses altivec instead of asm, disabling it."
-			supports_asm=no
-		fi
-	fi
-
-	if [[ "${supports_asm}" = yes ]] && use asm ; then
-		myabicmakeargs+=( -DENABLE_ASSEMBLY=ON )
-
-		if multilib_is_native_abi ; then
-			myabicmakeargs+=( -DENABLE_TESTS=$(usex test ON OFF) )
-		fi
-	else
+		# 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) )
@@ -190,7 +173,7 @@ multilib_src_compile() {
 }
 
 x265_variant_src_test() {
-	if [[ -x "${BUILD_DIR}/test/TestBench" ]] ; then
+	if [ -x "${BUILD_DIR}/test/TestBench" ] ; then
 		"${BUILD_DIR}/test/TestBench" || die
 	else
 		einfo "Unit tests check only assembly."


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2021-12-01 15:46 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2021-12-01 15:46 UTC (permalink / raw
  To: gentoo-commits

commit:     9591e8238da4f5ddab702a01f93fba05943f2a0d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec  1 15:45:57 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec  1 15:45:57 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9591e823

media-libs/x265: rebase 9999 patches

Closes: https://bugs.gentoo.org/808462
Thanks-to: soundbastlerlive <AT> gmx.at (rebasing ppc64)
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/x265/files/x265-9999-arm.patch   | 64 +++++++++++++++++++++++++++++
 media-libs/x265/files/x265-9999-ppc64.patch | 11 +++++
 media-libs/x265/x265-9999.ebuild            |  6 +--
 3 files changed, 78 insertions(+), 3 deletions(-)

diff --git a/media-libs/x265/files/x265-9999-arm.patch b/media-libs/x265/files/x265-9999-arm.patch
new file mode 100644
index 000000000000..218d92a0ab41
--- /dev/null
+++ b/media-libs/x265/files/x265-9999-arm.patch
@@ -0,0 +1,64 @@
+From 85ee373b0d1f03e7600366eae64a767e07298688 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Wed, 1 Dec 2021 15:42:38 +0000
+Subject: [PATCH] Respect CFLAGS for arm*
+
+---
+ CMakeLists.txt              | 6 +++---
+ dynamicHDR10/CMakeLists.txt | 8 ++++----
+ 2 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 9580413..737bf14 100755
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -249,14 +249,14 @@ if(GCC)
+     endif()
+     if(ARM AND CROSS_COMPILE_ARM)
+         message(STATUS "cross compile arm")
+-		set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
++		set(ARM_ARGS -fPIC)
+     elseif(ARM)
+         find_package(Neon)
+         if(CPU_HAS_NEON)
+-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
++            set(ARM_ARGS -mfpu=neon -fPIC)
+             add_definitions(-DHAVE_NEON)
+         else()
+-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
++            set(ARM_ARGS -fPIC)
+         endif()
+     endif()
+ 	if(ARM64 OR CROSS_COMPILE_ARM64)
+diff --git a/dynamicHDR10/CMakeLists.txt b/dynamicHDR10/CMakeLists.txt
+index 22fb79d..3639281 100644
+--- a/dynamicHDR10/CMakeLists.txt
++++ b/dynamicHDR10/CMakeLists.txt
+@@ -43,14 +43,14 @@ if(GCC)
+         endif()
+     endif()
+     if(ARM AND CROSS_COMPILE_ARM)
+-        set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC)
++        set(ARM_ARGS -fPIC)
+     elseif(ARM)
+         find_package(Neon)
+         if(CPU_HAS_NEON)
+-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
++            set(ARM_ARGS -mfpu=neon -fPIC)
+             add_definitions(-DHAVE_NEON)
+         else()
+-            set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
++            set(ARM_ARGS -fPIC)
+         endif()
+     endif()
+     add_definitions(${ARM_ARGS})
+@@ -150,4 +150,4 @@ set(BIN_INSTALL_DIR bin CACHE STRING "Install location of executables")
+ option(ENABLE_SHARED "Build shared library" OFF)
+ 
+ install(FILES hdr10plus.h DESTINATION include)
+-endif()
+\ No newline at end of file
++endif()
+-- 
+2.34.1
+

diff --git a/media-libs/x265/files/x265-9999-ppc64.patch b/media-libs/x265/files/x265-9999-ppc64.patch
new file mode 100644
index 000000000000..8219dabf7c4f
--- /dev/null
+++ b/media-libs/x265/files/x265-9999-ppc64.patch
@@ -0,0 +1,11 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -49,7 +49,7 @@
+ list(FIND X86_ALIASES "${SYSPROC}" X86MATCH)
+ list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH)
+ list(FIND ARM64_ALIASES "${SYSPROC}" ARM64MATCH)
+-set(POWER_ALIASES ppc64 ppc64le)
++set(POWER_ALIASES ppc64 ppc64le powerpc64 powerpc64le)
+ list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH)
+ if(X86MATCH GREATER "-1")
+     set(X86 1)

diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-9999.ebuild
index 58018488f52c..d686f028c1da 100644
--- a/media-libs/x265/x265-9999.ebuild
+++ b/media-libs/x265/x265-9999.ebuild
@@ -31,9 +31,9 @@ BDEPEND="
 	abi_x86_64? ( ${ASM_DEPEND} )"
 
 PATCHES=(
-	"${FILESDIR}/arm-r1.patch"
-	"${FILESDIR}/neon.patch"
-	"${FILESDIR}/x265-3.3-ppc64.patch"
+	"${FILESDIR}/${PN}-9999-arm.patch"
+	#"${FILESDIR}/neon.patch"
+	"${FILESDIR}/${PN}-9999-ppc64.patch"
 	"${FILESDIR}/tests.patch"
 	"${FILESDIR}/test-ns.patch"
 )


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2023-12-21  9:57 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2023-12-21  9:57 UTC (permalink / raw
  To: gentoo-commits

commit:     b0bd48f0746c68d5bb9b597e232d17bc630541cb
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 21 08:56:35 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec 21 09:56:23 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b0bd48f0

media-libs/x265: rebase 9999

Still seems broken though and not going to spend more time on this today:
```
 * QA Notice: Unresolved soname dependencies:
 *
 *      /usr/bin/x265: libx265.so.208
 *
```

Closes: https://bugs.gentoo.org/878367
Closes: https://bugs.gentoo.org/914833
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/x265/files/x265-9999-test-ns.patch | 286 ++++++++++++++++++++++++++
 media-libs/x265/x265-9999.ebuild              |   7 +-
 2 files changed, 289 insertions(+), 4 deletions(-)

diff --git a/media-libs/x265/files/x265-9999-test-ns.patch b/media-libs/x265/files/x265-9999-test-ns.patch
new file mode 100644
index 000000000000..ed3de18ae83e
--- /dev/null
+++ b/media-libs/x265/files/x265-9999-test-ns.patch
@@ -0,0 +1,286 @@
+Namespace functions for multi-bitdepth builds so that libraries are self-contained.
+--- a/common/param.cpp
++++ b/common/param.cpp
+@@ -102,7 +102,7 @@ x265_param *x265_param_alloc()
+ 
+ void x265_param_free(x265_param* p)
+ {
+-    x265_zone_free(p);
++    PARAM_NS::x265_zone_free(p);
+ #ifdef SVT_HEVC
+      x265_free(p->svtHevcParam);
+ #endif
+--- a/common/param.h
++++ b/common/param.h
+@@ -55,6 +55,18 @@ int x265_param_apply_profile(x265_param *, const char *profile);
+ int x265_param_parse(x265_param *p, const char *name, const char *value);
+ int x265_scenecut_aware_qp_param_parse(x265_param* p, const char* name, const char* value);
+ int x265_zone_param_parse(x265_param* p, const char* name, const char* value);
++void x265_free_analysis_data(x265_param *param, x265_analysis_data* analysis);
++void x265_alloc_analysis_data(x265_param *param, x265_analysis_data* analysis);
++void x265_picture_free(x265_picture *);
++x265_zone *x265_zone_alloc(int zoneCount, int isZoneFile);
++void x265_zone_free(x265_param *param);
++FILE* x265_csvlog_open(const x265_param *);
++void x265_csvlog_frame(const x265_param *, const x265_picture *);
++void x265_csvlog_encode(const x265_param*, const x265_stats *, int padx, int pady, int argc, char** argv);
++void x265_dither_image(x265_picture *, int picWidth, int picHeight, int16_t *errorBuf, int bitDepth);
++int x265_encoder_reconfig(x265_encoder *, x265_param *);
++x265_picture *x265_picture_alloc(void);
++void x265_picture_init(x265_param *param, x265_picture *pic);
+ #define PARAM_NS X265_NS
+ #endif
+ }
+--- a/encoder/api.cpp
++++ b/encoder/api.cpp
+@@ -106,9 +106,9 @@ x265_encoder *x265_encoder_open(x265_param *p)
+     if (p->rc.zoneCount || p->rc.zonefileCount)
+     {
+         int zoneCount = p->rc.zonefileCount ? p->rc.zonefileCount : p->rc.zoneCount;
+-        param->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+-        latestParam->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+-        zoneParam->rc.zones = x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
++        param->rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
++        latestParam->rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
++        zoneParam->rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!p->rc.zonefileCount);
+     }
+ 
+     x265_copy_params(param, p);
+@@ -214,7 +214,7 @@ x265_encoder *x265_encoder_open(x265_param *p)
+     /* Try to open CSV file handle */
+     if (encoder->m_param->csvfn)
+     {
+-        encoder->m_param->csvfpt = x265_csvlog_open(encoder->m_param);
++        encoder->m_param->csvfpt = PARAM_NS::x265_csvlog_open(encoder->m_param);
+         if (!encoder->m_param->csvfpt)
+         {
+             x265_log(encoder->m_param, X265_LOG_ERROR, "Unable to open CSV log file <%s>, aborting\n", encoder->m_param->csvfn);
+@@ -319,7 +319,7 @@ int x265_encoder_reconfig(x265_encoder* enc, x265_param* param_in)
+     if (encoder->m_latestParam->rc.zoneCount || encoder->m_latestParam->rc.zonefileCount)
+     {
+         int zoneCount = encoder->m_latestParam->rc.zonefileCount ? encoder->m_latestParam->rc.zonefileCount : encoder->m_latestParam->rc.zoneCount;
+-        save.rc.zones = x265_zone_alloc(zoneCount, !!encoder->m_latestParam->rc.zonefileCount);
++        save.rc.zones = PARAM_NS::x265_zone_alloc(zoneCount, !!encoder->m_latestParam->rc.zonefileCount);
+     }
+     x265_copy_params(&save, encoder->m_latestParam);
+     int ret = encoder->reconfigureParam(encoder->m_latestParam, param_in);
+@@ -602,7 +602,7 @@ fail:
+         *pi_nal = 0;
+ 
+     if (numEncoded && encoder->m_param->csvLogLevel && encoder->m_outputCount >= encoder->m_latestParam->chunkStart)
+-        x265_csvlog_frame(encoder->m_param, pic_out);
++        PARAM_NS::x265_csvlog_frame(encoder->m_param, pic_out);
+ 
+     if (numEncoded < 0)
+         encoder->m_aborted = true;
+@@ -643,7 +643,7 @@ void x265_vmaf_encoder_log(x265_encoder* enc, int argc, char **argv, x265_param
+         encoder->fetchStats(&stats, sizeof(stats));
+         int padx = encoder->m_sps.conformanceWindow.rightOffset;
+         int pady = encoder->m_sps.conformanceWindow.bottomOffset;
+-        x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
++        PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
+     }
+ }
+ #endif
+@@ -657,7 +657,7 @@ void x265_encoder_log(x265_encoder* enc, int argc, char **argv)
+         encoder->fetchStats(&stats, sizeof(stats));
+         int padx = encoder->m_sps.conformanceWindow.rightOffset;
+         int pady = encoder->m_sps.conformanceWindow.bottomOffset;
+-        x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
++        PARAM_NS::x265_csvlog_encode(encoder->m_param, &stats, padx, pady, argc, argv);
+     }
+ }
+ 
+@@ -878,7 +878,7 @@ void x265_alloc_analysis_data(x265_param *param, x265_analysis_data* analysis)
+     return;
+ 
+ fail:
+-    x265_free_analysis_data(param, analysis);
++    PARAM_NS::x265_free_analysis_data(param, analysis);
+ }
+ 
+ void x265_free_analysis_data(x265_param *param, x265_analysis_data* analysis)
+--- a/encoder/encoder.cpp
++++ b/encoder/encoder.cpp
+@@ -216,8 +216,8 @@ void Encoder::create()
+         {
+             m_dupBuffer[i] = (AdaptiveFrameDuplication*)x265_malloc(sizeof(AdaptiveFrameDuplication));
+             m_dupBuffer[i]->dupPic = NULL;
+-            m_dupBuffer[i]->dupPic = x265_picture_alloc();
+-            x265_picture_init(p, m_dupBuffer[i]->dupPic);
++            m_dupBuffer[i]->dupPic = PARAM_NS::x265_picture_alloc();
++            PARAM_NS::x265_picture_init(p, m_dupBuffer[i]->dupPic);
+             m_dupBuffer[i]->dupPlane = NULL;
+             m_dupBuffer[i]->dupPlane = X265_MALLOC(char, framesize);
+             m_dupBuffer[i]->dupPic->planes[0] = m_dupBuffer[i]->dupPlane;
+@@ -768,7 +768,7 @@ int Encoder::setAnalysisData(x265_analysis_data *analysis_data, int poc, uint32_
+         curFrame->m_analysisData = (*analysis_data);
+         curFrame->m_analysisData.numCUsInFrame = widthInCU * heightInCU;
+         curFrame->m_analysisData.numPartitions = m_param->num4x4Partitions;
+-        x265_alloc_analysis_data(m_param, &curFrame->m_analysisData);
++        PARAM_NS::x265_alloc_analysis_data(m_param, &curFrame->m_analysisData);
+         if (m_param->maxCUSize == 16)
+         {
+             if (analysis_data->sliceType == X265_TYPE_IDR || analysis_data->sliceType == X265_TYPE_I)
+@@ -872,7 +872,7 @@ void Encoder::destroy()
+         for (uint32_t i = 0; i < DUP_BUFFER; i++)
+         {
+             X265_FREE(m_dupBuffer[i]->dupPlane);
+-            x265_picture_free(m_dupBuffer[i]->dupPic);
++            PARAM_NS::x265_picture_free(m_dupBuffer[i]->dupPic);
+             X265_FREE(m_dupBuffer[i]);
+         }
+ 
+@@ -1478,7 +1478,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+     if (m_exportedPic)
+     {
+         if (!m_param->bUseAnalysisFile && m_param->analysisSave)
+-            x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
++            PARAM_NS::x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
+ 
+         ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
+ 
+@@ -1892,7 +1892,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+ 
+             /* Free up inputPic->analysisData since it has already been used */
+             if ((m_param->analysisLoad && !m_param->analysisSave) || ((m_param->bAnalysisType == AVC_INFO) && slice->m_sliceType != I_SLICE))
+-                x265_free_analysis_data(m_param, &outFrame->m_analysisData);
++                PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
+ 
+             if (pic_out)
+             {
+@@ -1971,7 +1971,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+                     writeAnalysisFile(&pic_out->analysisData, *outFrame->m_encData);
+                     pic_out->analysisData.saveParam = pic_out->analysisData.saveParam;
+                     if (m_param->bUseAnalysisFile)
+-                        x265_free_analysis_data(m_param, &pic_out->analysisData);
++                        PARAM_NS::x265_free_analysis_data(m_param, &pic_out->analysisData);
+                 }
+             }
+             if (m_param->rc.bStatWrite && (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion))
+@@ -1986,7 +1986,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+                 writeAnalysisFileRefine(&outFrame->m_analysisData, *outFrame->m_encData);
+             }
+             if (m_param->analysisMultiPassRefine || m_param->analysisMultiPassDistortion)
+-                x265_free_analysis_data(m_param, &outFrame->m_analysisData);
++                PARAM_NS::x265_free_analysis_data(m_param, &outFrame->m_analysisData);
+             if (m_param->internalCsp == X265_CSP_I400)
+             {
+                 if (slice->m_sliceType == P_SLICE)
+@@ -2153,7 +2153,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+                 uint32_t heightInCU = (m_param->sourceHeight + m_param->maxCUSize - 1) >> m_param->maxLog2CUSize;
+                 frameEnc->m_analysisData.numCUsInFrame = widthInCU * heightInCU;
+                 frameEnc->m_analysisData.numPartitions = m_param->num4x4Partitions;
+-                x265_alloc_analysis_data(m_param, &frameEnc->m_analysisData);
++                PARAM_NS::x265_alloc_analysis_data(m_param, &frameEnc->m_analysisData);
+                 frameEnc->m_analysisData.poc = frameEnc->m_poc;
+                 if (m_param->rc.bStatRead)
+                     readAnalysisFile(&frameEnc->m_analysisData, frameEnc->m_poc, frameEnc->m_lowres.sliceType);
+@@ -2164,7 +2164,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+                 for (int i = 0; i < m_param->rc.zonefileCount; i++)
+                 {
+                     if (m_param->rc.zones[i].startFrame == frameEnc->m_poc)
+-                        x265_encoder_reconfig(this, m_param->rc.zones[i].zoneParam);
++                        PARAM_NS::x265_encoder_reconfig(this, m_param->rc.zones[i].zoneParam);
+                 }
+             }
+ 
+@@ -2307,7 +2307,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+                 analysis->numCUsInFrame  = numCUsInFrame;
+                 analysis->numCuInHeight = heightInCU;
+                 analysis->numPartitions  = m_param->num4x4Partitions;
+-                x265_alloc_analysis_data(m_param, analysis);
++                PARAM_NS::x265_alloc_analysis_data(m_param, analysis);
+             }
+             if (m_param->bEnableTemporalSubLayers > 2)
+             {
+@@ -4434,7 +4434,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+         else if (fread(val, size, readSize, fileOffset) != readSize)\
+     {\
+         x265_log(NULL, X265_LOG_ERROR, "Error reading analysis data\n");\
+-        x265_free_analysis_data(m_param, analysis);\
++        PARAM_NS::x265_free_analysis_data(m_param, analysis);\
+         m_aborted = true;\
+         return;\
+     }\
+@@ -4470,7 +4470,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+         if (poc != curPoc || feof(m_analysisFileIn))
+         {
+             x265_log(NULL, X265_LOG_WARNING, "Error reading analysis data: Cannot find POC %d\n", curPoc);
+-            x265_free_analysis_data(m_param, analysis);
++            PARAM_NS::x265_free_analysis_data(m_param, analysis);
+             return;
+         }
+     }
+@@ -4504,7 +4504,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+     if (m_param->scaleFactor)
+         analysis->numPartitions *= factor;
+     /* Memory is allocated for inter and intra analysis data based on the slicetype */
+-    x265_alloc_analysis_data(m_param, analysis);
++    PARAM_NS::x265_alloc_analysis_data(m_param, analysis);
+ 
+     if (m_param->ctuDistortionRefine == CTU_DISTORTION_INTERNAL)
+     {
+@@ -4757,7 +4757,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+     else if (fread(val, size, readSize, fileOffset) != readSize)\
+     {\
+         x265_log(NULL, X265_LOG_ERROR, "Error reading analysis data\n");\
+-        x265_free_analysis_data(m_param, analysis);\
++        PARAM_NS::x265_free_analysis_data(m_param, analysis);\
+         m_aborted = true;\
+         return;\
+     }\
+@@ -4794,7 +4794,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+         if (poc != curPoc || feof(m_analysisFileIn))
+         {
+             x265_log(NULL, X265_LOG_WARNING, "Error reading analysis data: Cannot find POC %d\n", curPoc);
+-            x265_free_analysis_data(m_param, analysis);
++            PARAM_NS::x265_free_analysis_data(m_param, analysis);
+             return;
+         }
+     }
+@@ -4825,7 +4825,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, const x
+     analysis->numCuInHeight = cuLoc.heightInCU;
+ 
+     /* Memory is allocated for inter and intra analysis data based on the slicetype */
+-    x265_alloc_analysis_data(m_param, analysis);
++    PARAM_NS::x265_alloc_analysis_data(m_param, analysis);
+ 
+     if (m_param->ctuDistortionRefine == CTU_DISTORTION_INTERNAL)
+     {
+@@ -5440,7 +5440,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, int sli
+     if (fread(val, size, readSize, fileOffset) != readSize)\
+     {\
+     x265_log(NULL, X265_LOG_ERROR, "Error reading analysis 2 pass data\n"); \
+-    x265_alloc_analysis_data(m_param, analysis); \
++    PARAM_NS::x265_alloc_analysis_data(m_param, analysis); \
+     m_aborted = true; \
+     return; \
+ }\
+@@ -5454,7 +5454,7 @@ void Encoder::readAnalysisFile(x265_analysis_data* analysis, int curPoc, int sli
+     if (poc != curPoc || feof(m_analysisFileIn))
+     {
+         x265_log(NULL, X265_LOG_WARNING, "Error reading analysis 2 pass data: Cannot find POC %d\n", curPoc);
+-        x265_free_analysis_data(m_param, analysis);
++        PARAM_NS::x265_free_analysis_data(m_param, analysis);
+         return;
+     }
+     /* Now arrived at the right frame, read the record */
+@@ -5561,7 +5561,7 @@ void Encoder::writeAnalysisFile(x265_analysis_data* analysis, FrameData &curEncD
+     if (fwrite(val, size, writeSize, fileOffset) < writeSize)\
+     {\
+         x265_log(NULL, X265_LOG_ERROR, "Error writing analysis data\n");\
+-        x265_free_analysis_data(m_param, analysis);\
++        PARAM_NS::x265_free_analysis_data(m_param, analysis);\
+         m_aborted = true;\
+         return;\
+     }\
+@@ -5783,7 +5783,7 @@ void Encoder::writeAnalysisFileRefine(x265_analysis_data* analysis, FrameData &c
+     if (fwrite(val, size, writeSize, fileOffset) < writeSize)\
+     {\
+     x265_log(NULL, X265_LOG_ERROR, "Error writing analysis 2 pass data\n"); \
+-    x265_free_analysis_data(m_param, analysis); \
++    PARAM_NS::x265_free_analysis_data(m_param, analysis); \
+     m_aborted = true; \
+     return; \
+ }\

diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-9999.ebuild
index 38c1dc82e324..7503475200d5 100644
--- a/media-libs/x265/x265-9999.ebuild
+++ b/media-libs/x265/x265-9999.ebuild
@@ -19,7 +19,7 @@ HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265_git/"
 
 LICENSE="GPL-2"
 # subslot = libx265 soname
-SLOT="0/207"
+SLOT="0/208"
 IUSE="+10bit +12bit cpu_flags_ppc_vsx2 numa test"
 RESTRICT="!test? ( test )"
 
@@ -32,10 +32,9 @@ BDEPEND="
 
 PATCHES=(
 	"${FILESDIR}/${PN}-9999-arm.patch"
-	#"${FILESDIR}/neon.patch"
-	"${FILESDIR}/${PN}-9999-ppc64.patch"
+	"${FILESDIR}/neon.patch"
 	"${FILESDIR}/tests.patch"
-	"${FILESDIR}/test-ns.patch"
+	"${FILESDIR}/${PN}-9999-test-ns.patch"
 )
 
 src_unpack() {


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/
@ 2024-08-25 15:44 Sam James
  0 siblings, 0 replies; 10+ messages in thread
From: Sam James @ 2024-08-25 15:44 UTC (permalink / raw
  To: gentoo-commits

commit:     bdc98b2ac3b1948e5fa197fbef055358cd0bb125
Author:     Paul Zander <negril.nx+gentoo <AT> gmail <DOT> com>
AuthorDate: Fri Aug 23 16:53:41 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug 25 15:43:06 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdc98b2a

media-libs/x265: add 3.6

Closes: https://bugs.gentoo.org/937756
Signed-off-by: Paul Zander <negril.nx+gentoo <AT> gmail.com>
Closes: https://github.com/gentoo/gentoo/pull/38267
Signed-off-by: Sam James <sam <AT> gentoo.org>

 media-libs/x265/Manifest                       |   1 +
 media-libs/x265/files/x265-3.6-test-ns_2.patch |  30 ++++
 media-libs/x265/x265-3.6.ebuild                | 195 +++++++++++++++++++++++++
 3 files changed, 226 insertions(+)

diff --git a/media-libs/x265/Manifest b/media-libs/x265/Manifest
index c27eb2713e67..2ea6fb64ce0a 100644
--- a/media-libs/x265/Manifest
+++ b/media-libs/x265/Manifest
@@ -1 +1,2 @@
+DIST x265-3.6.tar.gz 1655889 BLAKE2B 2598421e2e21974998b0b20895dc7e12dbf6ebe1b6c23bb5a7710b575d3db773335cd1f0b3ef110b79cf4d6dd01e543e9807a0509963497edc25f617f80c29f3 SHA512 570429c3f0b560b2f946ac9baba97d66d7d6485e46eb695b17003b5913028f62d35822477633e911cd3ea60e6ce0ecc7d9d82de7d8257272f9ca7b43761438be
 DIST x265_3.5.tar.gz 1537044 BLAKE2B 4fe15b762eda08a4379f69df622bef603fed784a237381d5c95876412020c113d053af829fa1eb66468462a6edc0de32dc597b1a98a63e9aa0250a47f4e76d05 SHA512 230e683239c3e262096ba96246c6f67229a1625d163f86647a411733bb1cf349685858aee3017bce818bb6992448d0abaa9241615a5b620561ce47ecb164f997

diff --git a/media-libs/x265/files/x265-3.6-test-ns_2.patch b/media-libs/x265/files/x265-3.6-test-ns_2.patch
new file mode 100644
index 000000000000..63308e5bb48d
--- /dev/null
+++ b/media-libs/x265/files/x265-3.6-test-ns_2.patch
@@ -0,0 +1,30 @@
+--- source.orig/encoder/encoder.cpp
++++ source/encoder/encoder.cpp
+@@ -1478,7 +1478,7 @@ int Encoder::encode(const x265_picture* pic_in, x265_picture* pic_out)
+     if (m_exportedPic)
+     {
+         if (!m_param->bUseAnalysisFile && m_param->analysisSave)
+-            x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
++            PARAM_NS::x265_free_analysis_data(m_param, &m_exportedPic->m_analysisData);
+ 
+         ATOMIC_DEC(&m_exportedPic->m_countRefEncoders);
+ 
+--- a/common/threadpool.cpp
++++ b/common/threadpool.cpp
+@@ -25,6 +25,7 @@
+ #include "common.h"
+ #include "threadpool.h"
+ #include "threading.h"
++#include "param.h"
+ 
+ #include <new>
+ 
+@@ -314,7 +315,7 @@ ThreadPool* ThreadPool::allocThreadPools(x265_param* p, int& numPools, bool isTh
+                    sprintf(nextCount, "%d", cpusPerNode[i]);
+              strcat(poolString, nextCount);
+          }
+-         x265_param_parse(p, "pools", poolString);
++         PARAM_NS::x265_param_parse(p, "pools", poolString);
+      }
+ #endif
+     if (p->numaPools && *p->numaPools)

diff --git a/media-libs/x265/x265-3.6.ebuild b/media-libs/x265/x265-3.6.ebuild
new file mode 100644
index 000000000000..55b794f17e42
--- /dev/null
+++ b/media-libs/x265/x265-3.6.ebuild
@@ -0,0 +1,195 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit cmake flag-o-matic multilib-minimal multibuild
+
+DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
+HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265_git/"
+
+if [[ ${PV} = 9999* ]]; then
+	inherit git-r3
+	EGIT_REPO_URI="https://bitbucket.org/multicoreware/x265_git/"
+	MY_P="${PN}-${PV}"
+else
+	SRC_URI="https://bitbucket.org/multicoreware/x265_git/downloads/${PN}_${PV}.tar.gz -> ${PN}-${PV}.tar.gz"
+	KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~loong ~mips ~ppc ~ppc64 ~riscv ~x86"
+	MY_P="${PN}_${PV}"
+fi
+
+S="${WORKDIR}/${MY_P}/source"
+unset MY_P
+
+LICENSE="GPL-2"
+# subslot = libx265 soname
+SLOT="0/209"
+IUSE="+10bit +12bit cpu_flags_ppc_vsx2 numa test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
+DEPEND="${RDEPEND}"
+ASM_DEPEND=">=dev-lang/nasm-2.13"
+BDEPEND="
+	abi_x86_32? ( ${ASM_DEPEND} )
+	abi_x86_64? ( ${ASM_DEPEND} )"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-9999-arm.patch"
+	"${FILESDIR}/neon.patch"
+	"${FILESDIR}/tests.patch"
+	"${FILESDIR}/test-ns.patch"
+	"${FILESDIR}/${PN}-3.5-r5-cpp-std.patch"
+	"${FILESDIR}/${PN}-3.5-r5-gcc15.patch"
+	"${FILESDIR}/${PN}-3.6-test-ns_2.patch"
+)
+
+pkg_setup() {
+	variants=(
+		$(usev 12bit "main12")
+		$(usev 10bit "main10")
+	)
+}
+
+# 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
+
+x265_variant_src_configure() {
+	einfo "Configuring variant: ${MULTIBUILD_VARIANT} for ABI: ${ABI}"
+
+	local mycmakeargs=(
+		"${mycmakeargs[@]}"
+		-DHIGH_BIT_DEPTH=ON
+		-DEXPORT_C_API=OFF
+		-DENABLE_SHARED=OFF
+		-DENABLE_CLI=OFF
+	)
+
+	case "${MULTIBUILD_VARIANT}" in
+		"main12")
+			mycmakeargs+=(
+				-DMAIN12=ON
+			)
+			;;
+		"main10")
+			mycmakeargs+=(
+				-DENABLE_HDR10_PLUS=ON
+			)
+			;;
+		*)
+			die "Unknown variant: ${MULTIBUILD_VARIANT}";;
+	esac
+	cmake_src_configure
+}
+
+multilib_src_configure() {
+	# -Werror=odr
+	# https://bugs.gentoo.org/875854
+	# https://bitbucket.org/multicoreware/x265_git/issues/937/build-fails-with-lto
+	filter-lto
+
+	local mycmakeargs=(
+		$(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
+		-DENABLE_PIC=ON
+		-DENABLE_LIBNUMA="$(usex numa)"
+		-DENABLE_MULTIVIEW="yes"
+		-DENABLE_SVT_HEVC="no" # missing
+		-DENABLE_VTUNE="no" # missing
+		-DGIT_ARCHETYPE=1 #814116
+		-DLIB_INSTALL_DIR="$(get_libdir)"
+	)
+
+	# Unfortunately, the asm for x86/x32/arm isn't PIC-safe.
+	# x86 # Bug #528202, bug #913412
+	# x32 # bug #510890
+	if [[ ${ABI} = x86 ]] || [[ ${ABI} = x32 ]] || [[ ${ABI} = arm ]] ; then
+		mycmakeargs+=(
+			-DENABLE_ASSEMBLY=OFF
+			-DENABLE_TESTS="no" #728748
+		)
+	else
+		mycmakeargs+=(
+			-DENABLE_TESTS="$(usex test)"
+		)
+	fi
+
+	if [[ ${ABI} = ppc* ]] ; then
+		# upstream uses mix of altivec + power8 vectors
+		# it's impossible to enable altivec without CPU_POWER8
+		# and it does not work on ppc32
+		# so we toggle both variables together
+		mycmakeargs+=(
+			-DCPU_POWER8="$(usex cpu_flags_ppc_vsx2)"
+			-DENABLE_ALTIVEC="$(usex cpu_flags_ppc_vsx2)"
+		)
+	fi
+
+	local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+	if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+		multibuild_foreach_variant x265_variant_src_configure
+
+		local liblist="" v=
+		for v in "${MULTIBUILD_VARIANTS[@]}" ; do
+			ln -sf "${BUILD_DIR}-${v}/libx265.a" "${BUILD_DIR%-*}/libx265_${v}.a" || die
+			liblist+="libx265_${v}.a;"
+		done
+
+		mycmakeargs+=(
+			-DEXTRA_LIB="${liblist}"
+			-DEXTRA_LINK_FLAGS="-L${BUILD_DIR%-*}"
+			-DLINKED_10BIT"=$(usex 10bit)"
+			-DLINKED_12BIT="$(usex 12bit)"
+		)
+	fi
+
+	cmake_src_configure
+}
+
+multilib_src_compile() {
+	local MULTIBUILD_VARIANTS=( "${variants[@]}" )
+	if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+		multibuild_foreach_variant cmake_src_compile
+	fi
+	cmake_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=( "${variants[@]}" )
+	if [[ "${#MULTIBUILD_VARIANTS[@]}" -gt 1 ]] ; then
+		multibuild_foreach_variant x265_variant_src_test
+	fi
+	x265_variant_src_test
+}
+
+multilib_src_install() {
+	cmake_src_install
+}
+
+multilib_src_install_all() {
+	dodoc -r "${S}/../doc/"*
+
+	# we don't install *.a files for all variants,
+	# so just delete these files instead of pretending
+	# real USE=static-libs support
+	find "${ED}" -name "*.a" -delete || die
+}


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2024-08-25 15:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-21  9:57 [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/files/, media-libs/x265/ Sam James
  -- strict thread matches above, loose matches on Subject: below --
2024-08-25 15:44 Sam James
2021-12-01 15:46 Sam James
2020-06-05 15:21 Alexis Ballier
2020-05-24 20:25 Thomas Deutschmann
2018-11-11 22:10 Andreas Sturmlechner
2018-10-17 12:48 Jeroen Roovers
2018-06-29  7:39 Alexis Ballier
2017-02-24  9:00 Alexis Ballier
2015-10-14 21:08 Michał Górny

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox