1 |
commit: e2661dbb76e81cc081c1220350c11e0a82401dd4 |
2 |
Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun May 24 14:58:19 2020 +0000 |
4 |
Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun May 24 20:23:49 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e2661dbb |
7 |
|
8 |
media-libs/x265: migrate to EAPI=7 |
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/files/x265-3.3-arm.patch | 34 ++++++++++++++++++++++++++ |
14 |
media-libs/x265/files/x265-3.3-neon.patch | 16 ++++++++++++ |
15 |
media-libs/x265/files/x265-3.3-ppc64.patch | 15 ++++++++++++ |
16 |
media-libs/x265/x265-3.3.ebuild | 39 +++++++++++++++++------------- |
17 |
4 files changed, 87 insertions(+), 17 deletions(-) |
18 |
|
19 |
diff --git a/media-libs/x265/files/x265-3.3-arm.patch b/media-libs/x265/files/x265-3.3-arm.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..7e7c8c58b72 |
22 |
--- /dev/null |
23 |
+++ b/media-libs/x265/files/x265-3.3-arm.patch |
24 |
@@ -0,0 +1,34 @@ |
25 |
+More aliases for ARM. |
26 |
+Do not force CFLAGS for ARM. |
27 |
+ |
28 |
+Index: source/CMakeLists.txt |
29 |
+=================================================================== |
30 |
+--- old/CMakeLists.txt |
31 |
++++ new/CMakeLists.txt |
32 |
+@@ -41,7 +41,7 @@ SET(CMAKE_MODULE_PATH "${PROJECT_SOURCE_ |
33 |
+ # System architecture detection |
34 |
+ string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" SYSPROC) |
35 |
+ set(X86_ALIASES x86 i386 i686 x86_64 amd64) |
36 |
+-set(ARM_ALIASES armv6l armv7l) |
37 |
++set(ARM_ALIASES armv6l armv6j armv7l armv7a) |
38 |
+ list(FIND X86_ALIASES "${SYSPROC}" X86MATCH) |
39 |
+ list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH) |
40 |
+ set(POWER_ALIASES ppc64 ppc64le) |
41 |
+@@ -208,15 +208,11 @@ if(GCC) |
42 |
+ endif() |
43 |
+ endif() |
44 |
+ endif() |
45 |
+- if(ARM AND CROSS_COMPILE_ARM) |
46 |
+- set(ARM_ARGS -march=armv6 -mfloat-abi=soft -mfpu=vfp -marm -fPIC) |
47 |
+- elseif(ARM) |
48 |
++ if(ARM) |
49 |
+ find_package(Neon) |
50 |
+ if(CPU_HAS_NEON) |
51 |
+- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC) |
52 |
++ set(ARM_ARGS -mfpu=neon) |
53 |
+ add_definitions(-DHAVE_NEON) |
54 |
+- else() |
55 |
+- set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm) |
56 |
+ endif() |
57 |
+ endif() |
58 |
+ add_definitions(${ARM_ARGS}) |
59 |
|
60 |
diff --git a/media-libs/x265/files/x265-3.3-neon.patch b/media-libs/x265/files/x265-3.3-neon.patch |
61 |
new file mode 100644 |
62 |
index 00000000000..316e670febe |
63 |
--- /dev/null |
64 |
+++ b/media-libs/x265/files/x265-3.3-neon.patch |
65 |
@@ -0,0 +1,16 @@ |
66 |
+These functions are only built when enabling assembly on ARM; use proper check |
67 |
+to avoid undefined symbols. |
68 |
+ |
69 |
+Index: source/common/primitives.cpp |
70 |
+=================================================================== |
71 |
+--- old/common/primitives.cpp |
72 |
++++ new/common/primitives.cpp |
73 |
+@@ -270,7 +270,7 @@ void PFX(cpu_emms)(void) {} |
74 |
+ void PFX(cpu_cpuid)(uint32_t, uint32_t *eax, uint32_t *, uint32_t *, uint32_t *) { *eax = 0; } |
75 |
+ void PFX(cpu_xgetbv)(uint32_t, uint32_t *, uint32_t *) {} |
76 |
+ |
77 |
+-#if X265_ARCH_ARM == 0 |
78 |
++#if X265_ARCH_ARM == 0 || !defined(ENABLE_ASSEMBLY) |
79 |
+ void PFX(cpu_neon_test)(void) {} |
80 |
+ int PFX(cpu_fast_neon_mrc_test)(void) { return 0; } |
81 |
+ #endif // X265_ARCH_ARM |
82 |
|
83 |
diff --git a/media-libs/x265/files/x265-3.3-ppc64.patch b/media-libs/x265/files/x265-3.3-ppc64.patch |
84 |
new file mode 100644 |
85 |
index 00000000000..8e739e3fab1 |
86 |
--- /dev/null |
87 |
+++ b/media-libs/x265/files/x265-3.3-ppc64.patch |
88 |
@@ -0,0 +1,15 @@ |
89 |
+More complete ppc64 matches. |
90 |
+ |
91 |
+Index: x265_2.2/source/CMakeLists.txt |
92 |
+=================================================================== |
93 |
+--- old/CMakeLists.txt |
94 |
++++ new/CMakeLists.txt |
95 |
+@@ -44,7 +44,7 @@ set(X86_ALIASES x86 i386 i686 x86_64 amd |
96 |
+ set(ARM_ALIASES armv6l armv6j armv7l armv7a) |
97 |
+ list(FIND X86_ALIASES "${SYSPROC}" X86MATCH) |
98 |
+ list(FIND ARM_ALIASES "${SYSPROC}" ARMMATCH) |
99 |
+-set(POWER_ALIASES ppc64 ppc64le) |
100 |
++set(POWER_ALIASES ppc64 ppc64le powerpc64 powerpc64le) |
101 |
+ list(FIND POWER_ALIASES "${SYSPROC}" POWERMATCH) |
102 |
+ if("${SYSPROC}" STREQUAL "" OR X86MATCH GREATER "-1") |
103 |
+ set(X86 1) |
104 |
|
105 |
diff --git a/media-libs/x265/x265-3.3.ebuild b/media-libs/x265/x265-3.3.ebuild |
106 |
index 41f53bc131e..9fc0159bc00 100644 |
107 |
--- a/media-libs/x265/x265-3.3.ebuild |
108 |
+++ b/media-libs/x265/x265-3.3.ebuild |
109 |
@@ -1,7 +1,7 @@ |
110 |
# Copyright 1999-2020 Gentoo Authors |
111 |
# Distributed under the terms of the GNU General Public License v2 |
112 |
|
113 |
-EAPI=5 |
114 |
+EAPI="7" |
115 |
|
116 |
inherit cmake-utils multilib-minimal multilib multibuild flag-o-matic |
117 |
|
118 |
@@ -25,19 +25,22 @@ IUSE="+10bit +12bit cpu_flags_arm_neon numa pic power8 test" |
119 |
RESTRICT="test" |
120 |
|
121 |
ASM_DEPEND=">=dev-lang/yasm-1.2.0" |
122 |
-RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )" |
123 |
-DEPEND="${RDEPEND} |
124 |
- abi_x86_32? ( ${ASM_DEPEND} ) |
125 |
+ |
126 |
+BDEPEND="abi_x86_32? ( ${ASM_DEPEND} ) |
127 |
abi_x86_64? ( ${ASM_DEPEND} )" |
128 |
|
129 |
+RDEPEND="numa? ( >=sys-process/numactl-2.0.10-r1[${MULTILIB_USEDEP}] )" |
130 |
+ |
131 |
+DEPEND="${RDEPEND}" |
132 |
+ |
133 |
PATCHES=( |
134 |
- "${FILESDIR}/arm.patch" |
135 |
- "${FILESDIR}/neon.patch" |
136 |
- "${FILESDIR}/ppc64.patch" |
137 |
+ "${FILESDIR}"/${PN}-3.3-arm.patch |
138 |
+ "${FILESDIR}"/${PN}-3.3-neon.patch |
139 |
+ "${FILESDIR}"/${PN}-3.3-ppc64.patch |
140 |
) |
141 |
|
142 |
src_unpack() { |
143 |
- if [[ ${PV} = 9999* ]]; then |
144 |
+ if [[ ${PV} = 9999* ]] ; then |
145 |
mercurial_src_unpack |
146 |
# Can't set it at global scope due to mercurial.eclass limitations... |
147 |
export S=${WORKDIR}/${P}/source |
148 |
@@ -61,11 +64,11 @@ src_unpack() { |
149 |
# allow disabling it: "main" *MUST* come last in the following list. |
150 |
|
151 |
x265_get_variants() { |
152 |
- local variants="" |
153 |
- use 12bit && variants+="main12 " |
154 |
- use 10bit && variants+="main10 " |
155 |
- variants+="main" |
156 |
- echo "${variants}" |
157 |
+ local -a variants=() |
158 |
+ use 12bit && variants+=( main12 ) |
159 |
+ use 10bit && variants+=( main10 ) |
160 |
+ variants+=( main ) |
161 |
+ echo "${variants[@]}" |
162 |
} |
163 |
|
164 |
x265_variant_src_configure() { |
165 |
@@ -117,9 +120,9 @@ x265_variant_src_configure() { |
166 |
if (( "${#MULTIBUILD_VARIANTS[@]}" > 1 )) ; then |
167 |
local myvariants=( "${MULTIBUILD_VARIANTS[@]}" ) |
168 |
unset myvariants[${#MULTIBUILD_VARIANTS[@]}-1] |
169 |
- local liblist="" |
170 |
+ local liblist="" v= |
171 |
for v in "${myvariants[@]}" ; do |
172 |
- ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die |
173 |
+ ln -s "${BUILD_DIR%-*}-${v}/libx265.a" "libx265_${v}.a" || die |
174 |
liblist+="libx265_${v}.a;" |
175 |
done |
176 |
mycmakeargs+=( |
177 |
@@ -133,6 +136,7 @@ x265_variant_src_configure() { |
178 |
*) |
179 |
die "Unknown variant: ${MULTIBUILD_VARIANT}";; |
180 |
esac |
181 |
+ |
182 |
cmake-utils_src_configure |
183 |
popd >/dev/null || die |
184 |
} |
185 |
@@ -140,8 +144,9 @@ x265_variant_src_configure() { |
186 |
multilib_src_configure() { |
187 |
append-cflags -fPIC |
188 |
append-cxxflags -fPIC |
189 |
+ |
190 |
local myabicmakeargs=( |
191 |
- $(cmake-utils_use_enable test TESTS) |
192 |
+ -DENABLE_TESTS=$(usex test ON OFF) |
193 |
$(multilib_is_native_abi || echo "-DENABLE_CLI=OFF") |
194 |
-DENABLE_LIBNUMA=$(usex numa ON OFF) |
195 |
-DCPU_POWER8=$(usex power8 ON OFF) |
196 |
@@ -173,7 +178,7 @@ multilib_src_compile() { |
197 |
} |
198 |
|
199 |
x265_variant_src_test() { |
200 |
- if [ -x "${BUILD_DIR}/test/TestBench" ] ; then |
201 |
+ if [[ -x "${BUILD_DIR}/test/TestBench" ]] ; then |
202 |
"${BUILD_DIR}/test/TestBench" || die |
203 |
else |
204 |
einfo "Unit tests check only assembly." |