Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/x265/
Date: Sun, 24 May 2020 20:25:18
Message-Id: 1590351875.4d93c54aa36af985f098b125ea53102ef145031f.whissi@gentoo
1 commit: 4d93c54aa36af985f098b125ea53102ef145031f
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Sun May 24 20:24:35 2020 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Sun May 24 20:24:35 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d93c54a
7
8 media-libs/x265: update live ebuild
9
10 Package-Manager: Portage-2.3.99, Repoman-2.3.22
11 Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>
12
13 media-libs/x265/x265-9999.ebuild | 125 +++++++++++++++++++++------------------
14 1 file changed, 68 insertions(+), 57 deletions(-)
15
16 diff --git a/media-libs/x265/x265-9999.ebuild b/media-libs/x265/x265-9999.ebuild
17 index aaf2a4fe9a0..9428b001e84 100644
18 --- a/media-libs/x265/x265-9999.ebuild
19 +++ b/media-libs/x265/x265-9999.ebuild
20 @@ -1,7 +1,7 @@
21 -# Copyright 1999-2019 Gentoo Authors
22 +# Copyright 1999-2020 Gentoo Authors
23 # Distributed under the terms of the GNU General Public License v2
24
25 -EAPI=5
26 +EAPI="7"
27
28 inherit cmake-utils multilib-minimal multilib multibuild flag-o-matic
29
30 @@ -14,28 +14,35 @@ else
31 fi
32
33 DESCRIPTION="Library for encoding video streams into the H.265/HEVC format"
34 -HOMEPAGE="http://x265.org/"
35 +HOMEPAGE="http://x265.org/ https://bitbucket.org/multicoreware/x265/wiki/Home"
36
37 LICENSE="GPL-2"
38 # subslot = libx265 soname
39 -SLOT="0/184"
40 -IUSE="+10bit +12bit cpu_flags_arm_neon numa pic power8 test"
41 -RESTRICT="!test? ( test )"
42 +SLOT="0/188"
43 +IUSE="+asm +10bit +12bit cpu_flags_arm_neon cpu_flags_ppc_altivec numa power8 test"
44 +
45 +# Test suite requires assembly support and is known to be broken
46 +RESTRICT="test"
47 +
48 +ASM_DEPEND=">=dev-lang/nasm-2.13"
49 +
50 +BDEPEND="asm? (
51 + abi_x86_32? ( ${ASM_DEPEND} )
52 + abi_x86_64? ( ${ASM_DEPEND} )
53 + )"
54
55 -ASM_DEPEND=">=dev-lang/yasm-1.2.0"
56 RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )"
57 -DEPEND="${RDEPEND}
58 - abi_x86_32? ( ${ASM_DEPEND} )
59 - abi_x86_64? ( ${ASM_DEPEND} )"
60 +
61 +DEPEND="${RDEPEND}"
62
63 PATCHES=(
64 - "${FILESDIR}/arm.patch"
65 - "${FILESDIR}/neon.patch"
66 - "${FILESDIR}/ppc64.patch"
67 + "${FILESDIR}"/${PN}-3.3-arm.patch
68 + "${FILESDIR}"/${PN}-3.3-neon.patch
69 + "${FILESDIR}"/${PN}-3.3-ppc64.patch
70 )
71
72 src_unpack() {
73 - if [[ ${PV} = 9999* ]]; then
74 + if [[ ${PV} = 9999* ]] ; then
75 mercurial_src_unpack
76 # Can't set it at global scope due to mercurial.eclass limitations...
77 export S=${WORKDIR}/${P}/source
78 @@ -59,11 +66,11 @@ src_unpack() {
79 # allow disabling it: "main" *MUST* come last in the following list.
80
81 x265_get_variants() {
82 - local variants=""
83 - use 12bit && variants+="main12 "
84 - use 10bit && variants+="main10 "
85 - variants+="main"
86 - echo "${variants}"
87 + local -a variants=()
88 + use 12bit && variants+=( main12 )
89 + use 10bit && variants+=( main10 )
90 + variants+=( main )
91 + echo "${variants[@]}"
92 }
93
94 x265_variant_src_configure() {
95 @@ -80,17 +87,6 @@ x265_variant_src_configure() {
96 -DENABLE_CLI=OFF
97 -DMAIN12=ON
98 )
99 - if [[ ${ABI} = x86 ]] ; then
100 - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
101 - fi
102 - if [[ ${ABI} = arm ]] ; then
103 - # 589674
104 - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
105 - fi
106 - if [[ ${ABI} = ppc64 ]] ; then
107 - # https://bugs.gentoo.org/show_bug.cgi?id=607802#c5
108 - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF -DENABLE_ALTIVEC=OFF )
109 - fi
110 ;;
111 "main10")
112 mycmakeargs+=(
113 @@ -99,25 +95,14 @@ x265_variant_src_configure() {
114 -DENABLE_SHARED=OFF
115 -DENABLE_CLI=OFF
116 )
117 - if [[ ${ABI} = x86 ]] ; then
118 - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
119 - fi
120 - if [[ ${ABI} = arm ]] ; then
121 - # 589674
122 - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF )
123 - fi
124 - if [[ ${ABI} = ppc64 ]] ; then
125 - # https://bugs.gentoo.org/show_bug.cgi?id=607802#c5
126 - mycmakeargs+=( -DENABLE_ASSEMBLY=OFF -DENABLE_ALTIVEC=OFF )
127 - fi
128 ;;
129 "main")
130 if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ; then
131 local myvariants=( "${MULTIBUILD_VARIANTS[@]}" )
132 unset myvariants[${#MULTIBUILD_VARIANTS[@]}-1]
133 - local liblist=""
134 + local liblist="" v=
135 for v in "${myvariants[@]}" ; do
136 - ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die
137 + ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die
138 liblist+="libx265_${v}.a;"
139 done
140 mycmakeargs+=(
141 @@ -131,34 +116,55 @@ x265_variant_src_configure() {
142 *)
143 die "Unknown variant: ${MULTIBUILD_VARIANT}";;
144 esac
145 +
146 cmake-utils_src_configure
147 popd >/dev/null || die
148 }
149
150 multilib_src_configure() {
151 - append-cflags -fPIC
152 - append-cxxflags -fPIC
153 local myabicmakeargs=(
154 - $(cmake-utils_use_enable test TESTS)
155 $(multilib_is_native_abi || echo "-DENABLE_CLI=OFF")
156 + -DENABLE_PIC=ON
157 -DENABLE_LIBNUMA=$(usex numa ON OFF)
158 - -DCPU_POWER8=$(usex power8 ON OFF)
159 - -DENABLE_ALTIVEC=$(usex power8 ON OFF)
160 -DLIB_INSTALL_DIR="$(get_libdir)"
161 )
162
163 + local supports_asm=yes
164 +
165 if [[ ${ABI} = x86 ]] ; then
166 - # Bug #528202
167 - if use pic ; then
168 - ewarn "PIC has been requested but x86 asm is not PIC-safe, disabling it."
169 - myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
170 + if use asm ; then
171 + # Bug #528202
172 + ewarn "x86 asm is not PIC-safe, disabling it."
173 + supports_asm=no
174 fi
175 elif [[ ${ABI} = x32 ]] ; then
176 - # bug #510890
177 - myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
178 + if use asm ; then
179 + # bug #510890
180 + ewarn "x32 ABI doesn't support asm"
181 + supports_asm=no
182 + fi
183 elif [[ ${ABI} = arm ]] ; then
184 - myabicmakeargs+=( -DENABLE_ASSEMBLY=$(usex pic OFF $(usex cpu_flags_arm_neon ON OFF)) )
185 - use cpu_flags_arm_neon && use pic && ewarn "PIC has been requested but arm neon asm is not PIC-safe, disabling it."
186 + if use asm && use cpu_flags_arm_neon ; then
187 + supports_asm=yes
188 + elif use asm ; then
189 + ewarn "arm asm is not PIC-safe, disabling it."
190 + supports_asm=no
191 + fi
192 + elif [[ ${ABI} = ppc* ]] ; then
193 + myabicmakeargs+=(
194 + -DCPU_POWER8=$(usex power8 ON OFF)
195 + -DENABLE_ALTIVEC=$(usex cpu_flags_ppc_altivec ON OFF)
196 + )
197 + fi
198 +
199 + if [[ "${supports_asm}" = yes ]] && use asm ; then
200 + myabicmakeargs+=( -DENABLE_ASSEMBLY=ON )
201 +
202 + if multilib_is_native_abi ; then
203 + myabicmakeargs+=( -DENABLE_TESTS=$(usex test ON OFF) )
204 + fi
205 + else
206 + myabicmakeargs+=( -DENABLE_ASSEMBLY=OFF )
207 fi
208
209 local MULTIBUILD_VARIANTS=( $(x265_get_variants) )
210 @@ -171,7 +177,7 @@ multilib_src_compile() {
211 }
212
213 x265_variant_src_test() {
214 - if [ -x "${BUILD_DIR}/test/TestBench" ] ; then
215 + if [[ -x "${BUILD_DIR}/test/TestBench" ]] ; then
216 "${BUILD_DIR}/test/TestBench" || die
217 else
218 einfo "Unit tests check only assembly."
219 @@ -193,4 +199,9 @@ multilib_src_install() {
220
221 multilib_src_install_all() {
222 dodoc -r "${S}/../doc/"*
223 +
224 + # we don't install *.a files for all variants,
225 + # so just delete these files instead of pretending
226 + # real USE=static-libs support
227 + find "${ED}" -name "*.a" -delete || die
228 }